/* Handong Workflow — design tokens & components (see ../../DESIGN.md) */
:root {
  /* Colors */
  --bg: #f4f4f5;
  --surface: #ffffff;
  --fg: #18181b;
  --fg-muted: #67676f;
  --line: #e4e4e7;
  --primary: #2860dc;
  --primary-soft: #e8f0fd;
  --on-primary: #ffffff;

  /* Semantic (status only) */
  --pending-bg: #f4f4f5;
  --pending-fg: #52525b;
  --active-bg: #e8f0fd;
  --active-fg: #1f56c4;
  --revision-bg: #fef3e2;
  --revision-fg: #b0500a;
  --done-bg: #e7f6ee;
  --done-fg: #157347;

  /* Error (입력·로그인·저장 실패 등 오류 전용 — 업무 상태에는 쓰지 않음) */
  --error-bg: #fdeceb;
  --error-fg: #cf2a22;

  /* Spacing: 4 8 12 16 24 32 40 48 */
  --s1: 4px;
  --s2: 8px;
  --s3: 12px;
  --s4: 16px;
  --s6: 24px;
  --s8: 32px;
  --s10: 40px;
  --s12: 48px;

  /* Radius */
  --r-control: 8px;
  --r-surface: 12px;
  --r-full: 999px;

  /* Type */
  --font: "Pretendard", system-ui, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-size: 14px;
  line-height: 22px;
  -webkit-font-smoothing: antialiased;
  word-break: keep-all;
  overflow-wrap: break-word;
}
h1, h2, h3, p, dl, dd, ol, ul { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Typography */
/* 텍스트 위계 (DESIGN.md Typography): 12 · 14 · 16 · 20 · 24 · 32px, 최소 12px */
.t-display { font-size: 32px; line-height: 40px; font-weight: 700; }
.t-page { font-size: 24px; line-height: 32px; font-weight: 700; }
.t-stat { font-size: 24px; line-height: 32px; font-weight: 700; font-variant-numeric: tabular-nums; }
.t-section { font-size: 20px; line-height: 28px; font-weight: 600; }
.t-title { font-size: 16px; line-height: 24px; font-weight: 600; }
.t-body { font-size: 14px; line-height: 22px; font-weight: 400; }
.t-caption { font-size: 12px; line-height: 18px; font-weight: 500; }
.t-label { font-size: 12px; line-height: 18px; font-weight: 600; color: var(--fg-muted); }
.count { font-weight: 500; color: var(--fg-muted); }
.row-between > .link-muted { font-size: 14px; }
.muted { color: var(--fg-muted); }
.strong { font-weight: 600; }
.mono { font-family: var(--mono); }
.pre { white-space: pre-wrap; }
.nowrap { white-space: nowrap; }
.truncate { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Layout */
.app { min-width: 1024px; min-height: 100vh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: 240px; z-index: 10;
  display: flex; flex-direction: column;
  background: var(--surface); border-right: 1px solid var(--line);
}
.sidebar-brand { display: flex; flex-direction: column; gap: var(--s1); padding: var(--s6); border-bottom: 1px solid var(--line); }
.sidebar-nav { flex: 1; overflow-y: auto; padding: var(--s4) var(--s3); }
.sidebar-nav ul { display: flex; flex-direction: column; gap: var(--s1); }
.nav-link {
  display: flex; align-items: center; height: 40px; padding: 0 var(--s3);
  border-radius: var(--r-control); color: var(--fg-muted); font-weight: 600;
}
.nav-link:hover { background: var(--bg); color: var(--fg); }
.nav-link.sub { height: 32px; padding-left: var(--s6); font-weight: 500; }
.nav-link.active { background: var(--primary-soft); color: var(--primary); }
.sidebar-user { display: flex; flex-direction: column; gap: var(--s3); padding: var(--s4) var(--s6); border-top: 1px solid var(--line); }
.avatar {
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
  width: 32px; height: 32px; border-radius: var(--r-full); background: var(--bg);
  font-size: 12px; font-weight: 600;
}
.main { margin-left: 240px; padding: var(--s8); display: flex; flex-direction: column; gap: var(--s8); }

.stack-1 { display: flex; flex-direction: column; gap: var(--s1); }
.stack-2 { display: flex; flex-direction: column; gap: var(--s2); }
.stack-3 { display: flex; flex-direction: column; gap: var(--s3); }
.stack-4 { display: flex; flex-direction: column; gap: var(--s4); }
.stack-6 { display: flex; flex-direction: column; gap: var(--s6); }
.stack-8 { display: flex; flex-direction: column; gap: var(--s8); }
.row { display: flex; align-items: center; gap: var(--s2); }
.row-3 { display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: var(--s4); }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s4) var(--s6); }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s2); }
.span-2 { grid-column: span 2; }
.divider-top { border-top: 1px solid var(--line); padding-top: var(--s6); }

/* Page header */
.page-header { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s6); }
.page-header .actions { display: flex; gap: var(--s2); flex-shrink: 0; }

/* Surface */
.surface { background: var(--surface); border-radius: var(--r-surface); padding: var(--s6); }
.surface.flush { padding: 0; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  height: 40px; padding: 0 var(--s4); border-radius: var(--r-control);
  font-size: 14px; font-weight: 600; white-space: nowrap; cursor: pointer;
  border: 1px solid transparent; background: none;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: var(--on-primary); }
.btn-primary:not(:disabled):hover { opacity: .9; }
.btn-secondary { background: var(--line); color: var(--fg); }
.btn-secondary:not(:disabled):hover { opacity: .9; }
.btn-text { height: 32px; padding: 0 var(--s2); font-weight: 500; }
.btn-text:hover { background: var(--bg); text-decoration: underline; text-underline-offset: 2px; }
.link-muted { font-size: 12px; font-weight: 500; color: var(--fg-muted); background: none; border: 0; padding: 0; cursor: pointer; }
.back-link { align-self: flex-start; font-size: 14px; font-weight: 500; color: var(--fg-muted); }
.back-link:hover { color: var(--fg); }
.link-muted:hover { color: var(--fg); text-decoration: underline; text-underline-offset: 2px; }

/* Form */
.field { display: flex; flex-direction: column; gap: var(--s2); }
.label { font-weight: 600; }
.label .req { margin-left: var(--s1); color: var(--fg-muted); }
.filter-label { font-size: 12px; font-weight: 600; color: var(--fg-muted); }
.input, .select, .textarea {
  width: 100%; height: 40px; padding: 0 var(--s3);
  background: var(--bg); border: 0; border-radius: var(--r-control);
  font-size: 14px;
}
.textarea { min-height: 120px; padding: var(--s2) var(--s3); resize: vertical; }
.input::placeholder, .textarea::placeholder { color: var(--fg-muted); }
.input:focus, .select:focus, .textarea:focus { outline: 2px solid var(--primary); outline-offset: 0; background-color: var(--surface); }
.input:disabled, .select:disabled { color: var(--fg-muted); cursor: not-allowed; }
.input[aria-invalid="true"], .select[aria-invalid="true"], .textarea[aria-invalid="true"] { background-color: var(--error-bg); }
.input[aria-invalid="true"]:focus, .select[aria-invalid="true"]:focus, .textarea[aria-invalid="true"]:focus { outline-color: var(--error-fg); }
/* Select: draw the chevron inside the box (native arrow sits on the edge) */
.select { appearance: none; -webkit-appearance: none; padding-right: var(--s8); cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none'%3E%3Cpath d='M3 4.5 6 7.5 9 4.5' stroke='%236b7280' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right var(--s3) center; background-size: 12px 12px; }
.readonly { display: flex; align-items: center; height: 40px; padding: 0 var(--s3); background: var(--bg); border-radius: var(--r-control); overflow: hidden; }
.hint { font-size: 12px; line-height: 18px; font-weight: 500; color: var(--fg-muted); }
.error-text { font-size: 12px; line-height: 18px; font-weight: 500; color: var(--error-fg); }
.option-box {
  display: flex; align-items: center; gap: var(--s2); height: 40px; padding: 0 var(--s3);
  border-radius: var(--r-control); background: var(--bg); cursor: pointer;
}
.option-box:has(input:checked), .option-box.on { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.option-box input { accent-color: var(--primary); margin: 0; }
.option-box.disabled { opacity: .5; cursor: not-allowed; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
legend { padding: 0; margin-bottom: var(--s2); font-weight: 600; }
.w-filter { width: 160px; }
.w-search { width: 288px; }
input[type="file"] { font-size: 14px; }
input[type="file"]::file-selector-button {
  height: 40px; margin-right: var(--s3); padding: 0 var(--s4); cursor: pointer;
  border: 0; border-radius: var(--r-control); background: var(--bg);
  font-weight: 600;
}

/* Filter chips & tabs */
.chip {
  display: inline-flex; align-items: center; height: 32px; padding: 0 var(--s3);
  border: 0; border-radius: var(--r-full); background: var(--bg); color: var(--fg-muted);
  font-weight: 500; cursor: pointer;
}
.chip:hover { color: var(--fg); }
.chip[aria-pressed="true"] { background: var(--primary-soft); color: var(--primary); }
input:checked + .chip { background: var(--primary-soft); color: var(--primary); }
input:focus-visible + .chip { outline: 2px solid var(--primary); outline-offset: 2px; }
.tabs { display: flex; gap: var(--s2); padding-bottom: var(--s3); border-bottom: 1px solid var(--line); }
.tab { display: inline-flex; align-items: center; gap: var(--s2); height: 32px; padding: 0 var(--s3); border-radius: var(--r-control); font-weight: 600; color: var(--fg-muted); }
.tab:hover { color: var(--fg); }
.tab[aria-current="page"] { background: var(--primary-soft); color: var(--primary); }

/* Table */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; text-align: left; }
.table th { height: 40px; padding: 0 var(--s3); border-bottom: 1px solid var(--line); font-size: 12px; font-weight: 600; color: var(--fg-muted); white-space: nowrap; }
.table td { height: 48px; padding: var(--s2) var(--s3); border-bottom: 1px solid var(--line); vertical-align: middle; }
.table th:first-child, .table td:first-child { padding-left: 0; }
.table th:last-child, .table td:last-child { padding-right: 0; }
.table tr.clickable { cursor: pointer; }
.table tr.clickable:hover td { background: var(--bg); }
.table a.main-link { font-weight: 600; }
.table a.main-link:hover { text-decoration: underline; text-underline-offset: 2px; }
/* 목록 페이지 나누기: 한 페이지 10개 */
.pager { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: var(--s3); padding-top: var(--s4); }
.pager-links { display: flex; align-items: center; gap: var(--s1); }
.pager-btn { display: inline-flex; align-items: center; justify-content: center; min-width: 32px; height: 32px; padding: 0 var(--s2); font-size: 14px; font-weight: 500; color: var(--fg-muted); }
a.pager-btn:hover { color: var(--fg); }
.pager-btn.on { color: var(--primary); font-weight: 600; }
.pager-btn.off { color: var(--line); }
.pager-btn[aria-label="이전 페이지"], .pager-btn[aria-label="다음 페이지"] { font-size: 16px; }
.cell-clip { max-width: 240px; }
.right { text-align: right; }

/* Badges */
.badge { display: inline-flex; align-items: center; height: 24px; padding: 0 var(--s2); border-radius: var(--r-full); font-size: 12px; font-weight: 500; white-space: nowrap; }
.tone-pending { background: var(--pending-bg); color: var(--pending-fg); }
.tone-active { background: var(--active-bg); color: var(--active-fg); }
.tone-revision { background: var(--revision-bg); color: var(--revision-fg); }
.tone-done { background: var(--done-bg); color: var(--done-fg); }
.badge-type { background: var(--bg); color: var(--fg-muted); }
.code { font-family: var(--mono); font-size: 12px; font-weight: 500; color: var(--fg-muted); }

/* States */
.notice { display: flex; align-items: flex-start; gap: var(--s3); padding: var(--s3) var(--s4); border-radius: var(--r-control); font-weight: 500; }
.notice::before { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; width: 20px; height: 20px; border-radius: var(--r-full); color: var(--on-primary); font-size: 12px; font-weight: 600; }
.notice.success::before { content: "✓" / ""; background: var(--done-fg); }
.notice.error::before { content: "!" / ""; background: var(--error-fg); }
.notice.revision::before { content: "!" / ""; background: var(--revision-fg); }
.notice.success { background: var(--done-bg); color: var(--done-fg); }
.notice.error { background: var(--error-bg); color: var(--error-fg); }
.notice.revision { background: var(--revision-bg); color: var(--revision-fg); }
.empty { display: flex; flex-direction: column; align-items: center; gap: var(--s4); padding: var(--s12) var(--s6); text-align: center; color: var(--fg-muted); }
.skeleton { background: var(--line); border-radius: var(--r-control); animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .5; } }
@media (prefers-reduced-motion: reduce) { .skeleton { animation: none; } }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); padding: 0; }
.stat { display: flex; flex-direction: column; gap: var(--s2); padding: var(--s6); border-left: 1px solid var(--line); }
.stat:first-child { border-left: 0; border-radius: var(--r-surface) 0 0 var(--r-surface); }
.stat:last-child { border-radius: 0 var(--r-surface) var(--r-surface) 0; }
.stat:hover { background: var(--bg); }

/* Detail */
.detail-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s8); align-items: start; }
@media (min-width: 1280px) { .detail-grid { grid-template-columns: minmax(0, 1fr) 320px; } }
.info-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s4) var(--s6); }
@media (min-width: 1280px) { .info-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.dept-row { display: grid; grid-template-columns: minmax(0, 1fr) 160px 160px; gap: var(--s6); padding: var(--s4) 0; border-bottom: 1px solid var(--line); }
.req-row { display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: var(--s6); padding: var(--s4) 0; border-bottom: 1px solid var(--line); }
.list-top { border-top: 1px solid var(--line); }
.timeline li { display: flex; gap: var(--s3); }
.timeline .rail { display: flex; flex-direction: column; align-items: center; width: 8px; flex-shrink: 0; }
.timeline .dot { width: 8px; height: 8px; margin-top: var(--s2); border-radius: var(--r-full); background: var(--fg-muted); }
.timeline .line { flex: 1; width: 1px; margin-top: var(--s1); background: var(--line); }
.timeline .body { display: flex; flex-direction: column; gap: var(--s1); padding-bottom: var(--s4); min-width: 0; }

/* Dialog */
dialog { width: 100%; max-width: 512px; padding: 0; border: 0; border-radius: var(--r-surface); background: var(--surface); color: var(--fg); }
dialog::backdrop { background: rgba(24, 24, 27, .4); }
.dialog-body { display: flex; flex-direction: column; gap: var(--s6); padding: var(--s6); }
.dialog-footer { display: flex; justify-content: flex-end; gap: var(--s2); }

/* ------------------------------------------------------------------
 * Additions for the 2026-10 IA (existing tokens only — no new values)
 * ------------------------------------------------------------------ */

/* Sidebar: section divider + group heading (Admin "관리") */
.nav-divider { height: 1px; margin: var(--s3) 0; background: var(--line); }
.nav-heading { display: flex; align-items: center; height: 32px; padding: 0 var(--s3); font-size: 12px; font-weight: 600; color: var(--fg-muted); }

/* Login: centered surface (same Surface component) */
.login-wrap { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: var(--s12) var(--s8); }
.login-card { width: 100%; max-width: 448px; }

/* Multi select: selected values as chips with a remove button */
.tag { display: inline-flex; align-items: center; gap: var(--s1); height: 32px; padding: 0 var(--s1) 0 var(--s3); border-radius: var(--r-full); background: var(--primary-soft); color: var(--primary); font-weight: 500; }
.tag-remove { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border: 0; border-radius: var(--r-full); background: none; color: inherit; cursor: pointer; font-size: 14px; }
.tag-remove:hover { background: var(--surface); }
.tag-list { display: flex; flex-wrap: wrap; gap: var(--s2); }

/* ------------------------------------------------------------------
 * 2026-10 workflow & responsive additions (existing tokens only)
 * ------------------------------------------------------------------ */

/* Stats: button variant + column counts */
button.stat { border: 0; border-left: 1px solid var(--line); background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
button.stat:first-child { border-left: 0; }
.stats-5 { grid-template-columns: repeat(5, 1fr); }
.stats-6 { grid-template-columns: repeat(6, 1fr); }

/* Form footer actions */
.form-actions { display: flex; justify-content: flex-end; gap: var(--s2); border-top: 1px solid var(--line); padding-top: var(--s6); }
.file-row { min-height: 48px; border-bottom: 1px solid var(--line); }
/* Upload: hidden native input + a fill-only drop area label */
.upload-box { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--s1); min-height: 96px; padding: var(--s4); border-radius: var(--r-control); background: var(--bg); text-align: center; cursor: pointer; }
.upload-box .strong { color: var(--primary); }
.upload-box:hover { background: var(--primary-soft); }
input[type="file"]:focus-visible + .upload-box { outline: 2px solid var(--primary); outline-offset: 2px; }
.filter-row { align-items: flex-end; }

/* Approval stepper: one connected line — done ✓ (Primary line) / current (Primary) / upcoming (muted) / revision·rejected (!) */
.stepper { display: flex; }
.step { position: relative; flex: 1; display: flex; flex-direction: column; align-items: flex-start; gap: var(--s2); min-width: 0; padding-right: var(--s2); }
.step::after { content: ""; position: absolute; top: 11px; left: 32px; right: var(--s2); height: 2px; border-radius: var(--r-full); background: var(--line); }
.step:last-child::after { display: none; }
.step.is-done::after { background: var(--primary); }
.step-mark { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; width: 24px; height: 24px; border-radius: var(--r-full); background: var(--bg); font-size: 12px; font-weight: 600; color: var(--fg-muted); }
.step-text { display: flex; flex-direction: column; min-width: 0; }
.step-name { font-weight: 600; }
.step-state { font-size: 12px; line-height: 18px; font-weight: 500; color: var(--fg-muted); }
.step.is-done .step-mark { background: var(--primary); color: var(--on-primary); }
.step.is-current .step-mark { background: var(--primary-soft); color: var(--primary); }
.step.is-current .step-name { color: var(--fg); }
.step.is-current .step-state { color: var(--primary); }
.step.is-upcoming .step-name { color: var(--fg-muted); font-weight: 500; }
.step.is-revision .step-mark, .step.is-rejected .step-mark { background: var(--revision-fg); color: var(--on-primary); }
.step.is-revision .step-name, .step.is-revision .step-state, .step.is-rejected .step-name, .step.is-rejected .step-state { color: var(--revision-fg); }

/* History details */
.history-comment { padding: var(--s2) var(--s3); border-radius: var(--r-control); background: var(--bg); color: var(--fg); font-size: 12px; line-height: 18px; }
.history-diff { display: flex; flex-direction: column; gap: var(--s1); font-size: 12px; line-height: 18px; }
.activity-row { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--s3); padding: var(--s3) 0; border-bottom: 1px solid var(--line); }

/* Login demo account guide */
.demo-accounts summary { cursor: pointer; margin-bottom: var(--s2); list-style: none; display: inline-flex; align-items: center; gap: var(--s1); }
.demo-accounts summary::-webkit-details-marker { display: none; }
.demo-accounts summary::before { content: "›"; display: inline-flex; justify-content: center; width: 12px; font-size: 16px; line-height: 16px; transition: transform .15s ease; }
.demo-accounts[open] summary::before { transform: rotate(90deg); }
.demo-accounts ul { max-height: 240px; overflow-y: auto; }

/* Topbar + drawer (shown below 1024px) */
.topbar { display: none; }
.drawer-backdrop { display: none; position: fixed; inset: 0; z-index: 9; background: rgba(24, 24, 27, .4); }
/* CSS-only drawer: hidden checkbox (#nav-toggle) + labels (메뉴 버튼 · 배경) */
.nav-toggle { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.nav-toggle:focus-visible ~ .topbar .menu-btn { outline: 2px solid var(--primary); outline-offset: 2px; }
.menu-btn { cursor: pointer; }

/* ---------- Tablet & mobile (< 1024px) ---------- */
@media (max-width: 1023px) {
  .app { min-width: 0; }
  .topbar { position: sticky; top: 0; z-index: 8; display: flex; align-items: center; gap: var(--s3); height: 56px; padding: 0 var(--s4); background: var(--surface); border-bottom: 1px solid var(--line); }
  .menu-btn { height: 40px; }
  .sidebar { transform: translateX(-100%); visibility: hidden; z-index: 10; }
  .sidebar.open, .nav-toggle:checked ~ .sidebar { transform: none; visibility: visible; }
  .nav-toggle:checked ~ .drawer-backdrop { display: block; }
  .main { margin-left: 0; padding: var(--s6); gap: var(--s6); }
  .stats, .stats-5, .stats-6 { grid-template-columns: repeat(3, 1fr); }
  .stats .stat { border-left: 0; border-top: 1px solid var(--line); }
  .stats .stat:nth-child(-n+3) { border-top: 0; }
  .stats .stat:not(:nth-child(3n+1)) { border-left: 1px solid var(--line); }
  .stats .stat, .stats .stat:first-child, .stats .stat:last-child { border-radius: 0; }
  .w-search { width: 100%; }
  .filter-row .w-filter { flex: 1 1 160px; }
  .btn, .chip, .tab, .nav-link { min-height: 40px; }
  .chip-row, .tabs { flex-wrap: wrap; }
}

/* ---------- Mobile (≤ 767px) ---------- */
@media (max-width: 767px) {
  .main { padding: var(--s4); gap: var(--s6); }
  .surface { padding: var(--s4); }
  .page-header { flex-direction: column; align-items: stretch; gap: var(--s4); }
  .page-header .actions { flex-wrap: wrap; }
  .page-header .actions .btn { flex: 1 1 auto; }
  .t-page, .t-stat { font-size: 20px; line-height: 28px; }
  .t-display { font-size: 24px; line-height: 32px; }
  .grid-2, .info-grid { grid-template-columns: minmax(0, 1fr); }
  .span-2 { grid-column: auto; }
  .stats, .stats-5, .stats-6 { grid-template-columns: repeat(2, 1fr); }
  /* reset the tablet 3-column borders, then draw a 2-column grid */
  .stats .stat, .stats .stat:not(:nth-child(3n+1)) { border-left: 0; border-top: 1px solid var(--line); padding: var(--s4); }
  .stats .stat:nth-child(-n+2) { border-top: 0; }
  .stats .stat:nth-child(2n) { border-left: 1px solid var(--line); }
  .stepper { flex-direction: column; }
  .step { flex: none; flex-direction: row; padding: 0 0 var(--s4); }
  .step::after { top: 28px; bottom: var(--s1); left: 11px; right: auto; width: 2px; height: auto; }
  .dept-row, .req-row { grid-template-columns: minmax(0, 1fr); gap: var(--s3); }
  .filter-row .w-filter { flex: 1 1 100%; width: 100%; }
  .form-actions { flex-wrap: wrap; }
  .form-actions .btn { flex: 1 1 auto; }
  .form-actions .btn-text { flex-basis: 100%; order: 3; }
  .activity-row { flex-direction: column; gap: var(--s1); }
  .detail-grid { gap: var(--s6); }
  dialog { max-width: calc(100% - var(--s8)); }
  .dialog-body { padding: var(--s4); }
  .row-between { flex-wrap: wrap; }
}
.cell-title { min-width: 200px; }
.form-hint { text-align: right; }
@media (max-width: 767px) {
  .form-hint { text-align: left; }
}

/* Sidebar tree (folders open/close with native <details>, no JS · no icons) */
.nav-folder { display: flex; align-items: center; gap: var(--s2); height: 40px; padding: 0 var(--s3); border-radius: var(--r-control); color: var(--fg-muted); font-weight: 600; cursor: pointer; list-style: none; }
.nav-folder::-webkit-details-marker { display: none; }
.nav-folder::before { content: "›"; display: inline-flex; justify-content: center; width: 12px; font-size: 16px; line-height: 16px; transition: transform .15s ease; }
details[open] > .nav-folder::before { transform: rotate(90deg); }
.nav-folder:hover { background: var(--bg); color: var(--fg); }
.nav-tree details:has(.nav-link.active) > .nav-folder { color: var(--fg); }
.nav-children { margin: var(--s1) 0 var(--s2) var(--s6); padding-left: var(--s2); border-left: 1px solid var(--line); }
.nav-tree .nav-link.sub { padding-left: var(--s3); }
@media (prefers-reduced-motion: reduce) { .nav-folder::before { transition: none; } }

/* Dashboard grid: main content (left, 2 rows) + full-height activity rail (right) */
.dash-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s8); }
.dash-main { min-width: 0; }
@media (min-width: 1280px) {
  .dash-grid { grid-template-columns: minmax(0, 1fr) 320px; grid-template-rows: auto 1fr; }
  .dash-main { grid-column: 1; }
  .dash-rail { grid-column: 2; grid-row: 1 / span 2; }
}
@media (max-width: 1023px) { .dash-grid { gap: var(--s6); } }

/* 인원 변경 요청 위젯: 접힌 상태(겹친 프로필 + 요약) ↔ 펼친 상태(목록 + 승인·반려). <details>, no JS */
.request-pill { background: var(--surface); border-radius: var(--r-surface); }
.request-pill-summary { display: flex; align-items: center; gap: var(--s3); min-height: 64px; padding: var(--s3) var(--s4); cursor: pointer; list-style: none; border-radius: var(--r-surface); }
.request-pill-summary::-webkit-details-marker { display: none; }
.request-pill-summary:hover { background: var(--bg); }
.request-pill[open] > .request-pill-summary { border-bottom: 1px solid var(--line); border-radius: var(--r-surface) var(--r-surface) 0 0; }
.avatar-stack { display: flex; flex-shrink: 0; }
.avatar-stack .avatar { border: 2px solid var(--surface); }
.avatar-stack .avatar + .avatar { margin-left: calc(var(--s2) * -1); }
.request-pill-text { display: flex; flex-direction: column; gap: var(--s1); flex: 1; min-width: 0; }
.request-pill-chevron { display: inline-flex; justify-content: center; width: 16px; font-size: 16px; color: var(--fg-muted); transition: transform .15s ease; }
.request-pill[open] .request-pill-chevron { transform: rotate(90deg); }
.request-pill-body { display: flex; flex-direction: column; gap: var(--s3); padding: var(--s4); }
.request-row { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; align-items: center; gap: var(--s3); padding: var(--s3) 0; border-bottom: 1px solid var(--line); }
.request-actions { display: flex; gap: var(--s2); }
@media (prefers-reduced-motion: reduce) { .request-pill-chevron { transition: none; } }
@media (max-width: 767px) {
  .request-pill-summary .badge { display: none; }
  .request-row { grid-template-columns: 32px minmax(0, 1fr); }
  .request-actions { grid-column: 1 / -1; }
  .request-actions .btn { flex: 1; }
}

/* Mobile: each table row becomes a card; labels come from data-label */
@media (max-width: 767px) {
  .table-wrap { overflow: visible; }
  .table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
  .table tr { padding: var(--s3) 0; border-bottom: 1px solid var(--line); }
  .table td, .table td:first-child, .table td:last-child { display: flex; justify-content: space-between; align-items: center; gap: var(--s3); height: auto; min-height: 32px; padding: var(--s1) 0; border-bottom: 0; text-align: right; white-space: normal; }
  .table td::before { content: attr(data-label); flex-shrink: 0; font-size: 12px; font-weight: 600; color: var(--fg-muted); text-align: left; }
  .table td:first-child { justify-content: flex-start; padding-bottom: var(--s2); text-align: left; }
  .table td:first-child::before { display: none; }
  .table td.right:last-child { justify-content: flex-end; }
  .table td.right:last-child::before { margin-right: auto; }
  .table .cell-clip { max-width: none; }
  .table .truncate { white-space: normal; }
}

/* 대외/국제 switch without JS: the checked type shows its own category list */
.cat-intl, .cat-panel-intl, .cat-intl-only { display: none; }
.grid-2:has(input[value="international"]:checked) .cat-ext { display: none; }
.grid-2:has(input[value="international"]:checked) .cat-intl { display: flex; }
.main:has(#ct-intl:checked) .cat-panel-ext, .main:has(#ct-intl:checked) .cat-ext-only { display: none; }
.main:has(#ct-intl:checked) .cat-panel-intl { display: flex; }
.main:has(#ct-intl:checked) .cat-intl-only { display: inline-flex; }
/* Work lists: pick 대외/국제, then click a category chip (no typing) */
.cat-chips { display: none; }
.cat-chips { flex-wrap: wrap; row-gap: var(--s2); }
.cat-chips .chip { flex-shrink: 0; white-space: nowrap; }
.cat-chips .filter-label { margin-right: var(--s1); }
.main:has(#wt-ext:checked) .cat-chips-ext, .main:has(#wt-intl:checked) .cat-chips-intl { display: flex; }
.main:has(#wt-ext:checked) .cat-chips-hint, .main:has(#wt-intl:checked) .cat-chips-hint { display: none; }
.cat-chips-hint { margin-left: var(--s2); }
