:root {
  color-scheme: light;
  --ink: #3d4031;
  --sub: #71745e;
  --bg: #fbf8ee;
  --paper: #fffdf7;
  --line: #dedbca;
  --sage: #e8edd9;
  --green: #4b603b;
  --honey: #f5ead1;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font:
    15px/1.6 system-ui,
    -apple-system,
    'Malgun Gothic',
    sans-serif;
}
button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}
button,
.link {
  cursor: pointer;
  border: 1px solid var(--line);
  background: #fffdf7;
  border-radius: 8px;
  padding: 8px 13px;
  font-weight: 650;
}
button:hover,
.link:hover {
  border-color: #9fae85;
  background: #f2f5e8;
}
button:disabled {
  opacity: 0.6;
  cursor: wait;
}
.primary {
  background: var(--green);
  border-color: var(--green);
  color: white;
}
.primary:hover {
  background: #3d512e;
  color: white;
}
.link {
  display: inline-block;
  text-decoration: none;
  margin-right: 5px;
}
header,
footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px max(4%, calc((100% - 1180px) / 2));
  background: #f7f3e7;
  border-bottom: 1px solid var(--line);
}
.brand,
.top-right {
  display: flex;
  align-items: center;
  gap: 8px;
}
.brand img,
.brand .avatar-fallback {
  width: 33px;
  height: 33px;
  border-radius: 9px;
}
.brand b {
  color: #4a552f;
  font:
    700 30px/1 Georgia,
    serif;
  letter-spacing: -0.09em;
}
.brand span {
  font-weight: 650;
  color: #626849;
}
.top-right,
footer,
small,
.eyebrow {
  font-size: 12px;
  color: var(--sub);
}
nav {
  display: flex;
  gap: 4px;
  padding: 8px max(4%, calc((100% - 1180px) / 2));
  border-bottom: 1px solid var(--line);
  overflow: auto;
}
nav button {
  white-space: nowrap;
  border-color: transparent;
  background: transparent;
  border-radius: 20px;
}
nav [aria-current='page'] {
  background: var(--sage);
  color: #3f512e;
  border-color: #d7dfc0;
}
main {
  max-width: 1180px;
  margin: auto;
  padding: 26px 4% 40px;
}
.heading,
.subhead {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}
.heading {
  margin-bottom: 18px;
}
h1,
h2,
p {
  margin: 0;
}
h1 {
  font-size: clamp(26px, 3.4vw, 36px);
  letter-spacing: -0.06em;
  line-height: 1.3;
}
h2 {
  font-size: 20px;
  letter-spacing: -0.04em;
}
p {
  margin: 8px 0;
  color: var(--sub);
}
.meeting-picker,
.actions,
.selectors {
  display: flex;
  align-items: end;
  gap: 8px;
  flex-wrap: wrap;
}
.meeting-picker label {
  margin-bottom: 9px;
}
.meeting-picker select {
  max-width: 240px;
}
.hero {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--paper);
  overflow: hidden;
}
.scene {
  min-height: 270px;
  background: #faefd9 url('./assets/room.webp') center/contain no-repeat;
  border-right: 1px solid var(--line);
}
.intake {
  padding: clamp(20px, 3vw, 35px);
  align-self: center;
}
.intake h2 {
  font-size: clamp(21px, 2.5vw, 27px);
}
label {
  display: block;
  font-size: 13px;
  font-weight: 650;
  color: var(--sub);
  margin: 10px 0 5px;
}
input,
select,
textarea {
  border: 1px solid var(--line);
  background: #fffef9;
  border-radius: 7px;
  padding: 9px 10px;
  max-width: 100%;
}
input,
textarea {
  display: block;
  width: 100%;
  margin-top: 4px;
}
select {
  display: block;
  min-width: 150px;
  margin-top: 4px;
}
textarea {
  resize: vertical;
}
form button {
  margin-top: 10px;
}
.subhead {
  margin: 25px 0 10px;
}
.subhead h2 {
  font-size: 17px;
}
.subhead span {
  font-size: 12px;
  color: var(--sub);
}
.seats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.seat {
  display: flex;
  gap: 10px;
  padding: 13px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.seat img,
.avatar-fallback {
  width: 48px;
  height: 48px;
  flex: none;
  border-radius: 11px;
  background: #f5e8d0;
  object-fit: cover;
}
.seat strong,
.seat small {
  display: block;
}
.pill {
  display: inline-block;
  font-size: 11px;
  color: #52663c;
  background: var(--sage);
  border-radius: 20px;
  padding: 1px 8px;
  margin-top: 4px;
}
.panel {
  min-width: 0;
  padding: 22px;
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: 14px;
}
.history {
  margin-top: 16px;
}
.grid {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 14px;
  align-items: start;
}
.empty {
  padding: 10px 0;
}
.panel article {
  border-top: 1px solid var(--line);
  padding: 14px 0 2px;
  margin-top: 12px;
}
.panel article p {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.panel details {
  border-top: 1px solid var(--line);
  padding: 10px 0;
}
.panel summary {
  cursor: pointer;
  font-weight: 650;
}
pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
  font:
    13px/1.65 Consolas,
    'Malgun Gothic',
    monospace;
  background: #f5f2e8;
  padding: 12px;
  border-radius: 8px;
  max-height: 380px;
  overflow: auto;
}
.review {
  background: var(--sage);
  padding: 8px;
  border-radius: 8px;
}
.review-form,
.outcome-form {
  display: flex;
  align-items: end;
  gap: 8px;
  flex-wrap: wrap;
}
.review-form label:nth-child(2),
.outcome-form label:nth-child(2) {
  flex: 1;
  min-width: 180px;
}
.selectors {
  margin: 14px 0;
}
.actions {
  margin: 12px 0;
}
.actions label {
  margin: 0;
}
#notice:not(:empty) {
  padding: 12px 0;
  color: #425c31;
  font-weight: 600;
}
footer {
  border-top: 1px solid var(--line);
  border-bottom: 0;
  background: transparent;
}
.loading {
  padding: 30px;
}
@media (max-width: 680px) {
  nav {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 2px;
    padding: 8px 2%;
    overflow: visible;
  }
  nav button {
    min-width: 0;
    padding: 6px 2px;
    font-size: 12px;
    letter-spacing: 0;
    white-space: normal;
    word-break: keep-all;
  }
  header {
    align-items: flex-start;
  }
  .top-right {
    flex-direction: column;
    align-items: end;
  }
  main {
    padding: 20px 4% 30px;
  }
  .hero,
  .grid {
    grid-template-columns: 1fr;
  }
  .scene {
    min-height: 190px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .seats {
    gap: 5px;
  }
  .seat {
    padding: 8px;
    flex-direction: column;
    gap: 4px;
  }
  .seat img {
    width: 42px;
    height: 42px;
  }
  .seat small {
    font-size: 11px;
  }
  .panel {
    padding: 16px;
  }
  .meeting-picker {
    width: 100%;
  }
  .meeting-picker select {
    flex: 1;
    min-width: 0;
  }
  .review-form,
  .outcome-form {
    align-items: stretch;
  }
  .review-form label,
  .outcome-form label {
    width: 100%;
  }
  button,
  select {
    min-height: 44px;
  }
  input,
  textarea {
    font-size: 16px;
  }
}

/* 연결 상태 · 회의실 키 ---------------------------------------- */
.connection h3 {
  margin: 0 0 6px;
  font-size: 15px;
}
.connection p {
  max-width: 72ch;
}
.key-form {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
}
.key-form small {
  font-weight: 500;
  color: var(--sub);
}
.key-form input[type='password'] {
  max-width: 420px;
}
.key-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}
.key-actions button {
  margin-top: 0;
}
.key-state {
  font-size: 12.5px;
}
.key-error {
  color: #9c3b2e;
}

/* 회의실 입장 · 키 관리 ---------------------------------------- */
.entry-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0 6px;
}
.admin-panel {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
}
.panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.panel-head h4 {
  margin: 0;
}
.admin-panel h4 {
  margin: 16px 0 6px;
  font-size: 14px;
}
.admin-panel h4 small {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  font-weight: 500;
  color: var(--sub);
}
.key-table-wrap {
  overflow-x: auto;
}
.key-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.key-table th,
.key-table td {
  text-align: left;
  padding: 7px 8px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.key-table th {
  font-weight: 600;
  color: var(--sub);
  background: #faf6ee;
  white-space: nowrap;
}
.key-table tr.inactive td {
  color: var(--sub);
}
.key-table code {
  font-size: 12.5px;
}
.key-table button.danger {
  padding: 5px 9px;
  font-size: 12.5px;
}
.pill.admin {
  background: #f1d9a8;
  color: #7a5320;
}
button.danger {
  color: #9c3b2e;
  border-color: #d9b3a8;
}
.issued-key {
  margin-top: 12px;
  padding: 12px 14px;
  border: 1px solid #cfe0b8;
  background: #f4f9ec;
  border-radius: 12px;
}
.issued-key strong {
  font-size: 13.5px;
}
.issued-key code {
  display: block;
  margin: 6px 0;
  padding: 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 13px;
  overflow-wrap: anywhere;
  user-select: all;
}

/* 입장 완료 · 에이전트 입장 · 회의실 관리 ---------------------- */
.joined-state {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 14px 0 2px;
}
.pill.ok {
  background: #e4eed4;
  color: #4a6a24;
}
.entry-panel {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
}
.entry-panel h5 {
  margin: 18px 0 6px;
  font-size: 14px;
}
.entry-panel h5 small,
.panel-head h4 small {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  font-weight: 500;
  color: var(--sub);
}
.entry-panel .panel-head {
  align-items: flex-start;
}
.master-ok {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.master-ok button {
  padding: 3px 9px;
  font-size: 12px;
}
.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.row-actions button {
  margin-top: 0;
  padding: 4px 8px;
  font-size: 12.5px;
}
.key-table.compact td,
.key-table.compact th {
  padding: 5px 7px;
  font-size: 12.5px;
}
.guide-preview {
  margin-top: 10px;
}
.guide-preview pre {
  max-height: 320px;
  overflow: auto;
  padding: 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 12.5px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.agent-guide {
  margin-top: 12px;
}
.agent-guide ol {
  margin: 8px 0 0;
  padding-left: 20px;
  font-size: 13px;
}
.agent-guide li {
  margin-bottom: 4px;
}

/* ============================================================
   반응형 (일반 폰 360~430 · 폴드 외부 280~344 · 태블릿 768~1024 · PC)
   위 규칙은 그대로 두고 뒤에서 필요한 값만 덮어쓴다.
   ============================================================ */

/* 0) 공통: 넘치는 글자·말줄임 처리 ---------------------------- */
header,
nav,
main,
footer {
  min-width: 0;
}
.brand {
  min-width: 0;
  flex: 0 1 auto;
}
.brand b {
  white-space: nowrap; /* "INVIA 회의실" 이 두 줄로 꺾이던 문제 */
}
.top-right {
  min-width: 0;
  flex: 1 1 auto;
  justify-content: flex-end;
}
.top-right span {
  text-align: right;
  overflow-wrap: anywhere;
}
h1,
h2 {
  overflow-wrap: anywhere;
}

/* 1) 태블릿 (1024px 이하) ------------------------------------ */
@media (max-width: 1024px) {
  header,
  footer,
  nav {
    padding-left: 3%;
    padding-right: 3%;
  }
  main {
    padding: 22px 3% 32px;
  }
  .brand b {
    font-size: clamp(22px, 3.2vw, 30px);
  }
  .seats {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  }
}

/* 2) 폰 (680px 이하) ----------------------------------------- */
@media (max-width: 680px) {
  /* 헤더: 제목은 한 줄 고정, 상태 문구는 아래 줄로 내려 폭을 다 쓴다 */
  header {
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 8px;
    padding-top: 10px;
    padding-bottom: 10px;
  }
  .brand {
    flex: 1 1 auto;
  }
  .brand b {
    font-size: clamp(20px, 5.4vw, 26px);
    letter-spacing: -0.06em;
  }
  .brand img,
  .brand .avatar-fallback {
    width: 28px;
    height: 28px;
  }
  .top-right {
    flex: 1 1 100%;
    justify-content: flex-start;
    flex-direction: row;
  }
  .top-right span {
    text-align: left;
    font-size: 11.5px;
    line-height: 1.45;
  }

  /* 탭바: 4칸 한 줄 → 2×2 로 바꿔 글자가 잘리지 않게 */
  nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
    padding: 6px 3%;
  }
  nav button {
    min-height: 40px;
    padding: 8px 6px;
    font-size: 13px;
    line-height: 1.25;
  }

  /* 제목 + 회의 선택 줄: 라벨은 위, 셀렉트는 남는 폭 전부, 버튼은 오른쪽 */
  .heading {
    gap: 8px;
    margin-bottom: 14px;
  }
  .heading h1 {
    font-size: clamp(22px, 6.4vw, 28px);
  }
  .meeting-picker {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 6px 8px;
    width: 100%;
  }
  .meeting-picker label {
    grid-column: 1 / -1;
    margin: 0;
  }
  .meeting-picker select {
    width: 100%;
    max-width: none;
    margin-top: 0;
  }
  .meeting-picker button {
    white-space: nowrap;
  }

  /* 좌석: 3열 세로 카드 → 2열, 아주 좁으면 1열 */
  .seats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  .seat {
    flex-direction: row;
    align-items: center;
    gap: 8px;
    padding: 9px;
  }
  .seat img,
  .seat .avatar-fallback {
    width: 36px;
    height: 36px;
    border-radius: 9px;
  }
  .seat strong {
    font-size: 14px;
    overflow-wrap: anywhere;
  }
  .seat small,
  .seat .pill {
    font-size: 11px;
  }

  /* 본문 */
  .hero {
    border-radius: 14px;
  }
  .scene {
    min-height: 160px;
  }
  .intake {
    padding: 18px 16px;
  }
  .subhead {
    margin: 20px 0 8px;
  }
  .panel {
    padding: 14px;
    border-radius: 12px;
  }
  .review-form,
  .outcome-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }
  .review-form label,
  .outcome-form label,
  .review-form label:nth-child(2),
  .outcome-form label:nth-child(2) {
    width: 100%;
    min-width: 0;
    margin: 0;
  }
  .review-form button,
  .outcome-form button {
    width: 100%;
  }
  pre {
    font-size: 12.5px;
    padding: 10px;
  }
  footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
  }
}

/* 3) 아주 좁은 폰 / 폴드 외부 (400px 이하) -------------------- */
@media (max-width: 400px) {
  .brand b {
    font-size: 20px;
  }
  nav button {
    font-size: 12px;
    padding: 7px 4px;
  }
  .seats {
    grid-template-columns: minmax(0, 1fr);
  }
  .seat {
    flex-direction: row;
  }
  .meeting-picker {
    grid-template-columns: minmax(0, 1fr);
  }
  .meeting-picker button {
    width: 100%;
  }
  button,
  .link {
    padding: 9px 11px;
  }
}

/* 4) 가로 모드 폰: 세로 공간이 짧을 때 */
@media (max-height: 430px) and (orientation: landscape) {
  .scene {
    min-height: 120px;
  }
  main {
    padding-top: 12px;
  }
}

/* ============================================================
   대시보드 (피클 현황 · 지시 · 관제) + 입장 잠금 화면
   ============================================================ */

.tagline {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--sub);
}
.muted {
  color: var(--sub);
}
.tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 650;
  color: #6d5a2c;
  background: var(--honey);
  border-radius: 6px;
  padding: 1px 6px;
}

/* 입장 잠금 -------------------------------------------------- */
.lock {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px 5%;
}
.lock-card {
  width: 100%;
  max-width: 460px;
  padding: clamp(22px, 5vw, 34px);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: 0 18px 40px -28px rgba(61, 64, 49, 0.45);
}
.lock-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  font-weight: 700;
  color: #4a552f;
}
.lock-brand img,
.lock-brand .avatar-fallback {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  object-fit: cover;
  background: #f5e8d0;
}
.lock-card h1 {
  font-size: clamp(23px, 5vw, 30px);
  margin: 4px 0 0;
}
.lock-card > p {
  margin: 10px 0 0;
}
.lock-form {
  margin-top: 16px;
}
.lock-form label {
  margin-top: 0;
}
.lock-form input[type='password'] {
  max-width: none;
}
.lock-form button {
  width: 100%;
  margin-top: 12px;
  min-height: 44px;
}
.lock-help {
  margin-top: 18px;
  border-top: 1px dashed var(--line);
  padding-top: 12px;
  font-size: 13px;
}
.lock-help summary {
  cursor: pointer;
  font-weight: 650;
  color: var(--sub);
}
.lock-help p {
  font-size: 13px;
}

/* 요약 숫자 -------------------------------------------------- */
.dash-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 6px;
}
.dash-stats > div {
  padding: 14px 16px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 14px;
}
.dash-stats small {
  display: block;
  font-size: 12px;
  color: var(--sub);
}
.dash-stats b {
  display: block;
  font-size: 26px;
  line-height: 1.15;
  color: #3f512e;
  letter-spacing: -0.04em;
}

/* 피클 카드 -------------------------------------------------- */
.agents {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.agent-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 14px;
  min-width: 0;
}
.agent-top {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.agent-top img,
.agent-top .avatar-fallback {
  width: 42px;
  height: 42px;
  flex: none;
  border-radius: 11px;
  object-fit: cover;
  background: #f5e8d0;
}
.agent-name {
  min-width: 0;
  flex: 1 1 auto;
}
.agent-name strong {
  display: block;
  font-size: 16px;
  overflow-wrap: anywhere;
}
.agent-name small {
  display: block;
  font-size: 12px;
  color: var(--sub);
  overflow-wrap: anywhere;
}
.status-pill {
  flex: none;
  font-size: 11.5px;
  font-weight: 650;
  border-radius: 20px;
  padding: 2px 9px;
  background: var(--sage);
  color: #52663c;
}
.status-pill.busy {
  background: #fde9c8;
  color: #8a5a12;
}
.status-pill.blocked {
  background: #f7dcd5;
  color: #9c3b2e;
}
.status-pill.done {
  background: #e2e6ef;
  color: #45516e;
}
.agent-message {
  margin: 0;
  font-size: 13.5px;
  color: var(--ink);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.agent-task {
  margin: 0;
  font-size: 12.5px;
  color: var(--sub);
  background: #faf6ee;
  border-radius: 8px;
  padding: 7px 9px;
}
.agent-foot {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.agent-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.agent-actions button,
.agent-actions select {
  min-height: 34px;
  font-size: 12.5px;
  padding: 5px 9px;
}
.agent-status-form {
  display: flex;
  gap: 6px;
  flex: 1 1 auto;
}
.agent-status-form select {
  margin-top: 0;
  min-width: 0;
  flex: 1 1 auto;
}
.agent-status-form button {
  margin-top: 0;
  flex: none;
}

/* 지시 ------------------------------------------------------ */
.task-panel {
  margin-top: 16px;
}
.task-form-row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-top: 10px;
}
.task-form-row label {
  margin-top: 0;
}
.task-form-row .grow {
  flex: 1 1 auto;
  min-width: 0;
}
.task-form-row select {
  min-width: 160px;
}
.task-list {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
}
.task-list li {
  border-top: 1px solid var(--line);
  padding: 10px 0;
}
.task-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.task-list p {
  margin: 4px 0 0;
  color: var(--ink);
  overflow-wrap: anywhere;
}
.panel h2 small {
  font-size: 13px;
  font-weight: 500;
  color: var(--sub);
}

/* 관제 ------------------------------------------------------ */
.metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}
.metric-card {
  padding: 16px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 14px;
  min-width: 0;
}
.metric-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.metric-head strong {
  font-size: 15px;
}
.metric-head a {
  font-size: 12px;
  color: var(--green);
}
.metric-items {
  list-style: none;
  margin: 0 0 8px;
  padding: 0;
  display: grid;
  gap: 6px;
}
.metric-items li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px;
  font-size: 13px;
}
.metric-items li span {
  color: var(--sub);
  min-width: 62px;
}
.metric-items li b {
  font-size: 16px;
  color: var(--ink);
}
.metric-items li small {
  font-size: 11.5px;
}
.metric-note {
  font-size: 12.5px;
  margin: 0 0 6px;
}
.metric-card > small {
  font-size: 11.5px;
}

/* 최근 활동 -------------------------------------------------- */
.feed-list {
  list-style: none;
  margin: 6px 0 0;
  padding: 0;
}
.feed-list li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 8px 0;
  border-top: 1px solid var(--line);
}
.feed-list li:first-child {
  border-top: 0;
}
.feed-type {
  flex: none;
  width: 68px;
  font-size: 11.5px;
  font-weight: 650;
  color: #52663c;
  background: var(--sage);
  border-radius: 6px;
  padding: 1px 6px;
  text-align: center;
}
.feed-list p {
  margin: 0;
  font-size: 13px;
  color: var(--ink);
  overflow-wrap: anywhere;
}

/* 원문·요약 하위 탭 ------------------------------------------ */
.record-switch {
  display: flex;
  gap: 6px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.record-switch button {
  border-radius: 20px;
}
.record-switch [aria-selected='true'] {
  background: var(--sage);
  color: #3f512e;
  border-color: #d7dfc0;
}

/* 반응형 ---------------------------------------------------- */
@media (max-width: 1024px) {
  .agents {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  }
}
@media (max-width: 680px) {
  .dash-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  .dash-stats b {
    font-size: 22px;
  }
  .agents {
    grid-template-columns: minmax(0, 1fr);
  }
  .task-form-row {
    flex-direction: column;
    gap: 4px;
  }
  .task-form-row select {
    width: 100%;
  }
  .feed-type {
    width: 58px;
  }
}

/* 관제 탭 · 추이 그래프 -------------------------------------- */
.metric-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}
.metric-foot > small {
  font-size: 11.5px;
}
.metric-foot .link {
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
}
.metric-trend {
  margin: 2px 0 8px;
}
.spark-svg {
  display: block;
  width: 100%;
  max-width: 180px;
  height: 30px;
  overflow: visible;
}

.monitor {
  display: grid;
  gap: 18px;
}
.monitor-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.monitor-hint {
  font-size: 12.5px;
  color: var(--sub);
}
.range-switch {
  display: inline-flex;
  gap: 4px;
  padding: 3px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 22px;
}
.range-switch button {
  border: 0;
  background: transparent;
  border-radius: 18px;
  padding: 5px 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--sub);
}
.range-switch button:hover {
  background: #f2f5e8;
}
.range-switch button[aria-pressed='true'] {
  background: var(--green);
  color: #fffdf7;
}

.monitor-block {
  display: grid;
  gap: 12px;
  padding: 18px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 16px;
}
.monitor-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.monitor-head h2 {
  margin: 0;
  font-size: 19px;
  letter-spacing: -0.01em;
}
.monitor-head small {
  display: block;
  font-size: 12px;
  color: var(--sub);
  margin-top: 2px;
}
.monitor-items {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
}
.monitor-items li {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}
.monitor-items small {
  display: block;
  font-size: 11.5px;
  color: var(--sub);
}
.monitor-items b {
  display: block;
  font-size: 19px;
  line-height: 1.3;
  color: #3f512e;
  overflow-wrap: anywhere;
}
.monitor-items em {
  font-style: normal;
  font-size: 11.5px;
  color: var(--sub);
}

.monitor-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.monitor-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 6px 11px;
  border-radius: 20px;
  background: var(--sage);
  color: #3f512e;
  font-size: 12.5px;
}
.monitor-chip small {
  font-size: 11.5px;
  color: #52663c;
}
.monitor-chip b {
  font-size: 15px;
}
.delta {
  font-size: 11.5px;
  font-weight: 650;
  padding: 1px 6px;
  border-radius: 10px;
  background: #fff;
}
.delta.up {
  color: #2f6b33;
}
.delta.down {
  color: #9c3b2e;
}
.delta.flat {
  color: var(--sub);
}

.monitor-card {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  min-width: 0;
}
.monitor-card h3 {
  margin: 0 0 8px;
  font-size: 14.5px;
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}
.monitor-card h3 small {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--sub);
}
.monitor-grid {
  display: grid;
  grid-template-columns: minmax(180px, 240px) minmax(0, 1fr);
  gap: 12px;
}
.monitor-note {
  margin: 0;
  font-size: 12px;
  color: var(--sub);
}
.chart-card {
  overflow: hidden;
}
.chart-svg {
  display: block;
  width: 100%;
  height: auto;
}
.chart-grid {
  stroke: #ece8da;
  stroke-width: 1;
}
.chart-tick {
  font-size: 10.5px;
  fill: #8b8e78;
}
.chart-value {
  font-size: 10.5px;
  fill: #52663c;
  font-weight: 650;
}
.chart-line {
  stroke-width: 2.2;
  stroke-linejoin: round;
  stroke-linecap: round;
}
.chart-area {
  opacity: 0.1;
}
.chart-dot {
  cursor: default;
}
.chart-last {
  font-size: 11px;
  font-weight: 700;
}
.chart-empty,
.chart-legend + .chart-empty {
  margin: 6px 0;
  font-size: 12.5px;
  color: var(--sub);
}
.chart-legend {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 0 0 6px;
  padding: 0;
  font-size: 12px;
  color: var(--sub);
}
.chart-legend li {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.chart-legend i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
}

.gauge-svg {
  max-width: 240px;
  margin: 4px auto 0;
}
.gauge-value {
  font-size: 22px;
  font-weight: 700;
  fill: #3f512e;
}
.gauge-max {
  font-size: 11.5px;
  fill: #8b8e78;
}
.gauge-pct {
  font-size: 12px;
  font-weight: 650;
  fill: #71745e;
}
.gauge-sub {
  font-size: 9.5px;
  fill: #a0a48e;
}

.cost-items {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 7px;
}
.cost-items li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(60px, 2fr) 62px;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
}
.cost-name {
  overflow-wrap: anywhere;
}
.cost-name em {
  display: block;
  font-style: normal;
  font-size: 11px;
  color: var(--sub);
}
.cost-bar {
  height: 8px;
  border-radius: 5px;
  background: #f1eee0;
  overflow: hidden;
}
.cost-bar i {
  display: block;
  height: 100%;
  border-radius: 5px;
  background: #9fae85;
}
.cost-items b {
  text-align: right;
  font-size: 12.5px;
}

.link-rank {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}
.link-rank li {
  display: grid;
  grid-template-columns: 22px minmax(96px, 1.1fr) minmax(48px, 1.6fr) 92px 60px auto;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
}
.rank-no {
  font-size: 11px;
  font-weight: 700;
  color: var(--sub);
  text-align: right;
}
.rank-path {
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
  overflow-wrap: anywhere;
}
.rank-path:hover {
  color: var(--green);
  text-decoration: underline;
}
.rank-path em {
  display: block;
  font-style: normal;
  font-size: 11px;
  font-weight: 400;
  color: var(--sub);
}
.rank-bar {
  height: 9px;
  border-radius: 5px;
  background: #f1eee0;
  overflow: hidden;
}
.rank-bar i {
  display: block;
  height: 100%;
  border-radius: 5px;
  background: var(--green);
  opacity: 0.75;
}
.rank-value {
  text-align: right;
  font-weight: 650;
}
.rank-value small {
  font-weight: 400;
  font-size: 11px;
  color: var(--sub);
  margin-left: 1px;
}
.rank-value em {
  display: block;
  font-style: normal;
  font-size: 10.5px;
  font-weight: 400;
  color: var(--sub);
}
.rank-trend .spark-svg {
  width: 58px;
  height: 22px;
}
.badge-new {
  font-size: 10.5px;
  font-weight: 700;
  color: #8a5a12;
  background: #fde9c8;
  border-radius: 10px;
  padding: 1px 7px;
}

@media (max-width: 860px) {
  .monitor-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .link-rank li {
    grid-template-columns: 20px minmax(0, 1.4fr) minmax(40px, 1fr) 76px auto;
  }
  .rank-trend {
    display: none;
  }
}
@media (max-width: 560px) {
  .monitor-block {
    padding: 14px;
  }
  .cost-items li {
    grid-template-columns: minmax(0, 1fr) 62px;
  }
  .cost-bar {
    display: none;
  }
  .link-rank li {
    grid-template-columns: 20px minmax(0, 1.4fr) 70px auto;
  }
  .rank-bar {
    display: none;
  }
}
