:root {
  --bg: #ffffff;
  --surface: #f6f7f9;
  --card: #ffffff;
  --ink: #10151c;
  --muted: #5b6675;
  --line: #e5e8ec;
  --brand: #4f46e5;
  --brand-strong: #4338ca;
  --brand-soft: #eef0fe;
  --on-brand: #ffffff;
  --shadow: 0 24px 60px -28px rgba(16, 21, 28, 0.28);
  --radius: 14px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1117;
    --surface: #151a22;
    --card: #171d26;
    --ink: #eef1f5;
    --muted: #9aa5b4;
    --line: #262d38;
    --brand: #8b8cf7;
    --brand-strong: #a5a6ff;
    --brand-soft: #1c2130;
    --on-brand: #0e1117;
    --shadow: 0 24px 60px -28px rgba(0, 0, 0, 0.6);
  }
}

* { box-sizing: border-box; }
html { background: var(--bg); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  color: var(--ink);
  font-family: var(--font);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
h1, h2, p { margin: 0; }

/* ── nav ─────────────────────────────────────────────── */
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1080px;
  margin: 0 auto;
  padding: 22px 28px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: -0.02em; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  color: var(--on-brand);
  background: var(--brand);
  border-radius: 9px;
  font-size: 17px;
  font-weight: 800;
}
.brand-name { font-size: 17px; }
.brand-beta { padding: 2px 6px; background: var(--brand-soft); color: var(--brand-strong); border-radius: 5px; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; }
.nav-links { display: flex; align-items: center; gap: 8px; }
.nav-links a { padding: 8px 14px; border-radius: 8px; color: var(--muted); font-size: 14px; font-weight: 600; transition: color .15s, background .15s; }
.nav-links a:hover { color: var(--ink); background: var(--surface); }
.nav-cta { color: var(--brand-strong) !important; }
.nav-cta:hover { background: var(--brand-soft) !important; }

/* ── hero ────────────────────────────────────────────── */
main { max-width: 1080px; margin: 0 auto; padding: 0 28px; }
.hero { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 64px 0 40px; }
.badge {
  display: inline-block;
  margin-bottom: 22px;
  padding: 6px 13px;
  color: var(--brand-strong);
  background: var(--brand-soft);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
h1 {
  max-width: 14ch;
  font-size: clamp(42px, 7vw, 74px);
  line-height: 1.02;
  letter-spacing: -0.045em;
  font-weight: 800;
}
.lede { max-width: 56ch; margin-top: 22px; color: var(--muted); font-size: clamp(16px, 2.2vw, 19px); }

.cta { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 34px; }
.button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 22px;
  border-radius: 11px;
  font-size: 15px;
  font-weight: 700;
  border: 1px solid transparent;
  transition: transform .15s, background .15s, border-color .15s, box-shadow .15s;
}
.button-primary { color: var(--on-brand); background: var(--brand); box-shadow: 0 10px 24px -12px var(--brand); }
.button-primary:not(.is-loading):not(.is-disabled):hover { background: var(--brand-strong); transform: translateY(-2px); }
.button-ghost { color: var(--ink); background: transparent; border-color: var(--line); }
.button-ghost:hover { background: var(--surface); }
.button-icon { font-size: 17px; }
.is-loading { cursor: progress; opacity: 0.6; }
.is-disabled { cursor: not-allowed; opacity: 0.55; box-shadow: none; }

.cta-meta { margin-top: 18px; color: var(--muted); font-size: 13px; }
.cta-meta .dot { margin: 0 8px; opacity: 0.5; }

/* ── product mock ────────────────────────────────────── */
.mock {
  width: 100%;
  max-width: 760px;
  margin-top: 56px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.mock-bar { display: flex; align-items: center; gap: 7px; padding: 13px 16px; border-bottom: 1px solid var(--line); background: var(--surface); }
.mock-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--line); }
.mock-dot:nth-child(1) { background: #ec6a8a; }
.mock-dot:nth-child(2) { background: #f5b13d; }
.mock-dot:nth-child(3) { background: #34c68a; }
.mock-title { margin-left: 10px; color: var(--muted); font-size: 12px; font-weight: 600; }

/* timetable grid — mirrors the app's solution view (TimeframeGrid) */
.tg {
  display: grid;
  grid-template-columns: 3.3rem repeat(5, minmax(0, 1fr));
  grid-template-rows: 1.9rem repeat(5, clamp(38px, 6.4vw, 54px));
  gap: 3px;
  padding: 14px;
}
/* Explicit grid placement as classes, not inline styles, so the CSP
   style-src policy (no 'unsafe-inline') doesn't silently drop them. */
.gc-1 { grid-column: 1; }
.gc-2 { grid-column: 2; }
.gc-3 { grid-column: 3; }
.gc-4 { grid-column: 4; }
.gc-5 { grid-column: 5; }
.gc-6 { grid-column: 6; }
.gr-1 { grid-row: 1; }
.gr-2 { grid-row: 2; }
.gr-3 { grid-row: 3; }
.gr-4 { grid-row: 4; }
.gr-5 { grid-row: 5; }
.gr-6 { grid-row: 6; }
.gr-2-s2 { grid-row: 2 / span 2; }
.gr-3-s2 { grid-row: 3 / span 2; }
.tg-corner, .tg-day, .tg-slot {
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  font-size: 12px;
}
.tg-corner { color: var(--muted); font-weight: 600; }
.tg-day { color: var(--ink); font-weight: 700; }
.tg-slot { color: var(--muted); font-size: 11px; }
.tg-cell { border: 1px solid var(--line); border-radius: 6px; background: var(--card); }
.tg-cell.nl { background: var(--surface); position: relative; overflow: hidden; }
.tg-cell.nl::after {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(45deg,
    color-mix(in srgb, var(--ink) 7%, transparent) 0, color-mix(in srgb, var(--ink) 7%, transparent) 6px,
    transparent 6px, transparent 12px);
}
.ev {
  display: flex;
  flex-direction: column;
  gap: 2px;
  justify-content: center;
  padding: 5px 8px;
  border-radius: 6px;
  overflow: hidden;
  color: #fff;
  z-index: 1;
}
.ev strong { font-size: 12.5px; font-weight: 700; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev-sub { font-size: 10.5px; line-height: 1.2; opacity: 0.9; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev.m-blue   { background: #4e79a7; }
.ev.m-orange { background: #f28e2b; }
.ev.m-red    { background: #e15759; }
.ev.m-teal   { background: #76b7b2; }
.ev.m-green  { background: #59a14f; }
.ev.m-purple { background: #b07aa1; }
.ev.m-brown  { background: #9c755f; }
.ev.m-yellow { background: #edc948; color: #1c1a10; }
.ev.m-pink   { background: #ff9da7; color: #24141a; }

/* ── features ────────────────────────────────────────── */
.features {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin: 80px 0;
}
.feature { padding: 24px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.feature-icon { display: inline-grid; place-items: center; width: 40px; height: 40px; margin-bottom: 16px; color: var(--brand-strong); background: var(--brand-soft); border-radius: 11px; font-size: 20px; }
.feature h2 { font-size: 16px; letter-spacing: -0.01em; }
.feature p { margin-top: 8px; color: var(--muted); font-size: 14px; }


/* ── footer ──────────────────────────────────────────── */
.footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1080px;
  margin: 0 auto;
  padding: 28px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}
.footer a:hover { color: var(--ink); }

/* ── guide page ──────────────────────────────────────── */
.doc { max-width: 720px; margin: 0 auto; padding: 48px 0 24px; }
.doc-back { display: inline-block; margin-bottom: 24px; color: var(--muted); font-size: 14px; font-weight: 600; }
.doc-back:hover { color: var(--ink); }
.doc h1 { font-size: clamp(34px, 5vw, 46px); letter-spacing: -0.04em; }
.doc-lede { margin-top: 16px; color: var(--muted); font-size: 18px; }
.doc-note { margin-top: 18px; padding: 12px 16px; background: var(--brand-soft); border-radius: 10px; color: var(--brand-strong); font-size: 14px; font-weight: 600; }
.doc section { margin-top: 40px; padding-top: 28px; border-top: 1px solid var(--line); }
.doc h2 { font-size: 22px; letter-spacing: -0.02em; }
.doc h2 .step { margin-right: 10px; color: var(--brand-strong); font-variant-numeric: tabular-nums; }
.doc p { margin-top: 12px; color: var(--muted); font-size: 16px; }
.doc ul { margin-top: 12px; padding-left: 20px; color: var(--muted); font-size: 16px; }
.doc li { margin-top: 6px; }

/* ── responsive ──────────────────────────────────────── */
@media (max-width: 860px) {
  .features { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .nav, main, .footer { padding-left: 20px; padding-right: 20px; }
  .hero { padding-top: 44px; }
  .features { grid-template-columns: 1fr; margin: 56px 0; }
}
