:root {
  --bg: #f6f5f2; --card: #ffffff; --fg: #1b1b1b; --muted: #6b6b6b; --line: #e3e1dc;
  --accent: #e1306c; --accent-fg: #fff; --ok: #1f8a4c; --err: #c62828; --warn-bg: #fff6e0;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111; --card: #1c1c1c; --fg: #eee; --muted: #9a9a9a; --line: #2e2e2e;
    --warn-bg: #3a3017;
  }
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--fg);
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  padding-bottom: env(safe-area-inset-bottom);
}
main { max-width: 640px; margin: 0 auto; padding: 16px; }
a { color: inherit; }
h1, h2 { margin: 0 0 8px; } h2 { font-size: 1.1rem; }
.top {
  display: flex; justify-content: space-between; align-items: center;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px; border-bottom: 1px solid var(--line); background: var(--card);
}
.top nav { display: flex; gap: 14px; align-items: center; }
.top form { margin: 0; }
.brand { font-weight: 700; text-decoration: none; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 16px; margin-bottom: 16px; }
.narrow { max-width: 360px; margin: 48px auto; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; }
label { display: flex; flex-direction: column; gap: 4px; font-weight: 600; font-size: .95rem; }
input, textarea, button, .button {
  font: inherit; border-radius: 10px; border: 1px solid var(--line); padding: 10px 12px;
  background: var(--bg); color: var(--fg);
}
textarea { resize: vertical; font-weight: 400; }
button, .button { cursor: pointer; font-weight: 600; text-decoration: none; display: inline-block; text-align: center; }
button:disabled { opacity: .5; }
.primary { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); }
.danger { color: var(--err); background: transparent; }
.link { border: 0; background: none; padding: 0; font-weight: 400; text-decoration: underline; }
.drop { border: 2px dashed var(--line); border-radius: 12px; padding: 24px; text-align: center; cursor: pointer; }
.drop input { display: none; }
progress { width: 100%; height: 10px; }
.muted { color: var(--muted); } .small { font-size: .85rem; }
.error { color: var(--err); } .ok { color: var(--ok); }
.warn { background: var(--warn-bg); border-radius: 10px; padding: 10px 12px; margin-top: 12px; }
.warn ul { margin: 4px 0 0; padding-left: 18px; }
.plain { list-style: none; padding: 0; margin: 0; }
video { width: 100%; max-height: 70vh; border-radius: 10px; background: #000; margin-top: 12px; }
.placeholder { aspect-ratio: 9/16; max-height: 50vh; margin: 12px auto 0; display: grid; place-items: center;
  border-radius: 10px; background: var(--bg); color: var(--muted); }
.jobs { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.job { display: flex; gap: 12px; text-decoration: none; background: var(--card); border: 1px solid var(--line);
  border-radius: 12px; padding: 10px; align-items: center; }
.job img, .job .thumb { width: 54px; height: 96px; object-fit: cover; border-radius: 8px; background: var(--bg); flex: none; }
.job > div { min-width: 0; }
.line { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.badge { display: inline-block; font-size: .78rem; font-weight: 700; padding: 2px 8px; border-radius: 99px;
  background: var(--line); }
.s-review { background: #ffe08a; color: #222; }
.s-published { background: #c8f0d4; color: #14532d; }
.s-failed { background: #ffd2d2; color: #7f1d1d; }
.s-processing, .s-publishing, .s-queued, .s-publish_requested { background: #d6e4ff; color: #1e3a8a; }
.google { display: block; margin-top: 8px; }
.choice { flex-direction: row; align-items: center; gap: 8px; font-weight: 500; }
.choice input { width: 20px; height: 20px; }
.memo { white-space: pre-wrap; font: 13px/1.5 ui-monospace, Menlo, monospace; background: var(--bg);
  border-radius: 10px; padding: 12px; max-height: 50vh; overflow: auto; margin: 0; }
select { font: inherit; border-radius: 10px; border: 1px solid var(--line); padding: 10px 12px; background: var(--bg); color: var(--fg); }
.big { font-size: 1.5rem; font-weight: 800; letter-spacing: -0.01em; }
.predict { margin-top: 12px; padding: 12px; border-radius: 10px; background: var(--bg); }
.predict .row { justify-content: space-between; }
.predict p { margin: 6px 0 0; }
.score { font-size: .8rem; font-weight: 700; }
.tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 12px; }
@media (min-width: 560px) { .tiles { grid-template-columns: repeat(4, 1fr); } }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.metrics { width: 100%; border-collapse: collapse; font-size: .9rem; font-variant-numeric: tabular-nums; }
.metrics th, .metrics td { text-align: right; padding: 6px 4px; border-bottom: 1px solid var(--line); }
.metrics th:first-child, .metrics td:first-child { text-align: left; }
.grid5 { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: 8px; }
.grid5 input { min-width: 0; }
.barrow { display: grid; grid-template-columns: 9em 1fr 4.5em; gap: 8px; align-items: center; font-size: .9rem; margin-top: 4px; }
.barrow > span:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.bar { height: 10px; background: var(--bg); border-radius: 99px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--accent); border-radius: 99px; }
p.warn { margin: 0 0 12px; }
:root { --band: #e4e1da; --ink2: #6b6b6b; }
@media (prefers-color-scheme: dark) { :root { --band: #3a3936; --ink2: #9a9a9a; } }
.chartwrap { position: relative; margin-top: 8px; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .tick { fill: var(--ink2); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart .endlabel { fill: var(--fg); font-size: 12px; font-weight: 700; }
.chart .band { fill: var(--band); }
.chart .line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .dot { fill: var(--accent); stroke: var(--card); stroke-width: 2; }
.chart .hit { fill: transparent; cursor: pointer; }
.chart .cross { stroke: var(--ink2); stroke-width: 1; }
.tip { position: absolute; top: 0; max-width: 220px; background: var(--card); color: var(--fg); border: 1px solid var(--line);
  border-radius: 8px; padding: 6px 8px; font-size: .8rem; line-height: 1.4; box-shadow: 0 4px 12px rgba(0,0,0,.12); pointer-events: none; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; color: var(--ink2); margin-top: 4px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.key-line { display: inline-block; width: 16px; height: 2px; background: var(--accent); border-radius: 2px; position: relative; }
.key-line::after { content: ""; position: absolute; left: 4px; top: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.key-band { display: inline-block; width: 10px; height: 14px; background: var(--band); border-radius: 3px; }

.reply { margin-top: 12px; padding: 12px 14px; border-radius: 10px; background: color-mix(in srgb, var(--accent, #3b82f6) 10%, transparent); }
.reply p { margin: 6px 0 0; white-space: pre-line; }
select { width: 100%; }
.slides { display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 4px; }
.slides img { width: 132px; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 8px; scroll-snap-align: start; display: block; }
.versions button { line-height: 1.3; }
.story { margin-top: 10px; padding: 10px 12px; border-radius: 10px; background: var(--soft, rgba(127,127,127,.08)); }
.beats { margin: 6px 0 0; padding-left: 20px; }
.beats li { margin: 4px 0; }
.chip { display: inline-block; padding: 0 6px; margin-left: 4px; border-radius: 8px; border: 1px solid rgba(127,127,127,.35); }
