/* Glasto Quick Copy v2. Fonts are self-hosted (the security policy blocks font CDNs). */
@font-face { font-family: "Newsreader"; font-weight: 500; font-style: normal; font-display: swap; src: url("fonts/newsreader-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Instrument Sans"; font-weight: 400; font-style: normal; font-display: swap; src: url("fonts/instrument-sans-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Instrument Sans"; font-weight: 500; font-style: normal; font-display: swap; src: url("fonts/instrument-sans-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Instrument Sans"; font-weight: 600; font-style: normal; font-display: swap; src: url("fonts/instrument-sans-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-weight: 400; font-style: normal; font-display: swap; src: url("fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-weight: 500; font-style: normal; font-display: swap; src: url("fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-weight: 600; font-style: normal; font-display: swap; src: url("fonts/ibm-plex-mono-latin-600-normal.woff2") format("woff2"); }

:root {
  --bg: #fbfaf6; --surface: #ffffff; --surface-sunk: #fbfaf6; --chip: #f1eee6;
  --ink: #22201c; --ink-2: #3d3a34; --muted: #625e55; --placeholder: #8f8a7f;
  --border: #e3dfd6; --border-strong: #d6d1c6; --divider: #eeebe4;
  --accent: oklch(0.52 0.12 250); --accent-hover: oklch(0.47 0.12 250); --accent-ink: oklch(0.45 0.12 250);
  --accent-deep: oklch(0.38 0.1 250); --accent-soft: oklch(0.95 0.03 250); --on-accent: #ffffff;
  --ok-dot: oklch(0.6 0.13 155); --danger: #a3352a; --danger-soft: #fbeae7;
  --demo-bg: oklch(0.94 0.05 75); --demo-ink: #5b3a0b;
  --mock-field: #ffffff;
  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --sans: "Instrument Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #161512; --surface: #1f1d19; --surface-sunk: #191814; --chip: #2a2823;
    --ink: #f1eee6; --ink-2: #dcd7cc; --muted: #a8a397; --placeholder: #7d786d;
    --border: #34312b; --border-strong: #4a463e; --divider: #2c2a25;
    --accent: oklch(0.72 0.11 250); --accent-hover: oklch(0.77 0.1 250); --accent-ink: oklch(0.78 0.1 250);
    --accent-deep: oklch(0.86 0.07 250); --accent-soft: oklch(0.3 0.05 250); --on-accent: #10151d;
    --ok-dot: oklch(0.7 0.13 155); --danger: #ef8a7d; --danger-soft: #3a211d;
    --demo-bg: oklch(0.32 0.06 75); --demo-ink: #f6dcb0;
    --mock-field: #24221d;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.55 var(--sans); }
main { max-width: 560px; margin: 0 auto; padding: 16px 20px 28px; }
p { margin: 0; text-wrap: pretty; }
a { color: var(--accent-ink); text-underline-offset: 2px; }
a:hover { color: var(--accent-deep); }
button, input, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
input::placeholder, textarea::placeholder { color: var(--placeholder); }
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.center { text-align: center; }
[hidden] { display: none !important; }
.offscreen { position: fixed; left: -9999px; opacity: 0; pointer-events: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* view rhythm */
.view { display: flex; flex-direction: column; --gap: 20px; gap: var(--gap); }
.view.v-create { --gap: 16px; }
.view.v-day, .view.v-edit { --gap: 14px; }
.view.v-data { --gap: 18px; }
.view.v-inter { --gap: 14px; padding-top: 6px; }

/* type */
.wordmark { font: 500 17px var(--serif); color: var(--ink); text-decoration: none; }
.topbar { display: flex; justify-content: space-between; align-items: center; min-height: 28px; font-size: 13px; color: var(--muted); }
h1 { margin: 0; font-family: var(--serif); font-weight: 500; letter-spacing: -0.02em; font-size: 30px; line-height: 1.1; text-wrap: balance; }
h1.display { font-size: 36px; line-height: 1.08; margin-top: 4px; }
h1.day { font-size: 28px; }
h1.small { font-size: 26px; }
h2 { margin: 0; font: 500 22px/1.2 var(--serif); }
h2.plain { font: 600 16px/1.35 var(--sans); }
.subtitle { font-size: 14px; color: var(--muted); margin-top: 4px; }
.lead { color: var(--muted); }
.help { font-size: 13.5px; color: var(--muted); }
.note { font-size: 13px; color: var(--muted); }
.back { font-size: 14px; color: var(--muted); text-decoration: none; display: inline-flex; align-items: center; min-height: 32px; align-self: flex-start; }
.back:hover { color: var(--ink); }

/* surfaces */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.card-title { font-weight: 600; font-size: 15px; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 52px; padding: 0 18px; border-radius: 14px; border: 1px solid transparent; font-weight: 600; text-decoration: none; cursor: pointer; width: 100%; }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-hover); color: var(--on-accent); }
.btn-primary:disabled { opacity: .5; cursor: default; }
.btn-primary:disabled:hover { background: var(--accent); }
.btn-secondary { background: var(--surface); border-color: var(--border-strong); color: var(--ink); }
.btn-secondary:hover { color: var(--ink); border-color: var(--muted); }
.btn-danger { background: var(--surface); border-color: var(--border); color: var(--danger); min-height: 48px; }
.btn-sm { min-height: 44px; font-size: 15px; }
.btn-row { display: flex; gap: 8px; }
.btn-row .btn-primary { flex: 1; }
.btn-row .btn-secondary { width: auto; }
.textbtn { background: none; border: 0; padding: 12px 8px; margin: -12px -8px; color: var(--muted); font-size: 13px; cursor: pointer; }
.textbtn:hover { color: var(--ink); }
.linkbtn { display: inline-flex; align-items: center; background: none; border: 0; padding: 0 2px; min-height: 44px; line-height: 1; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; font-size: 13px; }
.linkbtn.danger { color: var(--danger); }
.clear-ticks { align-self: center; font-size: 14px; }
.cta-note { text-align: center; font-size: 13px; color: var(--muted); margin-top: -12px; }

/* copy box */
.copy-grid { display: grid; grid-template-columns: 1.45fr 1fr; gap: 8px; }
.copy {
  text-align: left; display: flex; flex-direction: column; gap: 2px; min-height: 66px; padding: 10px 12px;
  border-radius: 12px; border: 1.5px solid var(--border); background: var(--surface); color: var(--ink); cursor: pointer;
  transition: background .15s, border-color .15s, transform .08s;
}
.copy:active { transform: scale(0.98); }
.copy .lbl { font-size: 12.5px; color: var(--muted); line-height: 1.35; }
.copy .val { font: 600 19px/1.25 var(--mono); letter-spacing: .02em; word-break: break-all; }
.copy.is-next { border-color: var(--accent); }
.copy.is-used { background: var(--accent-soft); border-color: var(--accent); }
.copy.is-fail { border-color: var(--danger); }
.copy.hero { min-height: 64px; }
.copy.hero .val { font-size: 18px; }

/* home: try it */
.mock { background: var(--surface-sunk); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; }
.mock-cap { font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.mock-row { display: grid; grid-template-columns: 8em 1fr; align-items: center; gap: 8px; font-size: 13px; }
.mock-field {
  height: 34px; border: 1px solid var(--border-strong); border-radius: 4px; background: var(--mock-field); padding: 0 8px;
  font: 500 16px var(--mono); color: var(--ink); width: 100%; min-width: 0;
  transition: border-color .15s, box-shadow .15s;
}
.mock-field.is-target { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.mock-field.is-filled { border-color: var(--accent); }
.mock-field::placeholder { color: var(--placeholder); font: 400 13px var(--sans); }
.mock-field:focus { outline: none; border-color: var(--accent); }
.try-msg { font-size: 13.5px; color: var(--muted); min-height: 1.4em; }
.try-msg.good { background: var(--accent-soft); color: var(--accent-deep); font-weight: 600; border-radius: 12px; padding: 10px 12px; }
.try-done { display: flex; flex-direction: column; gap: 10px; }

/* home: saved row, steps, faq */
.saved { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 60px; padding: 10px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; text-decoration: none; color: var(--ink); }
.saved:hover { border-color: var(--border-strong); color: var(--ink); }
.saved .meta { font-size: 12.5px; color: var(--muted); display: block; }
.saved .names { font-weight: 600; }
.saved .open { font-weight: 600; color: var(--accent-ink); white-space: nowrap; }
.saved-list { display: flex; flex-direction: column; gap: 8px; }
.section { display: flex; flex-direction: column; gap: 10px; }
.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.steps li { display: grid; grid-template-columns: 24px 1fr; gap: 6px; font-size: 15px; }
.steps .num { font: 500 18px/1.4 var(--serif); color: var(--accent-ink); }
.faq-list { display: flex; flex-direction: column; }
.faq { border-top: 1px solid var(--border); padding: 12px 0; }
.faq:last-child { border-bottom: 1px solid var(--border); }
.faq summary { list-style: none; cursor: pointer; font-weight: 600; display: flex; justify-content: space-between; gap: 12px; min-height: 24px; }
.faq summary::-webkit-details-marker { display: none; }
.faq-sign { color: var(--muted); font-weight: 400; }
.faq-sign::before { content: "+"; }
.faq[open] .faq-sign::before { content: "\2212"; }
.faq p { font-size: 14.5px; color: var(--muted); margin-top: 6px; }

/* footer */
footer { font-size: 12.5px; color: var(--muted); display: flex; flex-direction: column; gap: 6px; margin-top: 4px; }
footer a { color: var(--muted); }
.foot-links { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.foot-links a { min-height: 32px; display: inline-flex; align-items: center; }
.guides-links ul { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.guides-links a { color: var(--accent-ink); }

/* ad slots (see ads.js): nothing shows until Google fills the slot; then it sits in its own
   dashed panel with a label and extra space, so it can't be mistaken for part of the tool */
.ad-slot:not([data-filled]) { display: none; }
.ad-slot ins.adsbygoogle { display: block; }
/* Google's recommended rule: an ad it couldn't fill (or one waiting for site approval) leaves no gap */
.ad-slot ins.adsbygoogle[data-ad-status="unfilled"] { display: none !important; }
.ad-slot:has(ins[data-ad-status="unfilled"]) { display: none; }
/* Not (yet) holding an ad: zero height, keeps its width for Google, and cancels the page's
   spacing so it adds no gap between items (ads.js sets is-empty / is-live) */
.ad-slot.is-empty, .ad-slot:not(:has(ins[data-ad-status="filled"])) { height: 0; overflow: hidden; padding: 0; border: 0; margin: calc(-1 * var(--gap, 0px)) 0 0; }
.ad-label { display: none; margin: 0 0 6px; font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.ad-slot:has(ins[data-ad-status="filled"]) { margin: 26px 0; padding: 10px 12px 12px; background: var(--surface-sunk); border: 1px dashed var(--border-strong); border-radius: 12px; }
.ad-slot:has(ins[data-ad-status="filled"]) > .ad-label { display: block; }
.dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--ok-dot); margin-right: 6px; vertical-align: middle; }
.dot.big { width: 8px; height: 8px; }

/* create: import */
.import-label { font-weight: 600; display: flex; flex-direction: column; gap: 8px; }
.import {
  width: 100%; min-height: 9.6em; resize: vertical; border-radius: 14px; border: 1px solid var(--border-strong); background: var(--surface);
  padding: 14px; font: 400 14px/1.55 var(--mono);
}
.results { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; overflow: hidden; }
.res-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--divider); font-weight: 600; }
.res-head .max { font-size: 13px; color: var(--muted); font-weight: 400; }
.res-row { display: grid; grid-template-columns: 32px 1fr auto; gap: 10px; align-items: center; padding: 10px 16px; border-bottom: 1px solid var(--divider); }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-ink); display: grid; place-items: center; font-size: 14px; font-weight: 600; }
.res-name { font-weight: 600; line-height: 1.3; }
.res-sub { font: 400 13.5px/1.35 var(--mono); color: var(--muted); display: flex; flex-wrap: wrap; column-gap: 12px; }
.status { font-size: 12.5px; font-weight: 600; text-align: right; }
.status.ready { color: var(--accent-ink); }
.status.missing { color: var(--danger); background: none; border: 0; padding: 8px 0; min-height: 44px; font-family: inherit; cursor: pointer; }
.status.missing::after { content: " \25BE"; }
.status.missing[aria-expanded="true"]::after { content: " \25B4"; }
.res-note { grid-column: 1 / -1; margin: 0; padding: 10px 12px; border-radius: 10px; background: var(--danger-soft); color: var(--danger); font-size: 13.5px; }
.res-foot { display: flex; align-items: center; min-height: 44px; padding: 0 16px; font-size: 14px; font-weight: 600; text-decoration: none; background: none; border: 0; color: var(--accent-ink); cursor: pointer; width: 100%; text-align: left; }

/* ticket day */
.demo-banner { margin: -16px -20px 0; padding: 10px 20px; background: var(--demo-bg); color: var(--demo-ink); font-size: 13.5px; font-weight: 600; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.stats.single { grid-template-columns: 1fr; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; text-align: left; color: var(--ink); }
.stat .lbl { font-size: 13px; color: var(--muted); }
.stat .v { font-weight: 600; }
.bar { height: 5px; border-radius: 3px; background: var(--divider); overflow: hidden; }
.bar-fill { height: 100%; width: 0; background: var(--accent); border-radius: 3px; transition: width .2s ease-out; }
button.stat { cursor: pointer; font: inherit; }
.switch-row { display: flex; justify-content: space-between; align-items: center; }
.switch { width: 40px; height: 24px; border-radius: 12px; padding: 3px; background: var(--border-strong); transition: background .15s; flex: none; }
.switch .knob { display: block; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.15); transition: transform .15s ease-out; }
.stat[aria-checked="true"] .switch { background: var(--accent); }
.stat[aria-checked="true"] .knob { transform: translateX(16px); }
.person { padding: 12px; gap: 8px; }
.person-head { display: flex; justify-content: space-between; align-items: center; padding: 0 2px; }
.person-head .name { font-weight: 600; }
.person-head .pstatus { font-size: 13px; font-weight: 600; color: var(--accent-ink); }
.share { padding: 16px; }
.share p { font-size: 14.5px; color: var(--ink-2); }
.inlink summary { list-style: none; cursor: pointer; color: var(--accent-ink); font-weight: 600; min-height: 32px; display: flex; align-items: center; }
.inlink summary::-webkit-details-marker { display: none; }
.link-box { background: var(--surface-sunk); border: 1px solid var(--border); border-radius: 12px; padding: 4px 12px; margin-top: 6px; }
.lrow { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--divider); }
.lrow .vals { font: 400 13px/1.4 var(--mono); color: var(--ink-2); display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.link-foot { font-size: 13px; color: var(--muted); padding: 8px 0 6px; }
.bottom-row { display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: var(--muted); }
.bottom-row .acts { display: flex; gap: 14px; margin-left: auto; }
.finish { background: var(--accent-soft); border-color: transparent; }
.finish p { color: var(--accent-deep); }

/* edit */
.ecard { padding: 12px 14px 14px; gap: 10px; }
.ecard.has-error { border-color: var(--danger); }
.ehead { display: flex; justify-content: space-between; align-items: center; font-weight: 600; }
.ehead .textbtn { font-size: 14px; font-weight: 400; }
.egrid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 8px; }
.field { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 500; color: var(--muted); }
.input { min-height: 46px; border-radius: 12px; border: 1px solid var(--border-strong); background: var(--surface-sunk); padding: 10px 12px; font-size: 16px; color: var(--ink); width: 100%; font-weight: 400; }
.input.mono { font-family: var(--mono); }
.input.bad { border-color: var(--danger); }
.err { font-size: 13.5px; color: var(--danger); }
.err:empty { display: none; }
.add-person { min-height: 48px; border-radius: 14px; border: 1px dashed var(--border-strong); background: none; color: var(--accent-ink); font-weight: 600; cursor: pointer; width: 100%; }
.add-person:disabled { color: var(--placeholder); cursor: default; }
.banner-ok { background: var(--accent-soft); color: var(--accent-deep); font-weight: 600; border-radius: 14px; padding: 12px 14px; }

/* interstitial list + data page */
.ilist { padding: 4px 16px 12px; gap: 0; }
.irow { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--divider); }
.irow .vals { font: 400 14px/1.4 var(--mono); color: var(--ink-2); display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.ilist .note { padding-top: 10px; }
.dblock { display: flex; flex-direction: column; gap: 4px; }
.dblock p { font-size: 15px; color: var(--ink-2); }
.dblock code, .code { font: 400 13.5px var(--mono); }
.check { padding: 14px 16px; gap: 8px; }
.check p { font-size: 14.5px; color: var(--ink-2); }
.check .links { display: flex; gap: 16px; flex-wrap: wrap; font-weight: 600; font-size: 14px; }

/* toast */
.toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  max-width: calc(100% - 40px); background: var(--accent); color: var(--on-accent); font-weight: 600; padding: 10px 18px; border-radius: 14px;
  transition: opacity .15s, transform .15s; text-align: center; z-index: 10;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.bad { background: var(--danger); color: #fff; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .copy:active { transform: none; }
}
