:root {
  --paper: #f7f0e1;
  --paper-2: #fffaf0;
  --ink: #3b3226;
  --ink-soft: #75685a;
  --forest: #4d7a58;
  --forest-deep: #365a40;
  --sky: #bfdde9;
  --wood: #9a7653;
  --sun: #f0c76b;
  --rose: #d98b73;
  --line: #e3d6bf;
  --shadow: 0 6px 20px rgba(92, 70, 40, 0.12);
  --radius: 16px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Gowun Dodum", "Malgun Gothic", "Apple SD Gothic Neo", sans-serif;
  color: var(--ink);
  background: linear-gradient(180deg, var(--sky) 0, #e3eee6 220px, var(--paper) 420px);
  font-size: 15px;
  line-height: 1.6;
}

h1, h2, h3 { font-family: "Gowun Batang", "Batang", serif; margin: 0; }

/* 하늘과 구름 */
.sky { position: fixed; inset: 0 0 auto 0; height: 220px; pointer-events: none; overflow: hidden; z-index: 0; }
.cloud { position: absolute; background: #fff; border-radius: 50px; opacity: .85; filter: blur(.4px); }
.cloud::before, .cloud::after { content: ""; position: absolute; background: #fff; border-radius: 50%; }
.c1 { width: 140px; height: 40px; top: 50px; left: -160px; animation: drift 70s linear infinite; }
.c1::before { width: 60px; height: 60px; top: -28px; left: 22px; }
.c1::after { width: 76px; height: 76px; top: -38px; left: 58px; }
.c2 { width: 100px; height: 30px; top: 120px; left: -120px; animation: drift 95s linear infinite 20s; }
.c2::before { width: 44px; height: 44px; top: -20px; left: 16px; }
.c2::after { width: 54px; height: 54px; top: -26px; left: 42px; }
.c3 { width: 180px; height: 46px; top: 20px; left: -200px; animation: drift 120s linear infinite 45s; }
.c3::before { width: 70px; height: 70px; top: -34px; left: 30px; }
.c3::after { width: 90px; height: 90px; top: -44px; left: 80px; }
@keyframes drift { to { transform: translateX(calc(100vw + 400px)); } }

.top {
  position: relative; z-index: 1;
  display: flex; justify-content: space-between; align-items: flex-end;
  padding: 28px 32px 8px;
}
.top h1 { font-size: 32px; color: var(--forest-deep); letter-spacing: -0.5px; }
.sub { margin: 2px 0 0; color: var(--ink-soft); }
.top-right { display: flex; align-items: center; gap: 8px; }
.clock { font-family: "Gowun Batang", serif; color: var(--forest-deep); font-size: 15px; background: rgba(255,250,240,.7); padding: 6px 14px; border-radius: 999px; }

.layout {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: minmax(0, 1fr) 420px; gap: 24px;
  padding: 16px 32px 32px;
  align-items: start;
}

h2 { font-size: 20px; color: var(--forest-deep); margin-bottom: 12px; }

/* 직원 카드 */
.staff-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-bottom: 28px; }
.staff {
  background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden; display: flex; flex-direction: column;
  transition: transform .25s ease, box-shadow .25s ease;
}
.staff .portrait { position: relative; aspect-ratio: 4 / 3; background: #e9e0cc; }
.staff img { width: 100%; height: 100%; object-fit: cover; object-position: center 20%; display: block; }
.staff .info { padding: 12px 14px 14px; }
.staff .name { font-family: "Gowun Batang", serif; font-size: 17px; font-weight: 700; }
.staff .role { color: var(--forest); font-size: 13px; margin-left: 6px; }
.staff .desc { color: var(--ink-soft); font-size: 13px; margin: 4px 0 8px; min-height: 40px; }
.staff .activity { font-size: 12.5px; color: var(--ink-soft); min-height: 20px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.pill {
  position: absolute; top: 10px; left: 10px;
  font-size: 12px; padding: 3px 10px; border-radius: 999px;
  background: rgba(255, 250, 240, .92); color: var(--ink-soft);
}
.staff.working { transform: translateY(-4px); box-shadow: 0 10px 28px rgba(77, 122, 88, .28); border-color: var(--forest); }
.staff.working .pill { background: var(--forest); color: #fff; }
.staff.working .pill::after { content: ""; display: inline-block; width: 1.2em; text-align: left; animation: dots 1.2s steps(4) infinite; }
.staff.done .pill { background: var(--sun); color: var(--ink); }
@keyframes dots { 0% { content: ""; } 25% { content: "."; } 50% { content: ".."; } 75% { content: "..."; } }

/* 채용 현황 */
.board-head { display: flex; justify-content: space-between; align-items: center; }
.jobs { display: grid; gap: 14px; }
.job { background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); }
.job-title { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.job-title h3 { font-size: 17px; }
.job-title .id { font-size: 12px; color: var(--ink-soft); }
.steps { display: flex; gap: 0; margin: 14px 0 12px; list-style: none; padding: 0; }
.steps li { flex: 1; text-align: center; font-size: 12px; color: var(--ink-soft); position: relative; }
.steps li::before {
  content: ""; display: block; width: 14px; height: 14px; margin: 0 auto 4px; border-radius: 50%;
  background: var(--paper); border: 2px solid var(--line); position: relative; z-index: 1;
}
.steps li::after { content: ""; position: absolute; top: 7px; left: -50%; width: 100%; height: 2px; background: var(--line); }
.steps li:first-child::after { display: none; }
.steps li.done::before { background: var(--forest); border-color: var(--forest); }
.steps li.done::after, .steps li.now::after { background: var(--forest); }
.steps li.now::before { background: var(--sun); border-color: var(--wood); }
.steps li.now { color: var(--ink); font-weight: 700; }
.stats { display: flex; flex-wrap: wrap; gap: 8px; }
.stat { background: var(--paper); border-radius: 10px; padding: 6px 12px; font-size: 13px; }
.stat b { font-size: 16px; color: var(--forest-deep); margin-left: 4px; font-variant-numeric: tabular-nums; }
.job a { color: var(--forest); font-size: 13px; }
.empty { background: rgba(255,250,240,.7); border: 1px dashed var(--wood); border-radius: var(--radius); padding: 28px; text-align: center; color: var(--ink-soft); }

/* 대표실 (채팅) */
.desk {
  position: sticky; top: 16px;
  background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); display: flex; flex-direction: column;
  height: calc(100vh - 140px); min-height: 520px;
}
.desk-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 18px 0; }
.desk-head h2 { margin: 0; }
.chat { flex: 1; overflow-y: auto; padding: 14px 18px; display: flex; flex-direction: column; gap: 12px; }
.msg { max-width: 92%; padding: 10px 14px; border-radius: 14px; font-size: 14.5px; word-break: break-word; }
.msg.me { align-self: flex-end; background: var(--forest); color: #fff; border-bottom-right-radius: 4px; white-space: pre-wrap; }
.msg.bot { align-self: flex-start; background: var(--paper); border-bottom-left-radius: 4px; display: flex; gap: 10px; }
.msg.bot img { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; flex: none; }
.msg.bot .body > :first-child { margin-top: 0; }
.msg.bot .body > :last-child { margin-bottom: 0; }
.msg.bot .body table { border-collapse: collapse; font-size: 13px; margin: 6px 0; }
.msg.bot .body th, .msg.bot .body td { border: 1px solid var(--line); padding: 3px 7px; text-align: left; }
.msg.bot .body h3, .msg.bot .body h4 { font-size: 15px; margin: 8px 0 4px; }
.msg.bot .body ul, .msg.bot .body ol { padding-left: 20px; margin: 4px 0; }
.msg.bot .body code { background: #efe6d3; padding: 0 4px; border-radius: 4px; font-size: 13px; }
.msg.sys { align-self: center; font-size: 12.5px; color: var(--ink-soft); background: transparent; padding: 2px 8px; }
.msg.err { align-self: stretch; background: #f8e1d9; color: #7a3420; font-size: 13px; white-space: pre-wrap; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 18px; border-top: 1px solid var(--line); }
.chips button {
  font: inherit; font-size: 12.5px; border: 1px solid var(--line); background: var(--paper);
  color: var(--ink); padding: 4px 10px; border-radius: 999px; cursor: pointer;
}
.chips button:hover { border-color: var(--forest); color: var(--forest-deep); }

.composer { padding: 4px 18px 16px; }
.composer textarea {
  width: 100%; resize: none; font: inherit; color: var(--ink);
  border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; background: #fff;
}
.composer textarea:focus { outline: 2px solid var(--forest); outline-offset: 0; border-color: transparent; }
.composer-actions { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.hint { flex: 1; font-size: 12px; color: var(--ink-soft); }
button { font: inherit; }
.send, .stop { border: 0; border-radius: 10px; padding: 8px 18px; cursor: pointer; font-weight: 700; }
.send { background: var(--forest); color: #fff; }
.send:hover { background: var(--forest-deep); }
.send:disabled { background: #a9b9a9; cursor: progress; }
.stop { background: var(--rose); color: #fff; }
.ghost { border: 1px solid var(--line); background: var(--paper-2); color: var(--ink-soft); border-radius: 999px; padding: 4px 12px; cursor: pointer; font-size: 13px; }
.ghost:hover { color: var(--forest-deep); border-color: var(--forest); }
button:focus-visible, .chips button:focus-visible { outline: 2px solid var(--forest); outline-offset: 2px; }

@media (max-width: 1100px) {
  .layout { grid-template-columns: 1fr; }
  .desk { position: static; height: 640px; }
}
@media (max-width: 680px) {
  .staff-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .top, .layout { padding-left: 16px; padding-right: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .cloud { animation: none; }
  .staff { transition: none; }
}
