/* 답답봇 대시보드 — RRL(더블알엘) 매장 느낌: 짙은 월넛 목재 · 황동 레터링 · 전구색 */
:root {
  --ground: #EFE7D9;          /* 오래된 종이·모래 */
  --surface: #FBF6EC;         /* 크림색 종이 */
  --ink: #241B12;             /* 짙은 갈색 먹 */
  --muted: #6E5B48;
  --line: #D9C9B0;
  --soft: #E7DAC5;
  --accent: #7A4A21;          /* 가죽 갈색 */
  --accent-hover: #603817;
  --accent-ink: #FBF6EC;
  --accent-soft: #EADCC5;
  --brass: #A8812B;           /* 황동 간판 글자 */
  --wood: #3A2A1B;            /* 월넛 목재 (상단 간판) */
  --wood-2: #2A1D12;
  --good: #4A6B34;
  --good-soft: #E3EBD6;
  --warn: #9A6212;
  --warn-soft: #F6E7CC;
  --bad: #A33526;
  --bad-soft: #F5DFD8;
  --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: #17100A;
    --surface: #221811;
    --ink: #EFE3D2;
    --muted: #A8927A;
    --line: #3A2A1B;
    --soft: #2C2016;
    --accent: #C98A4B;
    --accent-hover: #DDA061;
    --accent-ink: #1A1109;
    --accent-soft: #33241733;
    --brass: #D9AC4E;
    --wood: #221811;
    --wood-2: #17100A;
    --good: #8FB36A;
    --good-soft: #232C19;
    --warn: #DDA860;
    --warn-soft: #302413;
    --bad: #E08B78;
    --bad-soft: #35201B;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; color: var(--ink); font-family: var(--font); font-size: 15px; line-height: 1.6;
  /* 위쪽 전구 불빛 + 아주 옅은 나뭇결. 글자 뒤가 시끄러우면 안 되므로 대비는 낮게 둔다. */
  background:
    radial-gradient(1200px 380px at 50% -140px, rgba(217, 172, 78, .22), transparent 70%),
    repeating-linear-gradient(90deg,
      rgba(122, 74, 33, .030) 0 2px,
      rgba(122, 74, 33, .012) 2px 5px,
      rgba(122, 74, 33, .000) 5px 11px),
    var(--ground);
  background-attachment: fixed;
}
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: linear-gradient(180deg, var(--wood) 0%, var(--wood-2) 100%);
  border-bottom: 3px solid var(--brass);
  box-shadow: 0 2px 10px rgba(0, 0, 0, .28);
  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: #F0D9A6; font-size: 16px;
  letter-spacing: .04em; text-shadow: 0 1px 0 rgba(0, 0, 0, .5); }
.logo:hover { text-decoration: none; }
.logo-mark, .auth-mark { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px;
  background: linear-gradient(180deg, #D9AC4E, #A8812B); color: #2A1D12; font-size: 14px; font-weight: 800;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45); }
.nav { display: flex; gap: 2px; flex: 1; flex-wrap: wrap; }
.nav a { color: #C9B292; padding: 7px 12px; border-radius: 8px; font-weight: 600; font-size: 14px; display: flex; align-items: center; gap: 6px; }
.nav a:hover { background: rgba(255, 255, 255, .08); color: #F6E6C6; text-decoration: none; }
.nav a.on { color: #2A1D12; background: linear-gradient(180deg, #E0B662, #B78F35); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .4); }
.me { display: flex; align-items: center; gap: 10px; font-size: 13px; color: #C9B292; }
.linkbtn { background: none; border: 0; padding: 0; color: #E8C67E; 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;
  box-shadow: 0 1px 2px rgba(58, 42, 27, .10), 0 6px 18px rgba(58, 42, 27, .07); }
.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;
  box-shadow: 0 1px 2px rgba(58, 42, 27, .10), 0 4px 12px rgba(58, 42, 27, .06); }
.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; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chips .chip { display: inline-flex; align-items: center; gap: 6px; margin-top: 0; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); font-size: 14px; font-weight: 600; cursor: pointer; }
.chips .chip:hover { color: var(--ink); }
.chips .chip:has(input:checked) { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.chips .chip input { width: 15px; height: 15px; }
details.slot > summary { display: flex; align-items: center; gap: 8px; color: var(--ink); padding: 4px 0; list-style: none; }
details.slot > summary::-webkit-details-marker { display: none; }
details.slot > summary::before { content: "▸"; color: var(--accent); font-size: 15px; width: 14px; }
details.slot[open] > summary::before { content: "▾"; }
details.slot > summary:hover { color: var(--accent); }
details.slot[open] > summary { margin-bottom: 4px; }
.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; }
}

/* ── 답답이 캐릭터 · 매장 간판 ─────────────────────────────── */
/* 픽셀 그림은 늘어나면 뭉개진다. 크기는 SVG 에 박아 두고 여기서는 안 건드린다. */
.logo-hero { display: block; filter: drop-shadow(0 1px 0 rgba(0, 0, 0, .45)); }

/* 홈 화면 맨 위 — RRL 매장 간판처럼 짙은 나무판에 황동 글자 */
.marquee {
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  padding: 16px 22px; border-radius: var(--radius);
  background: linear-gradient(180deg, var(--wood) 0%, var(--wood-2) 100%);
  border: 1px solid #000; box-shadow: inset 0 0 0 3px var(--brass), 0 6px 18px rgba(0, 0, 0, .25);
}
.marquee-hero, .marquee-horse { flex: none; }
.marquee-horse { align-self: flex-end; }
/* 간판 표식 — 별 사이에 글자를 넣은 매장 간판 모양 */
.marquee-mark {
  margin-left: auto; flex: none;
  font-family: Georgia, "Times New Roman", serif; font-weight: 700;
  font-size: 19px; letter-spacing: .10em; color: #F0D9A6;
  padding: 6px 12px; border: 2px solid var(--brass); border-radius: 4px;
  text-shadow: 0 1px 0 rgba(0, 0, 0, .55);
}
.marquee-sign { display: flex; flex-direction: column; gap: 2px; }
.marquee-sign strong {
  font-size: 20px; letter-spacing: .12em; color: #F0D9A6;
  text-shadow: 0 1px 0 rgba(0, 0, 0, .55);
}
.marquee-sign span { font-size: 12px; letter-spacing: .18em; color: #C9A227; text-transform: uppercase; }

@media (max-width: 640px) {
  .marquee { gap: 12px; padding: 14px 16px; }
  .marquee-horse, .marquee-mark { display: none; }   /* 좁으면 말과 표식은 접는다 */
  .marquee-sign strong { font-size: 17px; }
}
