/* Pilot Night Calc: quiet, system type. Light and dark share one design; only the tokens change. */
:root {
  --bg: #f5f5f7;
  --surface: #ffffff;
  --ink: #1d1d1f;
  --muted: #6e6e73;
  --line: #d2d2d7;
  --hair: #e8e8ed;
  --accent: #0066cc;
  --accent-hover: #0071e3;
  --accent-soft: #eef5fd;
  --btn: #0066cc;
  --btn-hover: #0071e3;
  --inset: #f5f5f7;
  --inset-hover: #ebebf0;
  --nav-bg: rgba(245, 245, 247, .82);
  --nav-line: rgba(0, 0, 0, .06);
  --seg: rgba(0, 0, 0, .06);
  --seg-on: #ffffff;
  --placeholder: #a1a1a6;
  --th: #fafafc;
  --ok: #1d7d3a;
  --warn: #9a5000;
  --err: #c4161c;
  --radius: 22px;
  --shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 8px 28px rgba(0, 0, 0, .06);
  --ease: cubic-bezier(.25, .1, .25, 1);
  color-scheme: light;
}
/* Dark: chosen with the switch, or by the system when nothing was chosen (also without JS). */
:root[data-theme="dark"] {
  --bg: #000000;
  --surface: #1c1c1e;
  --ink: #f5f5f7;
  --muted: #a1a1a6;
  --line: #424245;
  --hair: #38383a;
  --accent: #2997ff;
  --accent-hover: #47a6ff;
  --accent-soft: #10263d;
  --btn: #0071e3;
  --btn-hover: #0077ed;
  --inset: #2c2c2e;
  --inset-hover: #3a3a3c;
  --nav-bg: rgba(22, 22, 23, .8);
  --nav-line: rgba(255, 255, 255, .08);
  --seg: rgba(255, 255, 255, .1);
  --seg-on: #48484a;
  --placeholder: #6e6e73;
  --th: #242426;
  --ok: #30d158;
  --warn: #ffb340;
  --err: #ff6961;
  --shadow: 0 0 0 1px rgba(255, 255, 255, .05);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #000000;
    --surface: #1c1c1e;
    --ink: #f5f5f7;
    --muted: #a1a1a6;
    --line: #424245;
    --hair: #38383a;
    --accent: #2997ff;
    --accent-hover: #47a6ff;
    --accent-soft: #10263d;
    --btn: #0071e3;
    --btn-hover: #0077ed;
    --inset: #2c2c2e;
    --inset-hover: #3a3a3c;
    --nav-bg: rgba(22, 22, 23, .8);
    --nav-line: rgba(255, 255, 255, .08);
    --seg: rgba(255, 255, 255, .1);
    --seg-on: #48484a;
    --placeholder: #6e6e73;
    --th: #242426;
    --ok: #30d158;
    --warn: #ffb340;
    --err: #ff6961;
    --shadow: 0 0 0 1px rgba(255, 255, 255, .05);
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 17px/1.47 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", "Segoe UI", Roboto, Arial, sans-serif;
  letter-spacing: -.01em; -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 3px solid rgba(0, 113, 227, .45); outline-offset: 2px; border-radius: 8px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
h1, h2, h3 { font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", "Segoe UI", Roboto, Arial, sans-serif; }

/* nav */
.nav {
  position: sticky; top: 0; z-index: 10;
  background: var(--nav-bg); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--nav-line);
}
.nav-in { max-width: 980px; margin: 0 auto; padding: 0 16px; height: 52px; display: flex; align-items: center; justify-content: space-between; }
.brand { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); font-weight: 600; font-size: 17px; }
.brand:hover { text-decoration: none; }
.brand-icon { width: 20px; height: 20px; fill: var(--ink); }
.nav-links { display: flex; gap: 20px; }
.nav-links a { color: var(--ink); font-size: 14px; opacity: .8; padding: 12px 0; }
.nav-links a:hover { opacity: 1; text-decoration: none; }
.nav-right { display: flex; align-items: center; gap: 18px; }
.theme-switch { display: inline-flex; gap: 2px; padding: 2px; border-radius: 980px; background: var(--seg); }
.theme-switch button {
  display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 32px; padding: 0;
  border: 0; border-radius: 980px; background: transparent; color: var(--muted); cursor: pointer;
  transition: background-color .2s var(--ease), color .2s var(--ease);
}
.theme-switch button:hover { color: var(--ink); }
.theme-switch button[aria-pressed="true"] { background: var(--seg-on); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .14); }
.theme-switch svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* hero */
.hero { max-width: 760px; margin: 0 auto; padding: 72px 16px 40px; text-align: center; }
h1 { margin: 0 0 14px; font-size: clamp(36px, 7vw, 56px); line-height: 1.07; font-weight: 700; letter-spacing: -.025em; }
.lede { margin: 0 auto; max-width: 600px; color: var(--muted); font-size: clamp(19px, 2.4vw, 21px); line-height: 1.4; }

/* tool */
.tool { max-width: 640px; margin: 0 auto; padding: 0 16px; }
.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 28px; margin-bottom: 20px; }
.drop {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  min-height: 168px; padding: 24px; text-align: center; cursor: pointer;
  background: var(--inset); border: 1.5px dashed var(--line); border-radius: 16px;
  transition: border-color .2s var(--ease), background-color .2s var(--ease);
}
.drop:hover, .drop.over { border-color: var(--accent); background: var(--accent-soft); }
.drop:focus-within { border-color: var(--accent); }
.drop.has-file { border-style: solid; border-color: var(--accent); background: var(--accent-soft); }
.drop input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.drop-icon { width: 34px; height: 34px; fill: none; stroke: var(--accent); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; margin-bottom: 4px; }
.drop-title { font-weight: 600; overflow-wrap: anywhere; }
.drop-sub { color: var(--muted); font-size: 14px; }

.field { display: flex; flex-direction: column; gap: 6px; margin: 20px 0 0; }
.field-label { font-size: 14px; font-weight: 500; color: var(--ink); }
select, input[type="text"], button { font: inherit; letter-spacing: inherit; }
select, input[type="text"] {
  width: 100%; min-height: 44px; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); font-size: 16px;
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
select { appearance: none; -webkit-appearance: none; padding-right: 40px; 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='%236e6e73' stroke-width='2' stroke-linecap='round' stroke-linejoin='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; }
select:focus, input[type="text"]:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px rgba(0, 113, 227, .15); }
input[type="text"] { font-family: ui-monospace, "SF Mono", Menlo, monospace; text-transform: uppercase; }
input[type="text"]::placeholder { color: var(--placeholder); text-transform: none; }

.coupon { margin-top: 14px; }
.link { background: none; border: 0; padding: 10px 0; min-height: 44px; color: var(--accent); cursor: pointer; font-size: 15px; }
.link:hover { text-decoration: underline; }
.coupon .field { margin-top: 4px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  width: 100%; min-height: 50px; padding: 12px 22px; border: 0; border-radius: 980px; cursor: pointer;
  font-size: 17px; font-weight: 500;
  transition: background-color .2s var(--ease), opacity .2s var(--ease), transform .1s var(--ease);
}
.btn:active:not(:disabled) { transform: scale(.985); }
.btn.primary { background: var(--btn); color: #fff; }
.btn.primary:hover:not(:disabled) { background: var(--btn-hover); }
.btn.secondary { background: var(--inset); color: var(--accent); }
.btn.secondary:hover:not(:disabled) { background: var(--inset-hover); }
.btn .ico { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.btn.locked { color: var(--muted); }
.btn.locked:hover:not(:disabled) { color: var(--ink); }
.btn:disabled { opacity: .38; cursor: not-allowed; }
#go { margin-top: 22px; }

.turnstile { margin: 20px 0 0; min-height: 65px; }
.status { min-height: 1.5em; margin: 14px 0 0; color: var(--muted); font-size: 15px; text-align: center; }
.status.err { color: var(--err); }
.status.ok { color: var(--ok); }
.plan-note { margin: 6px 0 0; color: var(--muted); font-size: 13px; text-align: center; }
.link.inline { min-height: 0; padding: 0; font-size: inherit; }
.plan-note .link.inline { padding: 12px 2px; }

.offer { margin-top: 22px; padding: 22px; border-radius: 16px; background: var(--accent-soft); text-align: left; }
.result .offer { margin: 0 0 20px; border: 1px solid var(--accent); }
.offer-hint { margin: 10px 0 0; font-size: 13px; color: var(--muted); text-align: center; }
.offer h3 { margin: 0 0 6px; font-size: 19px; font-weight: 600; letter-spacing: -.015em; }
.offer > p { margin: 0 0 16px; font-size: 15px; color: var(--ink); }
.check { display: flex; gap: 10px; align-items: flex-start; margin: 0 0 16px; font-size: 13px; line-height: 1.45; color: var(--muted); cursor: pointer; }
.check input { flex: none; width: 20px; height: 20px; margin: 0; accent-color: var(--accent); cursor: pointer; }
.fine { margin: 10px 0 0; font-size: 12px; color: var(--muted); text-align: center; }

/* result */
.result { text-align: center; }
.result.reveal { animation: rise .45s var(--ease) both; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.result-h { margin: 0; font-size: 15px; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.total { margin: 2px 0 6px; font-size: clamp(56px, 13vw, 80px); line-height: 1.05; font-weight: 600; letter-spacing: -.03em; font-variant-numeric: tabular-nums;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", "Segoe UI", Roboto, Arial, sans-serif; }
.badge { display: inline-block; margin: 0 0 8px; padding: 4px 12px; border-radius: 980px; font-size: 13px; font-weight: 500; background: var(--accent-soft); color: var(--accent); }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin: 18px 0; background: var(--hair); border-radius: 14px; overflow: hidden; }
.stats div { background: var(--inset); padding: 14px 8px; }
.stats dt { font-size: 12px; color: var(--muted); }
.stats dd { margin: 2px 0 0; font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.def { color: var(--muted); font-size: 14px; margin: 0 0 20px; }
.cols { color: var(--muted); font-size: 12px; margin: -12px 0 20px; overflow-wrap: anywhere; }
.actions { display: grid; gap: 10px; }
details { text-align: left; }
.result details { margin-top: 18px; font-size: 14px; }
.result summary { cursor: pointer; color: var(--warn); font-weight: 500; padding: 8px 0; }
.result details ul { padding-left: 18px; margin: 6px 0 0; color: var(--muted); }
.result details li { margin-bottom: 4px; overflow-wrap: anywhere; }

/* sections */
.section { max-width: 980px; margin: 0 auto; padding: 72px 16px 0; }
.section > h2 { margin: 0 0 28px; font-size: clamp(28px, 4.5vw, 40px); line-height: 1.1; font-weight: 700; letter-spacing: -.02em; text-align: center; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.steps li { background: var(--surface); border-radius: var(--radius); padding: 26px; }
.step-n { display: inline-flex; width: 30px; height: 30px; align-items: center; justify-content: center; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-weight: 600; font-size: 15px; }
.steps h3, .plan h3 { margin: 14px 0 6px; font-size: 19px; font-weight: 600; letter-spacing: -.015em; }
.steps p { margin: 0; color: var(--muted); font-size: 15px; }
.plans { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; max-width: 760px; margin: 0 auto; }
.plan { background: var(--surface); border-radius: var(--radius); padding: 28px; border: 1px solid transparent; }
.plan.featured { border-color: var(--accent); }
.plan h3 { margin-top: 0; }
.plan-price { margin: 0 0 16px; font-size: 34px; font-weight: 600; letter-spacing: -.02em; }
.plan-price .per { font-size: 15px; font-weight: 400; color: var(--muted); letter-spacing: 0; }
.plan ul { list-style: none; margin: 0; padding: 0; }
.plan li { position: relative; padding: 6px 0 6px 26px; font-size: 15px; color: var(--ink); border-top: 1px solid var(--hair); }
.plan .btn { margin-top: 20px; }
.plan .btn:hover { text-decoration: none; }
.plan li::before { content: ""; position: absolute; left: 2px; top: 12px; width: 12px; height: 7px; border-left: 2px solid var(--accent); border-bottom: 2px solid var(--accent); transform: rotate(-45deg); }
.faq { max-width: 760px; }
.faq details { background: var(--surface); border-radius: 16px; margin-bottom: 10px; padding: 0 22px; }
.faq summary { cursor: pointer; list-style: none; padding: 18px 28px 18px 0; font-weight: 500; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 0; top: 50%; transform: translateY(-50%); font-size: 22px; font-weight: 300; color: var(--muted); transition: transform .2s var(--ease); }
.faq details[open] summary::after { transform: translateY(-50%) rotate(45deg); }
.faq details[open] { padding-bottom: 22px; }
.faq details p { margin: 2px 0 12px; color: var(--muted); font-size: 15px; line-height: 1.55; }
.faq details p:last-child { margin-bottom: 0; }
code { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 13px; background: var(--inset); padding: 1px 6px; border-radius: 6px; overflow-wrap: anywhere; }

/* footer */
.foot { margin-top: 88px; border-top: 1px solid var(--line); }
.foot-in { max-width: 980px; margin: 0 auto; padding: 20px 16px 36px; font-size: 12px; color: var(--muted); }
.foot nav { display: flex; flex-wrap: wrap; gap: 4px 20px; margin-bottom: 8px; }
.foot nav a { color: var(--ink); opacity: .8; padding: 6px 0; }
.foot p { margin: 0; }

/* legal pages */
.doc { max-width: 720px; margin: 0 auto; padding: 56px 16px 0; }
.doc h1 { font-size: clamp(32px, 6vw, 44px); text-align: left; }
.doc .updated { color: var(--muted); font-size: 15px; margin: 0 0 32px; }
.doc h2 { font-size: 22px; font-weight: 600; letter-spacing: -.015em; margin: 36px 0 10px; }
.doc p, .doc li { font-size: 16px; line-height: 1.55; }
.doc ul { padding-left: 20px; }
.doc li { margin-bottom: 6px; }
.doc table { width: 100%; border-collapse: collapse; font-size: 14px; margin: 8px 0 16px; background: var(--surface); border-radius: 12px; overflow: hidden; }
.doc th, .doc td { text-align: left; vertical-align: top; padding: 10px 12px; border-bottom: 1px solid var(--hair); }
.doc th { font-weight: 600; background: var(--th); }
.table-wrap { overflow-x: auto; }

@media (max-width: 760px) {
  .steps, .plans { grid-template-columns: 1fr; }
  .hero { padding-top: 48px; }
  .section { padding-top: 56px; }
}
@media (max-width: 480px) {
  .card { padding: 20px; }
  .stats { grid-template-columns: 1fr; }
  .nav-links { gap: 14px; }
}
@media (max-width: 430px) {
  .nav-links a:first-child { display: none; }
  .nav-right { gap: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
