/* Verge entry — shared styles.
   Two themes taken from the Verge investor app (verge-wechatapp, src/styles/investor.scss):
   dark (near-black, bright gold) and light (warm white, deep gold), each over its own wireframe
   mountain backdrop. Light is the default (each page's <head> sets <html data-theme>); the sun/moon
   button in the top bar switches and remembers the choice (theme.js). Every colour below is a
   variable, so the rules further down never name a colour themselves. */
:root {
  color-scheme: dark;
  --bg: #08090a;
  --text: #f2f0eb;
  --muted: #a39d93;
  --faint: #7d776e;
  --gold: #d0ae69;
  --gold-hover: #dcbe82;
  --gold-soft: rgba(208, 174, 105, 0.14);
  --gold-line: rgba(208, 174, 105, 0.5);
  --line: rgba(255, 255, 255, 0.11);
  --line-strong: rgba(255, 255, 255, 0.22);
  --card: rgba(17, 18, 19, 0.78);
  --card-hover: rgba(24, 25, 27, 0.88);
  --chip: rgba(17, 18, 19, 0.5);
  --field: rgba(255, 255, 255, 0.04);
  --field-focus: rgba(255, 255, 255, 0.07);
  --field-line: rgba(255, 255, 255, 0.14);
  --field-line-hover: rgba(255, 255, 255, 0.26);
  --seg: rgba(255, 255, 255, 0.05);
  --btn: var(--gold);
  --btn-hover: var(--gold-hover);
  --btn-text: #15130f;
  --danger: #e8907d;
  --danger-soft: rgba(200, 80, 60, 0.14);
  --danger-line: rgba(232, 144, 125, 0.35);
  --ok: #7cc49a;
  --ok-soft: rgba(98, 173, 139, 0.18);
  --menu: #17181a;
  --menu-hover: rgba(255, 255, 255, 0.06);
  --avatar: #4a4030;
  --shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
  --logo-filter: brightness(1.45);
  --chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23d0ae69' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  --backdrop: linear-gradient(180deg, rgba(8, 9, 10, 0) 55%, rgba(8, 9, 10, 0.3) 100%),
    url("/img/bg-mountain.webp") center bottom / cover no-repeat;

  --radius: 14px;
  --font: "Helvetica Neue", Helvetica, -apple-system, "Segoe UI", Arial, sans-serif;
}
/* Light: the device asks for light and nobody picked dark, or somebody picked light. */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    color-scheme: light;
    --bg: #fafaf9; --text: #171714; --muted: #746e64; --faint: #918a7e;
    --gold: #a47728; --gold-hover: #8d6520; --gold-soft: rgba(164, 119, 40, 0.1); --gold-line: rgba(164, 119, 40, 0.45);
    --line: rgba(39, 32, 22, 0.13); --line-strong: rgba(39, 32, 22, 0.26);
    --card: rgba(255, 255, 254, 0.8); --card-hover: rgba(255, 255, 255, 0.94); --chip: rgba(255, 255, 255, 0.7);
    --field: rgba(255, 255, 255, 0.85); --field-focus: #fff; --field-line: rgba(39, 32, 22, 0.16); --field-line-hover: rgba(39, 32, 22, 0.3);
    --seg: rgba(39, 32, 22, 0.05);
    --btn: #171714; --btn-hover: #34302a; --btn-text: #fff;
    --danger: #b4412f; --danger-soft: #fbece9; --danger-line: #f0cdc6;
    --ok: #2b8a6e; --ok-soft: #e8f5f0;
    --menu: #fffefb; --menu-hover: #f5f1ea; --avatar: #a47728;
    --shadow: 0 24px 60px rgba(60, 46, 30, 0.1);
    --logo-filter: none;
    --chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23a47728' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    --backdrop: url("/img/bg-mountain-light.webp?v=20261108-2") center bottom / cover no-repeat;
  }
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #fafaf9; --text: #171714; --muted: #746e64; --faint: #918a7e;
  --gold: #a47728; --gold-hover: #8d6520; --gold-soft: rgba(164, 119, 40, 0.1); --gold-line: rgba(164, 119, 40, 0.45);
  --line: rgba(39, 32, 22, 0.13); --line-strong: rgba(39, 32, 22, 0.26);
  --card: rgba(255, 255, 254, 0.8); --card-hover: rgba(255, 255, 255, 0.94); --chip: rgba(255, 255, 255, 0.7);
  --field: rgba(255, 255, 255, 0.85); --field-focus: #fff; --field-line: rgba(39, 32, 22, 0.16); --field-line-hover: rgba(39, 32, 22, 0.3);
  --seg: rgba(39, 32, 22, 0.05);
  --btn: #171714; --btn-hover: #34302a; --btn-text: #fff;
  --danger: #b4412f; --danger-soft: #fbece9; --danger-line: #f0cdc6;
  --ok: #2b8a6e; --ok-soft: #e8f5f0;
  --menu: #fffefb; --menu-hover: #f5f1ea; --avatar: #a47728;
  --shadow: 0 24px 60px rgba(60, 46, 30, 0.1);
  --logo-filter: none;
  --chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23a47728' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  --backdrop: url("/img/bg-mountain-light.webp?v=20261108-2") center bottom / cover no-repeat;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }

/* Backdrop: wireframe mountains along the bottom (dark from the VergePM landing page; light made
   from the same picture so the two line up). The old tower photo is still /img/bg.jpg. */
.backdrop { position: fixed; inset: 0; z-index: -1; background: var(--backdrop), var(--bg); }

.shell { max-width: 1120px; margin: 0 auto; padding: 32px 24px 48px; min-height: 100vh; display: flex; flex-direction: column; }

/* ---------- top bar ---------- */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.logo { display: block; height: 26px; width: auto; filter: var(--logo-filter); }
.back { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); text-decoration: none; font-size: 14px; }
.back:hover { color: var(--gold); }
.back svg { width: 16px; height: 16px; }

/* Top right of the top bar: theme switch, then the avatar menu when signed in or "Sign in" when
   not (same place). The avatar menu is shared in spirit with the website and Training Log. */
.topbar-end { display: flex; align-items: center; gap: 14px; }
.theme-toggle { width: 36px; height: 36px; padding: 0; display: grid; place-items: center; color: var(--muted); cursor: pointer;
  border: 1px solid var(--line); border-radius: 50%; background: var(--chip); transition: color 0.18s, border-color 0.18s; }
.theme-toggle:hover { color: var(--gold); border-color: var(--gold-line); }
.theme-toggle:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.theme-toggle svg { width: 17px; height: 17px; }
/* Show the moon on dark (click for light), the sun on light (click for dark). */
.theme-toggle .sun { display: none; }
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) .theme-toggle .sun { display: block; } :root:not([data-theme="dark"]) .theme-toggle .moon { display: none; } }
:root[data-theme="light"] .theme-toggle .sun { display: block; }
:root[data-theme="light"] .theme-toggle .moon { display: none; }

.account { position: relative; font-size: 13px; color: var(--text); }
.account summary { list-style: none; display: flex; align-items: center; gap: 10px; cursor: pointer; padding: 3px 12px 3px 3px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--chip); }
.account summary::-webkit-details-marker { display: none; }
.account summary:hover, .account[open] summary { border-color: var(--gold-line); }
.account summary:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.avatar { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; flex: none; display: inline-flex; align-items: center;
  justify-content: center; background: var(--avatar); color: #fff; font-size: 12px; letter-spacing: 0.5px; }
.account-name { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-menu { position: absolute; right: 0; top: calc(100% + 8px); z-index: 20; min-width: 230px; padding: 8px 0;
  background: var(--menu); color: var(--text); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); }
.account-who { display: flex; flex-direction: column; gap: 2px; padding: 6px 16px 10px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.account-who span { color: var(--muted); font-size: 12px; }
.account-menu a { display: block; padding: 8px 16px; text-decoration: none; }
.account-menu a:hover { background: var(--menu-hover); color: var(--gold); }
.account-signin { font-size: 13px; color: var(--text); text-decoration: none; padding: 8px 18px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--chip); }
.account-signin:hover { color: var(--gold); border-color: var(--gold-line); }
.account-signin:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
@media (max-width: 640px) { .account-signin { padding: 7px 14px; } .topbar-end { gap: 10px; } }
@media (max-width: 640px) { .account-name { display: none; } .account summary { padding-right: 3px; } }

/* Date block, carried over from the old entry page; it opens the hero, above the eyebrow. */
.date { display: flex; align-items: stretch; border: 1px solid var(--line-strong); color: var(--text); }
.hero .date { align-self: flex-start; width: max-content; margin-bottom: 28px; }
.date .day { font-size: 44px; font-weight: 600; line-height: 1; padding: 8px 14px; border-right: 1px solid var(--line-strong); font-variant-numeric: tabular-nums; }
.date .my { display: flex; flex-direction: column; justify-content: center; padding: 0 14px; font-size: 12px; letter-spacing: 3px; text-transform: uppercase; gap: 4px; }
.date .my span:last-child { color: var(--muted); }

/* ---------- entry page ---------- */
.hero { margin-top: auto; padding-top: 72px; }
.eyebrow { font-size: 12px; letter-spacing: 4px; text-transform: uppercase; color: var(--gold); margin: 0 0 12px; }
.hero .eyebrow { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.hero .eyebrow::before { content: ""; width: 28px; height: 1px; background: var(--gold); }

.doors { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; }
.door {
  position: relative; display: flex; flex-direction: column; gap: 10px;
  padding: 26px 24px 22px; min-height: 210px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  text-decoration: none; color: var(--text);
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}
.door:hover, .door:focus-visible { transform: translateY(-3px); border-color: var(--gold-line); background: var(--card-hover); box-shadow: var(--shadow); outline: none; }
.door .icon { width: 42px; height: 42px; border-radius: 10px; display: grid; place-items: center; background: var(--gold-soft); color: var(--gold); }
.door .icon svg { width: 22px; height: 22px; }
.door h2 { font-size: 20px; font-weight: 600; margin: 8px 0 0; }
.door p { margin: 0; font-size: 14px; line-height: 1.5; color: var(--muted); }
.door .foot { margin-top: auto; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 8px; font-size: 13px; color: var(--faint); padding-top: 14px; }
/* Narrow cards: the arrow drops below it (right-aligned) instead of squeezing the text. */
.door .foot .tag { max-width: 100%; overflow-wrap: anywhere; }
.door .go { flex: none; margin-left: auto; width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--line-strong); display: grid; place-items: center; transition: background 0.18s, border-color 0.18s, color 0.18s; }
.door .go svg { width: 15px; height: 15px; }
.door:hover .go { background: var(--gold); border-color: var(--gold); color: var(--btn-text); }
:root[data-theme="light"] .door:hover .go { color: #fff; }
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) .door:hover .go { color: #fff; } }
.tag { display: inline-flex; align-items: center; gap: 5px; }
.tag svg { width: 13px; height: 13px; }

.footer { margin-top: 40px; font-size: 12px; color: var(--faint); letter-spacing: 1px; }

/* ---------- form pages ---------- */
/* Form pages use a tighter shell so the whole form fits on one laptop screen. The panel is the
   same card as the doors on the home page. */
.shell.compact { padding-top: 22px; padding-bottom: 28px; }
.form-wrap { width: 100%; max-width: 900px; margin: 22px auto 0; }
.panel {
  background: var(--card); color: var(--text); border: 1px solid var(--line); border-radius: var(--radius);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); box-shadow: var(--shadow); overflow: hidden;
}

.panel-head {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 20px;
  padding: 26px 30px 20px; position: relative; border-bottom: 1px solid var(--line);
}
.panel-head .eyebrow { display: flex; align-items: center; gap: 10px; margin: 0 0 6px; font-size: 11px; letter-spacing: 3.5px; }
.panel-head .eyebrow::before { content: ""; width: 22px; height: 1px; background: var(--gold); }
.panel-head h1 { margin: 4px 0 0; font-size: 23px; font-weight: 600; letter-spacing: -0.2px; }
.panel-head p { margin: 5px 0 0; font-size: 13px; color: var(--muted); line-height: 1.45; }
.stamp { flex: none; text-align: right; border-left: 1px solid var(--line); padding-left: 18px; }
.stamp small { display: block; font-size: 10.5px; letter-spacing: 2.5px; text-transform: uppercase; color: var(--faint); margin-bottom: 4px; }
.stamp b { font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: 0.5px; color: var(--text); }

.panel-body { padding: 22px 30px 24px; }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 22px; }
.grid .span2 { grid-column: 1 / -1; }
.field { min-width: 0; }

label, .label { display: flex; align-items: baseline; gap: 2px; font-size: 12.5px; font-weight: 600; color: var(--text); margin-bottom: 6px; letter-spacing: 0.15px; }
.label-row { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 6px; }
.label-row .label { margin: 0; }
.req { color: var(--danger); }
.opt { font-weight: 400; color: var(--faint); margin-left: 4px; }

input[type=text], input[type=email], input[type=password], input[type=date], select, textarea {
  width: 100%; font: inherit; font-size: 14.5px; color: var(--text);
  background: var(--field); border: 1px solid var(--field-line); border-radius: 9px;
  padding: 10px 12px; height: 42px; transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
  -webkit-appearance: none; appearance: none;
}
input::placeholder, textarea::placeholder { color: var(--faint); opacity: 0.8; }
input:hover, select:hover, textarea:hover { border-color: var(--field-line-hover); }
select { padding-right: 36px; cursor: pointer; background-image: var(--chevron); background-repeat: no-repeat; background-position: right 13px center; }
select:invalid { color: var(--faint); }
select option { color: #1d1a17; background: #fff; }
textarea { height: 132px; resize: none; line-height: 1.5; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--gold); background-color: var(--field-focus); box-shadow: 0 0 0 3px var(--gold-soft); }
.money { position: relative; }
.money span { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 14.5px; pointer-events: none; }
.money input { padding-left: 25px; font-variant-numeric: tabular-nums; font-weight: 600; }

/* Segmented choice (Transaction Type). */
.seg { display: flex; height: 42px; background: var(--seg); box-shadow: inset 0 0 0 1px var(--line); border-radius: 9px; padding: 3px; gap: 3px; }
.seg label { flex: 1; margin: 0; position: relative; display: block; }
.seg input { position: absolute; opacity: 0; inset: 0; cursor: pointer; margin: 0; }
.seg span { display: flex; align-items: center; justify-content: center; height: 100%; border-radius: 7px; font-size: 14px; font-weight: 500; color: var(--muted); transition: background 0.15s, color 0.15s, box-shadow 0.15s; }
.seg label:hover span { color: var(--text); }
.seg input:checked + span { background: var(--gold-soft); color: var(--text); box-shadow: inset 0 0 0 1px var(--gold); font-weight: 600; }
.seg input:focus-visible + span { box-shadow: 0 0 0 2px var(--gold); }

.invalid input, .invalid select, .invalid textarea, .invalid .drop { border-color: var(--danger) !important; }
.invalid .seg { box-shadow: inset 0 0 0 1px var(--danger); }
.err { display: none; color: var(--danger); font-size: 12px; margin-top: 5px; }
.invalid .err { display: block; }

.linkbtn { background: none; border: 0; padding: 0; font: inherit; font-size: 12.5px; color: var(--muted); cursor: pointer; }
.linkbtn:hover { color: var(--danger); text-decoration: underline; }

/* File drop zone (DDC driver's licenses): same height as the Memo box beside it. */
.drop { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 132px; border: 1.5px dashed var(--gold-line); border-radius: 9px; text-align: center; cursor: pointer; background: var(--field); transition: border-color 0.15s, background 0.15s; font-weight: 400; margin: 0; padding: 10px; }
.drop:hover, .drop.over { border-color: var(--gold); background: var(--gold-soft); }
.drop svg { width: 24px; height: 24px; color: var(--gold); }
.drop strong { display: block; font-size: 13.5px; margin-top: 6px; color: var(--text); font-weight: 600; }
.drop small { display: block; font-size: 12px; color: var(--muted); margin-top: 3px; }
.drop input { display: none; }
.files { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.files li { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; padding: 5px 6px 5px 10px; background: var(--seg); border: 1px solid var(--line); border-radius: 7px; font-size: 12.5px; }
.files li .name { min-width: 0; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.files li .size { color: var(--muted); font-variant-numeric: tabular-nums; }
.files li button { border: 0; background: none; cursor: pointer; color: var(--muted); font-size: 16px; line-height: 1; padding: 0 3px; }
.files li button:hover { color: var(--danger); }

/* Life Questionnaire: section headings, add-a-line lists, small drop zones. */
.section { font-size: 12px; letter-spacing: 3px; text-transform: uppercase; color: var(--gold); font-weight: 600; margin: 28px 0 14px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
#form > .section:first-of-type { margin-top: 4px; }
.field[hidden] { display: none; }
.list { display: flex; flex-direction: column; gap: 8px; }
.linkbtn.add { margin-top: 6px; }
.linkbtn.add:hover { color: var(--gold); }
.drop.small { height: 76px; }
.sig-grid { margin-top: 22px; }
.with-unit { display: flex; gap: 8px; }
.with-unit input[type=text] { flex: 1; min-width: 0; }
.with-unit .seg { flex: none; width: 150px; }
.sigpad { display: block; width: 100%; height: 150px; border: 1px solid var(--field-line); border-radius: 9px; background: #fff; touch-action: none; cursor: crosshair; }
.invalid .sigpad { border-color: var(--danger); }
.trap { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.drop.small strong { margin-top: 0; }

.actions { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.actions .legend { font-size: 12px; color: var(--faint); }
.btn {
  appearance: none; border: 0; border-radius: 10px; padding: 12px 28px; min-width: 180px;
  font: inherit; font-size: 14.5px; font-weight: 600; letter-spacing: 0.3px;
  background: var(--btn); color: var(--btn-text); cursor: pointer; transition: background 0.15s, transform 0.05s, box-shadow 0.15s;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.btn svg { width: 16px; height: 16px; transition: transform 0.15s; }
.btn:hover { background: var(--btn-hover); box-shadow: var(--shadow); }
.btn:hover svg { transform: translateX(2px); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: 0.6; cursor: progress; }
a.btn { text-decoration: none; }
.btn.secondary { background: transparent; color: var(--text); border: 1px solid var(--line-strong); box-shadow: none; }
.btn.secondary:hover { background: var(--menu-hover); border-color: var(--gold-line); }
.btn.block { width: 100%; }

.alert { display: none; border-radius: 9px; padding: 10px 14px; font-size: 13.5px; margin-bottom: 16px; }
.alert.show { display: block; }
.alert.error { background: var(--danger-soft); color: var(--danger); border: 1px solid var(--danger-line); }

/* Success state. */
.done { display: none; text-align: center; padding: 44px 32px 40px; }
.done.show { display: block; }
.done .check { width: 60px; height: 60px; border-radius: 50%; background: var(--ok-soft); color: var(--ok); display: grid; place-items: center; margin: 0 auto 16px; }
.done .check svg { width: 28px; height: 28px; }
.done h2 { margin: 0 0 6px; font-size: 21px; }
.done p { margin: 0 0 24px; color: var(--muted); font-size: 14.5px; }
.done .buttons { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* Sign-in page. */
.login { max-width: 420px; margin-top: 12vh; }
.login .panel-head { display: block; padding: 28px 28px 20px; }
.login .panel-body { padding: 22px 28px 26px; }
.login .actions { border-top: 0; padding-top: 0; margin-top: 18px; }

.note { font-size: 12.5px; color: var(--faint); text-align: center; margin-top: 16px; }
.note a { color: var(--muted); }
.note b { font-weight: 500; color: var(--muted); }

.gbtn {
  display: flex; align-items: center; justify-content: center; gap: 12px; width: 100%;
  padding: 12px 18px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--field);
  font-size: 15px; font-weight: 600; color: var(--text); text-decoration: none;
  transition: background 0.18s, border-color 0.18s;
}
.gbtn:hover, .gbtn:focus-visible { background: var(--gold-soft); border-color: var(--gold); outline: none; }
.gbtn svg { width: 24px; height: 24px; flex: none; padding: 3px; border-radius: 50%; background: #fff; }
.fine { margin: 14px 0 0; font-size: 12.5px; line-height: 1.5; color: var(--muted); text-align: center; }

/* ---------- small screens ---------- */
@media (max-width: 860px) {
  .doors { grid-template-columns: 1fr; gap: 12px; }
  .door { min-height: 0; padding: 20px; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 4px 14px; }
  .door .icon { flex: none; }
  .door .text { flex: 1; min-width: 0; }
  .door h2 { margin: 0; font-size: 18px; }
  .door p { font-size: 13.5px; }
  .door .foot { width: 100%; padding-top: 8px; }
  .hero { padding-top: 48px; }
  .hero .eyebrow { margin-bottom: 16px; white-space: nowrap; }
}
@media (max-width: 640px) {
  .hero .eyebrow { font-size: 11px; letter-spacing: 2.5px; gap: 10px; }
  .hero .eyebrow::before { width: 20px; }
  .shell { padding: 20px 16px 32px; }
  .logo { height: 20px; }
  .theme-toggle { width: 32px; height: 32px; }
  .date .day { font-size: 32px; padding: 6px 10px; }
  .date .my { padding: 0 10px; font-size: 10px; letter-spacing: 2px; }
  .form-wrap { margin-top: 16px; }
  .panel-head { padding: 20px 20px 18px; flex-direction: column; align-items: flex-start; gap: 12px; }
  .stamp { text-align: left; border-left: 0; padding-left: 0; display: flex; align-items: baseline; gap: 8px; }
  .stamp small { margin: 0; }
  .stamp b { font-size: 14px; }
  .panel-body { padding: 20px 20px 22px; }
  .grid { grid-template-columns: 1fr; gap: 14px; }
  textarea { height: 100px; }
  .actions { flex-direction: column-reverse; align-items: stretch; gap: 10px; }
  .actions .legend { text-align: center; }
  .btn { width: 100%; }
  .done { padding: 32px 20px; }
  .login { margin-top: 8vh; }
}
/* Phone held sideways (wide but short): four doors side by side, compact headers. */
@media (orientation: landscape) and (max-height: 500px) {
  .shell { padding: 14px 24px 20px; }
  .logo { height: 20px; }
  .date .day { font-size: 28px; padding: 5px 10px; }
  .date .my { padding: 0 10px; font-size: 10px; letter-spacing: 2px; }
  .hero { padding-top: 18px; }
  .eyebrow { margin-bottom: 6px; }
  .hero .eyebrow { margin-bottom: 12px; }
  .doors { grid-template-columns: repeat(5, 1fr); gap: 10px; }
  .door { flex-direction: column; flex-wrap: nowrap; align-items: stretch; min-height: 0; padding: 14px 14px 12px; gap: 6px; }
  .door .icon { width: 34px; height: 34px; }
  .door .icon svg { width: 18px; height: 18px; }
  .door h2 { font-size: 16px; margin: 2px 0 0; }
  .door p { font-size: 12.5px; line-height: 1.4; }
  .door .foot { padding-top: 6px; font-size: 11.5px; }
  .door .go { width: 26px; height: 26px; }
  .footer { margin-top: 14px; }

  .form-wrap { margin-top: 12px; }
  .panel-head { padding: 14px 24px 12px; flex-direction: row; align-items: center; }
  .panel-head .eyebrow { display: none; }
  .panel-head h1 { font-size: 19px; }
  .panel-head p { font-size: 12px; margin-top: 3px; }
  .stamp b { font-size: 15px; }
  .panel-body { padding: 16px 24px 18px; }
  .login { margin-top: 4vh; }
}

/* Touch screens: 16px text in fields, otherwise iPhone Safari zooms the page in on every tap. */
@media (pointer: coarse) {
  input[type=text], input[type=email], input[type=password], input[type=date], select, textarea, .money span { font-size: 16px; }
  input[type=text], input[type=email], input[type=password], select { height: 44px; }
  .seg { height: 44px; }
  .linkbtn { font-size: 14px; padding: 4px 0 4px 12px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
