:root {
  --bg: #0a1420;
  --bg-grad-1: #12283f;
  --surface: #101f31;
  --surface-2: #14273c;
  --card: #142a41;
  --card-2: #17324c;
  --panel: #0d1c2c;
  --border: #223a55;
  --border-soft: #1a2f45;
  --text: #eef4fb;
  --text-2: #c6d6e8;
  --muted: #8ba3bf;
  --accent: #f5b13d;
  --accent-2: #e8933a;
  --accent-soft: rgba(245, 177, 61, 0.12);
  --teal: #4ecdc4;
  --green: #37d39b;
  --amber: #f5b13d;
  --orange: #f08a4b;
  --red: #f2635f;
  --shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
  --shadow-sm: 0 2px 12px rgba(0, 0, 0, 0.25);
  --radius: 18px;
  --radius-sm: 12px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", sans-serif;
  background:
    radial-gradient(900px 500px at 85% -5%, rgba(245,177,61,0.06), transparent 60%),
    radial-gradient(1000px 600px at 10% -10%, var(--bg-grad-1) 0%, var(--bg) 55%) fixed;
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.1px;
}
a { color: var(--accent); }
b, strong { color: var(--text); font-weight: 700; }
code { background: rgba(255,255,255,.07); padding: 1px 6px; border-radius: 6px; font-size: .85em; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px 100px; }

/* ===== sticky top bar ===== */
header.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 0; margin-bottom: 8px;
  background: rgba(10,20,32,0.82);
  backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid var(--border-soft);
}
.brand { display: flex; align-items: center; gap: 13px; }
.brand .logo {
  width: 44px; height: 44px; border-radius: 13px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: grid; place-items: center; font-size: 22px;
  box-shadow: 0 6px 18px rgba(245,177,61,0.28);
}
.brand h1 { font-size: 1.12rem; margin: 0; letter-spacing: -0.4px; font-weight: 800; }
.brand p { margin: 0; font-size: .76rem; color: var(--muted); }

/* ===== buttons ===== */
.btn {
  cursor: pointer; border: 1px solid var(--border); background: var(--surface-2);
  color: var(--text); padding: 10px 17px; border-radius: 11px;
  font-size: .9rem; font-weight: 650; transition: .16s; font-family: inherit;
}
.btn:hover { border-color: var(--accent); transform: translateY(-1px); }
.btn.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #1a1200; border: none;
  box-shadow: 0 6px 18px rgba(245,177,61,0.25);
}
.btn.primary:hover { filter: brightness(1.05); }
.btn.ghost { background: transparent; }
.btn.mini { padding: 7px 12px; font-size: .8rem; }

.card {
  background: linear-gradient(180deg, var(--card), var(--card-2));
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px; box-shadow: var(--shadow-sm);
}

/* ===== hero lede ===== */
.hero {
  margin: 22px 0 18px; padding: 30px 30px;
  border-radius: 22px; position: relative; overflow: hidden;
  background:
    radial-gradient(600px 300px at 100% 0%, rgba(245,177,61,0.10), transparent 55%),
    linear-gradient(180deg, var(--surface), var(--surface-2));
  border: 1px solid var(--border);
}
.hero .eyebrow { font-size: .74rem; font-weight: 800; letter-spacing: 2px; color: var(--accent); text-transform: uppercase; }
.hero h2 { margin: 8px 0 10px; font-size: 1.75rem; font-weight: 800; letter-spacing: -0.6px; line-height: 1.25; }
.hero p { margin: 0; color: var(--text-2); font-size: .96rem; max-width: 720px; }
.hero .pills { margin-top: 16px; display: flex; flex-wrap: wrap; gap: 8px; }
.hero .pill { font-size: .78rem; color: var(--muted); background: rgba(255,255,255,.05); border: 1px solid var(--border-soft); padding: 5px 11px; border-radius: 999px; }

/* ===== fields ===== */
.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 650; margin-bottom: 7px; font-size: .88rem; }
.field .inline { display: flex; gap: 8px; }
.field input, .field select {
  width: 100%; padding: 13px 15px; border-radius: 12px; border: 1px solid var(--border);
  background: var(--panel); color: var(--text); font-size: .95rem; font-family: inherit;
}
.field select { cursor: pointer; }
.field input:focus, .field select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.hint { font-size: .8rem; color: var(--muted); margin-top: 7px; }

.transcript-toggle {
  display: flex; align-items: flex-start; gap: 10px; cursor: pointer;
  margin-top: 14px; padding: 12px 14px;
  background: var(--panel); border: 1px solid var(--border-soft); border-radius: 12px;
  font-size: .87rem; color: var(--text-2); user-select: none;
}
.transcript-toggle input[type="checkbox"] { margin-top: 2px; width: 16px; height: 16px; accent-color: var(--accent); flex-shrink: 0; cursor: pointer; }
.transcript-toggle input[type="checkbox"]:disabled { cursor: not-allowed; opacity: .5; }
.transcript-toggle:has(input:disabled) { opacity: .6; cursor: not-allowed; }
.hint.transcript-hint { margin-top: 8px; }
.hint.transcript-hint b { color: var(--accent); }

.oauth-setup {
  margin-top: 12px; padding: 14px 16px;
  background: var(--accent-soft); border: 1px solid rgba(245,177,61,.3); border-radius: 12px;
}
.oauth-setup-title { font-weight: 750; font-size: .88rem; margin-bottom: 8px; }
.oauth-setup-desc { margin: 0 0 12px; font-size: .8rem; color: var(--text-2); line-height: 1.6; }

.oauth-steps { margin: 0 0 14px; padding-left: 20px; font-size: .82rem; color: var(--text-2); line-height: 1.7; }
.oauth-steps li { margin-bottom: 9px; }
.oauth-steps li:last-child { margin-bottom: 0; }
.oauth-steps a { color: var(--teal); }
.oauth-steps code {
  background: rgba(255,255,255,.08); padding: 1px 6px; border-radius: 6px; font-size: .92em;
}
.oauth-origin {
  display: flex; align-items: center; gap: 8px; margin-top: 7px;
  padding: 8px 10px; background: var(--panel); border: 1px solid var(--border-soft); border-radius: 9px;
}
.oauth-origin code {
  flex: 1; background: none; padding: 0; font-size: .84rem; color: var(--accent);
  word-break: break-all; font-weight: 650;
}
.oauth-origin-warning {
  margin-top: 8px; font-size: .78rem; color: #ff9a97;
  background: rgba(242,99,95,.1); border: 1px solid rgba(242,99,95,.3); border-radius: 9px; padding: 8px 10px;
}

.oauth-setup-row { display: flex; gap: 8px; }
.oauth-setup-row input {
  flex: 1; padding: 10px 13px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--panel); color: var(--text); font-size: .87rem; font-family: inherit;
}
.oauth-setup-row input:focus { outline: none; border-color: var(--accent); }
.oauth-setup-status { margin-top: 9px; font-size: .82rem; min-height: 1.2em; }
.oauth-setup-status .ok { color: var(--green); }
.oauth-setup-status .err { color: var(--red); }

.notice {
  font-size: .83rem; color: var(--text-2); background: var(--accent-soft);
  border: 1px solid rgba(245,177,61,.24); border-radius: 12px; padding: 13px 15px; margin-top: 4px;
}
.row-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }

/* ===== 📄 내 대본(TXT) 업로드 ===== */
.script-upload {
  margin-top: 14px; padding: 12px 14px;
  background: var(--panel); border: 1px solid var(--border-soft); border-radius: 12px;
}
.script-upload-label { display: block; font-size: .87rem; color: var(--text-2); margin-bottom: 9px; font-weight: 650; }
.script-upload input[type="file"] { font-size: .85rem; color: var(--muted); max-width: 100%; }
.script-file-list { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.script-file-item {
  display: flex; align-items: center; gap: 10px; padding: 7px 11px;
  background: var(--bg); border: 1px solid var(--border-soft); border-radius: 9px; font-size: .82rem;
}
.sf-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sf-len { color: var(--muted); flex-shrink: 0; }
.sf-remove { padding: 3px 9px; flex-shrink: 0; }

/* ===== search ===== */
.searchbar { display: flex; gap: 10px; margin: 4px 0 8px; }
.searchbar input {
  flex: 1; padding: 15px 17px; border-radius: 14px; border: 1px solid var(--border);
  background: var(--panel); color: var(--text); font-size: 1.02rem;
}
.searchbar input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

/* ===== loading ===== */
.loading { display: flex; flex-direction: column; align-items: center; gap: 16px; padding: 56px 20px; text-align: center; color: var(--muted); }
.spinner {
  width: 44px; height: 44px; border-radius: 50%;
  border: 4px solid rgba(255,255,255,.10); border-top-color: var(--accent);
  animation: spin .9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== banner ===== */
.banner { border-radius: 12px; padding: 14px 16px; margin: 14px 0; font-size: .92rem; border: 1px solid transparent; }
.banner.error { background: rgba(242,99,95,.12); border-color: rgba(242,99,95,.42); color: #ffd6d5; }
.banner.info { background: var(--accent-soft); border-color: rgba(245,177,61,.3); color: var(--text-2); }

/* ===== result topbar ===== */
.result-topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  margin: 24px 0 14px; padding: 18px 22px;
  background: linear-gradient(180deg, var(--card), var(--card-2));
  border: 1px solid var(--border); border-radius: var(--radius);
}
.topbar-actions { display: flex; gap: 8px; flex-shrink: 0; }
.chan-head { display: flex; gap: 15px; align-items: center; }
.chan-head img { width: 66px; height: 66px; border-radius: 50%; border: 2px solid var(--border); }
.chan-head h2 { margin: 0; font-size: 1.3rem; font-weight: 800; }
.chan-head p { margin: 3px 0 0; color: var(--muted); font-size: .86rem; max-width: 560px; }

/* ===== metric strip ===== */
.metric-strip {
  display: flex; align-items: center; gap: 26px; flex-wrap: wrap;
  padding: 14px 22px; margin-bottom: 6px;
  background: var(--panel); border: 1px solid var(--border-soft); border-radius: 14px;
}
.metric { display: flex; flex-direction: column; }
.metric .mv { font-size: 1.15rem; font-weight: 800; letter-spacing: -.4px; }
.metric .mk { font-size: .72rem; color: var(--muted); }
.metric-note { margin-left: auto; font-size: .76rem; color: var(--muted); }
.metric-note b { color: var(--accent); }

/* ===== sections ===== */
section.block { margin-top: 30px; }
.block-head { display: flex; align-items: center; gap: 13px; margin-bottom: 12px; }
.block-head .idx {
  font-size: .78rem; font-weight: 800; color: var(--accent);
  border: 1px solid rgba(245,177,61,.4); border-radius: 8px;
  padding: 3px 8px; letter-spacing: 1px; background: var(--accent-soft);
}
.block-head h2 { font-size: 1.16rem; margin: 0; display: flex; align-items: center; gap: 10px; font-weight: 750; letter-spacing: -0.3px; }
.section-note { margin: 0 0 12px; font-size: .82rem; color: var(--muted); }
.section-note b { color: var(--accent); }
.tag {
  font-size: .64rem; font-weight: 800; letter-spacing: .5px;
  background: var(--accent-soft); color: var(--accent);
  padding: 3px 8px; border-radius: 999px; text-transform: uppercase;
}
.tag.ctx { background: rgba(139,163,191,.15); color: var(--muted); }
.tag.ai { background: rgba(78,205,196,.15); color: var(--teal); }

/* ===== scorecard ===== */
.score-card { padding: 26px; }
.score-hero {
  display: flex; align-items: center; gap: 28px; padding-bottom: 22px;
  border-bottom: 1px solid var(--border-soft); margin-bottom: 22px;
}
.score-verdict .sv-label { font-size: .78rem; color: var(--muted); font-weight: 700; letter-spacing: .5px; text-transform: uppercase; }
.score-verdict .sv-text { font-size: 1.28rem; font-weight: 750; line-height: 1.4; margin-top: 6px; letter-spacing: -0.3px; }

/* ring gauge */
.gauge { position: relative; width: 160px; height: 160px; flex-shrink: 0; }
.gauge svg { display: block; }
.gauge .g-track { fill: none; stroke: rgba(255,255,255,.08); stroke-width: 13; }
.gauge .g-fill { fill: none; stroke-width: 13; stroke-linecap: round; transition: stroke-dashoffset 1s cubic-bezier(.2,.8,.2,1); }
.gauge.sc-high .g-fill { stroke: var(--green); }
.gauge.sc-mid  .g-fill { stroke: var(--amber); }
.gauge.sc-low  .g-fill { stroke: var(--orange); }
.gauge.sc-crit .g-fill { stroke: var(--red); }
.g-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.g-score { font-size: 2.7rem; font-weight: 850; line-height: 1; letter-spacing: -1.5px; }
.g-of { font-size: .72rem; color: var(--muted); margin-top: 2px; }
.g-grade {
  margin-top: 6px; font-size: .8rem; font-weight: 800; padding: 2px 12px; border-radius: 999px;
  background: rgba(255,255,255,.08); border: 1px solid var(--border);
}
.sc-high .g-grade { color: var(--green); }
.sc-mid  .g-grade { color: var(--amber); }
.sc-low  .g-grade { color: var(--orange); }
.sc-crit .g-grade { color: var(--red); }

/* dimension bars */
.dims { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 26px; }
.dim {}
.dim-top { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 7px; }
.dim-name { font-weight: 700; font-size: .96rem; }
.dim-score { font-weight: 850; font-size: 1.15rem; letter-spacing: -.5px; }
.dim-score em { font-size: .68rem; font-weight: 700; font-style: normal; margin-left: 6px; color: var(--muted); }
.dim-track { height: 9px; border-radius: 999px; background: rgba(255,255,255,.07); overflow: hidden; }
.dim-fill { height: 100%; border-radius: 999px; transition: width 1s cubic-bezier(.2,.8,.2,1); }
.sc-high .dim-fill { background: linear-gradient(90deg, #2fb488, var(--green)); }
.sc-mid  .dim-fill { background: linear-gradient(90deg, var(--accent-2), var(--amber)); }
.sc-low  .dim-fill { background: linear-gradient(90deg, #d9713a, var(--orange)); }
.sc-crit .dim-fill { background: linear-gradient(90deg, #d9433f, var(--red)); }
.sc-high .dim-score { color: var(--green); }
.sc-mid  .dim-score { color: var(--amber); }
.sc-low  .dim-score { color: var(--orange); }
.sc-crit .dim-score { color: var(--red); }
.dim-diag { font-size: .85rem; color: var(--text-2); margin-top: 8px; }
.dim-improve { font-size: .84rem; color: var(--muted); margin-top: 6px; background: var(--panel); border: 1px solid var(--border-soft); border-radius: 9px; padding: 8px 11px; }
.dim-improve .lbl { color: var(--accent); font-weight: 700; margin-right: 4px; }

/* ===== prose ===== */
.prose p { margin: 0 0 10px; color: var(--text-2); }
.prose p:last-child { margin-bottom: 0; }
.lead { font-size: 1.05rem; color: var(--text) !important; }

.tags { display: flex; flex-wrap: wrap; gap: 9px; }
.topic {
  background: var(--accent-soft); border: 1px solid rgba(245,177,61,.33);
  color: var(--accent); padding: 7px 13px; border-radius: 999px; font-weight: 650; font-size: .87rem;
}

.level { display: inline-block; font-weight: 800; font-size: .76rem; padding: 4px 11px; border-radius: 999px; margin-bottom: 10px; }
.lv-high { background: rgba(55,211,155,.14); color: var(--green); border: 1px solid rgba(55,211,155,.4); }
.lv-mid  { background: var(--accent-soft); color: var(--accent); border: 1px solid rgba(245,177,61,.34); }
.lv-low  { background: rgba(242,99,95,.13); color: #ff9a97; border: 1px solid rgba(242,99,95,.4); }

.evi { margin-top: 14px; }
.evi-t { display: block; font-size: .74rem; font-weight: 800; letter-spacing: .5px; color: var(--muted); text-transform: uppercase; margin-bottom: 8px; }
.evi-list, ul.plain { margin: 0; padding-left: 18px; color: var(--text-2); }
.evi-list li, ul.plain li { margin-bottom: 5px; }

/* positioning + taglines */
.positioning { margin-bottom: 18px; }
.taglines { display: flex; flex-direction: column; gap: 10px; }
.tagline {
  font-size: 1.05rem; font-weight: 650; font-style: italic; color: var(--text);
  background: var(--panel); border-left: 3px solid var(--accent);
  border-radius: 10px; padding: 12px 16px;
}

/* priority actions */
.action-row { display: flex; gap: 13px; background: var(--panel); border: 1px solid var(--border-soft); border-radius: 12px; padding: 14px 16px; margin-bottom: 11px; }
.action-row:last-child { margin-bottom: 0; }
.pri { flex-shrink: 0; align-self: flex-start; font-size: .72rem; font-weight: 800; padding: 4px 10px; border-radius: 8px; }
.pri-high { background: rgba(242,99,95,.16); color: #ff9a97; border: 1px solid rgba(242,99,95,.4); }
.pri-mid  { background: var(--accent-soft); color: var(--accent); border: 1px solid rgba(245,177,61,.34); }
.pri-low  { background: rgba(139,163,191,.14); color: var(--muted); border: 1px solid var(--border); }
.action-title { font-weight: 700; font-size: .98rem; }
.action-title .target { font-size: .74rem; font-weight: 700; color: var(--teal); }
.action-why, .action-how { font-size: .86rem; color: var(--muted); margin-top: 4px; }
.action-why .lbl, .action-how .lbl { font-weight: 800; font-size: .68rem; padding: 1px 7px; border-radius: 6px; background: rgba(255,255,255,.06); margin-right: 5px; color: var(--text-2); }

/* timeline / roadmap */
.timeline { position: relative; }
.phase { position: relative; padding-left: 40px; padding-bottom: 20px; }
.phase:last-child { padding-bottom: 0; }
.phase::before { content: ""; position: absolute; left: 15px; top: 30px; bottom: 0; width: 2px; background: var(--border); }
.phase:last-child::before { display: none; }
.phase-dot {
  position: absolute; left: 0; top: 0; width: 32px; height: 32px; border-radius: 50%;
  display: grid; place-items: center; font-weight: 800; font-size: .9rem;
  background: var(--accent-soft); color: var(--accent); border: 1px solid rgba(245,177,61,.4);
}
.phase-name { font-weight: 800; font-size: 1rem; }
.phase-focus { color: var(--text-2); font-size: .9rem; margin: 3px 0 8px; }
.phase-actions { margin: 0; padding-left: 18px; color: var(--muted); font-size: .88rem; }
.phase-actions li { margin-bottom: 4px; }

/* content pillars */
.pillars { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.pillar {
  background: linear-gradient(180deg, var(--card), var(--card-2));
  border: 1px solid var(--border); border-top: 3px solid var(--accent);
  border-radius: 14px; padding: 16px 18px;
}
.pillar-name { font-weight: 800; font-size: 1.02rem; margin-bottom: 6px; }
.pillar-desc { color: var(--text-2); font-size: .88rem; }
.pillar-ex { color: var(--muted); font-size: .82rem; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border-soft); }

/* content review */
.review-row { background: var(--panel); border: 1px solid var(--border-soft); border-radius: 12px; padding: 13px 15px; margin-bottom: 10px; }
.review-row:last-child { margin-bottom: 0; }
.review-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 5px; }
.review-head .level { margin-bottom: 0; }
.review-pat { font-weight: 700; }
.review-note { color: var(--muted); font-size: .88rem; }

/* about rewrite */
.rewrite { display: grid; grid-template-columns: 1fr auto 1fr; gap: 16px; align-items: stretch; }
.rw-col { background: var(--panel); border: 1px solid var(--border-soft); border-radius: 12px; padding: 15px 17px; }
.rw-col.after { border-color: rgba(245,177,61,.4); background: var(--accent-soft); }
.rw-label { display: block; font-size: .72rem; font-weight: 800; letter-spacing: .5px; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.rw-col.after .rw-label { color: var(--accent); }
.rw-col p { margin: 0; font-size: .9rem; color: var(--text-2); }
.rw-arrow { align-self: center; color: var(--accent); font-size: 1.5rem; font-weight: 800; }

/* next videos */
.video-idea { background: var(--panel); border: 1px solid var(--border-soft); border-left: 3px solid var(--accent); border-radius: 12px; padding: 14px 16px; margin-bottom: 10px; }
.video-idea:last-child { margin-bottom: 0; }
.video-idea .t { font-weight: 700; font-size: 1rem; margin-bottom: 6px; }
.video-idea .why { color: var(--muted); font-size: .86rem; margin-top: 3px; }
.video-idea .why.narr { color: var(--teal); }
.video-idea .lbl { font-weight: 800; font-size: .68rem; padding: 1px 7px; border-radius: 6px; background: rgba(255,255,255,.06); margin-right: 5px; color: var(--text-2); }

/* table */
.tablewrap { overflow-x: auto; border-radius: 14px; border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; font-size: .87rem; min-width: 680px; }
thead th { background: var(--panel); text-align: left; padding: 12px 14px; color: var(--muted); font-weight: 700; white-space: nowrap; position: sticky; top: 0; }
thead th.num { text-align: right; }
thead th.sortable { cursor: pointer; user-select: none; }
thead th.sortable:hover { color: var(--accent); }
thead th .arrow { font-size: .7rem; opacity: .7; }
tbody td { padding: 11px 14px; border-top: 1px solid var(--border-soft); vertical-align: top; }
tbody tr:hover { background: rgba(255,255,255,.02); }
td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
td.er { color: var(--teal); font-weight: 650; }
td.title a { color: var(--text); text-decoration: none; }
td.title a:hover { color: var(--accent); }

.fmt-badge {
  display: inline-block; font-size: .74rem; font-weight: 700; white-space: nowrap;
  padding: 3px 9px; border-radius: 999px; border: 1px solid var(--border);
}
.fmt-badge.fmt-short { color: var(--accent); background: var(--accent-soft); border-color: rgba(245,177,61,.35); }
.fmt-badge.fmt-long { color: var(--muted); background: rgba(255,255,255,.04); }

/* summary */
.summary-card { border-color: rgba(245,177,61,.35); background: linear-gradient(180deg, var(--surface), var(--surface-2)); }
.summary-card p { font-size: 1.04rem; color: var(--text); }
.model-tag { margin-top: 14px; font-size: .74rem; color: var(--muted); }

.ai-loading { color: var(--muted); font-size: .9rem; display: flex; align-items: center; gap: 12px; }
.ai-loading .spinner { width: 22px; height: 22px; border-width: 3px; }

footer.foot { margin-top: 46px; text-align: center; color: var(--muted); font-size: .78rem; line-height: 1.9; }

.hidden { display: none !important; }

/* ===== responsive ===== */
@media (max-width: 760px) {
  .searchbar { flex-direction: column; }
  .dims { grid-template-columns: 1fr; }
  .score-hero { flex-direction: column; text-align: center; gap: 18px; }
  .rewrite { grid-template-columns: 1fr; }
  .rw-arrow { transform: rotate(90deg); }
  .result-topbar { flex-direction: column; align-items: stretch; }
  .topbar-actions { justify-content: flex-end; }
  .metric-strip { gap: 16px; }
  .metric-note { margin-left: 0; width: 100%; }
  .hero h2 { font-size: 1.4rem; }
  .brand h1 { font-size: 1rem; }
}

/* ===== print ===== */
@media print {
  body { background: #fff; color: #111; }
  header.topbar, .topbar-actions, #view-settings, .searchbar, .hint, footer.foot, .chat-widget { display: none !important; }
  .card, .hero, .result-topbar, .metric-strip { box-shadow: none; border-color: #ccc; }
  * { color: #111 !important; }
}

/* =====================================================================
 * 신빙성(Credibility) 기능 — 데이터 출처 배너 / 투명성 패널 / 근거 검증 /
 * 재검증(자체 감사) 패널
 * ===================================================================== */
.chan-link { color: var(--text); text-decoration: none; }
.chan-link:hover { color: var(--accent); }
.count-badge {
  display: inline-block; font-size: .74rem; font-weight: 800; color: var(--accent);
  background: var(--accent-soft); border: 1px solid rgba(245,177,61,.3);
  padding: 2px 9px; border-radius: 999px; vertical-align: middle;
}

.provenance {
  margin: 6px 0 4px; padding: 13px 20px;
  background: var(--panel); border: 1px solid var(--border-soft); border-radius: 14px;
}
.prov-row { display: flex; flex-wrap: wrap; gap: 8px 4px; align-items: center; font-size: .8rem; color: var(--text-2); }
.prov-item {}
.prov-item.prov-transcript { color: var(--teal); font-weight: 700; }
.prov-sep { color: var(--muted); opacity: .6; }

.data-transparency { margin-top: 10px; }
.data-transparency summary {
  cursor: pointer; font-size: .82rem; font-weight: 700; color: var(--teal);
  list-style: none; display: flex; align-items: center; gap: 6px;
}
.data-transparency summary::-webkit-details-marker { display: none; }
.data-transparency summary::before { content: "▸"; transition: transform .15s; }
.data-transparency[open] summary::before { transform: rotate(90deg); }
.data-transparency .dt-hint { color: var(--muted); font-weight: 500; font-size: .74rem; }
.data-transparency pre {
  margin: 10px 0 0; padding: 14px 16px; background: var(--bg);
  border: 1px solid var(--border-soft); border-radius: 10px;
  font-size: .78rem; line-height: 1.7; color: var(--text-2);
  white-space: pre-wrap; word-break: break-word; max-height: 420px; overflow-y: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

/* 근거(evidence) 검증 배지 */
.evi-verified a { color: var(--text); }
.evi-verified a:hover { color: var(--accent); }
.evi-check {
  font-size: .68rem; font-weight: 800; padding: 2px 8px; border-radius: 999px; margin-left: 4px;
  background: rgba(55,211,155,.14); color: var(--green); border: 1px solid rgba(55,211,155,.35);
}
.evi-check.unverified { background: rgba(139,163,191,.14); color: var(--muted); border-color: var(--border); }

/* 재검증(자체 감사) */
.verify-row {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--border-soft);
}
.verify-hint { font-size: .78rem; color: var(--muted); }
.verify-result { margin-top: 14px; padding: 16px 18px; border-radius: 12px; background: var(--panel); border: 1px solid var(--border-soft); }
.verify-result.verify-pass { border-color: rgba(55,211,155,.35); }
.verify-result.verify-fail { border-color: rgba(242,99,95,.4); }
.verify-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.verify-badge { font-weight: 800; font-size: .9rem; }
.verify-pass .verify-badge { color: var(--green); }
.verify-fail .verify-badge { color: #ff9a97; }
.verify-note { color: var(--text-2); font-size: .9rem; margin: 0 0 10px; }
.verify-checks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 9px; }
.verify-checks li { display: flex; gap: 10px; align-items: flex-start; font-size: .86rem; }
.vc-icon { flex-shrink: 0; font-weight: 800; width: 20px; text-align: center; }
.verify-checks li.ok .vc-icon { color: var(--green); }
.verify-checks li.warn .vc-icon { color: var(--orange); }
.vc-claim { font-weight: 700; }
.vc-note { color: var(--muted); font-size: .82rem; margin-top: 2px; }

/* 영상 표 페이지네이션 */
.table-pagination {
  display: flex; align-items: center; justify-content: center; gap: 16px;
  margin-top: 14px; font-size: .84rem; color: var(--muted);
}
.table-pagination .btn.mini:disabled { opacity: .35; cursor: not-allowed; transform: none; }

/* =====================================================================
 * 하단 고정 채팅 위젯
 * ===================================================================== */
.chat-widget {
  position: fixed; right: 20px; bottom: 20px; z-index: 60;
  display: flex; flex-direction: column; align-items: flex-end;
  font-family: inherit;
}
.chat-toggle {
  display: flex; align-items: center; gap: 9px; cursor: pointer;
  padding: 13px 20px; border-radius: 999px; border: none;
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #1a1200;
  font-weight: 750; font-size: .92rem;
  box-shadow: 0 10px 28px rgba(245,177,61,0.32);
  transition: transform .15s;
}
.chat-toggle:hover { transform: translateY(-2px); }
.chat-widget.disabled .chat-toggle {
  background: var(--surface-2); color: var(--muted); box-shadow: var(--shadow-sm); cursor: not-allowed;
}
.chat-widget.disabled .chat-toggle:hover { transform: none; }

.chat-panel {
  display: none; flex-direction: column;
  width: min(400px, calc(100vw - 40px)); height: min(560px, calc(100vh - 140px));
  margin-bottom: 12px; border-radius: 18px; overflow: hidden;
  background: linear-gradient(180deg, var(--card), var(--card-2));
  border: 1px solid var(--border); box-shadow: var(--shadow);
}
.chat-widget.open .chat-panel { display: flex; }
.chat-widget.open .chat-toggle { display: none; }

.chat-panel-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; font-weight: 750; font-size: .92rem;
  border-bottom: 1px solid var(--border-soft); background: var(--panel);
}
.chat-close {
  cursor: pointer; background: transparent; border: none; color: var(--muted);
  font-size: 1rem; padding: 4px 8px; border-radius: 8px;
}
.chat-close:hover { color: var(--text); background: rgba(255,255,255,.06); }

.chat-messages { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.chat-msg { display: flex; }
.chat-msg.from-user { justify-content: flex-end; }
.chat-msg.from-ai { justify-content: flex-start; }
.chat-bubble {
  max-width: 84%; padding: 10px 14px; border-radius: 14px; font-size: .87rem; line-height: 1.55;
  background: var(--panel); border: 1px solid var(--border-soft); color: var(--text-2);
}
.chat-msg.from-user .chat-bubble { background: var(--accent-soft); border-color: rgba(245,177,61,.3); color: var(--text); border-bottom-right-radius: 4px; }
.chat-msg.from-ai .chat-bubble { border-bottom-left-radius: 4px; }
.chat-msg.is-error .chat-bubble { border-color: rgba(242,99,95,.4); color: #ffb3b1; }

.chat-msg.typing .chat-bubble { display: flex; gap: 4px; align-items: center; padding: 13px 16px; }
.chat-dot {
  width: 6px; height: 6px; border-radius: 50%; background: var(--muted);
  animation: chatDot 1.2s infinite ease-in-out;
}
.chat-dot:nth-child(2) { animation-delay: .15s; }
.chat-dot:nth-child(3) { animation-delay: .3s; }
@keyframes chatDot { 0%, 60%, 100% { opacity: .3; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }

.chat-input-row { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--border-soft); }
.chat-input-row input {
  flex: 1; padding: 10px 13px; border-radius: 11px; border: 1px solid var(--border);
  background: var(--panel); color: var(--text); font-size: .87rem; font-family: inherit;
}
.chat-input-row input:focus { outline: none; border-color: var(--accent); }
.chat-input-row input:disabled { opacity: .5; }
.chat-hint { padding: 0 14px 12px; font-size: .74rem; color: var(--muted); }

@media (max-width: 480px) {
  .chat-widget { right: 12px; bottom: 12px; left: 12px; align-items: stretch; }
  .chat-panel { width: 100%; }
  .chat-toggle { justify-content: center; }
}

/* =====================================================================
 * 📁 내 채널 상담 기록 대시보드 (지속 상담 AI 컨설턴트 기능)
 * ===================================================================== */
.channel-history { margin: 22px 0; }
.chd-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.chd-head h2 { margin: 0; font-size: 1.1rem; font-weight: 750; }

.chd-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.chd-card {
  display: flex; flex-direction: column; gap: 12px; padding: 16px;
  background: linear-gradient(180deg, var(--card), var(--card-2));
  border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow-sm);
}
.chd-thumb { width: 100%; height: 110px; object-fit: cover; border-radius: 11px; background: var(--panel); }
.chd-thumb-empty { display: flex; align-items: center; justify-content: center; font-size: 2rem; }
.chd-info { flex: 1; }
.chd-name { font-weight: 750; font-size: .98rem; margin-bottom: 6px; }
.chd-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: .78rem; color: var(--muted); }
.chd-score {
  font-weight: 800; font-size: .78rem; padding: 3px 9px; border-radius: 999px;
  background: rgba(255,255,255,.06); border: 1px solid var(--border);
}
.chd-score.sc-high { color: var(--green); border-color: rgba(55,211,155,.35); }
.chd-score.sc-mid  { color: var(--amber); border-color: rgba(245,177,61,.35); }
.chd-score.sc-low  { color: var(--orange); border-color: rgba(240,138,75,.35); }
.chd-score.sc-crit { color: var(--red); border-color: rgba(242,99,95,.35); }
.chd-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.chd-actions .btn { flex: 1; white-space: nowrap; }
.chd-actions .chd-del { flex: 0 0 auto; padding: 8px 12px; }

.chd-mine-badge {
  display: inline-block; font-size: .74rem; font-weight: 800; color: #1a1200;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-radius: 999px; padding: 2px 9px; margin-right: 6px; vertical-align: middle;
}

/* =====================================================================
 * 🆚 참고 채널 비교
 * ===================================================================== */
.channel-comparison { margin: 22px 0; }
.comparison-setup .prose { margin: 0; }

/* --- 내 채널 미지정 안내 --- */
.cmp-empty { display: flex; align-items: center; gap: 14px; }
.cmp-empty-icon { font-size: 1.8rem; flex-shrink: 0; }
.cmp-empty .prose { color: var(--text-2); line-height: 1.7; }

/* --- 내 채널(비교 기준) 배지 --- */
.cmp-my {
  display: flex; align-items: center; gap: 12px; margin-bottom: 16px;
  padding: 12px 15px; border-radius: 14px;
  background: var(--accent-soft); border: 1px solid rgba(245,177,61,.34);
}
.cmp-my-thumb { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.cmp-my-thumb-empty { display: flex; align-items: center; justify-content: center; background: var(--panel); font-size: 1.2rem; }
.cmp-my-text { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.cmp-my-label { font-size: .72rem; font-weight: 800; color: var(--accent); letter-spacing: .3px; }
.cmp-my-name { font-weight: 750; font-size: 1.02rem; }

.cmp-vs-label {
  font-size: .74rem; font-weight: 800; color: var(--muted); letter-spacing: 1.5px;
  text-transform: uppercase; margin: 4px 0 10px; text-align: center; position: relative;
}
.cmp-vs-label::before, .cmp-vs-label::after {
  content: ""; position: absolute; top: 50%; width: 34%; height: 1px; background: var(--border);
}
.cmp-vs-label::before { left: 0; } .cmp-vs-label::after { right: 0; }

.cmp-inputs { display: flex; flex-direction: column; gap: 9px; margin-bottom: 12px; }
.cmp-input-row { display: flex; align-items: center; gap: 8px; }
.cmp-ref-icon { flex-shrink: 0; font-size: 1rem; opacity: .7; }
.cmp-ref-input {
  flex: 1; padding: 11px 14px; border-radius: 11px; border: 1px solid var(--border);
  background: var(--panel); color: var(--text); font-size: .9rem; font-family: inherit; min-width: 0;
}
.cmp-ref-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.cmp-row-del { flex-shrink: 0; padding: 8px 11px; }

.cmp-controls { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.cmp-controls .btn.primary { margin-left: auto; }

/* --- ① 한눈에 보는 비교 매트릭스 --- */
.cmp-matrix-wrap { overflow-x: auto; border-radius: 12px; border: 1px solid var(--border-soft); }
.cmp-matrix { width: 100%; border-collapse: collapse; font-size: .88rem; min-width: 420px; }
.cmp-matrix th, .cmp-matrix td {
  padding: 11px 13px; text-align: center; border-bottom: 1px solid var(--border-soft);
  border-right: 1px solid var(--border-soft); white-space: nowrap;
}
.cmp-matrix th:last-child, .cmp-matrix td:last-child { border-right: none; }
.cmp-matrix tbody tr:last-child td { border-bottom: none; }
.cmp-metric-th { text-align: left; font-size: .76rem; color: var(--muted); background: var(--panel); }
.cmp-col-th { background: var(--panel); vertical-align: bottom; }
.cmp-col-thumb {
  width: 34px; height: 34px; border-radius: 50%; object-fit: cover; display: block; margin: 0 auto 6px;
}
.cmp-col-thumb-empty { display: flex; align-items: center; justify-content: center; background: var(--bg); }
.cmp-col-name { font-size: .8rem; font-weight: 700; display: block; max-width: 120px; margin: 0 auto; white-space: normal; line-height: 1.3; }
.cmp-metric { text-align: left; font-weight: 650; color: var(--text-2); background: var(--panel); }
.cmp-matrix td:not(.cmp-metric) { font-variant-numeric: tabular-nums; font-weight: 600; }

/* 내 채널 열 강조 */
.cmp-mine-col { background: var(--accent-soft) !important; }
.cmp-col-th.cmp-mine-col { border-top: 3px solid var(--accent); }
.cmp-matrix td.cmp-mine-col { color: var(--text); font-weight: 750; }

/* 공명(참여율) 행 + 선두 표시 */
.cmp-row-resonance td { background: rgba(94,213,193,.06); }
.cmp-row-resonance td.cmp-mine-col { background: var(--accent-soft) !important; }
.cmp-tag-resonance {
  display: inline-block; font-size: .62rem; font-weight: 800; color: var(--teal);
  border: 1px solid rgba(94,213,193,.4); border-radius: 999px; padding: 1px 6px; margin-left: 4px; vertical-align: middle;
}
.cmp-lead { color: var(--teal) !important; font-weight: 800 !important; }
.cmp-lead-mark { color: var(--teal); font-size: .7rem; }

/* --- ② 참고 채널별 정성 비교 --- */
.cmp-ref-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.cmp-ref-card {
  padding: 14px 15px; border-radius: 13px;
  background: var(--panel); border: 1px solid var(--border-soft);
}
.cmp-ref-name {
  font-weight: 750; font-size: .95rem; margin-bottom: 10px; padding-bottom: 8px;
  border-bottom: 1px solid var(--border-soft);
}
.cmp-ref-block { margin-bottom: 10px; }
.cmp-ref-block:last-child { margin-bottom: 0; }
.cmp-ref-block p { margin: 4px 0 0; font-size: .84rem; color: var(--text-2); line-height: 1.6; }
.cmp-ref-lbl { font-size: .72rem; font-weight: 800; letter-spacing: .2px; }
.cmp-ref-lbl.msg  { color: var(--teal); }
.cmp-ref-lbl.good { color: var(--green); }
.cmp-ref-lbl.diff { color: var(--muted); }
.cmp-ref-lbl.weak { color: var(--orange); }
.cmp-ref-lbl.mine { color: var(--accent); }

/* --- ③ 강점 / 보완점 2열 --- */
.cmp-sg-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; }
.cmp-strengths { border-top: 3px solid var(--green); }
.cmp-gaps { border-top: 3px solid var(--amber); }
.cmp-sg-title { display: block; margin-bottom: 12px; }
.cmp-sg-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.cmp-sg-list li {
  padding: 11px 13px; border-radius: 11px; background: var(--panel); border: 1px solid var(--border-soft);
}
.cmp-sg-point { font-weight: 700; font-size: .9rem; line-height: 1.5; }
.cmp-sg-evi { font-size: .78rem; color: var(--muted); margin-top: 6px; line-height: 1.5; }
.cmp-sg-fix {
  font-size: .82rem; color: var(--amber); margin-top: 7px; font-weight: 650; line-height: 1.5;
  padding-top: 7px; border-top: 1px dashed var(--border);
}

/* --- ④ 종합 포지셔닝 --- */
.cmp-positioning { border-left: 3px solid var(--accent); }
.cmp-positioning p { margin: 10px 0 0; color: var(--text-2); font-size: .92rem; line-height: 1.7; }

@media (max-width: 560px) {
  .cmp-sg-grid { grid-template-columns: 1fr; }
  .cmp-controls .btn.primary { margin-left: 0; width: 100%; }
}

/* =====================================================================
 * 📝 다음 영상 계획 · 향후 계획 — TO-DO 목록 + 일정 캘린더
 *   (사용자가 직접 기록하는 메모, AI 결과 아님)
 * ===================================================================== */
.plans-card .section-note { margin-bottom: 16px; }
.plan-add-row { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 18px; }
.plan-input {
  flex: 1; padding: 11px 14px; border-radius: 11px; border: 1px solid var(--border);
  background: var(--panel); color: var(--text); font-size: .9rem; font-family: inherit; resize: vertical; min-height: 40px;
}
.plan-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.plan-add-date {
  flex-shrink: 0; padding: 0 10px; border-radius: 11px; border: 1px solid var(--border);
  background: var(--panel); color: var(--text); font-size: .84rem; font-family: inherit; align-self: stretch;
}
.plan-add-row .btn { flex-shrink: 0; align-self: flex-start; }

/* --- 일정 캘린더 --- */
.plan-cal { margin-bottom: 18px; padding: 14px 15px; background: var(--panel); border: 1px solid var(--border-soft); border-radius: 14px; }
.plan-cal-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.plan-cal-title { font-weight: 750; font-size: .95rem; }
.plan-cal-today-btn { margin-left: auto; }
.plan-cal-weekdays {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-bottom: 4px;
  font-size: .72rem; font-weight: 700; color: var(--muted); text-align: center;
}
.plan-cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.plan-cal-cell {
  aspect-ratio: 1; border-radius: 9px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; cursor: pointer; background: var(--bg); border: 1px solid transparent; font-size: .82rem;
}
.plan-cal-cell.empty { background: none; cursor: default; }
.plan-cal-cell:not(.empty):hover { border-color: var(--border); }
.plan-cal-daynum { font-weight: 600; color: var(--text-2); }
.plan-cal-cell.is-today { border: 1.5px solid var(--accent); }
.plan-cal-cell.is-today .plan-cal-daynum { color: var(--accent); font-weight: 800; }
.plan-cal-cell.is-selected { background: var(--accent-soft); border-color: var(--accent); }
.plan-cal-cell.is-selected .plan-cal-daynum { color: var(--accent); font-weight: 800; }
.plan-cal-cell.has-overdue .plan-cal-daynum { color: #ff9a97; }
.plan-cal-dots { display: flex; gap: 3px; height: 6px; }
.plan-cal-dot { width: 6px; height: 6px; border-radius: 50%; display: block; }
.plan-cal-dot.pending { background: var(--accent); }
.plan-cal-dot.done { background: var(--green); }

/* --- 날짜 필터 바 (특정 날짜 선택 시) --- */
.plan-filter-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-bottom: 10px; padding: 8px 12px; background: var(--accent-soft); border-radius: 10px;
}
.plan-filter-label { font-weight: 700; font-size: .86rem; }

.plan-group-label {
  font-size: .72rem; font-weight: 800; color: var(--muted); letter-spacing: .5px;
  text-transform: uppercase; margin: 14px 0 8px;
}
.plan-group-label:first-of-type { margin-top: 0; }
.plan-group-label.plan-group-overdue { color: #ff9a97; }

.plan-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.plan-item {
  display: flex; align-items: flex-start; gap: 11px; padding: 11px 13px;
  background: var(--panel); border: 1px solid var(--border-soft); border-left: 3px solid var(--accent); border-radius: 12px;
}
.plan-check {
  flex-shrink: 0; width: 22px; height: 22px; margin-top: 1px; border-radius: 7px;
  border: 1.5px solid var(--border); background: var(--bg); color: var(--green);
  font-weight: 800; font-size: .8rem; cursor: pointer; display: flex; align-items: center; justify-content: center; padding: 0;
}
.plan-check:hover { border-color: var(--accent); }
.plan-body-text { flex: 1; min-width: 0; }
.plan-text { font-size: .9rem; line-height: 1.55; white-space: pre-wrap; word-break: break-word; }
.plan-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: .76rem; color: var(--muted); margin-top: 6px; }
.plan-date-edit {
  padding: 2px 7px; border-radius: 7px; border: 1px solid var(--border-soft); background: var(--bg);
  color: var(--text-2); font-size: .74rem; font-family: inherit;
}
.plan-overdue-badge {
  font-size: .68rem; font-weight: 800; color: #ff9a97; border: 1px solid rgba(242,99,95,.4);
  border-radius: 999px; padding: 1px 7px;
}
.plan-del { flex-shrink: 0; padding: 4px 9px; font-size: .78rem; }

.plan-item.plan-overdue { border-left-color: var(--red); }
.plan-item.plan-done { border-left-color: var(--border); opacity: .68; }
.plan-item.plan-done .plan-text { text-decoration: line-through; color: var(--muted); }
.plan-item.plan-done .plan-check { background: var(--green); border-color: var(--green); color: #06251a; }

.plan-done-details { margin-top: 14px; }
.plan-done-details summary {
  cursor: pointer; font-size: .82rem; font-weight: 700; color: var(--teal);
  list-style: none; display: flex; align-items: center; gap: 6px; margin-bottom: 8px;
}
.plan-done-details summary::-webkit-details-marker { display: none; }
.plan-done-details summary::before { content: "▸"; transition: transform .15s; }
.plan-done-details[open] summary::before { transform: rotate(90deg); }

.plan-empty { padding: 6px 0; }

@media (max-width: 480px) {
  .plan-add-row { flex-direction: column; }
  .plan-add-row .btn, .plan-add-row .plan-add-date { align-self: stretch; }
  .plan-cal-cell { font-size: .74rem; }
}

/* ---------- 지난 분석 대비 점수 변화 (JS 로 직접 계산, AI 서술 아님) ---------- */
.trend-delta {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 10px;
  padding: 5px 12px; border-radius: 999px; font-size: .82rem; font-weight: 700;
}
.trend-delta.trend-up   { background: rgba(55,211,155,.14); color: var(--green); border: 1px solid rgba(55,211,155,.35); }
.trend-delta.trend-down { background: rgba(242,99,95,.13); color: #ff9a97; border: 1px solid rgba(242,99,95,.35); }
.trend-delta.trend-flat { background: rgba(139,163,191,.14); color: var(--muted); border: 1px solid var(--border); }
.trend-detail { font-weight: 500; color: var(--muted); font-size: .78rem; }

.trend-note {
  margin-top: 16px; padding: 13px 16px; border-radius: 12px;
  background: var(--panel); border-left: 3px solid var(--teal);
}
.trend-note p { margin: 8px 0 0; color: var(--text-2); font-size: .9rem; }

/* ---------- 이 채널의 지난 상담 이력 타임라인 ---------- */
.history-timeline { margin-top: 10px; }
.history-timeline summary {
  cursor: pointer; font-size: .82rem; font-weight: 700; color: var(--teal);
  list-style: none; display: flex; align-items: center; gap: 6px;
}
.history-timeline summary::-webkit-details-marker { display: none; }
.history-timeline summary::before { content: "▸"; transition: transform .15s; }
.history-timeline[open] summary::before { transform: rotate(90deg); }
.history-list { margin: 10px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }
.history-list li {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: .82rem;
  padding: 8px 12px; background: var(--bg); border: 1px solid var(--border-soft); border-radius: 9px;
}
.hl-date { color: var(--muted); flex-shrink: 0; }
.hl-score {
  font-weight: 800; font-size: .76rem; padding: 2px 8px; border-radius: 999px;
  background: rgba(255,255,255,.06); border: 1px solid var(--border); flex-shrink: 0;
}
.hl-score.sc-high { color: var(--green); } .hl-score.sc-mid { color: var(--amber); }
.hl-score.sc-low  { color: var(--orange); } .hl-score.sc-crit { color: var(--red); }
.hl-verdict { color: var(--text-2); }

@media (max-width: 480px) {
  .chd-grid { grid-template-columns: 1fr; }
}
