/* ops.aiyammy.com — company board. Quiet neutral surfaces, one accent (brand yellow), navy ink. */

:root {
  color-scheme: light;
  --bg: #f4f5f7;
  --surface: #ffffff;
  --surface-2: #f7f8fa;
  --surface-3: #eef0f3;
  --border: #e3e6eb;
  --border-strong: #d2d7df;
  --text: #10141c;
  --text-2: #465061;
  --muted: #6f7887;
  --accent: #ffc547;
  --accent-ink: #10141c;
  --accent-soft: #fff5dc;
  --accent-line: #e8a90f;
  --sel: #fff8e6;
  --ok: #17803f;   --ok-soft: #e7f5ec;
  --info: #2459c2; --info-soft: #e8effc;
  --warn: #9a5b00; --warn-soft: #fdf1dc;
  --bad: #c0352b;  --bad-soft: #fcebe9;
  --mark: #10141c;          /* sparkline / bar ink */
  --mark-soft: rgba(16, 20, 28, 0.08);
  --shadow: 0 1px 2px rgba(16, 20, 28, 0.04), 0 1px 1px rgba(16, 20, 28, 0.03);
  --shadow-lg: 0 12px 40px rgba(16, 20, 28, 0.18), 0 2px 6px rgba(16, 20, 28, 0.08);
  --radius: 10px;
  --radius-sm: 6px;
  --sidebar: 224px;
  --font: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo",
    "Noto Sans KR", "Malgun Gothic", system-ui, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0b0e14;
    --surface: #121722;
    --surface-2: #161c29;
    --surface-3: #1c2433;
    --border: #232c3c;
    --border-strong: #2f3a4e;
    --text: #e8ebf1;
    --text-2: #b4bccb;
    --muted: #8a94a6;
    --accent-soft: rgba(255, 197, 71, 0.12);
    --accent-line: #ffc547;
    --sel: rgba(255, 197, 71, 0.08);
    --ok: #4cc584;   --ok-soft: rgba(76, 197, 132, 0.13);
    --info: #79a8ff; --info-soft: rgba(121, 168, 255, 0.13);
    --warn: #f0b44c; --warn-soft: rgba(240, 180, 76, 0.13);
    --bad: #f27a70;  --bad-soft: rgba(242, 122, 112, 0.13);
    --mark: #ffc547;
    --mark-soft: rgba(255, 197, 71, 0.12);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.55);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b0e14;
  --surface: #121722;
  --surface-2: #161c29;
  --surface-3: #1c2433;
  --border: #232c3c;
  --border-strong: #2f3a4e;
  --text: #e8ebf1;
  --text-2: #b4bccb;
  --muted: #8a94a6;
  --accent-soft: rgba(255, 197, 71, 0.12);
  --accent-line: #ffc547;
  --sel: rgba(255, 197, 71, 0.08);
  --ok: #4cc584;   --ok-soft: rgba(76, 197, 132, 0.13);
  --info: #79a8ff; --info-soft: rgba(121, 168, 255, 0.13);
  --warn: #f0b44c; --warn-soft: rgba(240, 180, 76, 0.13);
  --bad: #f27a70;  --bad-soft: rgba(242, 122, 112, 0.13);
  --mark: #ffc547;
  --mark-soft: rgba(255, 197, 71, 0.12);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.55);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
.num, td.n, th.n, .tabular { font-variant-numeric: tabular-nums; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--accent-line); outline-offset: 2px; border-radius: 4px; }

/* ------------------------------------------------------------- shell */

.app {
  display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); min-height: 100vh;
  /* the sidebar colour runs the full page height, also below the sticky sidebar */
  background: linear-gradient(90deg, var(--surface) calc(var(--sidebar) - 1px), var(--border) calc(var(--sidebar) - 1px), var(--border) var(--sidebar), transparent var(--sidebar));
}

.sidebar {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; gap: 4px;
  padding: 18px 12px 14px;
  background: var(--surface);
  border-right: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; padding: 2px 8px 16px; text-decoration: none; }
.brand-mark {
  width: 32px; height: 32px; border-radius: 9px; flex: none;
  display: grid; place-items: center;
  background: var(--accent); color: var(--accent-ink); font-weight: 800; font-size: 15px;
}
.brand-name { font-weight: 700; font-size: 15px; letter-spacing: -0.01em; line-height: 1.2; }
.brand-sub { color: var(--muted); font-size: 11.5px; letter-spacing: 0.04em; }

.nav { display: flex; flex-direction: column; gap: 1px; }
.nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 10px; border-radius: 7px;
  color: var(--text-2); text-decoration: none; font-weight: 500;
}
.nav a:hover { background: var(--surface-3); color: var(--text); }
.nav a[aria-current="page"] { background: var(--surface-3); color: var(--text); font-weight: 650; box-shadow: inset 3px 0 0 var(--accent); }
.nav svg { width: 17px; height: 17px; flex: none; opacity: 0.85; }
.nav .badge { margin-left: auto; }
.nav-sep { height: 1px; background: var(--border); margin: 8px 6px; }

.side-foot { margin-top: auto; padding: 10px 8px 0; color: var(--muted); font-size: 12px; display: flex; flex-direction: column; gap: 10px; }
.keys { display: grid; grid-template-columns: auto 1fr; gap: 3px 8px; align-items: center; }
kbd {
  display: inline-block; min-width: 18px; padding: 0 5px; text-align: center;
  border: 1px solid var(--border-strong); border-bottom-width: 2px; border-radius: 4px;
  font: 11px/16px ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--text-2); background: var(--surface-2);
}

.main { min-width: 0; display: flex; flex-direction: column; }

.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 16px;
  padding: 10px 24px; min-height: 58px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid var(--border);
}
.topbar h1 { font-size: 18px; margin: 0; font-weight: 700; letter-spacing: -0.015em; white-space: nowrap; }
.top-stats { display: flex; align-items: center; gap: 6px; margin-left: auto; min-width: 0; }
.stat {
  display: flex; flex-direction: column; justify-content: center;
  padding: 3px 12px; min-width: 0; border-left: 1px solid var(--border);
}
.stat:first-child { border-left: 0; }
.stat-label { font-size: 11px; color: var(--muted); line-height: 1.3; white-space: nowrap; }
.stat-value { font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.stat-value .sub { color: var(--muted); font-weight: 500; }
.stat-next .stat-value { max-width: 240px; }
.meter { height: 4px; border-radius: 2px; background: var(--surface-3); margin-top: 3px; overflow: hidden; width: 100%; min-width: 90px; }
.meter > i { display: block; height: 100%; background: var(--text); border-radius: 2px; }
.meter.warn > i { background: var(--warn); }
.meter.bad > i { background: var(--bad); }
.top-actions { display: flex; gap: 4px; align-items: center; }

.icon-btn {
  display: inline-grid; place-items: center; width: 32px; height: 32px;
  border: 1px solid transparent; border-radius: 8px; background: transparent; cursor: pointer; color: var(--text-2);
}
.icon-btn:hover { background: var(--surface-3); color: var(--text); }
.icon-btn svg { width: 17px; height: 17px; }
.icon-btn.spin svg { animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap;
  background: var(--surface-3); color: var(--text-2);
}
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.plain::before { display: none; }
.tone-ok { background: var(--ok-soft); color: var(--ok); }
.tone-info { background: var(--info-soft); color: var(--info); }
.tone-warn { background: var(--warn-soft); color: var(--warn); }
.tone-bad { background: var(--bad-soft); color: var(--bad); }
.tone-muted { background: var(--surface-3); color: var(--muted); }
.tone-accent { background: var(--accent-soft); color: var(--text); }

.badge {
  display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px;
  border-radius: 999px; font-size: 11.5px; font-weight: 700; font-variant-numeric: tabular-nums;
  background: var(--accent); color: var(--accent-ink);
}
.badge.quiet { background: var(--surface-3); color: var(--text-2); }

.banner {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin: 16px 24px 0; padding: 10px 14px; border-radius: var(--radius);
  border: 1px solid; font-size: 13.5px;
}
.banner strong { font-weight: 700; }
.banner .grow { flex: 1; min-width: 200px; }
.banner.warn { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 30%, transparent); color: var(--text); }
.banner.bad { background: var(--bad-soft); border-color: color-mix(in srgb, var(--bad) 30%, transparent); color: var(--text); }
.banner.info { background: var(--info-soft); border-color: color-mix(in srgb, var(--info) 25%, transparent); color: var(--text); }
.banner svg { width: 18px; height: 18px; flex: none; }
.banner.warn svg { color: var(--warn); } .banner.bad svg { color: var(--bad); } .banner.info svg { color: var(--info); }

.view { padding: 20px 24px 48px; display: flex; flex-direction: column; gap: 16px; min-width: 0; }

/* ------------------------------------------------------------- cards & grids */

.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); min-width: 0;
}
.card-head {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 12px 16px; border-bottom: 1px solid var(--border);
}
.card-head h2 { font-size: 14px; font-weight: 700; margin: 0; letter-spacing: -0.005em; }
.card-head .hint { color: var(--muted); font-size: 12.5px; }
.card-head .right { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.card-tools { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; justify-content: space-between; padding: 10px 16px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.card-tools .search { min-width: 260px; }
.card-tools > .chips { flex: 1 1 320px; min-width: 0; }
.card-body { padding: 14px 16px; }
.card-body.flush { padding: 0; }
.link-btn { background: none; border: 0; padding: 0; color: var(--text-2); font-size: 12.5px; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--border-strong); }
.link-btn:hover { color: var(--text); text-decoration-color: currentColor; }

.grid-2 { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(320px, 1fr); gap: 16px; align-items: start; }
.grid-2-even { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }

.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.tile { padding: 14px 16px 12px; display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto auto auto; gap: 2px 12px; }
.tile-label { color: var(--text-2); font-size: 12.5px; font-weight: 600; grid-column: 1 / -1; }
.tile-value { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; line-height: 1.25; align-self: end; white-space: nowrap; }
.tile-value .unit { font-size: 14px; font-weight: 600; color: var(--text-2); margin-left: 2px; letter-spacing: 0; }
.tile svg.spark { grid-row: 2; grid-column: 2; align-self: end; }
.tile-foot { grid-column: 1 / -1; display: flex; gap: 2px 8px; align-items: baseline; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.delta { font-weight: 650; font-variant-numeric: tabular-nums; }
.delta.up { color: var(--ok); } .delta.down { color: var(--bad); }
svg.spark { overflow: visible; }
svg.minibars { display: block; }
svg.minibars .b { fill: var(--text-2); opacity: 0.7; }
svg.minibars .b.zero { fill: var(--border-strong); opacity: 1; }
svg.spark .line { fill: none; stroke: var(--mark); stroke-width: 1.75; stroke-linejoin: round; stroke-linecap: round; }
svg.spark .area { fill: var(--mark-soft); stroke: none; }
svg.spark .dot { fill: var(--mark); }

/* ------------------------------------------------------------- tables */

.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.chips { display: flex; gap: 4px; flex-wrap: wrap; }
.chip {
  border: 1px solid var(--border); background: var(--surface); border-radius: 999px;
  padding: 3px 11px; font-size: 12.5px; cursor: pointer; color: var(--text-2); white-space: nowrap;
}
.chip:hover { border-color: var(--border-strong); color: var(--text); }
.chip[aria-pressed="true"] { background: var(--text); border-color: var(--text); color: var(--surface); font-weight: 600; }
.chip .count { opacity: 0.65; margin-left: 4px; font-variant-numeric: tabular-nums; }

.search {
  display: flex; align-items: center; gap: 6px; min-width: 220px;
  border: 1px solid var(--border); background: var(--surface); border-radius: 8px; padding: 0 8px; height: 32px;
}
.search svg { width: 15px; height: 15px; color: var(--muted); flex: none; }
.search input { border: 0; background: transparent; outline: none; width: 100%; height: 30px; font-size: 13px; }
.search:focus-within { border-color: var(--accent-line); box-shadow: 0 0 0 3px var(--accent-soft); }
select.select, input.input, textarea.input {
  border: 1px solid var(--border-strong); background: var(--surface); border-radius: 7px; padding: 5px 9px; font-size: 13px;
}
select.select { height: 32px; padding-right: 28px; }
input.input { height: 34px; }
textarea.input { width: 100%; resize: vertical; min-height: 60px; line-height: 1.5; }
input.input:focus, textarea.input:focus, select.select:focus { outline: none; border-color: var(--accent-line); box-shadow: 0 0 0 3px var(--accent-soft); }

.table-wrap { overflow: auto; max-height: calc(100vh - 220px); }
.table-wrap.short { max-height: 460px; }
.table-wrap.auto { max-height: none; }
table.data { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
table.data th {
  position: sticky; top: 0; z-index: 1;
  background: var(--surface-2); color: var(--muted); font-weight: 600; font-size: 12px; text-align: left;
  padding: 8px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; user-select: none;
}
table.data th.sortable { cursor: pointer; }
table.data th.sortable:hover { color: var(--text); }
table.data th .arrow { display: inline-block; width: 10px; margin-left: 3px; opacity: 0.8; }
table.data td { padding: 8px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.data tr:last-child td { border-bottom: 0; }
table.data td.n, table.data th.n { text-align: right; white-space: nowrap; }
table.data td.nowrap { white-space: nowrap; }
table.data td.muted { color: var(--muted); }
table.data tbody tr.clickable { cursor: pointer; }
table.data tbody tr.clickable:hover td { background: var(--surface-2); }
table.data tbody tr.is-sel td { background: var(--sel); }
table.data tbody tr.is-sel td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
table.data td.grow { width: 100%; max-width: 0; }
table.data td.grow .cell-title, table.data td.grow .cell-sub { max-width: 100%; }
.show-sm { display: none; }
.nowrap { white-space: nowrap; }
.cell-title { font-weight: 600; color: var(--text); display: block; max-width: 520px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cell-sub { color: var(--muted); font-size: 12px; display: block; max-width: 520px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cell-wrap { display: block; color: var(--text-2); font-size: 12.5px; white-space: pre-wrap; overflow-wrap: anywhere; }
.cell-clip { display: block; max-width: 340px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tag { font: 11.5px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--muted); }
.kind {
  display: inline-block; font-size: 11.5px; font-weight: 650; padding: 1px 7px; border-radius: 5px; white-space: nowrap;
  background: var(--surface-3); color: var(--text-2);
}
.kind.k-video { background: var(--accent-soft); color: var(--text); }
.kind.k-order { background: var(--info-soft); color: var(--info); }
.status-dot { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; font-size: 12.5px; font-weight: 600; }
.status-dot::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: none; }
.status-dot.ok { color: var(--ok); } .status-dot.info { color: var(--info); } .status-dot.warn { color: var(--warn); }
.status-dot.bad { color: var(--bad); } .status-dot.muted { color: var(--muted); }
.links { display: flex; gap: 4px; flex-wrap: wrap; }
.links a, a.ext {
  display: inline-flex; align-items: center; gap: 3px; font-size: 12px; padding: 1px 7px; border-radius: 5px;
  border: 1px solid var(--border); text-decoration: none; color: var(--text-2); white-space: nowrap; background: var(--surface);
}
.links a:hover, a.ext:hover { border-color: var(--border-strong); color: var(--text); }
.empty { padding: 28px 16px; text-align: center; color: var(--muted); font-size: 13px; }
.empty strong { display: block; color: var(--text-2); font-size: 13.5px; margin-bottom: 2px; }

/* ------------------------------------------------------------- overview lists */

.dept-list { list-style: none; margin: 0; padding: 4px 0; }
.dept-list li {
  display: grid; grid-template-columns: 10px minmax(0, 1fr) auto auto; gap: 10px; align-items: center;
  padding: 7px 16px; cursor: pointer;
}
.dept-list li:hover { background: var(--surface-2); }
.dept-list .dot { width: 8px; height: 8px; border-radius: 50%; }
.dot.ok { background: var(--ok); } .dot.info { background: var(--info); } .dot.warn { background: var(--warn); }
.dot.bad { background: var(--bad); } .dot.muted { background: var(--border-strong); }
.dept-name { font-weight: 600; font-size: 13px; }
.dept-line { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dept-usd { font-size: 12px; color: var(--text-2); font-variant-numeric: tabular-nums; text-align: right; min-width: 48px; }

.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.week .day { border-left: 1px solid var(--border); padding: 10px 10px 12px; min-height: 120px; min-width: 0; }
.week .day:first-child { border-left: 0; }
.week .day.today { background: var(--accent-soft); }
.week .day-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; font-size: 12px; color: var(--muted); font-weight: 600; }
.week .day.today .day-head { color: var(--text); }
.week .ev { display: flex; gap: 6px; align-items: baseline; font-size: 12px; padding: 2px 0; min-width: 0; }
.week .ev time { color: var(--muted); font-variant-numeric: tabular-nums; flex: none; font-size: 11.5px; }
.week .ev span.t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.week .more { font-size: 11.5px; color: var(--muted); padding-top: 2px; }
.pf { width: 7px; height: 7px; border-radius: 2px; flex: none; align-self: center; background: var(--muted); }
.pf.youtube { background: #e5484d; } .pf.tiktok { background: #10141c; } .pf.instagram { background: #c2449f; }
.pf.threads { background: #6f7887; } .pf.site { background: #2459c2; }
:root[data-theme="dark"] .pf.tiktok { background: #e8ebf1; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .pf.tiktok { background: #e8ebf1; } }

.feed { list-style: none; margin: 0; padding: 4px 0; }
.feed li { display: grid; grid-template-columns: 82px 1fr; gap: 12px; padding: 7px 16px; font-size: 13px; align-items: baseline; }
.feed time { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.feed .txt { min-width: 0; }
.feed .k { margin-right: 6px; }

/* ------------------------------------------------------------- KPI */

.progress { position: relative; height: 6px; border-radius: 3px; background: var(--surface-3); min-width: 120px; }
.progress > i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 3px; background: var(--text); }
.progress > b { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--border-strong); }
.funnel { display: flex; flex-direction: column; gap: 10px; }
.funnel-row { display: grid; grid-template-columns: 120px minmax(0, 1fr) 70px 64px; gap: 10px; align-items: center; font-size: 13px; }
.funnel-row .bar { height: 18px; border-radius: 4px; background: var(--surface-3); overflow: hidden; }
.funnel-row .bar > i { display: block; height: 100%; background: var(--mark); border-radius: 4px; min-width: 2px; }
.funnel-row .rate { color: var(--muted); font-size: 12px; text-align: right; font-variant-numeric: tabular-nums; }
.funnel-row .val { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.budget-top { display: flex; gap: 28px; flex-wrap: wrap; margin-bottom: 12px; }
.kv { display: flex; flex-direction: column; }
.kv .k { color: var(--muted); font-size: 12px; }
.kv .v { font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.kv .v small { font-size: 12.5px; color: var(--muted); font-weight: 500; }
svg.bars { width: 100%; height: 150px; display: block; }
svg.bars .b { fill: var(--mark); }
svg.bars .b.over { fill: var(--warn); }
svg.bars .b:hover { opacity: 0.75; }
svg.bars .grid { stroke: var(--border); stroke-width: 1; }
svg.bars .target { stroke: var(--text-2); stroke-width: 1; stroke-dasharray: 4 3; }
svg.bars text { fill: var(--muted); font-size: 10.5px; font-family: var(--font); }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); margin-top: 6px; }
.legend i { display: inline-block; width: 14px; height: 0; border-top: 1px dashed var(--text-2); vertical-align: middle; margin-right: 5px; }
.legend i.box { width: 9px; height: 9px; border: 0; background: var(--mark); border-radius: 2px; }
.flag-list { margin: 0; padding: 0; list-style: none; }
.flag-list li { display: flex; gap: 10px; padding: 8px 16px; border-bottom: 1px solid var(--border); font-size: 13px; align-items: baseline; }
.flag-list li:last-child { border-bottom: 0; }
.flag-list svg { width: 15px; height: 15px; color: var(--warn); flex: none; transform: translateY(2px); }

/* ------------------------------------------------------------- calendar page */

.cal-week + .cal-week { border-top: 1px solid var(--border); }
.cal-week-label { padding: 8px 16px; font-size: 12px; font-weight: 650; color: var(--muted); background: var(--surface-2); border-bottom: 1px solid var(--border); }
.cal-week .week .day { min-height: 150px; }

/* ------------------------------------------------------------- journal */

.timeline { list-style: none; margin: 0; padding: 0; }
.tl-day { padding: 8px 16px; font-size: 12px; font-weight: 700; color: var(--muted); background: var(--surface-2); border-bottom: 1px solid var(--border); position: sticky; top: 0; }
.tl-item { display: grid; grid-template-columns: 52px 86px minmax(0, 1fr); gap: 12px; padding: 8px 16px; border-bottom: 1px solid var(--border); font-size: 13px; align-items: baseline; }
.tl-item time { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 12px; }

/* ------------------------------------------------------------- commands page */

.cmd-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.form { display: flex; flex-direction: column; gap: 12px; }
.form-row { display: flex; gap: 10px; align-items: end; flex-wrap: wrap; }
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field.grow { flex: 1; min-width: 180px; }
.field > span { font-size: 12px; color: var(--text-2); font-weight: 600; }
.field > small { font-size: 11.5px; color: var(--muted); }
.field input.input { width: 100%; }
.caps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.counter { font-size: 11.5px; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
.seg { display: inline-flex; border: 1px solid var(--border-strong); border-radius: 8px; overflow: hidden; height: 34px; }
.seg button { border: 0; background: var(--surface); padding: 0 14px; cursor: pointer; color: var(--text-2); border-left: 1px solid var(--border-strong); }
.seg button:first-child { border-left: 0; }
.seg button[aria-pressed="true"] { background: var(--text); color: var(--surface); font-weight: 650; }
.note { font-size: 12.5px; color: var(--muted); margin: 0; }
.note.warn { color: var(--warn); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 34px; padding: 0 14px; border-radius: 8px; cursor: pointer; white-space: nowrap;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font-weight: 600; font-size: 13px;
}
.btn:hover { background: var(--surface-3); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(0.96); }
.btn.dark { background: var(--text); border-color: var(--text); color: var(--surface); }
.btn.danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, var(--border-strong)); }
.btn.danger:hover { background: var(--bad-soft); }
.btn.sm { height: 28px; padding: 0 10px; font-size: 12.5px; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; filter: none; }
.btn.armed { box-shadow: 0 0 0 3px var(--accent-soft), 0 0 0 1px var(--accent-line); }
.btn svg { width: 15px; height: 15px; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ------------------------------------------------------------- drawer */

.scrim { position: fixed; inset: 0; background: rgba(11, 14, 20, 0.28); z-index: 40; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 50;
  width: min(600px, 100vw); display: flex; flex-direction: column;
  background: var(--surface); border-left: 1px solid var(--border); box-shadow: var(--shadow-lg);
}
.drawer[hidden], .scrim[hidden] { display: none; }
.drawer-head { display: flex; gap: 12px; align-items: flex-start; padding: 16px 18px 14px; border-bottom: 1px solid var(--border); }
.drawer-head .titles { flex: 1; min-width: 0; }
.drawer-head h2 { margin: 4px 0 2px; font-size: 16.5px; line-height: 1.4; letter-spacing: -0.01em; }
.drawer-head .meta { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; color: var(--muted); font-size: 12px; }
.drawer-body { flex: 1; overflow: auto; padding: 4px 18px 24px; }
.drawer-status:empty { display: none; }
.drawer-status { padding: 10px 18px; border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 6px; background: var(--surface-2); font-size: 12.5px; }
.section { padding: 14px 0; border-bottom: 1px solid var(--border); }
.section:last-child { border-bottom: 0; }
.section h3 { margin: 0 0 8px; font-size: 12px; color: var(--muted); font-weight: 700; letter-spacing: 0.02em; }
.section p { margin: 0; }
.prose { white-space: pre-wrap; overflow-wrap: anywhere; }
.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.facts .kv .v { font-size: 15px; }
.choice-list { display: flex; flex-direction: column; gap: 6px; }
.choice {
  display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border-radius: 8px;
  border: 1px solid var(--border); cursor: pointer;
}
.choice:hover { border-color: var(--border-strong); }
.choice:has(input:checked) { border-color: var(--accent-line); background: var(--accent-soft); }
.choice input { margin: 3px 0 0; accent-color: #10141c; }
.choice .no { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; min-width: 16px; }
.thumbs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.thumb-choice { border: 2px solid var(--border); border-radius: 9px; padding: 0; overflow: hidden; cursor: pointer; position: relative; background: var(--surface-2); }
.thumb-choice:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.thumb-choice input { position: absolute; top: 8px; left: 8px; accent-color: #10141c; width: 16px; height: 16px; margin: 0; }
.thumb-choice .cap { display: block; padding: 5px 8px; font-size: 12px; color: var(--text-2); font-weight: 600; }
.media { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: var(--surface-3); }
.media.portrait { aspect-ratio: 9 / 16; }
.media.cover { aspect-ratio: 3 / 4; }
.media-missing { display: grid; place-items: center; color: var(--muted); font-size: 12px; }
.frames { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.frames .media { border-radius: 7px; }
.short-block + .short-block { margin-top: 12px; }
.short-head { display: flex; justify-content: space-between; gap: 8px; align-items: center; margin-bottom: 6px; font-size: 13px; font-weight: 600; }
ul.plain { margin: 0; padding-left: 18px; }
ul.plain li { margin: 2px 0; }
.problems li { color: var(--bad); }
.checks li::marker { color: var(--ok); }
.action { border: 1px solid var(--border); border-radius: 9px; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.action + .action { margin-top: 10px; }
.action.primary-action { border-color: color-mix(in srgb, var(--accent-line) 55%, var(--border)); background: color-mix(in srgb, var(--accent-soft) 45%, var(--surface)); }
.action-title { font-size: 12.5px; font-weight: 700; color: var(--text-2); }
.issue-row { display: grid; grid-template-columns: 110px minmax(0, 1fr) 28px; gap: 8px; align-items: start; }
.understood { background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; font-size: 13px; }
.understood code { font: 12px ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--text-2); }

.cover-row { display: flex; gap: 18px; align-items: flex-start; }
.cover-wrap { width: 140px; flex: none; border-radius: 8px; overflow: hidden; border: 1px solid var(--border); }
.facts.facts-col { grid-template-columns: minmax(0, 1fr); gap: 12px; }
.meter-row { display: flex; align-items: center; gap: 12px; margin-bottom: 4px; }
.meter-row .meter { flex: 1; margin: 0; height: 6px; border-radius: 3px; }
.meter-row .note { white-space: nowrap; }
.path-cell { display: inline-flex; align-items: center; gap: 2px; max-width: 100%; }
.path-cell .cell-clip { max-width: 240px; direction: rtl; text-align: left; }
.section-chart { margin-top: 12px; }
.section-chart svg { max-width: 100%; height: auto; }

/* ------------------------------------------------------------- toasts */

.toasts { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 60; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: var(--text); color: var(--surface); padding: 9px 14px; border-radius: 9px; font-size: 13px; box-shadow: var(--shadow-lg); max-width: min(560px, calc(100vw - 32px)); pointer-events: auto; }
.toast.bad { background: var(--bad); color: #fff; }

.loading { padding: 60px; text-align: center; color: var(--muted); }

/* ------------------------------------------------------------- responsive */

@media (max-width: 1360px) {
  .stat-next { display: none; }
}
@media (max-width: 1180px) {
  .grid-2 { grid-template-columns: minmax(0, 1fr); }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cmd-grid, .grid-2-even { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .app { grid-template-columns: minmax(0, 1fr); background: none; }
  .tile svg.spark { display: none; }
  .sidebar {
    position: sticky; top: 0; z-index: 30; height: auto; flex-direction: row; align-items: center;
    padding: 8px 12px; gap: 8px; border-right: 0; border-bottom: 1px solid var(--border); overflow: hidden;
  }
  .brand { padding: 0; }
  .brand-text, .side-foot, .nav-sep { display: none; }
  .nav { flex-direction: row; overflow-x: auto; scrollbar-width: none; gap: 2px; flex: 1; }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { white-space: nowrap; padding: 6px 10px; font-size: 13px; }
  .nav a[aria-current="page"] { box-shadow: inset 0 -2px 0 var(--accent); }
  .nav svg { display: none; }
  .topbar { position: static; flex-wrap: wrap; padding: 10px 16px; gap: 8px; }
  .top-stats { order: 3; width: 100%; margin-left: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .stat { border-left: 0; padding: 6px 10px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; }
  .stat-next { display: flex; grid-column: 1 / -1; order: 9; }
  .show-sm { display: inline; }
  .card-tools .search { min-width: 0; }
  .stat-next .stat-value { max-width: none; }
  .top-actions { margin-left: auto; }
  .banner { margin: 12px 16px 0; }
  .view { padding: 14px 16px 40px; gap: 12px; }
  .tiles { gap: 10px; }
  .tile { padding: 12px; }
  .tile-value { font-size: 21px; }
  .tile svg.spark { width: 64px; }
  .week { grid-template-columns: minmax(0, 1fr); }
  .week .day { border-left: 0; border-top: 1px solid var(--border); min-height: 0; display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 8px; }
  .week .day:first-child { border-top: 0; }
  .week .day-head { flex-direction: column; margin: 0; }
  .week .day:not(:has(.ev)) { display: none; }
  .caps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .table-wrap { max-height: none; }
  .cover-wrap { width: 110px; }
  .hide-sm { display: none; }
  .cell-title, .cell-sub { max-width: 62vw; }
  .search { min-width: 0; flex: 1; }
  .funnel-row { grid-template-columns: 96px minmax(0, 1fr) 56px; }
  .funnel-row .rate { display: none; }
  .tl-item { grid-template-columns: 44px minmax(0, 1fr); }
  .tl-item .kind-cell { display: none; }
  .feed li { grid-template-columns: 70px 1fr; }
}

/* confirm step for every command (Round 7b) */
dialog.confirm { border: 1px solid var(--border); border-radius: 12px; padding: 20px 22px; width: min(440px, calc(100vw - 32px));
  background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg); }
dialog.confirm::backdrop { background: rgba(16, 20, 28, .45); }
dialog.confirm .confirm-title { font-weight: 700; font-size: 16px; margin-bottom: 8px; }
dialog.confirm .confirm-what { font-size: 14px; line-height: 1.55; margin: 0 0 6px; word-break: keep-all; overflow-wrap: anywhere; }
dialog.confirm .btn-row { justify-content: flex-end; margin-top: 16px; }

/* 개발실 */
.dev-jobs { display: grid; gap: 12px; }
.dev-job { border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; display: grid; gap: 8px; background: var(--surface, transparent); }
.dev-job-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.dev-job-head strong { font-weight: 600; }
.dev-summary { margin: 0; white-space: pre-wrap; word-break: break-word; font-family: inherit; font-size: 13px; line-height: 1.55; max-height: 360px; overflow: auto; }
textarea.input { width: 100%; resize: vertical; font: inherit; }
