/* 답답봇 대시보드 */
:root {
  --ground: #F2F4F3;
  --surface: #FFFFFF;
  --ink: #1A1E1D;
  --muted: #626B67;
  --line: #DCE1DE;
  --soft: #EBEEEC;
  --accent: #1D6A61;
  --accent-hover: #175850;
  --accent-ink: #FFFFFF;
  --accent-soft: #DCEEE9;
  --good: #2A774A;
  --good-soft: #E0F1E6;
  --warn: #9C5F14;
  --warn-soft: #FAEDD8;
  --bad: #B3392A;
  --bad-soft: #FAE3DE;
  --radius: 10px;
  --font: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Pretendard", "Noto Sans KR", "Malgun Gothic", sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --ground: #111514;
    --surface: #1A1F1D;
    --ink: #E5EAE7;
    --muted: #98A29D;
    --line: #2C3431;
    --soft: #232A27;
    --accent: #5CB8A9;
    --accent-hover: #74C8BA;
    --accent-ink: #0D1A18;
    --accent-soft: #1C3531;
    --good: #6CC68F;
    --good-soft: #17301F;
    --warn: #E3A857;
    --warn-soft: #33281A;
    --bad: #EE8573;
    --bad-soft: #3A1F1A;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--ground); color: var(--ink); font-family: var(--font); font-size: 15px; line-height: 1.6; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2 { line-height: 1.3; margin: 0; text-wrap: balance; }
h1 { font-size: 24px; font-weight: 700; letter-spacing: -0.01em; }
h2 { font-size: 17px; font-weight: 700; }
p { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.mono { font-family: var(--mono); font-size: 0.92em; }
.err, .bad { color: var(--bad); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
kbd { font-family: var(--mono); font-size: 12px; padding: 1px 6px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; background: var(--soft); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* 상단 */
.top { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.top-in { max-width: 1080px; margin: 0 auto; padding: 0 20px; display: flex; align-items: center; gap: 24px; min-height: 58px; flex-wrap: wrap; }
.logo { display: flex; align-items: center; gap: 8px; font-weight: 800; color: var(--ink); font-size: 16px; }
.logo:hover { text-decoration: none; }
.logo-mark, .auth-mark { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: var(--accent); color: var(--accent-ink); font-size: 14px; font-weight: 800; }
.nav { display: flex; gap: 2px; flex: 1; flex-wrap: wrap; }
.nav a { color: var(--muted); padding: 7px 12px; border-radius: 8px; font-weight: 600; font-size: 14px; display: flex; align-items: center; gap: 6px; }
.nav a:hover { background: var(--soft); color: var(--ink); text-decoration: none; }
.nav a.on { color: var(--ink); background: var(--soft); }
.me { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); }
.linkbtn { background: none; border: 0; padding: 0; color: var(--accent); font: inherit; cursor: pointer; }
.badge { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--bad); color: #fff; font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
.badge.soft { background: var(--soft); color: var(--ink); }
.badge.soft.bad { background: var(--bad-soft); color: var(--bad); }

/* 페이지 */
.page { max-width: 1080px; margin: 0 auto; padding: 28px 20px 80px; display: flex; flex-direction: column; gap: 20px; }
.page-head { display: flex; flex-direction: column; gap: 6px; }
.section { display: flex; flex-direction: column; gap: 14px; }
.section-title { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; display: flex; flex-direction: column; gap: 14px; }
.panel-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.panel-head > div { display: flex; flex-direction: column; gap: 4px; }
.empty { color: var(--muted); padding: 18px 0; }

/* 알림 */
.flash { padding: 11px 14px; border-radius: 8px; font-size: 14px; background: var(--soft); }
.flash.ok { background: var(--good-soft); color: var(--good); }
.flash.error { background: var(--bad-soft); color: var(--bad); }
.flash.warn { background: var(--warn-soft); color: var(--warn); }

/* 버튼 */
.btns { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: inherit; font-size: 14px; font-weight: 600; padding: 8px 14px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--soft); text-decoration: none; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: var(--accent-hover); }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, var(--line)); }
.btn.danger:hover { background: var(--bad-soft); }
.btn.wide { width: 100%; padding: 11px; margin-top: 6px; }

/* 칩 */
.chip { display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 999px; font-size: 12.5px; font-weight: 600; background: var(--soft); color: var(--muted); white-space: nowrap; }
a.chip:hover { text-decoration: none; filter: brightness(0.97); }
.chip.good, .chip.st-posted { background: var(--good-soft); color: var(--good); }
.chip.warn, .chip.st-pending, .chip.cat-needs_human { background: var(--warn-soft); color: var(--warn); }
.chip.st-toxic, .chip.cat-toxic, .chip.cat-spam { background: var(--bad-soft); color: var(--bad); }
.chip.cat-positive { background: var(--accent-soft); color: var(--accent); }

/* 설정 체크리스트 */
.setup-panel { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.progress-text { color: var(--muted); font-size: 14px; }
.checklist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.checklist li { display: flex; gap: 12px; align-items: flex-start; padding: 9px 4px; border-top: 1px solid var(--soft); }
.checklist li:first-child { border-top: 0; }
.checklist .tick { flex: none; width: 26px; height: 26px; border-radius: 50%; border: 1.5px solid var(--line); display: grid; place-items: center; font-size: 13px; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.checklist li.done .tick { background: var(--good); border-color: var(--good); color: var(--surface); }
.checklist li.done span { color: var(--muted); }
.checklist a { font-weight: 600; }
.checklist .hint { font-size: 13px; color: var(--bad); margin-top: 2px; }

/* 상태 막대 */
.statusbar { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px; }
.state { display: flex; gap: 12px; align-items: center; }
.state > div { display: flex; flex-direction: column; }
.state .muted { font-size: 13px; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--muted); flex: none; }
.state.on .dot { background: var(--good); box-shadow: 0 0 0 4px var(--good-soft); }
.state.paused .dot { background: var(--warn); box-shadow: 0 0 0 4px var(--warn-soft); }

/* 표 */
.table-wrap { overflow-x: auto; margin: 0 -4px; }
table.grid { width: 100%; border-collapse: collapse; font-size: 14px; }
.grid th { text-align: left; font-size: 12px; font-weight: 700; color: var(--muted); letter-spacing: .02em; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.grid td { padding: 12px 10px; border-bottom: 1px solid var(--soft); vertical-align: middle; }
.grid tr:last-child td { border-bottom: 0; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg button { font: inherit; font-size: 13px; font-weight: 600; border: 0; background: var(--surface); color: var(--muted); padding: 6px 10px; cursor: pointer; white-space: nowrap; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button.on { background: var(--accent); color: var(--accent-ink); }

.quota { display: flex; flex-direction: column; gap: 6px; padding-top: 6px; border-top: 1px solid var(--soft); }
.quota-label { display: flex; justify-content: space-between; font-size: 13px; font-weight: 600; }
.meter { height: 8px; border-radius: 4px; background: var(--soft); overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--accent); border-radius: 4px; }
.meter.hot i { background: var(--bad); }

/* 댓글 목록 */
.rows { list-style: none; margin: 0; padding: 0; }
.rows li + li { border-top: 1px solid var(--soft); }
.rows a { display: grid; grid-template-columns: 88px 90px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 4px; color: var(--ink); }
.rows a:hover { background: var(--soft); text-decoration: none; }
.rows .when { color: var(--muted); font-size: 12.5px; }
.rows .teacher { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rows .text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.rows .text strong { font-weight: 600; margin-right: 4px; }
.rows .chips { display: flex; gap: 4px; }
@media (max-width: 720px) {
  .rows a { grid-template-columns: 1fr auto; row-gap: 2px; }
  .rows .when { order: 1; }
  .rows .chips { order: 2; }
  .rows .teacher { order: 3; }
  .rows .text { order: 4; grid-column: 1 / -1; white-space: normal; }
}
.filters { display: flex; gap: 8px; flex-wrap: wrap; }
.filters input { flex: 1; min-width: 180px; }
.pager { display: flex; justify-content: space-between; }

/* 댓글 카드 */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; display: flex; flex-direction: column; gap: 10px; scroll-margin-top: 80px; }
.card.st-toxic { border-left: 4px solid var(--bad); }
.card.st-pending { border-left: 4px solid var(--warn); }
.card.st-scheduled { border-left: 4px solid var(--accent); }
.chip.st-scheduled { background: var(--accent-soft); color: var(--accent); }

/* 오른쪽 아래 Claude 사용 금액 */
.usage { position: fixed; right: 16px; bottom: 16px; z-index: 20; max-width: calc(100% - 32px); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 12px; font-size: 13px; line-height: 1.45; box-shadow: 0 4px 16px rgba(0, 0, 0, .12); }
.usage strong { font-variant-numeric: tabular-nums; }
.page { padding-bottom: 96px; }
.bulk { display: flex; flex-direction: column; gap: 10px; }
.bulk form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.bulk form input[type="text"] { flex: 1; min-width: 240px; }


/* 전체 댓글 분류 탭 */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tabs a { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); font-size: 14px; font-weight: 600; }
.tabs a:hover { color: var(--ink); text-decoration: none; }
.tabs a.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.tabs .count { font-variant-numeric: tabular-nums; opacity: .8; }
.card-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.card-head .clip { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.card-head .ext { margin-left: auto; }
.author { font-size: 14px; }
blockquote { margin: 0; padding: 10px 14px; border-radius: 8px; white-space: pre-wrap; overflow-wrap: anywhere; }
.comment { background: var(--soft); font-size: 15px; }
.reply-text { background: var(--accent-soft); }
.reason { font-size: 13.5px; color: var(--muted); display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.reason .label { font-size: 11.5px; font-weight: 700; letter-spacing: .04em; color: var(--ink); background: var(--soft); padding: 1px 7px; border-radius: 4px; }
.subactions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.subactions .ask { display: flex; gap: 8px; flex: 1; min-width: 260px; }
.subactions .ask input { flex: 1; }
.result { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* 폼 */
.stack { display: flex; flex-direction: column; gap: 6px; }
.stack .btns { margin-top: 8px; }
.stack.narrow { max-width: 380px; }
label { font-size: 13.5px; font-weight: 600; margin-top: 6px; }
.stack > label:first-of-type { margin-top: 0; }
input, select, textarea { font: inherit; font-size: 15px; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 9px 11px; width: 100%; }
textarea { resize: vertical; line-height: 1.55; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input[type="checkbox"] { width: 17px; height: 17px; accent-color: var(--accent); }
input[type="file"] { padding: 8px; }
.help { font-size: 12.5px; color: var(--muted); }
.checkline { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
details { border-top: 1px solid var(--soft); padding-top: 10px; }
summary { cursor: pointer; font-weight: 600; font-size: 14px; color: var(--accent); }
details[open] summary { margin-bottom: 10px; }
.danger-zone { margin-top: 14px; }
.persona { white-space: pre-wrap; font-size: 14px; color: var(--muted); }
.try-result { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }

/* 인증 단계 */
.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.steps > li { flex-direction: row; gap: 16px; }
.steps > li > div { display: flex; flex-direction: column; gap: 10px; flex: 1; min-width: 0; }
.step-no { flex: none; width: 30px; height: 30px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-weight: 700; }
.do { margin: 0; padding-left: 1.3em; display: flex; flex-direction: column; gap: 4px; }

/* 로그인 */
.auth { max-width: 400px; width: 100%; margin: 48px auto 0; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 30px 28px; display: flex; flex-direction: column; gap: 12px; }
.auth-mark { width: 40px; height: 40px; font-size: 18px; border-radius: 11px; }

@media (max-width: 640px) {
  .page { padding: 20px 16px 60px; }
  .top-in { gap: 10px; padding: 8px 16px; }
  .nav { order: 3; width: 100%; overflow-x: auto; flex-wrap: nowrap; }
  .panel, .card { padding: 16px; }
  .steps > li { flex-direction: column; }
}
