/* reiz design system: tokens, app bar, mobile tab bar, and the components every page shares.
   Flat surfaces on a soft gray canvas, large type, one blue accent. No Tailwind dependency. */

:root {
  color-scheme: light;
  --bg: #f2f4f6;
  --surface: #ffffff;
  --surface-2: #f9fafb;
  --fill: #f2f4f6;
  --fill-strong: #e5e8eb;
  --border: #eef0f3;
  --border-strong: #d1d6db;
  --text: #191f28;
  --text-2: #4e5968;
  --text-3: #8b95a1;
  --accent: #3182f6;
  --accent-hover: #1b64da;
  --accent-soft: #e8f3ff;
  --accent-text: #1b64da;
  --ok: #00a661;
  --ok-soft: #e5f8ef;
  --warn: #e08600;
  --warn-soft: #fff4e0;
  --bad: #f04452;
  --bad-soft: #ffeeef;
  --focus: 0 0 0 3px rgba(49, 130, 246, 0.25);
  --shadow: 0 2px 8px rgba(0, 23, 51, 0.04);
  --shadow-float: 0 12px 40px rgba(0, 23, 51, 0.14);
  --radius-lg: 24px;
  --radius: 18px;
  --radius-sm: 14px;
  --radius-xs: 10px;
  --bar-h: 60px;
  --tab-h: 64px;
  --font: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo",
    "Malgun Gothic", "Segoe UI", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, "Pretendard Variable", Pretendard, monospace;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #101013;
    --surface: #1c1c21;
    --surface-2: #232329;
    --fill: #26262d;
    --fill-strong: #32323a;
    --border: #2a2a31;
    --border-strong: #3d3d46;
    --text: #f2f3f5;
    --text-2: #b0b8c1;
    --text-3: #7e8791;
    --accent: #4a92ff;
    --accent-hover: #6ba6ff;
    --accent-soft: #1a2a45;
    --accent-text: #7fb2ff;
    --ok: #2fd18a;
    --ok-soft: #12291f;
    --warn: #ffb547;
    --warn-soft: #2e2413;
    --bad: #ff6b76;
    --bad-soft: #36181c;
    --focus: 0 0 0 3px rgba(74, 146, 255, 0.35);
    --shadow: none;
    --shadow-float: 0 16px 48px rgba(0, 0, 0, 0.55);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  word-break: keep-all;
  overflow-wrap: anywhere;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
img, svg { display: block; }
[hidden] { display: none !important; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: var(--radius-xs); }

/* ---------- layout ---------- */
.container { width: 100%; max-width: 1040px; margin: 0 auto; padding: 0 24px; }
.container.narrow { max-width: 680px; }
.page { padding: 36px 0 72px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-eyebrow { margin: 0 0 6px; color: var(--text-3); font-size: 15px; font-weight: 600; }
.page-title { margin: 0; font-size: 28px; line-height: 1.3; font-weight: 700; letter-spacing: -0.03em; }
.page-sub { margin: 8px 0 0; color: var(--text-2); font-size: 16px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.stack-lg { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; align-items: center; gap: 8px; }
.grow { flex: 1 1 auto; min-width: 0; }
.grid { display: grid; gap: 12px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 860px) { .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr); } }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.small { font-size: 14px; }
.tiny { font-size: 13px; }
.mono { font-family: var(--mono); font-size: 0.92em; }
.num { font-variant-numeric: tabular-nums; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- app bar (desktop) ---------- */
.app-bar {
  position: sticky; top: 0; z-index: 40; height: var(--bar-h);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.8) blur(16px);
  -webkit-backdrop-filter: saturate(1.8) blur(16px);
}
.app-bar .container { height: 100%; display: flex; align-items: center; gap: 28px; }
.brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; font-size: 20px; letter-spacing: -0.04em; }
.brand-mark {
  width: 28px; height: 28px; border-radius: 9px; color: #fff; display: grid; place-items: center;
  background: linear-gradient(140deg, #5aa2ff 0%, #3182f6 55%, #1b64da 100%);
  font-size: 15px; font-weight: 800; box-shadow: 0 4px 10px rgba(49, 130, 246, 0.3);
}
.nav { display: flex; align-items: center; gap: 4px; }
.nav a {
  padding: 8px 12px; border-radius: 10px; font-size: 15px; font-weight: 600; color: var(--text-3);
  transition: background .15s, color .15s;
}
.nav a:hover { color: var(--text); background: var(--fill); }
.nav a[aria-current="page"] { color: var(--text); }
.bar-right { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.icon-btn {
  position: relative; width: 40px; height: 40px; border-radius: 12px; border: 0; background: transparent;
  display: grid; place-items: center; color: var(--text-2); cursor: pointer; transition: background .15s, color .15s;
}
.icon-btn:hover { background: var(--fill); color: var(--text); }
.icon-btn svg { width: 22px; height: 22px; }
.dot-count {
  position: absolute; top: 5px; right: 4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--bad); color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center;
  box-shadow: 0 0 0 2px var(--bg);
}
.user-chip {
  display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px 0 6px; border-radius: 12px;
  border: 0; background: transparent; cursor: pointer; color: var(--text); font-size: 15px; font-weight: 600;
}
.user-chip:hover { background: var(--fill); }
.avatar {
  width: 30px; height: 30px; border-radius: 50%; color: #fff; display: grid; place-items: center;
  font-size: 13px; font-weight: 700; text-transform: uppercase;
  background: linear-gradient(140deg, #8ec5ff, #3182f6);
}

/* ---------- tab bar (mobile) ---------- */
.tab-bar { display: none; }
@media (max-width: 760px) {
  .app-bar .nav, .user-chip .user-name, .user-chip .badge { display: none; }
  .user-chip { padding: 0 5px; }
  .app-bar .container { gap: 12px; padding: 0 16px; }
  .tab-bar {
    display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 45;
    height: calc(var(--tab-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
    background: color-mix(in srgb, var(--surface) 92%, transparent);
    backdrop-filter: saturate(1.8) blur(16px); -webkit-backdrop-filter: saturate(1.8) blur(16px);
    border-top: 1px solid var(--border);
  }
  .tab-bar a, .tab-bar button {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    border: 0; background: none; color: var(--text-3); font-size: 11px; font-weight: 600; cursor: pointer;
  }
  .tab-bar svg { width: 24px; height: 24px; }
  .tab-bar [aria-current="page"] { color: var(--text); }
  body.has-tabs { padding-bottom: calc(var(--tab-h) + env(safe-area-inset-bottom)); }
}

/* ---------- floating layers ---------- */
.popover {
  position: fixed; z-index: 60; min-width: 240px; max-width: min(380px, calc(100vw - 24px));
  background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow-float);
  overflow: hidden; animation: pop .16s cubic-bezier(.2, .9, .3, 1.2);
}
@keyframes pop { from { opacity: 0; transform: translateY(-6px) scale(.98); } to { opacity: 1; transform: none; } }
.popover-head { padding: 16px 18px 8px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.popover-title { font-weight: 700; font-size: 17px; }
.popover-body { max-height: min(60vh, 480px); overflow-y: auto; padding: 0 8px 8px; }
.popover-foot { padding: 8px; display: flex; gap: 6px; justify-content: flex-end; }
.menu-item {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; border: 0; border-radius: 12px;
  background: transparent; text-align: left; font-size: 16px; font-weight: 500; color: var(--text); cursor: pointer;
}
.menu-item:hover { background: var(--fill); }
.menu-item svg { width: 20px; height: 20px; color: var(--text-3); flex: none; }
.menu-sep { height: 1px; background: var(--border); margin: 6px 8px; }
.menu-label { padding: 10px 14px 4px; font-size: 13px; font-weight: 600; color: var(--text-3); }
.notif-item { display: block; padding: 12px 12px; border-radius: 14px; font-size: 15px; }
.notif-item:hover { background: var(--fill); }
.notif-item .notif-meta { font-size: 13px; color: var(--text-3); margin-bottom: 2px; font-weight: 500; }
.notif-item.is-alert .notif-meta { color: var(--bad); font-weight: 700; }
.scrim { position: fixed; inset: 0; z-index: 55; background: rgba(0, 12, 30, 0.36); animation: fade .16s ease-out; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.sheet {
  position: fixed; z-index: 60; left: 0; right: 0; bottom: 0; max-height: 85vh; overflow-y: auto;
  background: var(--surface); border-radius: 24px 24px 0 0; box-shadow: var(--shadow-float);
  padding: 10px 12px calc(16px + env(safe-area-inset-bottom)); animation: rise .22s cubic-bezier(.2, .9, .3, 1);
}
@keyframes rise { from { transform: translateY(100%); } to { transform: none; } }
.sheet-grip { width: 40px; height: 5px; border-radius: 3px; background: var(--fill-strong); margin: 2px auto 12px; }
.sheet-title { padding: 4px 14px 10px; font-size: 20px; font-weight: 700; }

/* ---------- surfaces ---------- */
.card { background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow); }
.card-pad { padding: 24px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 22px 24px 6px; }
.card-title { margin: 0; font-size: 19px; font-weight: 700; letter-spacing: -0.02em; }
.card-body { padding: 8px 24px 24px; }
@media (max-width: 560px) {
  .card-pad { padding: 20px; }
  .card-head { padding: 20px 20px 4px; }
  .card-body { padding: 8px 20px 20px; }
}
.section-title { margin: 0 0 10px 4px; font-size: 15px; font-weight: 700; color: var(--text-2); }
.list { list-style: none; margin: 0; padding: 4px 8px 8px; }
.list-row { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 16px; transition: background .15s; }
a.list-row:hover, button.list-row:hover { background: var(--fill); }
a.list-row:active { transform: scale(0.99); }
.list-title { font-weight: 600; font-size: 16px; }
.list-meta { font-size: 14px; color: var(--text-3); margin-top: 2px; }
.chev { margin-left: auto; color: var(--fill-strong); flex: none; }
.chev svg { width: 20px; height: 20px; }
.is-locked { opacity: .45; cursor: not-allowed; }

/* app-icon style squircles */
.app-icon {
  flex: none; width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; color: #fff;
  background: linear-gradient(145deg, var(--c1), var(--c2));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 4px 12px -4px var(--c2);
}
.app-icon svg { width: 24px; height: 24px; }
.app-icon.lg { width: 56px; height: 56px; border-radius: 17px; }
.app-icon.lg svg { width: 28px; height: 28px; }
.c-orange { --c1: #ffc15e; --c2: #ff8a3d; }
.c-green { --c1: #4be0a6; --c2: #0fb77a; }
.c-blue { --c1: #6fb1ff; --c2: #3182f6; }
.c-red { --c1: #ff8a96; --c2: #f04452; }
.c-violet { --c1: #b69cff; --c2: #7a5af8; }
.c-gray { --c1: #8b95a1; --c2: #4e5968; }

/* ---------- controls ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 18px;
  border-radius: var(--radius-sm); border: 0; font-size: 16px; font-weight: 600; cursor: pointer; white-space: nowrap;
  transition: background .15s, color .15s, transform .08s, opacity .15s;
}
.btn:active:not(:disabled) { transform: scale(0.97); }
.btn svg { width: 18px; height: 18px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); }
.btn-soft { background: var(--accent-soft); color: var(--accent-text); }
.btn-soft:hover:not(:disabled) { filter: brightness(0.97); }
.btn-secondary { background: var(--fill); color: var(--text); }
.btn-secondary:hover:not(:disabled) { background: var(--fill-strong); }
.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover:not(:disabled) { background: var(--fill); color: var(--text); }
.btn-danger { background: var(--bad-soft); color: var(--bad); }
.btn-sm { height: 36px; padding: 0 14px; font-size: 14px; border-radius: 11px; }
.btn-lg { height: 56px; padding: 0 22px; font-size: 17px; border-radius: 16px; }
.btn-block { width: 100%; }
.link { color: var(--accent-text); font-weight: 600; background: none; border: 0; padding: 0; cursor: pointer; }
.link:hover { text-decoration: underline; text-underline-offset: 3px; }

.field { display: flex; flex-direction: column; gap: 8px; }
.field-label { font-size: 14px; font-weight: 600; color: var(--text-2); padding-left: 2px; }
.input, .select, .textarea {
  width: 100%; height: 54px; padding: 0 16px; border-radius: var(--radius-sm); border: 1.5px solid transparent;
  background: var(--fill); color: var(--text); font-size: 17px; transition: border-color .15s, background .15s, box-shadow .15s;
}
.textarea { height: auto; min-height: 140px; padding: 14px 16px; line-height: 1.6; resize: vertical; }
.input::placeholder, .textarea::placeholder { color: var(--text-3); }
.input:focus, .select:focus, .textarea:focus { outline: none; background: var(--surface); border-color: var(--accent); box-shadow: var(--focus); }
.check { display: inline-flex; align-items: center; gap: 10px; font-size: 15px; color: var(--text-2); cursor: pointer; user-select: none; }
.check input { width: 20px; height: 20px; accent-color: var(--accent); margin: 0; }

/* ---------- feedback ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 9px; border-radius: 8px;
  font-size: 13px; font-weight: 600; background: var(--fill); color: var(--text-2); white-space: nowrap;
}
.badge-accent { background: var(--accent-soft); color: var(--accent-text); }
.badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-bad { background: var(--bad-soft); color: var(--bad); }
.notice {
  display: flex; gap: 12px; align-items: center; padding: 16px 18px; border-radius: var(--radius);
  background: var(--surface); color: var(--text-2); font-size: 15px; box-shadow: var(--shadow);
}
.notice svg { width: 22px; height: 22px; flex: none; }
.notice-warn { background: var(--warn-soft); color: var(--warn); box-shadow: none; }
.notice-bad { background: var(--bad-soft); color: var(--bad); box-shadow: none; }
.notice-ok { background: var(--ok-soft); color: var(--ok); box-shadow: none; }
.notice-accent { background: var(--accent-soft); color: var(--accent-text); box-shadow: none; }
.form-msg { font-size: 14px; color: var(--bad); padding-left: 2px; }
.form-msg.is-ok { color: var(--ok); }
.form-msg:empty, #captchaLogin:empty, #captchaSignup:empty { display: none; }
.empty { padding: 40px 20px; text-align: center; color: var(--text-3); font-size: 15px; }
.skeleton { height: 16px; border-radius: 8px; background: linear-gradient(90deg, var(--fill), var(--surface-2), var(--fill)); background-size: 200% 100%; animation: shimmer 1.2s infinite linear; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.stat-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.stat-chip {
  display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: 12px;
  background: var(--fill); color: var(--text-2); font-size: 14.5px; font-weight: 600;
}
.stat-chip b { color: var(--text); }
.stat-chip.is-hot { background: var(--accent-soft); color: var(--accent-text); }
.stat-chip.is-hot b { color: var(--accent-text); }

.footer { padding: 8px 0 40px; color: var(--text-3); font-size: 13px; text-align: center; }

/* ---------- hero + auth ---------- */
.hero { padding: 28px 28px 24px; }
.hero-date { color: var(--text-3); font-size: 15px; font-weight: 600; }
.hero-title { margin: 6px 0 18px; font-size: 30px; line-height: 1.3; font-weight: 800; letter-spacing: -0.035em; }
@media (max-width: 560px) {
  .hero { padding: 24px 22px 20px; }
  .hero-title { font-size: 26px; }
  .container { padding: 0 16px; }
  .page { padding: 20px 0 56px; }
  .page-title { font-size: 24px; }
}

.auth-wrap { min-height: calc(100vh - var(--bar-h)); display: grid; place-items: center; padding: 24px 16px 72px; }
.auth-card { width: 100%; max-width: 420px; }
.auth-hero { text-align: center; margin-bottom: 28px; }
.auth-hero .app-icon { margin: 0 auto 18px; }
.auth-title { margin: 0; font-size: 28px; font-weight: 800; letter-spacing: -0.035em; }
.auth-sub { margin: 8px 0 0; color: var(--text-2); font-size: 16px; }
.auth-alt { margin-top: 20px; display: flex; justify-content: center; gap: 8px; font-size: 15px; color: var(--text-3); }
/* on the gray auth canvas, fields and the secondary button sit on white */
.auth-card .input { background-color: var(--surface); box-shadow: var(--shadow); }
.auth-card .input:focus { box-shadow: var(--focus); }
.auth-card .btn-secondary { background: var(--surface); box-shadow: var(--shadow); }
.auth-card .btn-secondary:hover:not(:disabled) { background: var(--surface-2); }

/* ---------- content pages ---------- */
.container.medium { max-width: 780px; }
.page-actions { display: flex; align-items: center; gap: 8px; }
.toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.select {
  appearance: none; -webkit-appearance: none; padding-right: 38px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238b95a1' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 18px;
}
.input-sm, .select-sm { height: 44px; font-size: 15px; border-radius: 12px; }
.search-row { display: flex; gap: 8px; padding: 6px 16px 10px; }
.search-row .select { width: 132px; flex: none; }
@media (max-width: 560px) { .search-row { padding: 4px 12px 8px; } .search-row .select { width: 104px; } }
.filter-chip {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 6px 0 12px; border-radius: 10px;
  background: var(--accent-soft); color: var(--accent-text); font-size: 14px; font-weight: 600;
}
.filter-chip button { width: 22px; height: 22px; border: 0; border-radius: 7px; background: transparent; color: inherit; cursor: pointer; display: grid; place-items: center; }
.filter-chip button:hover { background: rgba(0, 0, 0, 0.06); }
.tag { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 7px; background: var(--fill); color: var(--text-2); font-size: 12.5px; font-weight: 600; }
.count-pill { display: inline-flex; align-items: center; gap: 3px; color: var(--accent-text); font-size: 14px; font-weight: 700; }
.meta-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 14px; color: var(--text-3); margin-top: 4px; }
.meta-row .dot::before { content: "·"; }
.avatar-sm { width: 22px; height: 22px; font-size: 11px; }
.pager { display: flex; align-items: center; justify-content: center; gap: 4px; padding: 8px 12px 16px; flex-wrap: wrap; }
.pager button {
  min-width: 38px; height: 38px; padding: 0 8px; border: 0; border-radius: 11px; background: transparent;
  color: var(--text-2); font-size: 15px; font-weight: 600; cursor: pointer;
}
.pager button:hover:not(:disabled) { background: var(--fill); color: var(--text); }
.pager button[aria-current="page"] { background: var(--text); color: var(--surface); }
.pager button:disabled { opacity: .35; cursor: default; }
.progress { height: 8px; border-radius: 4px; background: var(--fill); overflow: hidden; }
.progress > span { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 4px; transition: width .2s; }
.tool-btn {
  min-width: 36px; height: 36px; padding: 0 10px; border: 0; border-radius: 10px; background: var(--fill);
  color: var(--text-2); font-size: 14px; font-weight: 700; cursor: pointer;
}
.tool-btn:hover { background: var(--fill-strong); color: var(--text); }
.file-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; background: var(--fill); }
.file-row .file-icon { width: 36px; height: 36px; border-radius: 10px; background: var(--surface); display: grid; place-items: center; color: var(--text-3); flex: none; }
.file-row .file-icon svg { width: 18px; height: 18px; }
.composer .input { background-color: var(--surface); border-color: var(--border-strong); height: 50px; }
.composer .input.title-input { font-size: 20px; font-weight: 700; height: 58px; }
.composer .textarea { background-color: var(--surface); border-color: var(--border-strong); min-height: 220px; }
.composer .input:focus, .composer .textarea:focus { border-color: var(--accent); }
.preview-box { padding: 16px 18px; border-radius: 14px; background: var(--surface-2); border: 1px dashed var(--border-strong); }
.divider { height: 1px; background: var(--border); margin: 4px 0; }
.state-screen { display: grid; place-items: center; text-align: center; padding: 56px 24px; gap: 14px; }
.state-screen .app-icon { margin: 0 auto; }
.state-screen h2 { margin: 0; font-size: 22px; font-weight: 700; }
.state-screen p { margin: 0; color: var(--text-2); }
.card { scroll-margin-top: calc(var(--bar-h) + 12px); }
@media (max-width: 560px) {
  .search-row .select { width: 116px; padding-left: 12px; padding-right: 30px; background-position: right 8px center; }
}
.post-title { margin: 0; font-size: 26px; line-height: 1.35; font-weight: 800; letter-spacing: -0.035em; }
@media (max-width: 560px) { .post-title { font-size: 22px; } }
.post-media { width: 100%; max-height: 70vh; object-fit: contain; border-radius: 16px; background: var(--fill); display: block; }
.comment-body { font-size: 15.5px; margin-top: 2px; }
a.file-row:hover { background: var(--fill-strong); }
.icon-btn-danger:hover { background: var(--bad-soft); color: var(--bad); }
.thumb-sm { width: 36px; height: 36px; border-radius: 10px; object-fit: cover; flex: none; background: var(--surface); }

/* ---------- finance ---------- */
:root { --up: #f04452; --down: #3182f6; --up-soft: #ffeeef; --down-soft: #e8f3ff; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --up: #ff6b76; --down: #4a92ff; --up-soft: #36181c; --down-soft: #1a2a45; } }
.is-up { color: var(--up); }
.is-down { color: var(--down); }
.big-number { margin: 4px 0 6px; font-size: 34px; line-height: 1.2; font-weight: 800; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; }
@media (max-width: 560px) { .big-number { font-size: 30px; } }
.delta-line { font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; }
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 20px; }
@media (max-width: 700px) { .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.stat { padding: 14px 16px; border-radius: 16px; background: var(--fill); min-width: 0; }
.stat-label { font-size: 13.5px; color: var(--text-3); font-weight: 600; }
.stat-value { margin-top: 4px; font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.chart-wrap { position: relative; padding: 4px 12px 16px; }
.chart-wrap svg { width: 100%; height: 260px; display: block; overflow: visible; }
.chart-tip {
  position: absolute; top: 8px; pointer-events: none; padding: 10px 12px; border-radius: 12px; min-width: 150px;
  background: var(--surface); box-shadow: var(--shadow-float); font-size: 13px; line-height: 1.6; transform: translateX(-50%);
}
.chart-tip b { font-variant-numeric: tabular-nums; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13.5px; color: var(--text-2); font-weight: 600; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.seg { display: inline-flex; padding: 3px; border-radius: 12px; background: var(--fill); gap: 2px; }
.seg button { height: 32px; padding: 0 12px; border: 0; border-radius: 9px; background: transparent; color: var(--text-2); font-size: 14px; font-weight: 600; cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.sym-avatar {
  flex: none; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
  background: var(--fill); color: var(--text-2); font-size: 13px; font-weight: 800; letter-spacing: -0.03em;
}
.row-right { text-align: right; flex: none; font-variant-numeric: tabular-nums; }
.row-right .main { font-weight: 700; }
.row-right .sub { font-size: 13.5px; margin-top: 2px; }
.prose { color: var(--text-2); font-size: 15.5px; line-height: 1.7; margin: 0; }
.kv-note { padding: 14px 16px; border-radius: 16px; background: var(--fill); }
.kv-note .k { font-size: 13px; font-weight: 700; color: var(--text-3); margin-bottom: 4px; }

/* ---------- radio ---------- */
.player-title { font-size: 21px; font-weight: 800; letter-spacing: -0.03em; margin: 2px 0; }
.is-error { color: var(--bad); }
.brand-icon, .brand-text { font-size: 12.5px; font-weight: 800; letter-spacing: -0.02em; }
.play-btn {
  position: relative; flex: none; width: 60px; height: 60px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--accent); color: #fff; display: grid; place-items: center; transition: transform .1s, background .15s;
  box-shadow: 0 8px 20px -8px var(--accent);
}
.play-btn:hover:not(:disabled) { background: var(--accent-hover); }
.play-btn:active:not(:disabled) { transform: scale(0.94); }
.play-btn:disabled { background: var(--fill-strong); color: var(--text-3); box-shadow: none; cursor: default; }
.play-btn svg { width: 26px; height: 26px; grid-area: 1 / 1; }
.play-btn .i-pause, .play-btn .spinner { display: none; }
.player[data-state="playing"] .play-btn .i-play { display: none; }
.player[data-state="playing"] .play-btn .i-pause { display: block; }
.player[data-state="loading"] .play-btn svg { display: none; }
.player[data-state="loading"] .play-btn .spinner { display: block; }
.spinner { grid-area: 1 / 1; width: 24px; height: 24px; border-radius: 50%; border: 3px solid rgba(255, 255, 255, 0.35); border-top-color: #fff; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.volume { display: inline-flex; align-items: center; gap: 8px; color: var(--text-3); }
.volume svg { width: 20px; height: 20px; }
.volume input { width: 96px; accent-color: var(--accent); }
@media (max-width: 560px) { .volume { display: none; } }
.station-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; padding: 4px 8px 12px; }
@media (max-width: 560px) { .station-grid { grid-template-columns: minmax(0, 1fr); } }
.station {
  display: flex; align-items: center; gap: 14px; padding: 12px 14px; border: 0; border-radius: 16px; background: transparent;
  cursor: pointer; color: var(--text); font: inherit; transition: background .15s;
}
.station:hover { background: var(--fill); }
.station[data-selected="true"] { background: var(--accent-soft); }
.station[data-selected="true"] .list-title { color: var(--accent-text); }
.eq { display: none; align-items: flex-end; gap: 2px; height: 16px; flex: none; }
.eq i { width: 3px; background: var(--accent); border-radius: 2px; animation: eq 0.9s ease-in-out infinite; }
.eq i:nth-child(2) { animation-delay: .2s; } .eq i:nth-child(3) { animation-delay: .4s; }
@keyframes eq { 0%, 100% { height: 4px; } 50% { height: 16px; } }
.player[data-state="playing"] ~ .card .station[data-selected="true"] .eq,
body:has(.player[data-state="playing"]) .station[data-selected="true"] .eq { display: inline-flex; }
.player[data-state="idle"] #retryBtn { display: none; }

/* ---------- admin ---------- */
.container.wide { max-width: 1180px; }
.subnav { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; margin: 0 -4px 4px; padding: 0 4px; }
.subnav::-webkit-scrollbar { display: none; }
.subnav a {
  flex: none; height: 38px; padding: 0 14px; border-radius: 12px; display: inline-flex; align-items: center;
  font-size: 15px; font-weight: 600; color: var(--text-3); transition: background .15s, color .15s;
}
.subnav a:hover { color: var(--text); background: var(--fill-strong); }
.subnav a.is-active { color: var(--text); background: var(--surface); box-shadow: var(--shadow); }
.stat-grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 0; }
@media (max-width: 700px) { .stat-grid.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.stat.on-card { background: var(--surface); box-shadow: var(--shadow); }
.stat .stat-value.lg { font-size: 24px; font-weight: 800; letter-spacing: -0.03em; }
.grid-main-side { display: grid; gap: 16px; grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr); align-items: start; }
@media (max-width: 900px) { .grid-main-side { grid-template-columns: minmax(0, 1fr); } }
.code-block {
  margin: 0; padding: 14px 16px; border-radius: 14px; background: var(--fill); color: var(--text-2);
  font-family: var(--mono); font-size: 12.5px; line-height: 1.6; white-space: pre-wrap; word-break: break-word; max-height: 60vh; overflow: auto;
}
.admin-disclosure-toggle {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border: 0; border-radius: 10px;
  background: var(--fill); color: var(--text-2); font-size: 13.5px; font-weight: 600; cursor: pointer;
}
.admin-disclosure-toggle::before { content: attr(data-disclosure-label) " 펼치기"; }
.admin-disclosure-toggle[aria-expanded="true"]::before { content: attr(data-disclosure-label) " 접기"; }
.admin-disclosure-toggle:hover { background: var(--fill-strong); color: var(--text); }
.job-row { display: block; padding: 14px 16px; }
.job-row + .job-row { border-top: 1px solid var(--border); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.kv { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13px; color: var(--text-3); margin-top: 6px; }
.kv b { color: var(--text-2); font-weight: 600; }
.dot-status { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--text-3); margin-right: 8px; vertical-align: 2px; }
.dot-status.ok { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }
.dot-status.warn { background: var(--warn); box-shadow: 0 0 0 3px var(--warn-soft); }
.dot-status.bad { background: var(--bad); box-shadow: 0 0 0 3px var(--bad-soft); }
.empty.is-error { color: var(--bad); }
body:has(.container.wide) .app-bar .container { max-width: 1180px; }
.job-list { padding: 4px 8px 8px; max-height: 72vh; overflow-y: auto; }
.job-item { display: block; width: 100%; text-align: left; padding: 14px 16px; border: 0; border-radius: 16px; background: transparent; color: var(--text); font: inherit; cursor: pointer; transition: background .15s; }
.job-item:hover { background: var(--fill); }
.job-item.is-selected { background: var(--accent-soft); }
.timeline { list-style: none; margin: 0; padding: 0 0 0 18px; border-left: 2px solid var(--border); display: flex; flex-direction: column; gap: 14px; }
.timeline li { position: relative; }
.timeline li::before { content: ""; position: absolute; left: -24px; top: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--surface); border: 2px solid var(--accent); }
.switch { position: relative; flex: none; width: 52px; height: 32px; border: 0; border-radius: 16px; background: var(--fill-strong); cursor: pointer; transition: background .2s; padding: 0; margin-top: 4px; }
.switch span { position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18); transition: transform .2s; }
.switch[aria-checked="true"] { background: var(--accent); }
.switch[aria-checked="true"] span { transform: translateX(20px); }
.switch:disabled { opacity: .6; cursor: wait; }
.sub-card { padding: 18px 20px; border-radius: 18px; background: var(--surface-2); border: 1px solid var(--border); }
.sub-card .file-row { background: var(--surface); }
.agent-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding: 6px 16px 16px; }
@media (max-width: 1000px) { .agent-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 620px) { .agent-grid { grid-template-columns: minmax(0, 1fr); } }
.agent-card { padding: 14px 16px; border-radius: 16px; background: var(--fill); }
.details > summary { cursor: pointer; font-size: 14px; font-weight: 600; color: var(--text-3); list-style: none; }
.details > summary::-webkit-details-marker, .details-card > summary::-webkit-details-marker { display: none; }
.details-card > summary { list-style: none; cursor: pointer; }
.details-chev svg { transition: transform .2s; }
.details-card[open] .details-chev svg { transform: rotate(180deg); }
.sample-table { overflow-x: auto; }
.sample-table table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.sample-table th { text-align: left; font-weight: 600; color: var(--text-3); padding: 8px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.sample-table td { padding: 8px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.sample-table .r { text-align: right; }
.agent-grid > .empty { grid-column: 1 / -1; }
.notice-muted { background: var(--fill); color: var(--text-2); box-shadow: none; }
