/* 오토 뤼튼 포스트 — 관리 화면 (v2.8)
   밝은 사이드바 + 카드형 본문. 강조색은 인디고, 앰버는 "지금 진행 중"에만 쓴다. */

:root {
  --font-sans: "Pretendard Variable", "Pretendard", "IBM Plex Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
  --font-serif: var(--font-sans);
  --font-mono: ui-monospace, SFMono-Regular, "JetBrains Mono", Menlo, monospace;

  --surface: #ffffff;
  --ground: #f5f6fa;
  --ink: #14161f;
  --muted: #646b7e;
  --line: #e7e9f1;
  --line-strong: #d3d7e4;

  --rail: #ffffff;
  --rail-ink: #2a2f40;
  --rail-muted: #7a8196;
  --rail-active: #eef0ff;

  --primary: #4f46e5;
  --primary-hover: #4038c9;
  --primary-ink: #ffffff;
  --primary-soft: #eef0ff;
  --signal: #f5a524;

  --ok: #12804a;      --ok-soft: #dff5e8;
  --draft: #3b5bdb;   --draft-soft: #e5ecff;
  --warn: #92560a;    --warn-soft: #fff1d6;
  --err: #c0271b;     --err-soft: #fde7e4;
  --muted-soft: #eceef5;

  --r-s: 8px; --r-m: 12px; --r-l: 18px;
  --shadow-card: 0 1px 2px rgba(20, 22, 40, .04), 0 4px 16px rgba(20, 22, 40, .04);
  --shadow-pop: 0 24px 60px rgba(14, 16, 40, .28);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --surface: #161925; --ground: #0e1018; --ink: #eceef7; --muted: #9aa1b8;
    --line: #242838; --line-strong: #353a50;
    --rail: #121520; --rail-ink: #dfe2f0; --rail-muted: #8a91a8; --rail-active: #222650;
    --primary: #8b87ff; --primary-hover: #a3a0ff; --primary-ink: #0c0d1c; --primary-soft: #222650;
    --ok: #6ad39b; --ok-soft: #173326; --draft: #9db4ff; --draft-soft: #1c2548;
    --warn: #f0b74a; --warn-soft: #3a2c10; --err: #ff8b80; --err-soft: #3d1b18; --muted-soft: #1f2332;
    --shadow-card: 0 1px 2px rgba(0, 0, 0, .3); --shadow-pop: 0 24px 60px rgba(0, 0, 0, .6);
  }
}
:root[data-theme="dark"] {
  --surface: #161925; --ground: #0e1018; --ink: #eceef7; --muted: #9aa1b8;
  --line: #242838; --line-strong: #353a50;
  --rail: #121520; --rail-ink: #dfe2f0; --rail-muted: #8a91a8; --rail-active: #222650;
  --primary: #8b87ff; --primary-hover: #a3a0ff; --primary-ink: #0c0d1c; --primary-soft: #222650;
  --ok: #6ad39b; --ok-soft: #173326; --draft: #9db4ff; --draft-soft: #1c2548;
  --warn: #f0b74a; --warn-soft: #3a2c10; --err: #ff8b80; --err-soft: #3d1b18; --muted-soft: #1f2332;
  --shadow-card: 0 1px 2px rgba(0, 0, 0, .3); --shadow-pop: 0 24px 60px rgba(0, 0, 0, .6);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh;
  display: grid; grid-template-columns: 248px minmax(0, 1fr);
  background: var(--ground); color: var(--ink);
  font: 400 14.5px/1.65 var(--font-sans); letter-spacing: -.006em;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p, ul, ol, dl, dd { margin: 0; padding: 0; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
code { font: 12.5px var(--font-mono); background: var(--muted-soft); padding: 1px 6px; border-radius: 4px; word-break: break-all; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }
.spacer { flex: 1; }
.ico { flex: none; }

/* ------------------------------------------------ 사이드바 */
.rail {
  position: sticky; top: 0; align-self: start; height: 100vh;
  display: flex; flex-direction: column; gap: 30px;
  padding: 24px 14px 16px; background: var(--rail); color: var(--rail-ink); border-right: 1px solid var(--line);
}
.brand { display: grid; gap: 2px; padding: 0 10px; text-decoration: none; }
.rail-run { margin: -14px 0 0; padding: 0 2px; }
.rail-run .btn { width: 100%; padding: 10px 14px; border-radius: 10px; }
.brand-name { font: 800 18px/1.25 var(--font-sans); color: var(--ink); letter-spacing: -.03em; }
.brand-name::before { content: ""; display: inline-block; width: 12px; height: 12px; margin-right: 9px; border-radius: 4px; background: linear-gradient(135deg, var(--primary), #8b5cf6); transform: rotate(45deg); vertical-align: 1px; }
.brand-site { font-size: 12.5px; color: var(--rail-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav { display: grid; gap: 2px; }
.nav a {
  display: flex; align-items: center; gap: 11px; padding: 9px 10px;
  border-radius: 10px; color: var(--rail-muted); text-decoration: none; font-weight: 500;
}
.nav a:hover { background: var(--ground); color: var(--ink); }
.nav a[aria-current="page"] { background: var(--rail-active); color: var(--primary); font-weight: 600; }
.rail-foot { margin-top: auto; display: grid; gap: 8px; padding: 0 4px; }
.rail-status { display: flex; align-items: center; gap: 9px; padding: 0 6px; font-size: 13px; color: var(--rail-muted); }
.rail-status .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--rail-muted); }
.rail-status[data-running="1"] { color: var(--ink); font-weight: 600; }
.rail-status[data-running="1"] .dot { background: var(--signal); }
.theme-btn {
  display: flex; align-items: center; gap: 10px; padding: 8px 6px; border: 0; border-radius: var(--r-s);
  background: transparent; color: var(--rail-muted); cursor: pointer; font-size: 13px; text-align: left;
}
.theme-btn:hover { color: var(--ink); background: var(--ground); }
.topbar { display: none; }

/* ------------------------------------------------ 본문 */
.main { width: 100%; max-width: 1180px; padding: 36px clamp(20px, 3.4vw, 48px) 96px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 26px; }
h1 { font: 800 28px/1.3 var(--font-sans); letter-spacing: -.03em; }
h2 { font: 700 15px/1.45 var(--font-sans); }
h3 { font: 600 15px/1.45 var(--font-sans); }
.lede { margin-top: 6px; max-width: 62ch; color: var(--muted); }
.hint { color: var(--muted); font-size: 13px; line-height: 1.55; }
.link { color: var(--muted); font-size: 13px; text-underline-offset: 3px; }
.link:hover { color: var(--ink); }
.block { margin-top: 44px; }
.block-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 8px; }
.split { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 48px; }

.notice {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 12px 16px; margin-bottom: 24px; border-radius: var(--r-m);
  background: var(--warn-soft); color: var(--warn);
}
.notice b { display: block; }
.notice span { font-size: 13.5px; }

/* ------------------------------------------------ 발행 흐름 (대시보드의 중심) */
.pipeline { padding: 28px 30px 22px; border-radius: var(--r-l); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-card); }
.steps { list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.step { position: relative; padding-right: 18px; }
.step::after { content: ""; position: absolute; top: 9px; left: 30px; right: 6px; height: 2px; background: var(--line-strong); border-radius: 1px; }
.step:last-child::after { display: none; }
.mark { position: relative; z-index: 1; display: block; width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--line-strong); background: var(--surface); }
.step-text { display: grid; gap: 1px; margin-top: 12px; min-width: 0; word-break: keep-all; }
.step-text b { font-weight: 600; }
.step-text small { color: var(--muted); font-size: 13px; min-height: 1.6em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.step.is-done .mark { background: var(--primary); border-color: var(--primary); }
.step.is-done::after { background: var(--primary); }
.step.is-active .mark { background: var(--signal); border-color: var(--signal); }
.step.is-active .step-text small { color: var(--ink); }
@media (prefers-reduced-motion: no-preference) {
  .step.is-active .mark { animation: pulse 1.7s ease-out infinite; }
  @keyframes pulse {
    0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--signal) 55%, transparent); }
    100% { box-shadow: 0 0 0 13px transparent; }
  }
}
.meter { height: 4px; margin-top: 24px; border-radius: 2px; background: var(--line); overflow: hidden; }
.meter i { display: block; width: 0; height: 100%; background: var(--primary); transition: width .5s ease; }
.pipeline-foot { margin-top: 12px; color: var(--muted); font-size: 13.5px; }

.figures { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-top: 20px; }
.figure { padding: 18px 20px; border: 1px solid var(--line); border-radius: var(--r-m); background: var(--surface); box-shadow: var(--shadow-card); }
.figure:first-child { padding-left: 20px; }
.num { display: block; font: 800 30px/1.2 var(--font-sans); letter-spacing: -.01em; font-variant-numeric: lining-nums; }
.cap { display: block; margin-top: 2px; color: var(--muted); font-size: 13.5px; }

/* ------------------------------------------------ 목록 */
.rows { list-style: none; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 13px 0; border-top: 1px solid var(--line); }
.row-main { display: grid; min-width: 0; }
.row-title { font-weight: 500; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
a.row-title:hover { text-decoration: underline; text-underline-offset: 3px; }
.row-sub { display: flex; gap: 12px; color: var(--muted); font-size: 13px; overflow: hidden; white-space: nowrap; }
.row-sub > span:first-child { overflow: hidden; text-overflow: ellipsis; }

.pill {
  display: inline-flex; align-items: center; padding: 1px 10px; border-radius: 99px;
  font-size: 12.5px; font-weight: 500; white-space: nowrap; background: var(--muted-soft); color: var(--muted);
}
.pill-ok { background: var(--ok-soft); color: var(--ok); }
.pill-draft { background: var(--draft-soft); color: var(--draft); }
.pill-warn { background: var(--warn-soft); color: var(--warn); }
.pill-muted { background: var(--muted-soft); color: var(--muted); }

.empty { display: grid; justify-items: start; gap: 12px; padding: 22px 0; color: var(--muted); border-top: 1px solid var(--line); }
.empty-lg { padding: 48px 0; }

/* ------------------------------------------------ 버튼 / 폼 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 8px 16px; border: 1px solid transparent; border-radius: 10px;
  font-weight: 500; font-size: 14px; line-height: 1.4; cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background-color .15s, border-color .15s;
}
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.primary { background: var(--primary); color: var(--primary-ink); box-shadow: 0 1px 2px rgba(79, 70, 229, .35); }
.btn.primary:hover:not(:disabled) { background: var(--primary-hover); }
.btn.ghost { background: transparent; border-color: var(--line-strong); color: var(--ink); }
.btn.ghost:hover:not(:disabled) { background: var(--ground); }
.btn.quiet { background: transparent; color: var(--muted); }
.btn.quiet:hover:not(:disabled) { background: var(--ground); color: var(--ink); }
.btn.danger-quiet { background: transparent; color: var(--err); }
.btn.danger-quiet:hover { background: var(--err-soft); }
.icon-btn {
  display: inline-grid; place-items: center; width: 34px; height: 34px; border: 0; border-radius: var(--r-s);
  background: transparent; color: var(--muted); cursor: pointer; text-decoration: none;
}
.icon-btn:hover { background: var(--ground); color: var(--ink); }

.field { display: grid; gap: 6px; }
.field-narrow { max-width: 220px; }
.field-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.label { font-weight: 600; font-size: 13.5px; }
.input {
  width: 100%; padding: 10px 13px; border: 1px solid var(--line-strong); border-radius: 10px;
  background: var(--surface); color: var(--ink);
}
.input::placeholder { color: color-mix(in srgb, var(--muted) 70%, transparent); }
.input:hover { border-color: var(--muted); }
.input:focus-visible { outline: 3px solid color-mix(in srgb, var(--primary) 28%, transparent); outline-offset: 0; border-color: var(--primary); }

.switch { position: relative; display: inline-block; width: 40px; height: 24px; flex: none; cursor: pointer; }
.switch input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.switch .track { position: absolute; inset: 0; border-radius: 99px; background: var(--line-strong); transition: background-color .15s; }
.switch .track::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%;
  background: #fff; transition: transform .18s; box-shadow: 0 1px 2px rgba(0, 0, 0, .25);
}
.switch input:checked + .track { background: var(--primary); }
.switch input:checked + .track::after { transform: translateX(16px); }
.switch input:focus-visible + .track { outline: 2px solid var(--signal); outline-offset: 2px; }

.check { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; }
.check input { margin-top: 5px; width: 16px; height: 16px; accent-color: var(--primary); }
.check span { display: grid; }
.check small { color: var(--muted); font-size: 13px; }
.check-inline { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 13.5px; }

/* ------------------------------------------------ 카테고리 */
.cats { list-style: none; }
.cat { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 22px; padding: 22px 0; border-top: 1px solid var(--line); }
.cat:last-child { border-bottom: 1px solid var(--line); }
.cat-toggle { display: grid; }
.cat-main { display: grid; gap: 6px; min-width: 0; }
.cat-name { font: 700 17px/1.4 var(--font-sans); letter-spacing: -.02em; }
.cat.is-off .cat-name, .cat.is-off .chips { opacity: .5; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { padding: 1px 10px; border: 1px solid var(--line-strong); border-radius: 99px; font-size: 13px; color: var(--muted); }
.cat-meta { color: var(--muted); font-size: 13.5px; }
.cat-actions { display: flex; align-items: center; gap: 4px; }

/* ------------------------------------------------ 포스팅 표 */
.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 20px; }
.filters .input { width: auto; min-width: 150px; }
.search { position: relative; flex: 1 1 260px; display: block; }
.search .ico { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search .input { width: 100%; padding-left: 34px; }
.count { margin-bottom: 6px; color: var(--muted); font-size: 13px; }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th { padding: 8px 12px 8px 0; text-align: left; font-weight: 500; font-size: 13px; color: var(--muted); border-bottom: 1px solid var(--line-strong); white-space: nowrap; }
.table td { padding: 13px 12px 13px 0; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.cell-title { max-width: 360px; font-weight: 500; }
.cell-title a { text-underline-offset: 3px; }
.cell-actions { display: flex; justify-content: flex-end; gap: 2px; }
.cell-actions form { display: inline; }
.pager { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 24px; }

/* ------------------------------------------------ 로그 */
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 14px; flex-wrap: wrap; }
.seg-inline { display: inline-flex; padding: 3px; border-radius: var(--r-m); background: var(--ground); }
.seg-btn { padding: 5px 14px; border: 0; border-radius: var(--r-s); background: transparent; color: var(--muted); cursor: pointer; font-size: 13.5px; font-weight: 500; }
.seg-btn[aria-pressed="true"] { background: var(--surface); color: var(--primary); color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, .12); }
.log-list { list-style: none; font: 12.5px/1.6 var(--font-mono); }
.log-row { display: grid; grid-template-columns: auto auto minmax(0, 1fr); gap: 4px 12px; align-items: baseline; padding: 6px 0; border-top: 1px solid var(--line); }
.log-row time { color: var(--muted); white-space: nowrap; }
.log-row .msg { overflow-wrap: anywhere; font-family: var(--font-sans); font-size: 13px; }
.lv { font: 500 12px var(--font-sans); color: var(--muted); min-width: 2.2em; }
.lv-warn { color: var(--warn); }
.lv-error { color: var(--err); }
.log-row[data-level="ERROR"] .msg { color: var(--err); }
.log-list-lg .log-row { padding: 8px 0; }
.log-row.is-new { animation: fresh 1.6s ease-out; }
@keyframes fresh { from { background: color-mix(in srgb, var(--signal) 22%, transparent); } to { background: transparent; } }
@media (prefers-reduced-motion: reduce) { .log-row.is-new { animation: none; } }

/* ------------------------------------------------ 설정 */
.setting { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 32px; padding: 28px 30px; margin-bottom: 16px; border: 1px solid var(--line); border-radius: var(--r-l); background: var(--surface); box-shadow: var(--shadow-card); }
.setting-intro { display: grid; align-content: start; gap: 4px; }
.setting-body { display: grid; gap: 18px; max-width: 600px; }
.kv { display: grid; }
.kv-row { display: flex; justify-content: space-between; gap: 16px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.kv-row:first-child { padding-top: 0; }
.kv dt { color: var(--muted); }
.kv-val { font-weight: 500; overflow-wrap: anywhere; text-align: right; }
.test-row { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.test-result { font-size: 13.5px; }
.test-result.ok { color: var(--ok); }
.test-result.err { color: var(--err); }
.seg { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid var(--line-strong); border-radius: var(--r-m); overflow: hidden; }
.seg-item { position: relative; cursor: pointer; }
.seg-item + .seg-item { border-left: 1px solid var(--line-strong); }
.seg-item input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg-item span { display: grid; gap: 2px; padding: 12px 14px; height: 100%; }
.seg-item small { color: var(--muted); font-size: 12.5px; line-height: 1.45; }
.seg-item input:checked + span { background: var(--primary); color: var(--primary-ink); }
.seg-item input:checked + span small { color: color-mix(in srgb, var(--primary-ink) 80%, transparent); }
.seg-item input:focus-visible + span { outline: 2px solid var(--signal); outline-offset: -2px; }
.savebar { position: sticky; bottom: 0; display: flex; justify-content: flex-end; padding: 16px 0; margin-top: 8px; background: linear-gradient(to top, var(--surface) 70%, transparent); }

/* ------------------------------------------------ 대화상자 / 토스트 */
dialog {
  width: min(520px, calc(100vw - 32px)); padding: 0; border: 1px solid var(--line); border-radius: var(--r-l);
  background: var(--surface); color: var(--ink); box-shadow: var(--shadow-pop);
}
dialog::backdrop { background: rgba(8, 20, 16, .5); }
dialog[open] { animation: dlg-in .18s ease-out; }
@keyframes dlg-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { dialog[open] { animation: none; } }
.dlg { display: grid; }
.dlg-head { padding: 22px 24px 4px; display: grid; gap: 4px; }
.dlg-head h2 { font: 800 19px/1.4 var(--font-sans); letter-spacing: -.02em; }
.dlg-body { display: grid; gap: 16px; padding: 16px 24px 8px; max-height: 62vh; overflow-y: auto; }
.dlg-foot { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 16px 24px 20px; }
.dlg-foot [hidden] { display: none; }

.kw-list { list-style: none; }
.kw-item { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 0; border-top: 1px solid var(--line); }
.kw-item:first-child { border-top: 0; }
.kw-main { display: grid; min-width: 0; }
.kw-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.kw-top b { font-weight: 600; }
.kw-main > span { color: var(--muted); font-size: 13px; }
.loading { display: flex; align-items: center; gap: 10px; color: var(--muted); padding: 20px 0; }
.spinner { width: 16px; height: 16px; border: 2px solid var(--line-strong); border-top-color: var(--primary); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 2.4s; } }

.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 50; display: grid; gap: 8px; justify-items: end; pointer-events: none; }
.toast {
  max-width: min(420px, calc(100vw - 40px)); padding: 11px 16px; border-radius: var(--r-m);
  background: var(--ink); color: var(--surface); font-size: 14px; box-shadow: var(--shadow-pop); pointer-events: auto;
  animation: toast-in .2s ease-out;
}
.toast.err { background: var(--err); color: #fff; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .toast { animation: none; } }

/* ------------------------------------------------ 좁은 화면 */
@media (max-width: 960px) {
  .split { grid-template-columns: 1fr; gap: 12px; }
  .setting { grid-template-columns: 1fr; gap: 14px; }
}
@media (max-width: 860px) {
  body { grid-template-columns: 1fr; }
  .rail {
    position: fixed; z-index: 20; top: auto; bottom: 0; left: 0; right: 0; height: auto;
    flex-direction: row; gap: 0; padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
  }
  .rail .brand, .rail .rail-foot { display: none; }
  .nav { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; width: 100%; gap: 0; }
  .nav a { flex-direction: column; gap: 3px; padding: 7px 2px; font-size: 11.5px; text-align: center; }
  .topbar { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
  .topbar .brand-name { color: var(--ink); font-size: 17px; margin-right: auto; }
  .topbar .rail-status { color: var(--muted); }
  .topbar .rail-status[data-running="1"] { color: var(--ink); }
  .main { padding: 18px 16px 104px; }
  .page-head { flex-direction: column; align-items: stretch; gap: 16px; }
  .page-head .btn { align-self: flex-start; }
  h1 { font-size: 25px; }
  .pipeline { padding: 22px 18px 18px; }
  .step { padding-right: 8px; }
  .step::after { left: 26px; }
  .step-text small { white-space: normal; }
  .figures { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 22px; }
  .figure:nth-child(odd) { padding-left: 0; border-left: 0; }
  .cat { grid-template-columns: auto minmax(0, 1fr); align-items: start; }
  .cat-toggle { margin-top: 2px; }
  .cat-actions { grid-column: 2; flex-wrap: wrap; margin-left: -8px; }
  .seg { grid-template-columns: 1fr; }
  .seg-item + .seg-item { border-left: 0; border-top: 1px solid var(--line-strong); }
  .field-row { grid-template-columns: 1fr; }
  .toasts { right: 12px; left: 12px; bottom: 84px; justify-items: stretch; }
  .toast { max-width: none; }
}

/* ------------------------------------------------ 연결 입력 */
.conn-form { display: grid; gap: 16px; margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--line); }
.conn-reset { margin-top: 4px; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--muted); text-decoration: underline; cursor: pointer; font: inherit; font-size: 13px; }
.linkbtn:hover { color: var(--ink); }
.conn-form .field-row { align-items: start; }
.conn-form .field { align-content: start; }
.conn-reset { margin-top: -4px; }

/* ------------------------------------------------ AI 키 목록 */
.keys { list-style: none; margin: 0 0 16px; padding: 0; border-top: 1px solid var(--line); }
.key { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.key-main { min-width: 0; display: grid; gap: 4px; }
.key-title { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.key-meta { margin: 0; display: flex; flex-wrap: wrap; gap: 4px 14px; color: var(--muted); font-size: 13px; }
.key-meta span { overflow-wrap: anywhere; }
.key-actions { display: flex; align-items: center; flex-wrap: wrap; justify-content: flex-end; gap: 6px; flex-shrink: 0; }
.key-actions form { margin: 0; }
.key.is-env .key-title b { font-weight: 600; }
.keys-empty { margin: 0 0 16px; }
.conn-first { margin-top: 0; padding-top: 0; border-top: 0; }
select.input { appearance: auto; }
@media (max-width: 640px) {
  .key { flex-direction: column; }
  .key-actions { justify-content: flex-start; }
}

/* ------------------------------------------------ 로그인 / 가입 */
.auth-body { display: grid; grid-template-columns: minmax(0, 1fr); place-items: center; padding: 24px 16px; background: radial-gradient(800px 420px at 80% -10%, color-mix(in srgb, var(--primary) 16%, transparent), transparent 70%), var(--ground); }
.auth { width: min(420px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 38px 32px; box-shadow: 0 20px 60px rgba(40, 40, 120, .12); }
.auth-brand { font: 800 15px var(--font-sans); color: var(--primary); letter-spacing: -.01em; margin-bottom: 18px; }
.auth-title { font: 800 24px/1.3 var(--font-sans); letter-spacing: -.015em; margin-bottom: 8px; }
.auth-note { color: var(--muted); font-size: 13.5px; margin-bottom: 18px; }
.auth-form { display: grid; gap: 16px; margin-top: 18px; }
.auth-note + .auth-form { margin-top: 0; }
.auth-submit { width: 100%; justify-content: center; padding: 11px 16px; }
.auth-error { margin: 0; padding: 10px 12px; border-radius: var(--r-s); background: var(--err-soft); color: var(--err); font-size: 13.5px; }
.auth-alt { margin-top: 20px; color: var(--muted); font-size: 13.5px; }
.auth-alt a { color: var(--primary); font-weight: 600; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* ------------------------------------------------ 회원 관리 / 계정 */
.nav-badge { margin-left: auto; min-width: 20px; padding: 1px 6px; border-radius: 999px; background: var(--primary); color: var(--primary-ink); font-size: 11.5px; font-weight: 700; text-align: center; }
.rail-user { display: grid; gap: 2px; padding-bottom: 6px; margin-bottom: 4px; border-bottom: 1px solid var(--line); }
.rail-me { display: flex; align-items: center; gap: 8px; padding: 8px; border-radius: var(--r-s); color: var(--rail-ink); font-weight: 600; text-decoration: none; overflow: hidden; }
.rail-me span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rail-me:hover { background: var(--ground); }
.rail-me[aria-current="page"] { background: var(--rail-active); color: var(--primary); }
.rail-user form { margin: 0; }
.rail-user .theme-btn { width: 100%; }
.count { margin-left: 6px; padding: 1px 8px; border-radius: 999px; background: var(--muted-soft); color: var(--muted); font: 600 12px var(--font-sans); vertical-align: middle; }
.switch-row { display: flex; align-items: center; gap: 12px; }
.limit-form { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.limit-form > * { flex: none; }
.limit-form .hint { white-space: nowrap; }
.input-sm { width: 92px; padding: 5px 8px; }
.key.is-off .key-title b { color: var(--muted); }
.field-narrow-lg { max-width: 360px; }
.notice-key .temp-pw { display: block; margin: 6px 0 4px; }
.notice-key code { font: 600 16px var(--font-mono); padding: 4px 8px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-s); user-select: all; }

.plan-form { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; }
.plan-form > * { flex: none; }
.plan-form .hint { white-space: nowrap; }
.plan-form select.input-sm { width: auto; min-width: 92px; }
.plan-state { margin-top: 4px; }
.plan-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.plan-row > b { min-width: 64px; }
.plan-row .hint, .plan-row label { white-space: nowrap; font-size: 13px; color: var(--muted); }
.doc-text { width: 100%; font: 400 14px/1.7 var(--font-sans); resize: vertical; min-height: 220px; }
.inq-body { margin-top: 8px; white-space: normal; color: var(--ink); max-width: 60ch; }
.auth-brand a { color: inherit; text-decoration: none; }
.form-grid { display: grid; gap: 16px; max-width: 640px; }
.form-actions { display: flex; gap: 10px; align-items: center; }
.checks { display: grid; gap: 10px; margin-top: 4px; }
.check { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-m); cursor: pointer; background: var(--surface); }
.check:hover { border-color: var(--line-strong); }
.check input { margin-top: 5px; accent-color: var(--primary); width: 16px; height: 16px; flex: none; }
.check b { display: block; }
.check small { display: block; color: var(--muted); font-size: 13px; line-height: 1.5; }
.redirect-uri { display: block; padding: 8px 10px; user-select: all; word-break: break-all; }
.pubs { display: block; margin-top: 4px; }
.pubs .pill { text-decoration: none; margin-right: 2px; }

/* ------------------------------------------------ v2.8 카드형 마감 */
.table-wrap, .cats, .keys, .log-list, .rows { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); box-shadow: var(--shadow-card); }
.table-wrap { padding: 4px 22px; }
.cats, .rows, .log-list { padding: 4px 22px; }
.cats .cat:first-child, .rows .row:first-child, .log-row:first-child { border-top: 0; }
.cat:last-child { border-bottom: 0; }
.keys { padding: 0 20px; margin-bottom: 16px; }
.key:last-child { border-bottom: 0; }
.empty { padding: 28px 24px; border: 1px dashed var(--line-strong); border-radius: var(--r-l); background: var(--surface); }
.block { margin-top: 36px; }
.block-head { margin-bottom: 12px; }
.notice { border-radius: var(--r-m); border: 1px solid color-mix(in srgb, var(--warn) 22%, transparent); }
.pill { padding: 2px 10px; }
.chip { background: var(--ground); border-color: transparent; }
.check:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.seg { border-radius: 12px; }
.table tbody tr:hover td { background: color-mix(in srgb, var(--primary) 4%, transparent); }
.input-sm { border-radius: 8px; }
.toast { border-radius: 12px; }
dialog { border-radius: 20px; }
.savebar { background: linear-gradient(to top, var(--ground) 70%, transparent); }
.filters { padding: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); box-shadow: var(--shadow-card); }
.filters .input { border-color: transparent; background: var(--ground); }
@media (max-width: 860px) {
  .rail { border-right: 0; border-top: 1px solid var(--line); background: color-mix(in srgb, var(--rail) 92%, transparent); backdrop-filter: blur(12px); }
  .rail .rail-run { display: none; }
  .nav a { border-radius: 10px; }
  .setting { padding: 20px 18px; }
  .table-wrap, .cats, .rows, .log-list { padding: 2px 14px; }
  .figure:nth-child(odd) { padding-left: 20px; }
  .figures { gap: 10px; }
}
@media (min-width: 861px) { .page-head > [data-open-run] { display: none; } }
@media (max-width: 860px) {
  .nav { grid-auto-columns: minmax(58px, 1fr); overflow-x: auto; scrollbar-width: none; }
  .nav a { font-size: 11px; white-space: nowrap; position: relative; }
  .nav a .nav-badge { position: absolute; top: 2px; right: 8px; margin: 0; min-width: 16px; padding: 0 4px; font-size: 10px; }
}
.kw-acts { display: flex; gap: 6px; flex: none; }
.field-row { align-items: start; } .chips .check-inline { padding: 4px 10px 4px 6px; border: 1px solid var(--line-strong); border-radius: 99px; }
[hidden] { display: none !important; }
.time-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; max-width: 480px; } .time-grid .input-sm { width: 100%; }

.plan-edit h3 { margin: 4px 0 0; font-size: 15px; }
.plan-edit textarea { width: 100%; }
.plan-del { margin: 6px 0 2px; }

/* ------------------------------------------------ 회원 관리 */
.mg-signup { align-self: flex-start; padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.mg-signup .hint { display: block; font-size: 12.5px; }
.mg-stats { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; margin: 0 0 24px; }
.mg-stat { display: grid; gap: 2px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.mg-stat span { font-size: 13px; color: var(--muted); }
.mg-stat b { font-size: 26px; font-weight: 800; letter-spacing: -.02em; line-height: 1.2; }
.mg-stat b i { font-size: 14px; font-style: normal; font-weight: 500; margin-left: 2px; color: var(--muted); }
.mg-stat small { font-size: 12px; color: var(--muted); }
.mg-stat.is-warn { border-color: var(--warn); background: var(--warn-soft); }
.mg-stat.is-warn b { color: var(--warn); }
.mg-block { margin: 0 0 28px; }
.mg-block-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin-bottom: 12px; }
.mg-block-head h2 { margin: 0; font-size: 17px; }
.mg-block-head .hint { flex: 1; min-width: 200px; }
.mg-avatar { flex: none; display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--primary-soft); color: var(--primary); font-weight: 700; font-size: 15px; }
.mg-avatar-lg { width: 48px; height: 48px; font-size: 19px; }
.mg-who { display: flex; align-items: center; gap: 12px; min-width: 0; }
.mg-who > div { display: grid; gap: 1px; min-width: 0; }
.mg-who b { overflow-wrap: anywhere; }
.mg-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin-top: 2px; }
.mg-pending { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.mg-pending li { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--warn); border-radius: 14px; background: var(--warn-soft); }
.mg-pending .mg-who { flex: 1; }
.mg-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.mg-actions form { margin: 0; }
.mg-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin-bottom: 12px; }
.mg-search { position: relative; flex: 1 1 220px; min-width: 180px; display: block; }
.mg-search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.mg-search .input { padding-left: 36px; width: 100%; }
.mg-tools select.input-sm { width: auto; }
.mg-table { border: 1px solid var(--line); border-radius: 16px; background: var(--surface); overflow: hidden; }
.mg-row { display: grid; grid-template-columns: minmax(200px, 2.2fr) minmax(130px, 1.2fr) minmax(110px, 1fr) minmax(110px, 1fr) minmax(90px, .8fr) 64px; align-items: center; gap: 14px; padding: 12px 16px; border-top: 1px solid var(--line); }
.mg-row[hidden] { display: none; }
.mg-head { border-top: 0; padding-block: 9px; background: var(--ground); font-size: 12.5px; font-weight: 600; color: var(--muted); }
.mg-row.is-off .mg-who b { color: var(--muted); }
.mg-plan, .mg-use { display: grid; gap: 3px; font-size: 13.5px; }
.mg-plan > b { font-size: 14px; }
.mg-bad { color: var(--err); font-size: 13px; font-weight: 600; }
.mg-soon { color: var(--warn); font-size: 13px; font-weight: 600; }
.mg-bar { display: block; height: 5px; border-radius: 3px; background: var(--line); overflow: hidden; max-width: 120px; }
.mg-bar i { display: block; height: 100%; background: var(--primary); }
.mg-num { font-size: 13.5px; }
.mg-login { font-size: 13px; }
.mg-none { padding: 28px; text-align: center; color: var(--muted); border-top: 1px solid var(--line); }
.mg-dlg { width: min(620px, calc(100vw - 32px)); }
.mg-dlg .dlg-head { gap: 14px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.mg-facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 0; }
.mg-facts div { display: grid; gap: 1px; }
.mg-facts dt { font-size: 12px; color: var(--muted); }
.mg-facts dd { margin: 0; font-size: 13.5px; font-weight: 600; }
.mg-sec { display: grid; gap: 10px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.mg-sec:last-child { border-bottom: 0; padding-bottom: 0; }
.mg-sec h3 { margin: 0; font-size: 14.5px; }
.mg-sec .hint { margin: 0; }
.mg-plan-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; align-items: start; }
.mg-plan-form .field { display: grid; gap: 4px; }
.mg-plan-form .field[hidden] { display: none; }
.mg-plan-actions { grid-column: 1 / -1; display: flex; justify-content: flex-end; }
.mg-quick, .mg-btns { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.mg-quick form, .mg-btns form { margin: 0; }
.mg-danger h3 { color: var(--err); }
@media (max-width: 980px) {
  .mg-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .mg-head { display: none; }
  .mg-row { grid-template-columns: 1fr auto; gap: 8px 12px; }
  .mg-who { grid-column: 1; }
  .mg-go { grid-column: 2; grid-row: 1; }
  .mg-plan, .mg-use, .mg-num, .mg-login { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
  .mg-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) { .mg-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } .mg-pending li { flex-wrap: wrap; } }

.guide-presets { margin-top: 8px; }
.chip-btn { cursor: pointer; background: var(--ground); font: inherit; font-size: 13px; }
.chip-btn:hover { color: var(--ink); border-color: var(--primary); }

.ts-tabs { margin-bottom: 14px; }
.ts-steps { margin: 0; padding-left: 20px; display: grid; gap: 12px; }
.ts-steps li { line-height: 1.6; }
.ts-ext .inline-form { display: inline-block; margin: 0 6px 0 0; }
.ts-code { width: 100%; margin: 8px 0; font-family: ui-monospace, monospace; font-size: 12px; word-break: break-all; }
.ts-last { margin-top: 14px; }


/* ------------------------------------------------ 테마 화면 */
a.theme-btn { text-decoration: none; display: flex; align-items: center; gap: 8px; }
.th-sub { margin: 22px 0 10px; font-size: 13.5px; color: var(--muted); font-weight: 600; }
.th-grid { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); gap: 12px; margin: 0; padding: 0; }
.th-item { position: relative; }
.th-card { width: 100%; display: grid; gap: 8px; padding: 8px 8px 10px; text-align: left; cursor: pointer;
  background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--r-m); transition: border-color .15s, box-shadow .15s, transform .15s; }
.th-card:hover { border-color: var(--line-strong); transform: translateY(-1px); }
.th-item.is-on .th-card { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.th-sample { display: flex; height: 76px; border-radius: 8px; overflow: hidden; background: var(--c-g, #f5f6fa); border: 1px solid rgba(128, 128, 128, .22); }
.th-sample .th-rail { width: 28%; background: var(--c-r, #fff); border-right: 1px solid rgba(128, 128, 128, .2); }
.th-sample .th-body { flex: 1; display: grid; align-content: center; gap: 6px; padding: 8px; }
.th-sample .th-card-s { display: block; height: 22px; border-radius: 5px; background: var(--c-s, #fff); border: 1px solid rgba(128, 128, 128, .2); position: relative; }
.th-sample .th-card-s::after { content: ""; position: absolute; left: 6px; top: 7px; width: 55%; height: 5px; border-radius: 3px; background: var(--c-i, #14161f); opacity: .75; }
.th-sample .th-btn { display: block; width: 38%; height: 9px; border-radius: 5px; background: var(--c-p, #4f46e5); }
.th-sample-auto { background: linear-gradient(115deg, #f5f6fa 50%, #0e1018 50%); }
.th-sample-auto .th-rail { background: linear-gradient(115deg, #fff 50%, #121520 50%); }
.th-sample-auto .th-card-s { background: linear-gradient(115deg, #fff 50%, #161925 50%); }
.th-sample-auto .th-btn { background: linear-gradient(115deg, #4f46e5 50%, #8b87ff 50%); }
.th-name { font-weight: 600; font-size: 13.5px; padding: 0 2px; }
.th-state { justify-self: start; margin-left: 2px; }
.th-del { position: absolute; top: 14px; right: 14px; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 7px; border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--muted); cursor: pointer; opacity: 0; transition: opacity .15s; }
.th-item:hover .th-del, .th-del:focus-visible { opacity: 1; }
.th-del:hover { color: var(--err); border-color: var(--err); }
@media (hover: none) { .th-del { opacity: 1; } }
.th-mode { border: 0; margin: 0 0 14px; padding: 0; display: flex; gap: 18px; flex-wrap: wrap; align-items: center; }
.th-mode legend { padding: 0; margin-right: 8px; float: left; }
.th-colors { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 14px 18px; margin-bottom: 14px; }
.th-color-row { display: flex; gap: 8px; align-items: center; }
.th-color-row input[type=color] { width: 44px; height: 38px; padding: 2px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); cursor: pointer; }
.th-color-row .input { flex: 1; min-width: 0; font-family: var(--font-mono); }
.th-warn { color: var(--warn); background: var(--warn-soft); padding: 8px 12px; border-radius: 8px; }
@media (prefers-reduced-motion: reduce) { .th-card, .th-del { transition: none; } .th-card:hover { transform: none; } }


/* ------------------------------------------------ 시험 실행 결과 표시 */
.pill-test { background: transparent; color: var(--draft); border: 1px dashed var(--draft); }
.tag-test { display: inline-block; margin-right: 6px; padding: 0 7px; border: 1px dashed var(--draft); border-radius: 6px; color: var(--draft); font-size: 11.5px; font-weight: 700; line-height: 1.6; vertical-align: 1px; }
tr.is-test td { background: repeating-linear-gradient(135deg, transparent 0 10px, var(--muted-soft) 10px 20px); }
tr.is-test td:first-child { box-shadow: inset 3px 0 0 var(--draft); }
tr.is-test .cell-title, li.row.is-test .row-title { color: var(--muted); font-style: italic; }
li.row.is-test { background: repeating-linear-gradient(135deg, transparent 0 10px, var(--muted-soft) 10px 20px); box-shadow: inset 3px 0 0 var(--draft); }

.pv-frame { width: 100%; min-height: 480px; border: 1px solid var(--line-strong); border-radius: var(--r-m); background: #fff; display: block; margin-bottom: 12px; }
.pv-src { width: 100%; margin-top: 12px; font: 12.5px/1.6 var(--font-mono); }

.topbar-logout { margin: 0; display: flex; }
.topbar-logout .icon-btn { cursor: pointer; }


/* ------------------------------------------------ 모바일: 포스팅 표를 카드 목록으로 */
p.count { width: fit-content; }
@media (max-width: 720px) {
  .table-stack thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .table-stack, .table-stack tbody { display: block; width: 100%; }
  .table-stack tr { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 14px 2px; border-bottom: 1px solid var(--line); }
  .table-stack tr:last-child { border-bottom: 0; }
  .table-stack tr::before { content: ""; order: 3; flex: 0 0 100%; height: 0; }
  .table-stack td { display: block; padding: 0; border: 0; min-width: 0; }
  .table-stack tbody tr:hover td { background: transparent; }
  .table-stack .cell-title { order: 1; flex: 1 1 0; max-width: none; font-size: 15px; line-height: 1.5; overflow-wrap: anywhere; word-break: keep-all; }
  .table-stack .cell-actions { order: 2; flex: none; align-self: flex-start; }
  .table-stack .c-kw, .table-stack .c-cat, .table-stack .c-st, .table-stack .c-time { order: 4; font-size: 12.5px; }
  .table-stack .c-kw { flex: 0 1 auto; max-width: 100%; overflow-wrap: anywhere; }
  .table-stack .c-kw::before, .table-stack .c-cat::before { content: attr(data-label) " "; color: var(--muted); opacity: .75; }
  .table-stack .c-cat { color: var(--ink); }
  .table-stack .c-time { margin-left: auto; }
  .table-stack .pubs { display: block; margin-top: 6px; }
  /* 시험 글 */
  tr.is-test td, tr.is-test td:first-child { background: none; box-shadow: none; }
  .table-stack tr.is-test { background: repeating-linear-gradient(135deg, transparent 0 10px, var(--muted-soft) 10px 20px); box-shadow: inset 3px 0 0 var(--draft); padding-left: 12px; margin: 0 -2px; border-radius: 6px; }
  .table-wrap { padding: 2px 14px; }
}

/* AI 사용량 */
.us-bar { display: flex; flex-wrap: wrap; gap: 10px 16px; margin: 0 0 16px; }
.seg-inline a.seg-btn { text-decoration: none; }
.us-stats { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.us-card { margin: 0 0 20px; padding: 18px 20px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); min-width: 0; }
.us-card h2 { margin: 0 0 12px; font-size: 15px; }
.us-grid { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 20px; }
.us-grid .us-card { margin-bottom: 20px; }
.us-chart { display: flex; align-items: flex-end; gap: 3px; height: 160px; padding-bottom: 18px; overflow-x: auto; }
.us-col { position: relative; flex: 1 0 14px; max-width: 44px; height: 100%; display: flex; align-items: flex-end; justify-content: center; }
.us-col i { display: block; width: 100%; border-radius: 4px 4px 0 0; background: var(--primary); min-height: 0; opacity: .85; }
.us-col:hover i { opacity: 1; }
.us-col span { position: absolute; bottom: -18px; font-size: 10.5px; color: var(--muted); }
.table th.nr, .table td.nr { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.us-foot { margin-top: 8px; }
@media (max-width: 860px) { .us-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); } .us-grid { grid-template-columns: minmax(0, 1fr); gap: 0; } }
@media (max-width: 560px) { .us-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } .us-card { padding: 14px; } }
.us-bar, .us-card, .us-grid { max-width: 100%; }
.us-bar .seg-inline { max-width: 100%; overflow-x: auto; }
.us-card .table td, .us-card .table th { padding-right: 10px; }
@media (max-width: 560px) { .us-chart { gap: 2px; } .us-col { flex-basis: 10px; } .us-col span { font-size: 9px; } .us-col:nth-child(even) span { visibility: hidden; } }
.main { min-width: 0; } .us-chart { max-width: 100%; } .us-card .table-wrap { max-width: 100%; }

/* 약관 동의 */
.agree { margin: 0 0 14px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-m); display: grid; gap: 9px; min-width: 0; }
.agree legend { padding: 0 4px; }
.agree .check-inline { align-items: flex-start; font-size: 13.5px; }
.agree .check-inline input { margin-top: 3px; width: 16px; height: 16px; accent-color: var(--primary); flex: none; }
.agree-all { padding-bottom: 9px; border-bottom: 1px solid var(--line); }
.agree a, .auth-legal a { color: var(--primary); text-decoration: underline; text-underline-offset: 2px; }
.auth-legal { margin-top: 14px; color: var(--muted); font-size: 12.5px; line-height: 1.6; }
