/* Renewal Radar — one stylesheet, no build step.
   Dense and quiet on purpose: this is a tool people open next to their accounting software,
   not a landing page they scroll once. */

:root {
  color-scheme: light dark;

  --bg: #faf9f7;
  --bg-soft: #f2f1ed;
  --surface: #ffffff;
  --surface-2: #f7f6f3;
  --border: #e3e1dc;
  --border-strong: #cfccc5;
  --text: #17191b;
  --text-muted: #6a6f75;
  --text-faint: #70757b;

  --accent: #0e7c66;
  --accent-soft: #e2f2ee;
  --accent-text: #0a5c4c;
  --warn: #a35a06;
  --warn-soft: #fdf1e0;
  --danger: #b02a21;
  --danger-soft: #fdeceb;
  --info: #1f52c4;
  --info-soft: #e8eefc;

  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 1px 2px rgba(20, 22, 24, .05), 0 8px 24px -16px rgba(20, 22, 24, .28);
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", "Roboto Mono", Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans KR",
          "Malgun Gothic", "Apple SD Gothic Neo", Helvetica, Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d0f11;
    --bg-soft: #131619;
    --surface: #16191d;
    --surface-2: #1c2025;
    --border: #272c32;
    --border-strong: #363c44;
    --text: #eceef0;
    --text-muted: #9aa1a9;
    --text-faint: #8b939c;

    --accent: #35c9a5;
    --accent-soft: #0f2b26;
    --accent-text: #6fe0c2;
    --warn: #e0a04a;
    --warn-soft: #2c2113;
    --danger: #f0776c;
    --danger-soft: #2e1715;
    --info: #7ba2f5;
    --info-soft: #141d33;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 10px 30px -18px rgba(0, 0, 0, .8);
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { margin: 0 0 .5rem; line-height: 1.25; letter-spacing: -0.014em; font-weight: 640; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1rem; }
p { margin: 0 0 .8rem; }
a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; }
small { font-size: .82rem; }
hr { border: 0; border-top: 1px solid var(--border); margin: 1.5rem 0; }

.num, td.num, .money { font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- layout */

.wrap { max-width: 1180px; margin: 0 auto; padding: 0 1.25rem; }
.wrap-narrow { max-width: 720px; margin: 0 auto; padding: 0 1.25rem; }

.topbar {
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: saturate(140%) blur(8px);
  position: sticky; top: 0; z-index: 20;
}
.topbar-inner { display: flex; align-items: center; gap: 1.25rem; height: 56px; }
.brand { display: flex; align-items: center; gap: .5rem; font-weight: 680; color: var(--text); letter-spacing: -0.02em; }
.brand:hover { text-decoration: none; }
.brand svg { display: block; }
.nav { display: flex; gap: .15rem; margin-left: .5rem; flex: 1; flex-wrap: wrap; }
.nav a {
  padding: .38rem .7rem; border-radius: var(--radius-sm); color: var(--text-muted);
  font-weight: 520; font-size: .92rem;
}
.nav a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.nav a.active { background: var(--accent-soft); color: var(--accent-text); }
.topbar-right { display: flex; align-items: center; gap: .5rem; }

main { padding: 2rem 0 4rem; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.page-head p { color: var(--text-muted); margin: 0; max-width: 60ch; }

.grid { display: grid; gap: 1rem; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.row { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.row-tight { display: flex; gap: .35rem; align-items: center; }
.spread { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.stack > * + * { margin-top: 1rem; }

/* ---------------------------------------------------------------- surfaces */

.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.15rem 1.25rem;
}
.card-tight { padding: .85rem 1rem; }
.card h2, .card h3 { margin-bottom: .35rem; }
.card-title { display: flex; align-items: baseline; justify-content: space-between; gap: .75rem; margin-bottom: .9rem; }
.card-title h2, .card-title h3 { margin: 0; }
.card-title a { font-size: .86rem; font-weight: 520; }

.metric { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.1rem; }
.metric .label { font-size: .78rem; text-transform: uppercase; letter-spacing: .055em; color: var(--text-faint); font-weight: 620; }
.metric .value { font-size: 1.75rem; font-weight: 660; letter-spacing: -0.025em; font-variant-numeric: tabular-nums; margin-top: .3rem; }
.metric .sub { font-size: .84rem; color: var(--text-muted); margin-top: .15rem; }
.metric.accent .value { color: var(--accent-text); }
.metric.warn .value { color: var(--warn); }
.metric.danger .value { color: var(--danger); }

.empty {
  border: 1px dashed var(--border-strong); border-radius: var(--radius);
  padding: 2.5rem 1.5rem; text-align: center; color: var(--text-muted); background: var(--surface);
}
.empty h2 { color: var(--text); }
.empty p { max-width: 46ch; margin: 0 auto .9rem; }

/* ---------------------------------------------------------------- controls */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  padding: .5rem .9rem; border-radius: var(--radius-sm); border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--text); font: inherit; font-weight: 560;
  font-size: .92rem; cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background .12s ease, border-color .12s ease;
}
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: color-mix(in srgb, var(--accent) 88%, #000); }
@media (prefers-color-scheme: dark) {
  .btn-primary { color: #04211b; }
  .btn-primary:hover { background: color-mix(in srgb, var(--accent) 88%, #fff); }
}
.btn-danger { border-color: var(--danger); color: var(--danger); }
.btn-danger:hover { background: var(--danger-soft); }
.btn-sm { padding: .3rem .6rem; font-size: .84rem; }
.btn-ghost { border-color: transparent; background: transparent; color: var(--text-muted); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-lg { padding: .7rem 1.3rem; font-size: 1rem; }
.btn[disabled], .btn.disabled { opacity: .5; pointer-events: none; }

label { display: block; font-weight: 570; font-size: .88rem; margin-bottom: .3rem; }
.hint { font-size: .84rem; color: var(--text-muted); margin-top: .3rem; }
input[type=text], input[type=email], input[type=password], input[type=number],
input[type=date], select, textarea {
  width: 100%; padding: .5rem .65rem; border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); background: var(--surface); color: var(--text);
  font: inherit; font-size: .94rem;
}
input[type=file] { font: inherit; font-size: .9rem; }
textarea { min-height: 5rem; resize: vertical; }
.field { margin-bottom: 1rem; }
.field-row { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.check { display: flex; align-items: flex-start; gap: .55rem; font-weight: 500; }
.check input { margin-top: .25rem; width: auto; }
fieldset { border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.1rem; margin: 0 0 1rem; }
legend { font-weight: 620; font-size: .9rem; padding: 0 .35rem; }

.inline-form { display: inline; }

/* ---------------------------------------------------------------- tables */

.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -1.25rem; padding: 0 1.25rem; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { text-align: left; padding: .6rem .7rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
th {
  font-size: .76rem; text-transform: uppercase; letter-spacing: .05em;
  color: var(--text-faint); font-weight: 640; white-space: nowrap;
  border-bottom-color: var(--border-strong);
}
tbody tr:hover { background: var(--surface-2); }
tbody tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.vendor-cell { display: flex; align-items: center; gap: .55rem; min-width: 0; }
.vendor-cell strong { font-weight: 590; }
.avatar {
  width: 26px; height: 26px; border-radius: 7px; flex: none;
  display: grid; place-items: center; font-size: .72rem; font-weight: 700;
  background: var(--surface-2); color: var(--text-muted); border: 1px solid var(--border);
}

/* ---------------------------------------------------------------- badges */

.badge {
  display: inline-flex; align-items: center; gap: .28rem; padding: .12rem .45rem;
  border-radius: 999px; font-size: .76rem; font-weight: 620; white-space: nowrap;
  background: var(--surface-2); color: var(--text-muted); border: 1px solid var(--border);
}
.badge.ok { background: var(--accent-soft); color: var(--accent-text); border-color: transparent; }
.badge.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.badge.danger { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.badge.info { background: var(--info-soft); color: var(--info); border-color: transparent; }
.dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }

.confidence { display: inline-flex; align-items: center; gap: .3rem; color: var(--text-muted); font-size: .8rem; }
.meter { width: 44px; height: 5px; border-radius: 3px; background: var(--border); overflow: hidden; flex: none; }
.meter span { display: block; height: 100%; background: var(--accent); }
.meter.low span { background: var(--warn); }

/* ---------------------------------------------------------------- notices */

.notice {
  border: 1px solid var(--border); border-left: 3px solid var(--text-faint);
  border-radius: var(--radius-sm); padding: .7rem .9rem; background: var(--surface);
  font-size: .92rem; margin-bottom: 1rem;
}
.notice.ok { border-left-color: var(--accent); background: var(--accent-soft); border-color: transparent; color: var(--accent-text); }
.notice.err { border-left-color: var(--danger); background: var(--danger-soft); border-color: transparent; color: var(--danger); }
.notice.warn { border-left-color: var(--warn); background: var(--warn-soft); border-color: transparent; color: var(--warn); }
.notice.info { border-left-color: var(--info); background: var(--info-soft); border-color: transparent; color: var(--info); }
.notice strong { font-weight: 660; }

.paywall {
  border: 1px dashed var(--border-strong); border-radius: var(--radius);
  padding: 1.1rem 1.25rem; background: var(--surface-2); text-align: center;
}

/* ---------------------------------------------------------------- calendar */

.month-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 1rem;
  margin: 1.75rem 0 .6rem; padding-bottom: .4rem; border-bottom: 1px solid var(--border-strong);
}
.month-head h3 { margin: 0; font-size: .95rem; letter-spacing: .01em; }
.month-head .total { font-variant-numeric: tabular-nums; color: var(--text-muted); font-size: .9rem; }

.renewal {
  display: grid; grid-template-columns: 56px 1fr auto; gap: .9rem; align-items: center;
  padding: .7rem .9rem; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); margin-bottom: .5rem;
}
.renewal + .renewal { margin-top: -1px; }
.daychip {
  text-align: center; border-radius: var(--radius-sm); background: var(--surface-2);
  padding: .3rem 0; border: 1px solid var(--border);
}
.daychip .d { font-size: 1.05rem; font-weight: 680; line-height: 1.1; font-variant-numeric: tabular-nums; }
.daychip .m { font-size: .66rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-faint); font-weight: 640; }
.renewal.soon .daychip { background: var(--warn-soft); border-color: transparent; color: var(--warn); }
.renewal.today .daychip { background: var(--accent-soft); border-color: transparent; color: var(--accent-text); }
.renewal .meta { color: var(--text-muted); font-size: .84rem; display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.renewal .amount { text-align: right; font-variant-numeric: tabular-nums; font-weight: 640; font-size: 1rem; }

/* ---------------------------------------------------------------- charge history */

.spark { display: flex; align-items: flex-end; gap: 3px; height: 56px; margin: .5rem 0 1rem; }
.spark i {
  flex: 1; min-width: 3px; background: var(--accent); opacity: .75; border-radius: 2px 2px 0 0;
  display: block;
}
.spark i.up { background: var(--danger); opacity: 1; }
.spark i.down { background: var(--info); opacity: .9; }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li {
  display: flex; justify-content: space-between; gap: 1rem; padding: .45rem 0;
  border-bottom: 1px solid var(--border); font-size: .9rem;
}
.timeline li:last-child { border-bottom: 0; }
.timeline .when { color: var(--text-muted); font-variant-numeric: tabular-nums; }
.timeline .what { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--mono); font-size: .82rem; color: var(--text-faint); }

/* ---------------------------------------------------------------- tabs */

.tabs { display: flex; gap: .2rem; border-bottom: 1px solid var(--border); margin-bottom: 1.25rem; overflow-x: auto; }
.tabs a {
  padding: .5rem .8rem; color: var(--text-muted); font-weight: 560; font-size: .92rem;
  border-bottom: 2px solid transparent; white-space: nowrap;
}
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a.active { color: var(--text); border-bottom-color: var(--accent); }

.chips { display: flex; gap: .35rem; flex-wrap: wrap; margin-bottom: 1rem; }
.chips a {
  padding: .3rem .7rem; border-radius: 999px; border: 1px solid var(--border);
  color: var(--text-muted); font-size: .86rem; font-weight: 540; background: var(--surface);
}
.chips a:hover { text-decoration: none; background: var(--surface-2); }
.chips a.active { background: var(--text); color: var(--bg); border-color: var(--text); }

/* ---------------------------------------------------------------- landing */

.hero { padding: 4.5rem 0 3rem; text-align: center; }
.hero h1 { font-size: clamp(2rem, 5vw, 3.1rem); letter-spacing: -0.035em; max-width: 18ch; margin: 0 auto 1rem; }
.hero p.lede { font-size: 1.1rem; color: var(--text-muted); max-width: 58ch; margin: 0 auto 1.75rem; }
.hero .cta-row { display: flex; gap: .6rem; justify-content: center; flex-wrap: wrap; }
.hero .trust { margin-top: 1.1rem; color: var(--text-faint); font-size: .87rem; }

.eyebrow {
  display: inline-block; font-size: .76rem; text-transform: uppercase; letter-spacing: .09em;
  font-weight: 680; color: var(--accent-text); background: var(--accent-soft);
  padding: .22rem .6rem; border-radius: 999px; margin-bottom: 1rem;
}
.section { padding: 3rem 0; border-top: 1px solid var(--border); }
.section h2 { font-size: 1.5rem; letter-spacing: -0.02em; margin-bottom: 1.5rem; }
.feature h3 { font-size: 1.02rem; }
.feature p { color: var(--text-muted); margin: 0; font-size: .94rem; }
.steps { counter-reset: step; list-style: none; padding: 0; margin: 0; display: grid; gap: 1rem; }
.steps li { counter-increment: step; display: grid; grid-template-columns: 28px 1fr; gap: .8rem; align-items: start; color: var(--text-muted); }
.steps li::before {
  content: counter(step); width: 26px; height: 26px; border-radius: 50%;
  background: var(--surface-2); border: 1px solid var(--border); display: grid;
  place-items: center; font-size: .8rem; font-weight: 700; color: var(--text);
}

.preview {
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface);
  box-shadow: var(--shadow); overflow: hidden; margin: 2.5rem auto 0; max-width: 900px;
}
.preview-bar { display: flex; gap: .35rem; padding: .6rem .8rem; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.preview-bar i { width: 9px; height: 9px; border-radius: 50%; background: var(--border-strong); display: block; }
.preview-body { padding: 1rem 1.1rem; }

.price-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); align-items: start; }
.price-card { position: relative; }
.price-card.featured { border-color: var(--accent); box-shadow: var(--shadow); }
.price-card .amount { font-size: 2.1rem; font-weight: 680; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.price-card .amount span { font-size: .95rem; font-weight: 500; color: var(--text-muted); letter-spacing: 0; }
.price-card ul { list-style: none; padding: 0; margin: 1rem 0; }
.price-card li { padding: .3rem 0 .3rem 1.4rem; position: relative; color: var(--text-muted); font-size: .92rem; }
.price-card li::before { content: "✓"; position: absolute; left: 0; color: var(--accent); font-weight: 700; }
.ribbon {
  position: absolute; top: -10px; right: 1rem; background: var(--accent); color: #fff;
  font-size: .72rem; font-weight: 700; padding: .15rem .55rem; border-radius: 999px;
  text-transform: uppercase; letter-spacing: .05em;
}
@media (prefers-color-scheme: dark) { .ribbon { color: #04211b; } }

footer.site {
  border-top: 1px solid var(--border); padding: 2rem 0 3rem; color: var(--text-faint);
  font-size: .87rem;
}
footer.site .row { justify-content: space-between; }
footer.site a { color: var(--text-muted); }

/* ---------------------------------------------------------------- utilities */

.muted { color: var(--text-muted); }
.faint { color: var(--text-faint); }
.strong { font-weight: 640; }
.right { text-align: right; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.mono { font-family: var(--mono); font-size: .84em; }
.mt0 { margin-top: 0; } .mt1 { margin-top: .5rem; } .mt2 { margin-top: 1rem; } .mt3 { margin-top: 1.75rem; }
.mb0 { margin-bottom: 0; } .mb1 { margin-bottom: .5rem; } .mb2 { margin-bottom: 1rem; } .mb3 { margin-bottom: 1.75rem; }
.gap-sm { gap: .35rem; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: -999px; top: .5rem; background: var(--surface); padding: .5rem .8rem;
  border: 1px solid var(--accent); border-radius: var(--radius-sm); z-index: 100;
}
.skip-link:focus { left: .5rem; }

details.disclosure { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
details.disclosure > summary {
  cursor: pointer; padding: .75rem 1rem; font-weight: 580; font-size: .93rem; list-style: none;
  display: flex; justify-content: space-between; align-items: center; gap: .5rem;
}
details.disclosure > summary::-webkit-details-marker { display: none; }
details.disclosure > summary::after { content: "＋"; color: var(--text-faint); font-weight: 500; }
details.disclosure[open] > summary::after { content: "－"; }
details.disclosure > .body { padding: 0 1rem 1rem; border-top: 1px solid var(--border); padding-top: 1rem; }

@media (max-width: 720px) {
  .topbar-inner { height: auto; padding: .6rem 0; flex-wrap: wrap; }
  .nav { order: 3; width: 100%; margin-left: 0; }
  .renewal { grid-template-columns: 46px 1fr; }
  .renewal .amount { grid-column: 2; text-align: left; }
  .page-head { flex-direction: column; }
  main { padding: 1.25rem 0 3rem; }
}

@media print {
  .topbar, footer.site, .btn, .chips { display: none !important; }
  body { background: #fff; color: #000; }
  .card, .metric { border-color: #ccc; break-inside: avoid; }
}
