:root {
  --bg: #f7f8fa; --surface: #ffffff; --surface-2: #f1f3f6; --ink: #101828; --ink-2: #475467; --ink-3: #667085;
  --line: #e4e7ec; --accent: #3b5bdb; --accent-ink: #ffffff; --accent-soft: #edf1ff;
  --red: #d92d20; --red-soft: #fef3f2; --amber: #b54708; --amber-soft: #fffaeb; --green: #067647; --green-soft: #ecfdf3;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 4px 16px rgba(16, 24, 40, .06);
  --radius: 12px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0c111d; --surface: #141a29; --surface-2: #1b2234; --ink: #f2f4f7; --ink-2: #c3c9d4; --ink-3: #8c95a6;
    --line: #262f44; --accent: #6b8afd; --accent-ink: #0c111d; --accent-soft: #1c2647;
    --red: #f97066; --red-soft: #2b1615; --amber: #fdb022; --amber-soft: #2b2112; --green: #47cd89; --green-soft: #0f2a1d;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 16px rgba(0, 0, 0, .25);
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; } /* .btn and friends set display, which would otherwise beat the hidden attribute */
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 15px/1.55 Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif; background: var(--bg); color: var(--ink); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.2; letter-spacing: -0.02em; margin: 0; }
p { margin: 0; }
.muted { color: var(--ink-3); }
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 20px; }

/* Buttons and fields */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: inherit; font-weight: 600; padding: 9px 16px; border-radius: 9px; border: 1px solid transparent; background: var(--accent); color: var(--accent-ink); cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { filter: brightness(1.06); text-decoration: none; }
.btn:disabled { opacity: .55; cursor: default; filter: none; }
.btn.ghost { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn.ghost:hover { background: var(--surface-2); filter: none; }
.btn.quiet { background: none; color: var(--ink-2); padding: 6px 10px; }
.btn.quiet:hover { background: var(--surface-2); filter: none; }
.btn.danger { background: none; color: var(--red); border-color: var(--line); }
.btn.lg { padding: 12px 22px; font-size: 1rem; }
.btn.block { width: 100%; }
label { display: grid; gap: 6px; font-weight: 600; font-size: .875rem; color: var(--ink-2); }
input, select, textarea { font: inherit; font-weight: 400; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 9px; padding: 10px 12px; width: 100%; }
input:focus, select:focus, textarea:focus, .btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
textarea { resize: vertical; min-height: 70px; }
.error { color: var(--red); font-size: .875rem; }
.error:empty { display: none; }

/* Brand */
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.05rem; color: var(--ink); letter-spacing: -0.01em; }
.brand:hover { text-decoration: none; }
.brand img { width: 28px; height: 28px; }

/* Landing */
.nav { display: flex; align-items: center; justify-content: space-between; padding: 18px 0; gap: 12px; }
.nav .links { display: flex; align-items: center; gap: 6px; }
.hero { padding: 56px 0 48px; display: grid; grid-template-columns: 1.1fr 1fr; gap: 48px; align-items: center; }
.hero h1 { font-size: clamp(2.1rem, 5vw, 3.2rem); }
.hero .lead { font-size: 1.15rem; color: var(--ink-2); margin: 18px 0 26px; max-width: 34em; }
.hero .fine { margin-top: 12px; font-size: .875rem; }
.preview { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); padding: 8px; }
.section { padding: 56px 0; }
.section > h2 { font-size: 1.75rem; text-align: center; }
.section > .sub { text-align: center; color: var(--ink-2); margin: 10px auto 32px; max-width: 36em; }
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.card h3 { font-size: 1.02rem; margin-bottom: 6px; }
.card p { color: var(--ink-2); }
.step { width: 30px; height: 30px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-weight: 700; display: grid; place-items: center; margin-bottom: 12px; }
.pricing { display: grid; grid-template-columns: repeat(2, minmax(0, 340px)); justify-content: center; gap: 16px; }
.price-card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 26px; display: flex; flex-direction: column; gap: 16px; }
.price-card.featured { border: 2px solid var(--accent); box-shadow: var(--shadow); }
.price { font-size: 2.2rem; font-weight: 700; letter-spacing: -0.03em; }
.price small { font-size: .95rem; font-weight: 500; color: var(--ink-3); letter-spacing: 0; }
.checks { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; color: var(--ink-2); flex: 1; }
.checks li { padding-left: 26px; position: relative; }
.checks li::before { content: ""; position: absolute; left: 2px; top: .3em; width: 14px; height: 8px; border-left: 2px solid var(--green); border-bottom: 2px solid var(--green); transform: rotate(-45deg); }
.faq { max-width: 680px; margin: 0 auto; display: grid; gap: 10px; }
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px; }
.faq summary { font-weight: 600; cursor: pointer; }
.faq details p { margin-top: 8px; color: var(--ink-2); }
footer { border-top: 1px solid var(--line); padding: 24px 0 40px; color: var(--ink-3); font-size: .875rem; }

/* Auth page */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.auth-card { width: 100%; max-width: 400px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); padding: 32px 28px; }
.auth-card h1 { font-size: 1.45rem; margin: 22px 0 6px; }
.auth-card form { display: grid; gap: 14px; margin-top: 22px; }
.auth-card .switch { margin-top: 18px; text-align: center; font-size: .9rem; color: var(--ink-3); }
.auth-card .switch button { font: inherit; color: var(--accent); background: none; border: 0; padding: 0; cursor: pointer; font-weight: 600; }
.auth-foot { text-align: center; margin-top: 18px; font-size: .85rem; }

/* App */
.topbar { background: var(--surface); border-bottom: 1px solid var(--line); }
.topbar .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 60px; }
.topbar .right { display: flex; align-items: center; gap: 8px; }
.badge { font-size: .78rem; font-weight: 600; padding: 3px 9px; border-radius: 99px; background: var(--surface-2); color: var(--ink-2); white-space: nowrap; }
.badge.pro { background: var(--accent-soft); color: var(--accent); }
.app { padding: 28px 20px 64px; display: grid; gap: 20px; }
.head { display: flex; align-items: end; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.head h1 { font-size: 1.5rem; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.stat b { display: block; font-size: 1.6rem; letter-spacing: -0.02em; }
.stat span { color: var(--ink-3); font-size: .85rem; }
.stat.red b { color: var(--red); } .stat.amber b { color: var(--amber); }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.list { list-style: none; margin: 0; padding: 0; }
.row { display: grid; grid-template-columns: 10px 1fr auto auto; gap: 14px; align-items: center; padding: 14px 18px; border-top: 1px solid var(--line); }
.row:first-child { border-top: 0; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--green); }
.row.soon .dot { background: var(--amber); } .row.expired .dot { background: var(--red); }
.row .name { font-weight: 600; overflow-wrap: anywhere; }
.row .meta { color: var(--ink-3); font-size: .85rem; }
.row .when { text-align: right; font-size: .9rem; white-space: nowrap; }
.row .when b { display: block; font-weight: 600; }
.row.soon .when b { color: var(--amber); } .row.expired .when b { color: var(--red); }
.row .actions { display: flex; gap: 4px; }
.empty { padding: 40px 20px; text-align: center; }
.empty h2 { font-size: 1.15rem; margin-bottom: 6px; }
.chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 18px; }
.chip { font: inherit; font-size: .875rem; padding: 6px 12px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); cursor: pointer; }
.chip:hover { border-color: var(--accent); color: var(--accent); }
.cal { padding: 18px; display: grid; gap: 12px; }
.cal h2 { font-size: 1.05rem; }
.copy { display: flex; gap: 8px; }
.copy input { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .8rem; color: var(--ink-2); }
.cal .apps { display: flex; flex-wrap: wrap; gap: 8px; }
.notice { padding: 12px 16px; border-radius: var(--radius); background: var(--green-soft); color: var(--green); font-weight: 600; }
.notice.warn { background: var(--amber-soft); color: var(--amber); }
.locked { position: relative; }

/* Dialogs */
dialog { border: 0; border-radius: 16px; padding: 0; width: min(460px, calc(100vw - 32px)); background: var(--surface); color: var(--ink); box-shadow: 0 20px 60px rgba(0, 0, 0, .3); }
dialog::backdrop { background: rgba(16, 24, 40, .5); }
dialog form, .dialog-body { padding: 24px; display: grid; gap: 14px; }
dialog h2 { font-size: 1.2rem; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.dialog-actions { display: flex; gap: 8px; justify-content: space-between; margin-top: 4px; }
.dialog-actions .end { display: flex; gap: 8px; margin-left: auto; }
.plans { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.plan { position: relative; border: 1.5px solid var(--line); border-radius: 12px; padding: 12px 14px; cursor: pointer; display: grid; gap: 2px; font-weight: 400; color: var(--ink); }
.plan:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.plan input { position: absolute; opacity: 0; pointer-events: none; }
.plan b { font-size: 1.1rem; }
.plan .save { font-size: .78rem; color: var(--green); font-weight: 600; }

@media (max-width: 820px) {
  .hero { grid-template-columns: 1fr; padding-top: 28px; gap: 32px; }
  .cards { grid-template-columns: 1fr; }
  .pricing { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) {
  .wrap { padding: 0 16px; }
  .app { padding: 20px 16px 48px; }
  .nav .links .hide-sm { display: none; }
  .row { grid-template-columns: 10px 1fr auto; padding: 14px; }
  .row .actions { grid-column: 2 / -1; justify-content: flex-start; margin-left: -10px; }
  .stat b { font-size: 1.3rem; }
  .two { grid-template-columns: 1fr; }
  .topbar .email, .topbar #plan-badge, .topbar .brand-name { display: none; }
  .topbar .right { gap: 2px; }
  .topbar .btn { padding: 7px 10px; }
}
