* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg: #0b0f15;
  --bg-2: #0d1117;
  --surface: #151b24;
  --surface-2: #1d2532;
  --surface-3: #232c3b;
  --border: #2a3441;
  --border-strong: #3a4555;
  --text: #e6edf3;
  --text-dim: #b8c4d4;
  --muted: #8693a8;
  --accent: #e8d5a2;           /* 크림 (메인) */
  --accent-2: #f5e6c2;          /* 라이트 크림 */
  --accent-3: #fff4d6;          /* 아이보리 글로우 */
  --accent-deep: #c9b482;       /* 진한 크림 (콘트라스트) */
  --partner: #00d4ff;
  --partner-2: #4ae0ff;
  --metal: #6b9fd1;            /* ST88 메탈 블루 */
  --success: #3fb950;
  --danger: #f85149;
  --warn: #d29922;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.4);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.45);
  --shadow-lg: 0 10px 30px rgba(0,0,0,0.55);
  --shadow-glow: 0 0 24px rgba(232,213,162,0.20);
  --grad-accent: linear-gradient(135deg, #c9b482 0%, #f5e6c2 100%);
  --grad-partner: linear-gradient(135deg, #00d4ff 0%, #4ae0ff 100%);
  --grad-bg: radial-gradient(ellipse at top, #1a2030 0%, #0b0f15 60%);
}

html, body {
  height: 100%;
  background: var(--bg);
  background-image: var(--grad-bg);
  color: var(--text);
  font-family: -apple-system, "Pretendard", "Apple SD Gothic Neo", "Segoe UI", sans-serif;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--accent); text-decoration: none; }
button { font-family: inherit; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg-2); }
::-webkit-scrollbar-thumb { background: var(--surface-2); border-radius: 6px; border: 2px solid var(--bg-2); }
::-webkit-scrollbar-thumb:hover { background: var(--surface-3); }

/* ───────── Layout ───────── */
.app {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}
.sidebar {
  background: linear-gradient(180deg, #151b24 0%, #11161e 100%);
  border-right: 1px solid var(--border);
  padding: 20px 0;
  box-shadow: 1px 0 0 rgba(255,255,255,0.02) inset;
}

.brand {
  padding: 0 22px 22px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 14px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}
.brand .brand-logo {
  width: auto;
  height: 56px;
  max-width: 200px;
  object-fit: contain;
  filter: drop-shadow(0 4px 12px rgba(107,159,209,0.25));
}
.brand h1 { font-size: 18px; color: var(--accent); letter-spacing: 1px; }
.brand .sub {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  font-weight: 600;
}

.nav { display: flex; flex-direction: column; padding: 4px 10px; }
.nav a {
  padding: 10px 14px;
  color: var(--text-dim);
  border-radius: 8px;
  margin-bottom: 2px;
  font-size: 13.5px;
  transition: all .18s ease;
  position: relative;
  display: block;
}
.nav a:hover { background: var(--surface-2); color: var(--text); transform: translateX(2px); }
.nav a.active {
  background: linear-gradient(90deg, rgba(232,213,162,0.16) 0%, rgba(232,213,162,0.04) 100%);
  color: var(--accent);
  font-weight: 600;
}
.nav a.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 3px;
  background: var(--grad-accent);
  border-radius: 0 3px 3px 0;
  box-shadow: 0 0 12px rgba(232,213,162,0.5);
}

.user-bar {
  position: absolute;
  bottom: 0;
  padding: 16px 22px;
  width: 260px;
  border-top: 1px solid var(--border);
  background: linear-gradient(180deg, transparent 0%, rgba(0,0,0,0.3) 100%);
  font-size: 12px;
}
.user-bar .name { color: var(--accent); font-weight: 700; font-size: 13px; }
.user-bar .logout {
  color: var(--muted);
  cursor: pointer;
  margin-top: 6px;
  font-size: 11px;
  transition: color .15s;
}
.user-bar .logout:hover { color: var(--danger); }

main {
  padding: 28px 36px;
  overflow-x: auto;
  min-height: 100vh;
}
.page-title {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 24px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
  letter-spacing: -0.3px;
}
.row { display: flex; gap: 18px; flex-wrap: wrap; margin-bottom: 18px; }

/* ───────── Cards ───────── */
.card {
  background: linear-gradient(135deg, var(--surface) 0%, var(--surface-2) 100%);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px 22px;
  flex: 1;
  min-width: 200px;
  box-shadow: var(--shadow-sm);
  transition: all .2s ease;
  position: relative;
  overflow: hidden;
}
.card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--grad-accent);
  opacity: 0.6;
}
.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
}
.card .label {
  font-size: 11.5px;
  color: var(--muted);
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
}
.card .value {
  font-size: 26px;
  background: var(--grad-accent);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 800;
  letter-spacing: -0.5px;
  line-height: 1.1;
}
.card .small { font-size: 11px; color: var(--muted); margin-top: 6px; }
.card.partner::before { background: var(--grad-partner); }
.card.partner .value { background: var(--grad-partner); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.card.danger::before { background: linear-gradient(135deg, #f85149 0%, #ff7873 100%); }
.card.danger .value { background: linear-gradient(135deg, #f85149 0%, #ff7873 100%); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.card.success::before { background: linear-gradient(135deg, #3fb950 0%, #5edd6e 100%); }
.card.success .value { background: linear-gradient(135deg, #3fb950 0%, #5edd6e 100%); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }

.section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 22px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-sm);
}
.section h2 {
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}
.section h2::before {
  content: '';
  width: 3px;
  height: 14px;
  background: var(--grad-accent);
  border-radius: 2px;
}

/* ───────── Tables ───────── */
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 12px 10px; text-align: left; }
th {
  color: var(--muted);
  font-weight: 700;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border-strong);
  position: sticky;
  top: 0;
}
th:first-child { border-radius: 6px 0 0 6px; }
th:last-child { border-radius: 0 6px 6px 0; }
td { border-bottom: 1px solid var(--border); }
tbody tr { transition: background .15s; }
tbody tr:hover td { background: var(--surface-2); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ───────── Buttons ───────── */
.btn {
  background: var(--grad-accent);
  color: #1a1300;
  padding: 9px 18px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.2px;
  transition: all .18s ease;
  box-shadow: 0 2px 6px rgba(232,213,162,0.25), inset 0 1px 0 rgba(255,255,255,0.2);
}
.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(232,213,162,0.4), inset 0 1px 0 rgba(255,255,255,0.25);
  filter: brightness(1.05);
}
.btn:active { transform: translateY(0); }
.btn.ghost {
  background: transparent;
  color: var(--text-dim);
  border: 1px solid var(--border-strong);
  box-shadow: none;
}
.btn.ghost:hover { background: var(--surface-2); color: var(--text); border-color: var(--accent); transform: none; }
.btn.danger { background: linear-gradient(135deg, #f85149 0%, #ff7873 100%); color: #fff; box-shadow: 0 2px 6px rgba(248,81,73,0.3); }
.btn.danger:hover { box-shadow: 0 6px 16px rgba(248,81,73,0.45); }
.btn.sm { padding: 5px 12px; font-size: 11.5px; border-radius: 6px; }

/* ───────── Forms ───────── */
input, select, textarea {
  background: var(--bg-2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13px;
  width: 100%;
  font-family: inherit;
  transition: all .15s ease;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(232,213,162,0.15);
}
input:disabled, input[readonly] { opacity: 0.7; cursor: not-allowed; }
label {
  display: block;
  font-size: 11.5px;
  color: var(--muted);
  margin-bottom: 6px;
  font-weight: 600;
  letter-spacing: 0.3px;
}
.form-row { margin-bottom: 14px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* ───────── Badges ───────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3px;
  border: 1px solid transparent;
}
.badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 6px currentColor;
}
.badge.active     { background: rgba(63,185,80,.12);  color: var(--success); border-color: rgba(63,185,80,.3); }
.badge.suspended  { background: rgba(216,153,34,.12); color: var(--warn);    border-color: rgba(216,153,34,.3); }
.badge.closed     { background: rgba(248,81,73,.12);  color: var(--danger);  border-color: rgba(248,81,73,.3); }
.badge.pending    { background: rgba(216,153,34,.12); color: var(--warn);    border-color: rgba(216,153,34,.3); }
.badge.finalized  { background: rgba(63,185,80,.12);  color: var(--success); border-color: rgba(63,185,80,.3); }
.badge.paid       { background: rgba(232,213,162,.12); color: var(--accent);  border-color: rgba(232,213,162,.3); }

/* ───────── Tree ───────── */
.tree { font-family: "JetBrains Mono", "Consolas", monospace; font-size: 13px; }
.tree-node { padding: 4px 0; }
.tree-node .row-line {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 8px;
  transition: all .15s ease;
}
.tree-node .row-line:hover {
  background: var(--surface-2);
  box-shadow: var(--shadow-sm);
}
.tree-node .pct {
  color: var(--accent);
  font-weight: 700;
  background: rgba(232,213,162,0.1);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
}
.tree-node .own {
  color: var(--metal);
  font-size: 11px;
  font-weight: 600;
}
.tree-children {
  padding-left: 24px;
  border-left: 1px dashed var(--border-strong);
  margin-left: 12px;
  margin-top: 2px;
}

/* ───────── Modal ───────── */
.modal-bg {
  position: fixed;
  inset: 0;
  background: rgba(5,8,12,.75);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 50;
  animation: fadeIn .2s ease;
}
.modal-bg.show { display: flex; }
.modal {
  background: linear-gradient(180deg, var(--surface) 0%, #131820 100%);
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  padding: 28px;
  width: 520px;
  max-width: 92vw;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(255,255,255,0.03) inset;
  animation: modalIn .25s cubic-bezier(0.2, 0.9, 0.3, 1);
}
.modal h3 {
  margin-bottom: 18px;
  font-size: 18px;
  font-weight: 700;
  color: var(--accent-2);
  letter-spacing: -0.2px;
}
.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalIn { from { opacity: 0; transform: scale(0.96) translateY(8px); } to { opacity: 1; transform: scale(1) translateY(0); } }

/* ───────── Login ───────── */
.login-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background:
    radial-gradient(ellipse at 20% 10%, rgba(107,159,209,0.12) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 90%, rgba(232,213,162,0.10) 0%, transparent 50%),
    var(--bg);
}
.login-box {
  width: 400px;
  background: linear-gradient(180deg, var(--surface) 0%, #131820 100%);
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  padding: 40px 36px;
  box-shadow:
    var(--shadow-lg),
    0 0 0 1px rgba(255,255,255,0.04) inset,
    0 -4px 20px rgba(232,213,162,0.05) inset;
  position: relative;
  overflow: hidden;
}
.login-box::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent 0%, var(--accent) 50%, transparent 100%);
}
.login-box h1 { color: var(--accent); text-align: center; margin-bottom: 4px; letter-spacing: 2px; }
.login-logo {
  display: block;
  width: auto;
  height: 110px;
  max-width: 300px;
  margin: 0 auto 16px;
  object-fit: contain;
  filter: drop-shadow(0 8px 24px rgba(107,159,209,0.3));
}
.login-box .tagline {
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 32px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  font-weight: 600;
}
.login-box button {
  width: 100%;
  padding: 14px;
  font-size: 14px;
  margin-top: 8px;
}
.login-error {
  color: var(--danger);
  font-size: 12px;
  margin-top: 12px;
  min-height: 16px;
  text-align: center;
  font-weight: 600;
}

/* ───────── Misc ───────── */
.muted { color: var(--muted); }
.right { text-align: right; }
.spacer { flex: 1; }
.gold { color: var(--accent); }
.cyan { color: var(--partner); }
.empty {
  color: var(--muted);
  padding: 36px 24px;
  text-align: center;
  font-size: 13px;
}

.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.toolbar input, .toolbar select { width: auto; min-width: 140px; }

/* ───────── Docs page ───────── */
.docs-layout { display: grid; grid-template-columns: 240px 1fr; gap: 22px; align-items: flex-start; }
.docs-list {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  position: sticky;
  top: 16px;
  box-shadow: var(--shadow-sm);
}
.docs-list a {
  display: block;
  padding: 11px 14px;
  color: var(--text-dim);
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
  transition: all .15s ease;
  margin-bottom: 2px;
  font-weight: 500;
}
.docs-list a:hover { background: var(--surface-2); color: var(--text); }
.docs-list a.active {
  background: linear-gradient(90deg, rgba(232,213,162,0.16) 0%, rgba(232,213,162,0.04) 100%);
  color: var(--accent);
  font-weight: 700;
  box-shadow: inset 3px 0 0 var(--accent);
  padding-left: 14px;
}
.docs-body {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 32px 36px;
  min-width: 0;
  box-shadow: var(--shadow-sm);
}
.docs-context {
  background: linear-gradient(135deg, rgba(232,213,162,0.08) 0%, rgba(107,159,209,0.06) 100%);
  border: 1px solid rgba(232,213,162,0.2);
  border-radius: 10px;
  padding: 16px 20px;
  margin-bottom: 28px;
  font-size: 12.5px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  line-height: 1.7;
}
.docs-context .docs-context-logo {
  width: auto;
  height: 52px;
  max-width: 96px;
  flex: 0 0 auto;
  object-fit: contain;
  filter: drop-shadow(0 2px 8px rgba(107,159,209,0.25));
}
.docs-context .docs-context-text { flex: 1; min-width: 0; }
.docs-context strong { color: var(--accent-2); font-size: 13px; }
.docs-context code {
  background: rgba(255,255,255,0.08);
  padding: 2px 8px;
  border-radius: 4px;
  font-family: ui-monospace, monospace;
  font-size: 12px;
  color: var(--accent-2);
  font-weight: 600;
}

/* ───────── Markdown rendering ───────── */
.md-h1 {
  font-size: 24px;
  background: var(--grad-accent);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin: 0 0 18px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--border-strong);
  font-weight: 800;
  letter-spacing: -0.3px;
}
.md-h2 { font-size: 19px; color: var(--text); margin: 32px 0 14px; padding-bottom: 8px; border-bottom: 1px solid var(--border); font-weight: 700; }
.md-h3 { font-size: 16px; color: var(--accent-2); margin: 24px 0 10px; font-weight: 700; }
.md-h4 { font-size: 14px; color: var(--text-dim); margin: 18px 0 8px; font-weight: 700; }
.md-h5, .md-h6 { font-size: 13px; color: var(--muted); margin: 14px 0 6px; text-transform: uppercase; letter-spacing: .8px; font-weight: 700; }
.docs-body p { margin: 8px 0 14px; line-height: 1.7; color: var(--text-dim); }
.docs-body code {
  background: rgba(232,213,162,0.1);
  padding: 2px 7px;
  border-radius: 4px;
  font-family: ui-monospace, "SF Mono", Consolas, monospace;
  font-size: 12.5px;
  color: var(--accent-2);
  font-weight: 600;
  border: 1px solid rgba(232,213,162,0.15);
}
.md-code {
  background: #0a0e14;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px 18px;
  overflow-x: auto;
  margin: 14px 0;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.03);
}
.md-code code {
  background: transparent;
  padding: 0;
  color: #cdd9e5;
  font-size: 12.5px;
  line-height: 1.6;
  border: none;
  font-weight: 400;
}
/* Syntax highlight tokens */
.md-code .hl-key     { color: #f5e6c2; font-weight: 600; }   /* JSON 키 (라이트 크림) */
.md-code .hl-str     { color: #a3d9b1; }                      /* 문자열 (연한 민트) */
.md-code .hl-num     { color: #6b9fd1; font-weight: 600; }    /* 숫자 (메탈 블루) */
.md-code .hl-bool    { color: #4ae0ff; font-weight: 700; font-style: italic; } /* boolean/null */
.md-code .hl-comment { color: #6b7689; font-style: italic; }  /* 주석 (회색) */
.md-code .hl-kw      { color: #d4a3ff; font-weight: 600; }    /* 키워드 (라벤더) */
.md-code .hl-cmd     { color: #e8d5a2; font-weight: 700; }    /* bash 명령 (크림) */
.md-code .hl-flag    { color: #b8c4d4; font-style: italic; }  /* CLI 플래그 */
.md-code .hl-var     { color: #f5b878; }                      /* 변수 (앰버) */
.md-code .hl-method  { color: #e8d5a2; font-weight: 700; padding: 1px 6px; background: rgba(232,213,162,0.12); border-radius: 4px; } /* HTTP 메소드 */
.md-code[data-lang]::before {
  content: attr(data-lang);
  display: block;
  font-size: 10px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 10px;
  font-weight: 700;
}
.md-table { width: auto; min-width: 50%; margin: 16px 0; font-size: 12.5px; border-radius: 8px; overflow: hidden; }
.md-table th { background: linear-gradient(180deg, var(--surface-2) 0%, var(--surface) 100%); color: var(--accent-2); border-bottom: 1px solid var(--border-strong); padding: 10px 14px; font-weight: 700; }
.md-table td { padding: 9px 14px; border-bottom: 1px solid var(--border); color: var(--text-dim); }
.md-table tr:hover td { background: rgba(255,255,255,0.025); }
.md-bq {
  border-left: 3px solid var(--accent);
  background: linear-gradient(90deg, rgba(232,213,162,0.08) 0%, transparent 100%);
  padding: 12px 18px;
  margin: 14px 0;
  color: var(--text-dim);
  font-size: 13px;
  border-radius: 0 8px 8px 0;
}
.md-ul, .md-ol { margin: 10px 0 14px 26px; line-height: 1.8; color: var(--text-dim); }
.md-ul li, .md-ol li { margin: 5px 0; }
.md-ul li::marker { color: var(--accent); }
.md-ol li::marker { color: var(--accent-2); font-weight: 700; }
.docs-body hr { border: none; border-top: 1px solid var(--border); margin: 24px 0; }
.docs-body strong { color: var(--accent-2); font-weight: 700; }

/* ───────── 햄버거 메뉴 (모바일에서만 보임) ───────── */
.hamburger {
  display: none;
  position: fixed;
  top: 14px;
  left: 14px;
  z-index: 60;
  width: 42px;
  height: 42px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 4px;
  box-shadow: var(--shadow-md);
}
.hamburger span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
  transition: all .2s;
}
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.6);
  backdrop-filter: blur(2px);
  z-index: 40;
}
.sidebar-overlay.show { display: block; }

/* ───────── Mobile (≤ 768px) ───────── */
@media (max-width: 768px) {
  body { font-size: 13px; }

  .app { grid-template-columns: 1fr; }

  /* 사이드바 — 슬라이드인 드로어 */
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    height: 100vh;
    z-index: 50;
    transform: translateX(-100%);
    transition: transform .25s ease;
    overflow-y: auto;
  }
  .sidebar.open { transform: translateX(0); box-shadow: var(--shadow-lg); }
  .user-bar { width: 280px; }

  .hamburger { display: flex; }

  /* 본문 — 햄버거 자리 확보 */
  main { padding: 64px 16px 24px; }
  .page-title { font-size: 20px; margin-bottom: 16px; padding-bottom: 10px; }

  /* 카드 1열 */
  .card { min-width: 0; padding: 16px; flex: 1 1 100%; }
  .card .value { font-size: 22px; }
  .row { gap: 12px; margin-bottom: 12px; }

  /* 섹션 */
  .section { padding: 16px; }

  /* 표 — 가로 스크롤 + 폰트 축소 */
  .section table, table { font-size: 12px; min-width: 480px; }
  .section { overflow-x: auto; }
  th, td { padding: 8px 6px; }

  /* 폼 */
  .form-grid { grid-template-columns: 1fr; gap: 10px; }
  input, select, textarea { padding: 11px 12px; font-size: 14px; } /* 모바일 16px 미만이면 zoom 발생 위험 → 14px */

  /* 버튼 */
  .btn { padding: 11px 18px; font-size: 13.5px; }
  .btn.sm { padding: 6px 12px; font-size: 11.5px; }

  /* 트리 */
  .tree-children { padding-left: 14px; margin-left: 6px; }
  .tree-node .row-line { padding: 8px 6px; flex-wrap: wrap; gap: 6px; }
  .tree-node .row-line > span:first-child { flex-basis: 100%; }
  .tree-node .pct { font-size: 11px; padding: 2px 6px; }

  /* 모달 */
  .modal {
    width: 100%;
    max-height: 100vh;
    border-radius: 0;
    padding: 20px;
    margin: 0;
  }
  .modal-bg { padding: 0; align-items: stretch; }

  /* 로그인 */
  .login-wrap { padding: 16px; }
  .login-box { width: 100%; max-width: 400px; padding: 28px 24px; }
  .login-logo { height: 80px; }

  /* 토스트/배지 */
  .badge { font-size: 10.5px; padding: 2px 8px; }

  /* Docs */
  .docs-layout { grid-template-columns: 1fr; gap: 14px; }
  .docs-list { position: static; padding: 6px; }
  .docs-list a { padding: 10px 12px; font-size: 13px; }
  .docs-body { padding: 20px 16px; }
  .docs-context { flex-direction: column; align-items: center; text-align: center; padding: 14px; }
  .docs-context .docs-context-logo { height: 56px; }

  /* Markdown */
  .md-h1 { font-size: 20px; }
  .md-h2 { font-size: 17px; margin-top: 22px; }
  .md-h3 { font-size: 15px; }
  .md-code { padding: 12px; font-size: 12px; }
  .md-table { font-size: 11.5px; min-width: 320px; }
  .md-table th, .md-table td { padding: 6px 8px; }

  /* Sequence diagram — 가로 스크롤 보장 */
  .seq-diagram { padding: 18px 14px; overflow-x: auto; }
  .seq-actors, .seq-track { gap: 16px; }
  .seq-actor { padding: 10px 8px; font-size: 11.5px; }
  .seq-label { padding: 4px 10px; font-size: 10.5px; }
  .seq-note { padding: 7px 10px; font-size: 10.5px; }
}

/* 매우 작은 화면 (≤ 380px) */
@media (max-width: 380px) {
  main { padding: 60px 10px 20px; }
  .page-title { font-size: 18px; }
  .card .value { font-size: 20px; }
  .login-box { padding: 24px 18px; }
}

/* ───────── Sequence Diagram ───────── */
.seq-diagram {
  background:
    radial-gradient(ellipse at top, rgba(107,159,209,0.08) 0%, transparent 60%),
    linear-gradient(180deg, #0f1520 0%, #0a0f17 100%);
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  padding: 32px 28px;
  margin: 20px 0;
  box-shadow: var(--shadow-md), inset 0 1px 0 rgba(255,255,255,0.04);
  overflow-x: auto;
}
.seq-actors {
  display: grid;
  grid-template-columns: repeat(var(--cols), minmax(160px, 1fr));
  gap: 28px;
  margin-bottom: 32px;
  min-width: max-content;
}
.seq-actor {
  background: linear-gradient(135deg, var(--surface-2) 0%, var(--surface-3) 100%);
  border: 1px solid var(--border-strong);
  border-top: 2px solid var(--accent);
  padding: 14px 16px;
  border-radius: 10px;
  text-align: center;
  font-weight: 700;
  color: var(--text);
  font-size: 13px;
  letter-spacing: 0.3px;
  box-shadow: var(--shadow-sm), 0 0 0 1px rgba(255,255,255,0.02) inset;
  position: relative;
}
.seq-actor::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 8px;
  height: 8px;
  background: var(--metal);
  border-radius: 50%;
  box-shadow: 0 0 12px rgba(107,159,209,0.6);
}
.seq-actor-0 { border-top-color: var(--accent); }
.seq-actor-0::after { background: var(--accent); box-shadow: 0 0 12px rgba(232,213,162,0.6); }
.seq-actor-1 { border-top-color: var(--metal); }
.seq-actor-1::after { background: var(--metal); }
.seq-actor-2 { border-top-color: var(--partner); }
.seq-actor-2::after { background: var(--partner); box-shadow: 0 0 12px rgba(0,212,255,0.6); }
.seq-actor-3 { border-top-color: var(--success); }
.seq-actor-3::after { background: var(--success); box-shadow: 0 0 12px rgba(63,185,80,0.6); }

.seq-track {
  display: grid;
  grid-template-columns: repeat(var(--cols), minmax(160px, 1fr));
  grid-auto-rows: 56px;
  column-gap: 28px;
  position: relative;
  min-width: max-content;
}
.seq-lifeline {
  border-left: 2px dashed rgba(107,159,209,0.3);
  justify-self: center;
  width: 0;
  z-index: 0;
}
.seq-msg {
  align-self: center;
  position: relative;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}
.seq-msg::before {
  content: '';
  position: absolute;
  left: 4%;
  right: 4%;
  height: 2px;
  background: linear-gradient(90deg, var(--accent-deep) 0%, var(--accent) 50%, var(--accent-2) 100%);
  border-radius: 2px;
  box-shadow: 0 0 10px rgba(232,213,162,0.4);
}
.seq-msg.is-resp::before {
  background: linear-gradient(90deg, var(--metal) 0%, var(--partner-2) 100%);
  box-shadow: 0 0 10px rgba(107,159,209,0.45);
  height: 1.5px;
  background-image: linear-gradient(90deg, var(--metal), var(--partner-2));
  border-style: dashed;
}
.seq-msg.seq-r::after {
  content: '';
  position: absolute;
  right: 4%;
  width: 0;
  height: 0;
  border-top: 7px solid transparent;
  border-bottom: 7px solid transparent;
  border-left: 10px solid var(--accent-2);
  transform: translateX(8px);
  filter: drop-shadow(0 0 6px rgba(232,213,162,0.6));
}
.seq-msg.seq-l::after {
  content: '';
  position: absolute;
  left: 4%;
  width: 0;
  height: 0;
  border-top: 7px solid transparent;
  border-bottom: 7px solid transparent;
  border-right: 10px solid var(--accent-2);
  transform: translateX(-8px);
  filter: drop-shadow(0 0 6px rgba(232,213,162,0.6));
}
.seq-msg.is-resp.seq-r::after {
  border-left-color: var(--partner);
  filter: drop-shadow(0 0 6px rgba(0,212,255,0.6));
}
.seq-msg.is-resp.seq-l::after {
  border-right-color: var(--partner);
  filter: drop-shadow(0 0 6px rgba(0,212,255,0.6));
}
.seq-label {
  position: relative;
  z-index: 2;
  background: linear-gradient(180deg, var(--surface) 0%, var(--surface-2) 100%);
  padding: 6px 14px;
  border-radius: 18px;
  border: 1px solid var(--border-strong);
  font-size: 11.5px;
  color: var(--text);
  font-weight: 600;
  white-space: nowrap;
  box-shadow: var(--shadow-sm);
  font-family: ui-monospace, "SF Mono", Consolas, monospace;
  letter-spacing: 0.2px;
}
.seq-msg.is-resp .seq-label {
  color: var(--metal);
  border-color: rgba(107,159,209,0.35);
}
.seq-note {
  align-self: center;
  background:
    linear-gradient(135deg, rgba(232,213,162,0.18) 0%, rgba(232,213,162,0.06) 100%);
  border: 1px solid rgba(232,213,162,0.4);
  border-left: 3px solid var(--accent);
  padding: 9px 16px;
  border-radius: 8px;
  font-size: 11.5px;
  color: var(--accent-2);
  text-align: center;
  font-style: italic;
  white-space: nowrap;
  box-shadow: var(--shadow-sm);
  z-index: 1;
}
