:root {
  --bg: #f7f7fb;
  --surface: #ffffff;
  --surface-soft: #f1f2f7;
  --text: #171820;
  --muted: #6e7180;
  --line: #e4e5ec;
  --primary: #282038;
  --primary-soft: #eee9f7;
  --accent: #755b9f;
  --success: #287554;
  --success-bg: #eaf7f0;
  --warning: #9a631a;
  --warning-bg: #fff4df;
  --danger: #b43a47;
  --danger-bg: #fff0f1;
  --radius: 18px;
  --shadow: 0 12px 35px rgba(30, 23, 45, .07);
}
* { box-sizing: border-box; }
html { background: var(--bg); }
body { margin: 0; color: var(--text); background: var(--bg); font-family: -apple-system, BlinkMacSystemFont, "Pretendard", "Apple SD Gothic Neo", "Noto Sans KR", sans-serif; line-height: 1.5; }
a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
.topbar { position: sticky; top: 0; z-index: 20; height: 68px; display: flex; align-items: center; justify-content: space-between; padding: 0 24px; background: rgba(255,255,255,.92); border-bottom: 1px solid var(--line); backdrop-filter: blur(14px); }
.brand { display: flex; align-items: center; gap: 10px; }
.brand:hover strong { text-decoration: underline; text-underline-offset: 3px; }
.brand-external { color: var(--muted); font-size: 13px; font-weight: 900; }
.brand-mark, .login-logo { display: grid; place-items: center; background: var(--primary); color: white; font-family: Georgia, serif; font-style: italic; }
.brand-mark { width: 38px; height: 38px; border-radius: 13px; }
.brand span:last-child { display: flex; flex-direction: column; line-height: 1.15; }
.brand small { color: var(--muted); font-size: 11px; margin-top: 4px; }
.topbar-actions { display: flex; align-items: center; gap: 14px; }
.desktop-nav { max-width: 1120px; margin: 14px auto 0; padding: 0 20px; display: flex; gap: 4px; }
.desktop-nav a { padding: 10px 16px; border-radius: 12px; color: var(--muted); font-weight: 700; }
.desktop-nav a.active, .desktop-nav a:hover { background: var(--surface); color: var(--text); box-shadow: 0 4px 18px rgba(30,23,45,.05); }
.page { max-width: 1120px; margin: 0 auto; padding: 28px 20px 90px; }
.page-heading, .section-heading, .reply-card-top, .setting-title { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.page-heading { margin-bottom: 22px; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: clamp(25px, 4vw, 36px); letter-spacing: -.04em; }
h2 { margin-bottom: 0; font-size: 20px; letter-spacing: -.025em; }
h3 { font-size: 16px; }
.eyebrow { margin: 0 0 5px; color: var(--accent); font-size: 11px; font-weight: 900; letter-spacing: .13em; }
.muted, .microcopy { color: var(--muted); }
.microcopy { font-size: 12px; }
.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.metric-card { display: flex; flex-direction: column; gap: 8px; padding: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.metric-card span { color: var(--muted); font-size: 13px; font-weight: 700; }
.metric-card strong { font-size: 32px; line-height: 1; }
.metric-card.warning strong { color: var(--warning); }
.panel, .reply-card, .notice, .empty-state { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.panel { padding: 22px; }
.notice { padding: 16px 18px; margin-bottom: 22px; }
.notice p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.safe-notice { border-color: #ccebdc; background: var(--success-bg); }
.warning-notice { border-color: #f0d7aa; background: var(--warning-bg); }
.section-heading { margin: 28px 2px 13px; }
.section-heading a { color: var(--accent); font-weight: 700; font-size: 13px; }
.reply-list, .queue-list { display: grid; gap: 12px; }
.reply-card { display: block; padding: 18px; transition: transform .15s ease, border-color .15s ease; }
.reply-card:hover { transform: translateY(-1px); border-color: #cfc9da; }
.held-card { border-left: 4px solid #d89b3f; }
.reply-card-top strong { font-size: 14px; }
time { color: var(--muted); font-size: 12px; }
.reply-card > p, .original-comment > p { margin: 14px 0; font-size: 16px; white-space: pre-wrap; overflow-wrap: anywhere; }
.chip-row { display: flex; flex-wrap: wrap; gap: 7px; }
.chip, .badge, .count-pill, .regular-label, .model-label { display: inline-flex; align-items: center; border-radius: 999px; font-size: 11px; font-weight: 800; }
.chip { padding: 5px 9px; background: var(--surface-soft); color: var(--muted); }
.chip.category { color: #5e477d; background: #f0ebf8; }
.risk-safe, .status-published, .status-simulated { color: var(--success); background: var(--success-bg); }
.risk-review, .status-held, .status-retry { color: var(--warning); background: var(--warning-bg); }
.risk-block, .status-failed { color: var(--danger); background: var(--danger-bg); }
.status-drafted, .status-new, .status-queued, .status-pending, .status-processing { color: #4e5792; background: #edf0ff; }
.badge { padding: 6px 10px; }
.badge.safe { color: var(--success); background: var(--success-bg); }
.count-pill { padding: 7px 11px; color: var(--muted); background: var(--surface-soft); }
.regular-label { margin-left: 7px; padding: 3px 7px; background: #fff0d8; color: #8a5d1b; }
.model-label { padding: 5px 9px; color: var(--muted); background: var(--surface-soft); }
.draft-preview { margin: 12px 0; padding: 12px 14px; border-radius: 13px; background: #f7f3fb; color: #514660; font-size: 13px; }
.draft-preview span { display: block; margin-bottom: 4px; font-size: 10px; font-weight: 900; color: var(--accent); }
.inline-error { margin: 10px 0; padding: 10px 12px; border-radius: 10px; color: var(--danger); background: var(--danger-bg); font-size: 12px; overflow-wrap: anywhere; }
.filter-scroll { display: flex; gap: 8px; overflow-x: auto; margin: -5px 0 18px; padding: 5px 1px 8px; scrollbar-width: none; }
.filter-scroll::-webkit-scrollbar { display: none; }
.filter-chip { flex: 0 0 auto; padding: 9px 13px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: 13px; font-weight: 800; }
.filter-chip.active { color: white; background: var(--primary); border-color: var(--primary); }
.primary, .secondary, .text-button { appearance: none; border: 0; cursor: pointer; font-weight: 800; }
.primary, .secondary { display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: 11px 17px; border-radius: 13px; }
.primary { color: white; background: var(--primary); }
.primary:hover { background: #3a2d4e; }
.secondary { color: var(--text); background: var(--surface-soft); border: 1px solid var(--line); }
.text-button { padding: 5px; color: var(--accent); background: transparent; }
.text-button.danger { color: var(--danger); }
.full { width: 100%; }
.compact { min-height: 40px; padding: 8px 14px; font-size: 13px; }
.disabled { opacity: .45; pointer-events: none; }
.inline-form, .inline-action { display: inline; margin: 0; }
.stack-form { display: grid; gap: 14px; }
.stack-form label { display: grid; gap: 7px; font-size: 13px; font-weight: 800; }
input, textarea, select { width: 100%; border: 1px solid #d8d9e2; border-radius: 13px; background: white; color: var(--text); outline: 0; }
input, select { min-height: 48px; padding: 10px 13px; }
textarea { resize: none; padding: 15px; line-height: 1.65; }
input:focus, textarea:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(117,91,159,.12); }
.text-link { display: inline-block; margin-top: 12px; color: var(--accent); font-size: 13px; font-weight: 800; }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1.8fr) minmax(260px, .8fr); gap: 18px; }
.main-column, .side-column { display: grid; align-content: start; gap: 16px; }
.back-link { display: inline-block; margin-bottom: 14px; color: var(--muted); font-size: 13px; font-weight: 800; }
.editor-panel .section-heading { margin: 0 0 14px; }
.textarea-meta { display: flex; justify-content: space-between; margin-top: -8px; color: var(--muted); font-size: 11px; }
.check-row { grid-template-columns: 22px 1fr !important; align-items: start; padding: 13px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface-soft); cursor: pointer; }
.check-row input { width: 18px; min-height: 18px; margin-top: 3px; }
.check-row span { display: grid; gap: 2px; }
.check-row small { color: var(--muted); font-weight: 500; }
.button-grid, .button-row { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.button-row { display: flex; flex-wrap: wrap; }
.compliance-box { padding: 13px 14px; border-radius: 13px; font-size: 12px; }
.compliance-box ul { margin: 6px 0 0; padding-left: 18px; }
.compliance-box.pass { color: var(--success); background: var(--success-bg); }
.compliance-box.review { color: var(--warning); background: var(--warning-bg); }
.compliance-box.block { color: var(--danger); background: var(--danger-bg); }
.danger-actions { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 4px 6px; }
.info-list { display: grid; gap: 0; margin: 14px 0 0; }
.info-list div { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.info-list div:last-child { border-bottom: 0; }
dt { color: var(--muted); font-size: 12px; } dd { margin: 0; font-size: 13px; font-weight: 800; text-align: right; overflow-wrap: anywhere; }
.mini-history { display: grid; gap: 13px; margin-top: 12px; }
.mini-history > div { padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.mini-history p { margin: 4px 0; font-size: 13px; }
.mini-history small { display: block; color: var(--accent); }
.queue-card blockquote { margin: 13px 0; padding-left: 12px; border-left: 3px solid var(--line); color: var(--muted); }
.queued-reply { padding: 13px; border-radius: 12px; background: #f7f3fb; }
.inline-info { display: flex; flex-wrap: wrap; gap: 16px; }
.inline-info div { display: flex; gap: 6px; }
.revision-list, .audit-list { display: grid; gap: 12px; margin-top: 16px; }
.revision-item { padding: 15px 0; border-top: 1px solid var(--line); }
.diff-block { margin-top: 9px; padding: 11px; border-radius: 11px; background: var(--danger-bg); }
.diff-block.after { background: var(--success-bg); }
.diff-block span { font-size: 10px; font-weight: 900; color: var(--muted); }
.diff-block p { margin: 3px 0 0; white-space: pre-wrap; }
.audit-list > div { display: grid; grid-template-columns: 90px 1fr auto; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 12px; }
.audit-list span { color: var(--muted); }
.settings-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.setting-title p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.status-dot { width: 12px; height: 12px; border-radius: 999px; background: #a8abb6; box-shadow: 0 0 0 5px #f0f1f4; }
.status-dot.ready { background: #32a16f; box-shadow: 0 0 0 5px #e4f5ec; }
.status-dot.safe { background: #d59c3f; box-shadow: 0 0 0 5px #fff3db; }
.plain-list { padding-left: 18px; margin-bottom: 0; color: var(--muted); }
.top-gap { margin-top: 14px; }
.empty-state { padding: 40px 22px; text-align: center; }
.empty-state p { margin: 6px 0 0; color: var(--muted); }
.login-page { min-height: 100vh; display: grid; place-items: center; padding-bottom: 28px; }
.login-card { width: min(420px, 100%); padding: 30px; background: var(--surface); border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--shadow); }
.login-logo { width: 54px; height: 54px; margin-bottom: 20px; border-radius: 18px; font-size: 26px; }
.login-card h1 { margin-bottom: 6px; }
.flash { position: relative; z-index: 4; margin-bottom: 14px; padding: 13px 15px; border-radius: 13px; background: #edf0ff; color: #424c83; font-size: 13px; font-weight: 700; }
.flash.success { background: var(--success-bg); color: var(--success); }
.flash.warning { background: var(--warning-bg); color: var(--warning); }
.flash.error { background: var(--danger-bg); color: var(--danger); }
.mobile-nav { display: none; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
code { padding: 2px 5px; border-radius: 5px; background: var(--surface-soft); font-size: .9em; }

@media (max-width: 760px) {
  .topbar { height: 60px; padding: 0 14px; }
  .brand small, .brand-external { display: none; }
  .topbar-actions .badge { display: none; }
  .desktop-nav { display: none; }
  .page { padding: 22px 14px 92px; }
  .metric-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .metric-card { padding: 16px; }
  .metric-card strong { font-size: 27px; }
  .detail-grid, .settings-grid { grid-template-columns: 1fr; }
  .side-column { order: 2; }
  .panel { padding: 17px; }
  .page-heading { align-items: flex-end; }
  .page-heading .primary { display: none; }
  .button-grid { position: sticky; bottom: 72px; z-index: 8; padding: 8px; margin: 0 -8px -8px; border-radius: 16px; background: rgba(255,255,255,.93); box-shadow: 0 -8px 22px rgba(30,23,45,.06); backdrop-filter: blur(10px); }
  .mobile-nav { position: fixed; bottom: 0; left: 0; right: 0; z-index: 30; display: grid; grid-template-columns: repeat(5, 1fr); padding: 7px 5px calc(7px + env(safe-area-inset-bottom)); background: rgba(255,255,255,.96); border-top: 1px solid var(--line); backdrop-filter: blur(14px); }
  .mobile-nav a { display: grid; justify-items: center; gap: 1px; color: var(--muted); font-size: 10px; font-weight: 800; }
  .mobile-nav a span { font-size: 19px; line-height: 1.2; }
  .mobile-nav a.active { color: var(--primary); }
  .audit-list > div { grid-template-columns: 72px 1fr; }
  .audit-list span { display: none; }
  .login-card { padding: 24px; }
}
