/* Broadsheet. Colours are tokens: swap the palette here. */
/* Newlyn trial cuts: licence before shipping. */
@font-face { font-family: "New Spirit"; src: url("fonts/NewSpiritTRIAL-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "New Spirit"; src: url("fonts/NewSpiritTRIAL-Medium.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "New Spirit"; src: url("fonts/NewSpiritTRIAL-RegularItalic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "New Science Mono"; src: url("fonts/NewScienceMonoTRIAL-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "New Science Mono"; src: url("fonts/NewScienceMonoTRIAL-Medium.woff2") format("woff2"); font-weight: 500; font-display: swap; }

:root {
  --paper: #FFFFFF;
  --paper-2: #F4F4F5;
  --card: #FFFFFF;
  --ink: #18181B;
  --ink-2: #71717A;
  --ink-3: #71717A;
  --line: rgba(24, 24, 27, 0.09);
  --accent: #5C6242;        /* olive: primary buttons and ticks only */
  --accent-ink: #FFFFFF;
  --highlight: rgba(92, 98, 66, 0.12);
  --display: "New Spirit", "Iowan Old Style", Georgia, serif;
  --body: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", sans-serif;
  --mono: "New Science Mono", ui-monospace, "SF Mono", monospace;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --col: min(680px, calc(100vw - 168px));
  --grain: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='1.15' numOctaves='1' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.16  0 0 0 0 0.17  0 0 0 0 0.12  0 0 0 -1.5 1.05'/><feComponentTransfer><feFuncA type='discrete' tableValues='0 1'/></feComponentTransfer></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #131414; --paper-2: #1C1D1D; --card: #1A1B1B; --ink: #EDEDEA; --ink-2: #9A9B98; --ink-3: #9A9B98;
    --line: rgba(237, 237, 234, 0.09); --accent: #A3AA7C; --accent-ink: #131414; --highlight: rgba(163, 170, 124, 0.2);
  }
}
:root[data-theme="dark"] {
  --paper: #131414; --paper-2: #1C1D1D; --card: #1A1B1B; --ink: #EDEDEA; --ink-2: #9A9B98; --ink-3: #9A9B98;
  --line: rgba(237, 237, 234, 0.09); --accent: #A3AA7C; --accent-ink: #131414; --highlight: rgba(163, 170, 124, 0.2);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--paper); color: var(--ink); font: 15px/1.55 var(--body); -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; }
a { color: inherit; }
[hidden] { display: none !important; }
::selection { background: var(--highlight); }

/* Frameless window: an invisible strip to drag by, clear of the traffic lights. */
.drag { position: fixed; inset: 0 0 auto 0; height: 44px; -webkit-app-region: drag; z-index: 50; background: var(--paper); -webkit-mask-image: linear-gradient(to bottom, #000 30%, transparent); pointer-events: auto; }
.menu, .toast, .takeover, .chat-panel, button, a, input, textarea { -webkit-app-region: no-drag; }


.view { height: 100%; overflow-y: auto; overflow-x: hidden; outline: none; scroll-behavior: smooth; }
.view::-webkit-scrollbar { width: 0; }

/* ── Brief ─────────────────────────────────────────────── */
.brief { width: var(--col); margin: 0 auto; padding: 84px 0 150px; }
.brief.enter > * { animation: rise 700ms var(--ease) both; }
.brief.enter > *:nth-child(2) { animation-delay: 60ms; } .brief.enter > *:nth-child(3) { animation-delay: 120ms; }
.brief.enter > *:nth-child(4) { animation-delay: 180ms; }
@keyframes drop-in { from { opacity: 0; transform: translateY(10px) scale(0.98); } } .brief.enter > *:nth-child(5) { animation-delay: 240ms; }
.brief.enter > *:nth-child(n+6) { animation-delay: 300ms; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.masthead { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; font-size: 13px; color: var(--ink-3); padding-bottom: 14px; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.masthead .past { color: var(--ink); background: var(--highlight); padding: 1px 7px; border-radius: 4px; }

.title { font-family: var(--display); font-weight: 400; font-size: clamp(50px, 8vw, 84px); line-height: 0.98; letter-spacing: -0.025em; margin: 36px 0 20px; }
.greeting { font-family: var(--display); font-size: 21px; line-height: 1.45; color: var(--ink-2); margin: 0 0 34px; max-width: 32em; text-wrap: pretty; }

.plate { position: relative; display: block; width: 100%; margin: 0 0 8px; padding: 0; border: 0; border-radius: 3px; overflow: hidden; background: var(--paper-2); aspect-ratio: 16 / 7.5; cursor: pointer; }
.plate-hint { position: absolute; right: 12px; bottom: 12px; padding: 5px 11px; border-radius: 999px; background: rgba(248, 244, 227, 0.92); color: var(--ink); font: 12.5px var(--body); opacity: 0; transform: translateY(4px); transition: opacity 200ms, transform 250ms var(--ease); }
.plate:hover .plate-hint, .plate:focus-visible .plate-hint { opacity: 1; transform: none; }
.plate img { transition: opacity 900ms ease, transform 1.2s var(--ease); }
.plate img { width: 100%; height: 100%; object-fit: cover; display: block; opacity: 0; transition: opacity 900ms ease; }
.plate img.loaded { opacity: 1; }
.plate-caption { font-family: var(--display); font-style: italic; font-size: 14px; color: var(--ink-3); margin: 2px 0 52px; }

.section { margin: 0 0 52px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin: 0 0 6px; }
.section-head h2 { font-family: var(--display); font-weight: 400; font-size: 27px; margin: 0; }
.section-head .count { font-size: 13px; color: var(--ink-3); font-variant-numeric: tabular-nums; }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 8px; border: 0; border-radius: 999px; padding: 8px 16px; background: var(--accent); color: var(--accent-ink); font: 500 14px var(--body); cursor: pointer; text-decoration: none; transition: transform 150ms var(--ease), opacity 150ms, background 150ms; }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); opacity: 0.85; }
.btn:disabled { opacity: 0.45; cursor: default; transform: none; }
.btn.ghost { background: var(--card); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.btn.ghost:hover { box-shadow: inset 0 0 0 1px var(--ink-3); }
.btn.small { padding: 5px 12px; font-size: 13px; }
.btn .arrow { transition: transform 200ms var(--ease); }
.btn:hover .arrow { transform: translateX(3px); }

/* Source marks */
.ico { display: inline-block; width: var(--ico-size, 16px); height: var(--ico-size, 16px); flex: none; vertical-align: -2px; }
.ico svg, .ico img { width: 100%; height: 100%; display: block; object-fit: contain; }
.ico--app { transform: scale(1.25); } /* app icons carry built-in padding */
.item-meta .src { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; }
.colophon a { gap: 7px; }

/* The one thing */
.postcard { position: relative; display: grid; grid-template-columns: 1fr; gap: 18px 32px; align-items: center; margin: 14px 0 0; padding: 30px 34px 32px; border-radius: 16px; background: var(--paper-2); }
.postcard-body { min-width: 0; }
.postcard-kicker { font-family: var(--display); font-style: italic; font-size: 16px; color: var(--accent); margin: 0 0 6px; }
.postcard-title { font-family: var(--display); font-weight: 500; font-size: 26px; line-height: 1.18; margin: 0 0 10px; letter-spacing: -0.012em; text-wrap: balance; }
.postcard-text { margin: 0; color: var(--ink-2); }
.badge { position: relative; width: 92px; height: 92px; border: 0; padding: 0; border-radius: 50%; background: var(--accent); color: var(--accent-ink); cursor: pointer; display: grid; place-items: center; transform: rotate(-7deg); box-shadow: 0 8px 20px rgba(92, 98, 66, 0.28); transition: transform 380ms cubic-bezier(0.3, 1.5, 0.5, 1), box-shadow 300ms; }
.badge::before { content: ""; position: absolute; inset: 5px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, 0.28); }
.badge-text { position: relative; font-family: var(--display); font-style: italic; font-size: 17px; line-height: 1.05; text-align: center; }
.badge:hover { transform: rotate(3deg) scale(1.05); box-shadow: 0 12px 26px rgba(92, 98, 66, 0.32); }
.badge:active { transform: rotate(3deg) scale(0.97); }
.badge .arrow { display: inline-block; transition: transform 250ms var(--ease); }
.badge:hover .arrow { transform: translateX(3px); }

/* Museum plaque */
/* Everything moves together: the painting's zoom, the backdrop blur and the edge blur share one duration and curve */
.plaque-wrap { --focus-in: 560ms cubic-bezier(0.22, 0.8, 0.2, 1); --focus-out: 420ms cubic-bezier(0.4, 0, 0.2, 1);
  position: fixed; inset: 0; z-index: 70; background: rgba(255, 255, 255, 0.55); backdrop-filter: blur(18px) saturate(0.9); animation: focus-in var(--focus-in) both; }
.plaque-wrap.leaving { animation: focus-out var(--focus-out) forwards; }
@keyframes focus-in { from { background: rgba(255,255,255,0); backdrop-filter: blur(0); } }
@keyframes focus-out { to { background: rgba(255,255,255,0); backdrop-filter: blur(0); } }
.focus-art { position: fixed; border-radius: 4px; overflow: hidden; box-shadow: 0 40px 90px rgba(0, 0, 0, 0.22); }
.focus-art img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* Sharp in the middle, blurring towards the edges, like a camera finding focus */
.focus-soft { position: absolute; inset: 0; backdrop-filter: blur(9px); -webkit-mask-image: radial-gradient(ellipse at 50% 45%, transparent 38%, rgba(0,0,0,0.6) 68%, #000 100%); mask-image: radial-gradient(ellipse at 50% 45%, transparent 38%, rgba(0,0,0,0.6) 68%, #000 100%); }
.plaque-wrap > .plaque { position: fixed; left: 0; right: 0; margin: 0 auto; top: var(--plaque-top, 30vh); }
.plaque { position: relative; width: min(440px, calc(100vw - 48px)); background: var(--card); border-radius: 6px; padding: 28px 30px 24px; box-shadow: 0 30px 70px rgba(0, 0, 0, 0.25); animation: plaque-in 480ms cubic-bezier(0.2, 0.8, 0.2, 1) 160ms both; }
@keyframes plaque-in { from { opacity: 0; transform: translateY(12px); } }
.plaque-wrap.leaving .plaque { opacity: 0; transition: opacity 200ms; }
/* Three lines, most important first: title (serif), who and when (ink), details (grey). */
.plaque-title { margin: 0 0 10px; font: 400 26px/1.2 var(--display); color: var(--ink); }
.plaque p { margin: 0; font: 400 14px/1.45 var(--body); }
.plaque .plaque-who { color: var(--ink); }
.plaque .plaque-details { color: var(--ink-2); }
.plaque-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 22px; }
.plaque-actions a { text-decoration: none; }
.plaque-close { position: absolute; top: 14px; right: 16px; border: 0; background: none; font-size: 20px; color: var(--ink-3); cursor: pointer; }

/* Choosing your art */
.artpick { margin: 0 0 52px; padding: 24px 26px; border-radius: 16px; background: var(--paper-2); border: 0; transition: opacity 400ms ease, transform 400ms var(--ease); }
.artpick.leaving { opacity: 0; transform: translateY(-8px); }
.artpick.in-settings { padding: 0; border: 0; background: none; margin: 8px 0 0; }
.artpick.in-settings .postcard-kicker, .artpick.in-settings .artpick-title, .artpick.in-settings > .hint { display: none; }
.artpick-title { font-family: var(--display); font-weight: 500; font-size: 24px; margin: 0 0 6px; }
.artpick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; margin-top: 14px; }
.artpick-opt { display: grid; grid-template-columns: 1fr; align-content: start; gap: 3px; align-items: center; text-align: left; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); cursor: pointer; color: var(--ink); transition: transform 200ms var(--ease), border-color 150ms; }
.artpick-opt:hover { transform: translateY(-2px); border-color: var(--ink-3); }
.artpick-opt.on { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.artpick-name { font-weight: 600; font-size: 14px; }
.artpick-note { font-size: 12.5px; color: var(--ink-2); }

/* Items (to-dos and updates) */
.items { list-style: none; margin: 0; padding: 0; }
.item { display: grid; grid-template-columns: 28px 1fr; gap: 0 14px; padding: 16px 0; border-top: 1px solid var(--line); overflow: hidden; }
.item:first-child { border-top: 0; }
.item.leaving { animation: leave 420ms var(--ease) forwards; }
@keyframes leave { 0% { opacity: 1; } 40% { opacity: 0; transform: translateX(14px); max-height: 400px; } 100% { opacity: 0; transform: translateX(14px); max-height: 0; padding: 0; border-color: transparent; } }
.tick { width: 20px; height: 20px; margin-top: 2px; border-radius: 50%; border: 1.5px solid var(--ink-3); background: transparent; cursor: pointer; padding: 0; display: grid; place-items: center; transition: border-color 150ms, background 150ms, transform 120ms; }
.tick:hover { border-color: var(--ink); }
.tick:active { transform: scale(0.9); }
.tick svg { opacity: 0; color: var(--accent-ink); transition: opacity 150ms; }
.item.done .tick { background: var(--accent); border-color: var(--accent); }
.item.done .tick svg { opacity: 1; }
.item-title { font-weight: 600; margin: 0; line-height: 1.4; }
.item-title a { text-decoration: none; }
.item-title a:hover { text-decoration: underline; text-underline-offset: 3px; }
.item-body { margin: 3px 0 0; color: var(--ink-2); text-wrap: pretty; }
.item-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin-top: 8px; font-size: 12.5px; color: var(--ink-3); }
.item-meta .src { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; }
.item-meta .src:hover { color: var(--ink); }
.dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; display: inline-block; }
.act { border: 0; background: none; padding: 0; color: var(--accent); cursor: pointer; font: inherit; font-weight: 500; }
.act::after { content: " →"; transition: margin 200ms var(--ease); }
.act:hover::after { margin-left: 3px; }
.item.done .item-title { text-decoration: line-through; text-decoration-thickness: 1px; color: var(--ink-3); }
.item.done .item-body { color: var(--ink-3); }
.item .why { font-size: 12.5px; font-style: italic; color: var(--ink-3); margin-top: 4px; }

.done-toggle { margin-top: 10px; border: 0; background: none; padding: 6px 0; font-size: 13px; color: var(--ink-3); cursor: pointer; }
.done-toggle:hover { color: var(--ink); }
.done-list { opacity: 0.85; }
.empty { color: var(--ink-3); font-style: italic; padding: 14px 0; }

/* Your day */
.day { list-style: none; margin: 0; padding: 0; }
.day li { display: grid; grid-template-columns: 82px 1fr; gap: 14px; padding: 12px 0; border-top: 1px solid var(--line); }
.day li:first-child { border-top: 0; }
.day time { font-size: 13.5px; color: var(--ink-3); padding-top: 1px; font-variant-numeric: tabular-nums; }
.day .ev { font-weight: 600; }
.day .note { color: var(--ink-2); margin: 2px 0 0; }

/* Tell your brief */
.notes-form { display: flex; gap: 8px; margin-top: 6px; }
.notes-form input { flex: 1; font: inherit; padding: 10px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); color: var(--ink); outline: none; }
.notes-form input:focus { border-color: var(--ink-3); }
.notes { list-style: none; margin: 12px 0 0; padding: 0; }
.notes li { display: flex; gap: 12px; align-items: baseline; padding: 6px 0; color: var(--ink-2); }
.notes time { font-family: var(--mono); font-size: 11px; color: var(--ink-3); min-width: 84px; }
.notes span { flex: 1; }
.notes button { border: 0; background: none; color: var(--ink-3); cursor: pointer; }
.hint { color: var(--ink-3); margin: 0; }

/* Sources: a quiet colophon at the end */
.colophon { margin-top: 64px; padding-top: 18px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; font-size: 13px; color: var(--ink-3); }
.colophon .lead { font-size: 13px; color: var(--ink-2); } /* same sans as the source names */
.colophon a { text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.colophon a:hover { color: var(--ink); }

/* ── Settings and Connectors pages ───────────────────────── */
.title--panel { font-size: clamp(48px, 7vw, 72px); margin-bottom: 14px; }
.panel .greeting { font-size: 19px; color: var(--ink-2); }
.p-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 10px; }
.p-row > .p-input { flex: 1; min-width: 160px; }
.p-row[hidden] { display: none; }
.p-between { justify-content: space-between; }
.p-input { font: inherit; font-size: 14px; padding: 9px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); color: var(--ink); outline: none; }
.p-input:focus { border-color: var(--ink-3); }
select.p-input { appearance: none; padding-right: 28px; }
.p-msg { margin: 8px 0 0; font-size: 13px; color: var(--ink-2); min-height: 0; }
.p-msg:empty { display: none; }
.p-msg.bad { color: #8C3B24; }
.p-small { font-size: 12.5px; color: var(--ink-3); margin: 4px 0 0; }
.p-label { font-size: 13px; font-weight: 600; color: var(--ink-2); margin: 22px 0 0; }
.p-options { display: flex; flex-direction: column; margin-top: 8px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--card); }
.p-option { display: grid; grid-template-columns: 22px 1fr; gap: 0 12px; align-items: baseline; text-align: left; padding: 13px 16px; border: 0; border-top: 1px solid var(--line); background: none; cursor: pointer; color: var(--ink); }
.p-option:first-child { border-top: 0; }
.p-option:hover { background: var(--paper); }
.p-option-name { font-weight: 600; }
.p-option-note { grid-column: 2; color: var(--ink-2); font-size: 13.5px; }
.p-radio, .p-check { grid-row: 1 / span 2; width: 16px; height: 16px; margin-top: 2px; border-radius: 50%; border: 1.5px solid var(--ink-3); transition: border-color 150ms, box-shadow 150ms; }
.p-check { border-radius: 5px; }
.p-option.on .p-radio { border-color: var(--accent); box-shadow: inset 0 0 0 3.5px var(--card), inset 0 0 0 10px var(--accent); }
.p-option.on .p-check { border-color: var(--accent); background: var(--accent); box-shadow: inset 0 0 0 3px var(--card); }
.p-meter { height: 5px; border-radius: 3px; background: var(--paper-2); overflow: hidden; margin: 12px 0 0; }
.p-meter i { display: block; height: 100%; background: var(--accent); }
.p-line { display: flex; gap: 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); }
.p-line:first-of-type { border-top: 0; }
.panel .section > .hint + .p-line { border-top: 0; margin-top: 4px; }
.p-other { margin-top: 6px; }
.p-other[hidden] { display: none; }
.p-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; margin-top: 8px; }
.p-card { display: flex; flex-direction: column; gap: 6px; padding: 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); min-height: 116px; }
.p-card-name { font-weight: 600; display: flex; align-items: center; gap: 8px; }
.p-on { margin-left: auto; font-size: 12px; font-weight: 500; color: var(--accent); }
/* Logos stay in full colour whether or not they're connected */
.p-card-blurb { color: var(--ink-2); font-size: 13px; flex: 1; }
.p-card-act { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.p-card-act .p-input { flex: 1; min-width: 0; padding: 6px 9px; font-size: 13px; }
.btn.small { padding: 5px 12px; font-size: 13px; }

/* ── Menu (bottom left) ─────────────────────────────────── */
.menu { position: fixed; left: 22px; bottom: 22px; z-index: 40; }
.menu-button { width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line); background: var(--card); box-shadow: 0 4px 14px rgba(42, 44, 32, 0.08); cursor: pointer; display: grid; place-content: center; gap: 4px; opacity: 0.45; transition: opacity 200ms, background 200ms; }
.menu-button span { display: block; width: 16px; height: 1.5px; background: var(--ink); border-radius: 1px; transition: transform 300ms var(--ease), opacity 200ms; }
.menu-button:hover, .menu.open .menu-button { opacity: 1; }
.menu.open .menu-button span:nth-child(1) { transform: translateY(5.5px) rotate(45deg); }
.menu.open .menu-button span:nth-child(2) { opacity: 0; }
.menu.open .menu-button span:nth-child(3) { transform: translateY(-5.5px) rotate(-45deg); }
.menu-list { position: absolute; left: 0; bottom: 50px; padding: 6px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); box-shadow: 0 16px 40px rgba(42, 44, 32, 0.14); opacity: 0; transform: translateY(6px); transition: opacity 220ms var(--ease), transform 220ms var(--ease); display: flex; flex-direction: column; align-items: flex-start; gap: 2px; pointer-events: none; }
.menu-list button { border: 0; background: none; padding: 5px 10px; border-radius: 8px; cursor: pointer; white-space: nowrap; font-size: 14px; color: var(--ink-2); opacity: 0; transform: translateY(8px); transition: opacity 260ms var(--ease), transform 260ms var(--ease), background 150ms, color 150ms; }
.menu-list button:hover, .menu-list button:focus-visible { background: var(--paper-2); color: var(--ink); outline: none; }
.menu-list .stat { padding: 3px 10px; font-size: 13.5px; color: var(--ink-2); opacity: 0; transform: translateY(8px); transition: opacity 260ms var(--ease), transform 260ms var(--ease); white-space: nowrap; }
.menu-list .stat b { font-weight: 600; color: var(--ink); margin-left: 6px; font-variant-numeric: tabular-nums; }
.menu.open .menu-list { pointer-events: auto; opacity: 1; transform: none; }
.menu.open .menu-list > * { opacity: 1; transform: none; }
.menu.open .menu-list > *:nth-last-child(2) { transition-delay: 30ms; } .menu.open .menu-list > *:nth-last-child(3) { transition-delay: 60ms; }
.menu.open .menu-list > *:nth-last-child(4) { transition-delay: 90ms; } .menu.open .menu-list > *:nth-last-child(5) { transition-delay: 120ms; }
.menu.open .menu-list > *:nth-last-child(n+6) { transition-delay: 150ms; }

/* ── Toast ──────────────────────────────────────────────── */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: var(--paper); border-radius: 999px; padding: 9px 10px 9px 18px; display: flex; align-items: center; gap: 14px; font-size: 14px; z-index: 60; animation: toast-in 300ms var(--ease); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18); }
.toast button { border: 0; border-radius: 999px; padding: 4px 12px; background: rgba(255, 255, 255, 0.15); color: inherit; cursor: pointer; font-weight: 600; }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 10px); } }

/* ── Loading ────────────────────────────────────────────── */
.loading { min-height: 100%; display: grid; place-items: center; padding: 60px 24px; }
.loading-inner { width: min(460px, 100%); }
.loading h1 { font-family: var(--display); font-weight: 400; font-size: 46px; margin: 0 0 8px; line-height: 1; }
.loading .sub { color: var(--ink-2); margin: 0 0 28px; }
.steps { list-style: none; margin: 0; padding: 0; font-size: 14px; }
.steps li { display: flex; gap: 12px; align-items: center; padding: 7px 0; color: var(--ink-3); animation: rise 400ms var(--ease) both; }
.steps li.now { color: var(--ink); }
.steps li .mark { width: 14px; text-align: center; }
.steps li.now .mark { animation: pulse 1.1s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.25; } }
.loading .err { color: #B3261E; margin-top: 18px; }

/* ── History: the time machine ──────────────────────────── */
.machine { position: fixed; inset: 0; background: var(--paper); perspective: 1400px; perspective-origin: 50% 20%; overflow: hidden; z-index: 30; }
.machine-stack { position: absolute; left: 50%; top: 60%; width: min(560px, 62vw); height: 0; transform: translateX(-50%); transform-style: preserve-3d; }
.mcard { position: absolute; left: 0; right: 0; transform-origin: 50% 100%; border-radius: 12px; overflow: hidden; background: var(--card); box-shadow: 0 30px 60px rgba(0, 0, 0, 0.16), 0 0 0 1px var(--line); cursor: pointer; will-change: transform, opacity; user-select: none; }
.machine { animation: machine-in 320ms var(--ease) both; }
.machine.leaving { animation: machine-out 260ms ease forwards; }
@keyframes machine-in { from { opacity: 0; } }
@keyframes machine-out { to { opacity: 0; } }
.mcard img { width: 100%; aspect-ratio: 16 / 8; object-fit: cover; display: block; background: var(--paper-2); }
.mcard .mc-text { padding: 14px 18px 16px; }
.mcard .mc-date { font-size: 12.5px; color: var(--ink-3); }
.mcard .mc-title { font-family: var(--display); font-size: 28px; margin: 2px 0 4px; }
.mcard .mc-greet { color: var(--ink-2); font-size: 13.5px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.machine-rail { position: absolute; right: 34px; top: 80px; bottom: 80px; width: 120px; display: flex; flex-direction: column; justify-content: center; gap: 3px; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.machine-rail button { border: 0; background: none; text-align: right; color: var(--ink-3); cursor: pointer; padding: 2px 0; transition: color 200ms, transform 300ms var(--ease); }
.machine-rail button.on { color: var(--ink); transform: translateX(-6px); }
.machine-head { position: absolute; left: 0; right: 0; top: 0; padding: 38px 0 34px; text-align: center; z-index: 2; pointer-events: none;
  background: linear-gradient(to bottom, var(--paper) 78%, rgba(255,255,255,0)); }
.machine-head h2 { font-family: var(--display); font-weight: 400; font-size: 34px; margin: 0; }
.machine-head p { color: var(--ink-3); margin: 4px 0 0; font-size: 13px; }


/* ── First launch: an envelope opens into the brief ─────── */
.takeover { position: fixed; inset: 0; z-index: 100; background: var(--paper); display: grid; place-items: center; overflow: hidden; cursor: pointer; }
.takeover::after { content: ""; position: absolute; inset: 0; background-image: var(--grain); opacity: 0.08; pointer-events: none; mix-blend-mode: multiply; }
.shapes { position: absolute; inset: 0; pointer-events: none; z-index: 0; }
.env { position: relative; z-index: 1; width: min(440px, 56vw); aspect-ratio: 1.55; perspective: 1100px; animation: env-in 900ms cubic-bezier(0.2, 0.9, 0.25, 1.15) both; transition: transform 900ms var(--ease), opacity 700ms ease; }
@keyframes env-in { from { opacity: 0; transform: translateY(40px) rotate(-5deg) scale(0.94); } to { opacity: 1; transform: rotate(-1.5deg); } }
.takeover:not(.open) .env:hover { transform: rotate(-1deg) translateY(-3px); }
.env-back, .env-front, .env-flap { position: absolute; inset: 0; background-color: var(--accent); background-image: var(--grain); background-blend-mode: soft-light; }
.env-back { border-radius: 6px; filter: brightness(0.8); }
.env-front { clip-path: polygon(0 0, 50% 54%, 100% 0, 100% 100%, 0 100%); border-radius: 6px; z-index: 3; }
.env-front::before { content: ""; position: absolute; inset: 0; background: linear-gradient(160deg, rgba(255,255,255,0.10), rgba(0,0,0,0.10)); }
.env-flap { clip-path: polygon(0 0, 100% 0, 50% 58%); transform-origin: 50% 0; z-index: 4; filter: brightness(1.06); transition: transform 700ms cubic-bezier(0.5, 0, 0.2, 1), z-index 0s 300ms; }
.env-seal { position: absolute; left: 50%; top: 52%; width: 48px; height: 48px; margin: -24px; border-radius: 50%; z-index: 5; background: #8C3B24; background-image: var(--grain); background-blend-mode: soft-light; display: grid; place-items: center; font-family: var(--display); color: #F8F4E3; font-size: 20px; box-shadow: 0 2px 6px rgba(0,0,0,0.18); transition: opacity 250ms ease, transform 350ms cubic-bezier(0.3, 1.6, 0.6, 1); }
.takeover:not(.open) .env:hover .env-seal { transform: scale(1.06); }
.env-letter { position: absolute; left: 6%; right: 6%; top: 6%; bottom: 6%; z-index: 2; background: var(--card); border-radius: 4px; overflow: hidden; padding: 7% 8%; color: var(--ink); box-shadow: 0 6px 18px rgba(0,0,0,0.10); transition: transform 900ms cubic-bezier(0.3, 0.9, 0.25, 1) 380ms, z-index 0s 650ms; }
.env-letter::after { content: ""; position: absolute; inset: 0; background-image: var(--grain); opacity: 0.16; mix-blend-mode: multiply; pointer-events: none; }
.env-letter .l-date { font-size: 12px; color: var(--ink-3); }
.env-letter .l-title { font-family: var(--display); font-weight: 400; font-size: clamp(26px, 3.8vw, 42px); line-height: 1; margin: 10px 0 0; }
.shape { position: absolute; z-index: 1; width: var(--s); height: var(--s); left: 50%; top: 42%; background-color: var(--c); background-image: var(--grain); background-blend-mode: soft-light; opacity: 0; }
.takeover-hint { position: absolute; bottom: 9vh; left: 0; right: 0; text-align: center; font-family: var(--display); font-style: italic; font-size: 16px; color: var(--ink-3); animation: hint 800ms ease 1.2s both; transition: opacity 250ms; }
@keyframes hint { from { opacity: 0; } to { opacity: 1; } }

.takeover.open { cursor: default; }
.takeover.open .env-flap { transform: rotateX(180deg); z-index: 1; }
.takeover.open .env-seal { opacity: 0; transform: scale(1.5); }
.takeover.open .env-letter { transform: translateY(-58%); z-index: 6; }
.takeover.open .takeover-hint { opacity: 0; animation: none; }
.takeover.open .shape { animation: burst 1.5s cubic-bezier(0.15, 0.8, 0.3, 1) calc(320ms + var(--d)) forwards; }
@keyframes burst {
  0% { opacity: 0; transform: translate(-50%, 0) rotate(0) scale(0.3); }
  15% { opacity: 1; }
  100% { opacity: 1; transform: translate(calc(-50% + var(--x)), var(--y)) rotate(var(--r)) scale(1); }
}
/* Hand-off: the envelope drops away, the letter lifts and dissolves, the brief rises in behind. */
.takeover.reveal { background: transparent; pointer-events: none; transition: background 600ms ease 250ms; }
.takeover.reveal::after { opacity: 0; transition: opacity 600ms ease; }
.takeover.reveal .env { transform: translateY(70vh) rotate(4deg); opacity: 0; transition: transform 900ms cubic-bezier(0.55, 0, 0.75, 0.3), opacity 600ms ease 250ms; }
.takeover.reveal .env-letter { transform: translateY(-120%) scale(1.15); opacity: 0; transition: transform 800ms cubic-bezier(0.4, 0, 0.2, 1), opacity 500ms ease 200ms; }
.takeover.reveal .shape { opacity: 0 !important; transition: opacity 500ms ease; animation-play-state: paused; }
.brief.hold { opacity: 0; }

/* ── Every other morning: a light reveal ───────────────── */
.brief.morning .masthead { animation: fade-in 600ms ease both; }
.brief.morning .title .word { display: inline-block; animation: word-in 900ms cubic-bezier(0.2, 0.8, 0.2, 1) both; animation-delay: calc(120ms + var(--i) * 90ms); }
@keyframes word-in { from { opacity: 0; transform: translateY(0.35em); filter: blur(6px); } }
.brief.morning .greeting { animation: rise 800ms var(--ease) 520ms both; }
.brief.morning .plate { animation: unveil 1.2s cubic-bezier(0.65, 0, 0.35, 1) 650ms both; }
@keyframes unveil { from { clip-path: inset(0 0 100% 0); } to { clip-path: inset(0 0 0 0); } }
.brief.morning .plate img { transition-delay: 650ms; }
.brief.morning .plate-caption { animation: fade-in 600ms ease 1.5s both; }
.brief.morning > :nth-child(n+6) { animation: rise 700ms var(--ease) both; animation-delay: 1.1s; }
@keyframes fade-in { from { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; transition-duration: 1ms !important; transition-delay: 0ms !important; }
}

/* History: a quiet line of numbers */
.machine-stats { display: flex; justify-content: center; gap: 30px; margin: 0; color: var(--ink-3); font-size: 12.5px; }
.machine-stats b { font-family: var(--display); font-weight: 400; font-size: 17px; color: var(--ink); margin-right: 5px; font-variant-numeric: tabular-nums; }
.machine-stats div { display: flex; align-items: baseline; white-space: nowrap; }
.loading .cancel { margin-top: 18px; }

.p-keybox { margin-top: 14px; padding: 4px 0 0; }
.p-seg { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; margin-top: 8px; border-radius: 12px; background: var(--paper-2); }
.p-seg-btn { border: 0; background: none; padding: 6px 12px; border-radius: 8px; font: 500 13.5px var(--body); color: var(--ink-2); cursor: pointer; }
.p-seg-btn.on { background: var(--card); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,0.08); }

.p-searchrow { margin: 8px 0 8px; }
.p-card[hidden], .section[hidden] { display: none; }
.p-search { width: 100%; padding: 11px 14px; font-size: 15px; border-radius: 12px; background: var(--paper-2); border-color: transparent; }
.p-search:focus { background: var(--card); border-color: var(--ink-3); }

/* ── Coming up: plan cards ───────────────────────────────── */
.cards { display: grid; grid-template-columns: 1fr; gap: 12px; margin-top: 10px; }
.card { border: 1px solid var(--line); border-radius: 16px; background: var(--card); padding: 18px 20px; box-shadow: 0 1px 2px rgba(24,24,27,0.03); }
.card-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.card-who { display: inline-flex; align-items: center; gap: 8px; }
.card-kicker { font-size: 13px; font-weight: 500; color: var(--ink-2); }
.card-when { font-size: 13px; color: var(--ink-3); }
.card-title { font-family: var(--display); font-weight: 500; font-size: 22px; line-height: 1.2; margin: 8px 0 2px; }
.card-sub { color: var(--ink-2); margin: 0; font-size: 14px; }
.status { font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: var(--paper-2); color: var(--ink-2); }
.status.good { background: rgba(92, 98, 66, 0.12); color: var(--accent); }
.status.bad { background: rgba(155, 44, 31, 0.1); color: #9B2C1F; }
.facts { display: flex; flex-wrap: wrap; gap: 6px 28px; margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--line); }
.fact { display: flex; flex-direction: column; gap: 1px; }
.fact-label { font-size: 11.5px; color: var(--ink-3); }
.fact-value { font-size: 15px; font-weight: 500; font-variant-numeric: tabular-nums; }
.fact-value.mono { font-family: var(--mono); font-size: 14px; letter-spacing: 0.04em; }
.fact-value.copy { cursor: copy; border-radius: 4px; transition: background 150ms; }
.fact-value.copy:hover { background: var(--paper-2); }
.fact-value.copied::after { content: " ✓"; color: var(--accent); }
.card-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.card-btn { display: inline-flex; align-items: center; padding: 6px 13px; border-radius: 999px; font: 500 13px var(--body); color: var(--ink); background: var(--card); box-shadow: inset 0 0 0 1px var(--line); border: 0; cursor: pointer; text-decoration: none; transition: box-shadow 150ms, transform 150ms var(--ease); }
.card-btn:hover { box-shadow: inset 0 0 0 1px var(--ink-3); transform: translateY(-1px); }
.card-btn.primary { background: var(--accent); color: var(--accent-ink); box-shadow: none; }

/* Flight: a boarding-pass route */
.route { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 14px; margin-top: 14px; }
.route-end.to { text-align: right; }
.route-code { font-family: var(--display); font-size: 40px; line-height: 1; letter-spacing: -0.01em; }
.route-city { font-size: 12.5px; color: var(--ink-3); margin-top: 3px; }
.route-time { font-size: 17px; font-weight: 600; margin-top: 6px; font-variant-numeric: tabular-nums; }
.route-path { position: relative; height: 56px; color: var(--ink-3); }
.route-path svg { position: absolute; inset: 6px 0 auto; width: 100%; height: 30px; }
.route-plane { position: absolute; left: 0; top: 0; font-size: 17px; line-height: 1; color: var(--ink); transition: left 600ms var(--ease), top 600ms var(--ease); }
.route-mid { position: absolute; left: 0; right: 0; bottom: 0; text-align: center; font-size: 12.5px; color: var(--ink-2); }

/* Train: a two-stop line */
.rail { margin-top: 14px; display: flex; flex-direction: column; gap: 10px; position: relative; }
.rail::before { content: ""; position: absolute; left: 62px; top: 10px; bottom: 10px; width: 2px; background: var(--line); }
.rail-stop { display: grid; grid-template-columns: 52px 22px 1fr; align-items: center; }
.rail-time { font-weight: 600; font-variant-numeric: tabular-nums; }
.rail-dot { width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--accent); background: var(--card); justify-self: center; position: relative; }
.rail-name { font-size: 15px; }

/* Reservation: a ticket stub */
.card-res { display: grid; grid-template-columns: 96px 1fr; padding: 0; overflow: hidden; }
.res-time { display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 2px; background: var(--paper-2); border-right: 1px dashed var(--line); }
.res-day { font-size: 12px; color: var(--ink-3); }
.res-clock { font-family: var(--display); font-size: 26px; font-variant-numeric: tabular-nums; }
.res-body { padding: 16px 20px; }
.res-body .card-title { margin-top: 2px; }

/* Delivery: a progress line */
.track { display: grid; grid-template-columns: repeat(4, 1fr); margin-top: 16px; position: relative; }
.track::before { content: ""; position: absolute; left: 6px; right: 6px; top: 5px; height: 2px; background: var(--line); }
.track-step { position: relative; display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--ink-3); }
.track-step:last-child { align-items: flex-end; text-align: right; }
.track-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--card); border: 2px solid var(--line); position: relative; z-index: 1; }
.track-step.on .track-dot { border-color: var(--accent); background: var(--accent); }
.track-step.now .track-name { color: var(--ink); font-weight: 600; }

.p-option-sub { border-top: 0; padding: 0 16px 14px 50px; margin-top: -4px; background: none; }
.p-option-sub .p-option-name { font-weight: 500; font-size: 14px; }
.p-option-sub .p-option-note { font-size: 13px; }
.p-option.on + .p-option-sub, .p-option-sub:hover { background: none; }
.p-card-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.p-card-name { min-width: 0; }
.p-cat .section-head h2 { font-size: 24px; }
.p-other { margin-top: 14px; padding: 16px; border-radius: 14px; background: var(--paper-2); }
.p-other[hidden] { display: none; }

.btn.ghost.danger { color: #9B2C1F; }

/* A fixed height and line-height, a tighter gap and a little less on the right
   (the arrow glyph carries its own space), so the label sits optically centred */
.postcard-go { margin-top: 18px; height: 34px; padding: 0 14px 0 16px; gap: 6px; font-size: 14px; line-height: 1; }
.postcard-go .arrow { line-height: 1; position: relative; top: -0.5px; }
.postcard-go:hover .arrow, .postcard-go:hover { transform: none; } /* Make a start: no moving arrow on hover */

/* Accessibility: a clear keyboard focus ring on everything you can tab to */
:where(button, a, input, select, textarea, [tabindex]):focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.p-input:focus-visible, .notes-form input:focus-visible { outline: 2px solid var(--accent); outline-offset: 0; }

/* Painting hover: lifts a touch and a warm gallery light follows the pointer */
.plate { transition: transform 500ms var(--ease), box-shadow 500ms var(--ease); }
.plate::after { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity 400ms ease;
  background: radial-gradient(circle 280px at var(--mx, 50%) var(--my, 50%), rgba(255, 244, 220, 0.55), rgba(255, 244, 220, 0.12) 45%, rgba(0, 0, 0, 0.18) 100%);
  mix-blend-mode: soft-light; }
.plate:hover { transform: translateY(-3px); box-shadow: 0 18px 40px rgba(24, 24, 27, 0.16); }
.plate:hover::after { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .plate:hover { transform: none; } }

/* The one Close button: top right, same everywhere */
.close-btn { position: fixed; top: 22px; right: 26px; z-index: 75; box-shadow: inset 0 0 0 1px var(--line), 0 4px 14px rgba(24, 24, 27, 0.06); }
.close-btn[hidden] { display: none; }

.one-thing { margin-bottom: 60px; }

/* Train: a railway between the stations, the train at its current position */
.rail-route { display: grid; grid-template-columns: minmax(90px, auto) 1fr minmax(90px, auto); align-items: center; gap: 18px; margin-top: 14px; }
.rail-end.to { text-align: right; }
.rail-end .rail-time { font-size: 22px; font-weight: 500; line-height: 1; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.rail-end .rail-name { font-size: 13px; color: var(--ink-2); margin-top: 6px; }
.rail-track { position: relative; height: 56px; }
/* two rails with sleepers */
.rail-track::before { content: ""; position: absolute; left: 0; right: 0; top: 18px; height: 8px;
  border-top: 1.5px solid var(--ink-3); border-bottom: 1.5px solid var(--ink-3);
  background: repeating-linear-gradient(90deg, transparent 0 7px, var(--line) 7px 9px); }
.rail-stop-dot { position: absolute; top: 15px; left: -2px; width: 10px; height: 14px; border-radius: 3px; background: var(--accent); }
.rail-stop-dot.end { left: auto; right: -2px; }
.rail-train { position: absolute; top: 10px; width: 40px; height: 15px; transform: translateX(-50%); color: var(--accent); transition: left 600ms var(--ease); filter: drop-shadow(0 2px 3px rgba(24,24,27,.15)); }
.rail-track.moving .rail-train { animation: rail-rock 1.2s ease-in-out infinite; }
@keyframes rail-rock { 50% { transform: translateX(-50%) translateY(-0.6px); } }
.rail-mid { position: absolute; left: 0; right: 0; bottom: 0; text-align: center; font-size: 12.5px; color: var(--ink-2); }
@media (prefers-reduced-motion: reduce) { .rail-track.moving .rail-train { animation: none; } }

.src--logo { display: inline-grid; place-items: center; width: 26px; height: 26px; margin: 0 -6px 0 -4px; border-radius: 7px; transition: background 150ms; }
.src--logo:hover { background: var(--paper-2); }

/* Flight: a progress bar, like a live activity */
.fl-seat { font-size: 13px; font-weight: 500; color: var(--ink-2); }
.fl-ends { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-top: 16px; }
.fl-end.to { text-align: right; }
.fl-line { display: flex; align-items: baseline; gap: 10px; }
.fl-end.to .fl-line { flex-direction: row-reverse; }
.fl-code { font-family: var(--display); font-size: 34px; line-height: 1; letter-spacing: -0.01em; }
.fl-time { font-size: 20px; font-weight: 600; color: var(--accent); font-variant-numeric: tabular-nums; }
.fl-city { font-size: 12.5px; color: var(--ink-3); margin-top: 4px; }
.fl-bar { position: relative; height: 26px; margin-top: 14px; border-radius: 999px; background: var(--paper-2); }
.fl-fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 999px; background: var(--accent); transition: width 600ms var(--ease); }
.fl-plane { position: absolute; top: 50%; width: 26px; height: 26px; transform: translate(-50%, -50%); border-radius: 50%; background: var(--card); color: var(--accent); box-shadow: 0 0 0 2px var(--accent), 0 2px 6px rgba(24,24,27,.18); display: grid; place-items: center; transition: left 600ms var(--ease); }
.fl-plane svg { width: 15px; height: 15px; }
.fl-goal { position: absolute; right: 7px; top: 50%; width: 12px; height: 12px; transform: translateY(-50%); border-radius: 50%; border: 2px solid var(--ink-3); background: var(--card); }
.fl-under { display: grid; grid-template-columns: 1fr auto 1fr; align-items: start; margin-top: 10px; }
.fl-left { display: flex; flex-direction: column; align-items: center; text-align: center; }
.fl-big { font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; }
.fl-small { font-size: 12px; color: var(--ink-3); }
.fl-under .status { justify-self: start; }

/* Live activity (flights and trains) */
.card.live { cursor: pointer; padding: 16px 20px 14px; transition: box-shadow 200ms, transform 200ms var(--ease); }
.card.live:hover { transform: translateY(-1px); box-shadow: 0 10px 26px rgba(24,24,27,.08); }
.live-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.live-id { font-size: 13px; font-weight: 500; color: var(--ink-2); }
.live-right { display: inline-flex; gap: 14px; align-items: center; font-size: 13px; color: var(--ink-2); }
.live-link { color: var(--accent); text-decoration: none; font-weight: 500; }
.live-link:hover { text-decoration: underline; }
.live-ends { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; margin-top: 10px; }
.live-end { display: flex; align-items: baseline; gap: 9px; min-width: 0; }
.live-end.to { flex-direction: row-reverse; text-align: right; }
.live-code { font-weight: 600; font-size: 20px; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-train .live-code { font-size: 17px; }
.live-time { font-size: 20px; font-weight: 600; color: var(--accent); font-variant-numeric: tabular-nums; white-space: nowrap; }
.live-bar { position: relative; height: 10px; margin: 14px 0 0; border-radius: 999px; background: var(--paper-2); }
.live-fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 999px; background: var(--accent); transition: width 600ms var(--ease); }
.live-vehicle { position: absolute; top: 50%; width: 24px; height: 24px; transform: translate(-50%, -50%); border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; box-shadow: 0 0 0 3px var(--card); transition: left 600ms var(--ease); }
.live-vehicle svg { width: 14px; height: 14px; }
.live-goal { position: absolute; right: 2px; top: 50%; width: 6px; height: 6px; transform: translateY(-50%); border-radius: 50%; background: var(--ink-3); }
.live-under { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; margin-top: 10px; font-size: 13px; }
.live-status { color: var(--accent); font-weight: 500; }
.live-status.bad { color: #9B2C1F; }
.live-status.to { text-align: right; color: var(--ink-2); }
.live-left { color: var(--ink-2); text-align: center; font-variant-numeric: tabular-nums; }

/* Right-click menu */
.ctx { position: fixed; z-index: 90; min-width: 200px; padding: 5px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); box-shadow: 0 14px 40px rgba(24, 24, 27, 0.16); animation: ctx-in 120ms ease-out; }
.ctx.leaving { opacity: 0; transition: opacity 120ms; }
@keyframes ctx-in { from { opacity: 0; transform: scale(0.97); } }
.ctx-item { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 7px 11px; border-radius: 7px; font: 14px var(--body); color: var(--ink); cursor: pointer; }
.ctx-item:hover, .ctx-item:focus-visible { background: var(--paper-2); outline: none; }
.ctx-item.primary { color: var(--accent); font-weight: 600; }
.ctx-sep { height: 1px; margin: 5px 6px; background: var(--line); }
/* Hover hint: a faint ⋯ in the corner */
.has-ctx { position: relative; }
.ctx-more { position: absolute; top: 8px; right: 8px; width: 28px; height: 24px; border: 0; border-radius: 7px; background: transparent; color: var(--ink-3); font-size: 17px; line-height: 1; cursor: pointer; opacity: 0; transition: opacity 150ms, background 150ms; }
.has-ctx:hover > .ctx-more, .ctx-more:focus-visible { opacity: 1; }
.ctx-more:hover { background: var(--paper-2); color: var(--ink); }
.plate > .ctx-more { background: rgba(255,255,255,.85); color: var(--ink); top: 10px; right: 10px; }
.card.clickable { cursor: pointer; }
.item.has-ctx > .ctx-more { top: 2px; right: 0; }

/* While the painting is open, its spot in the brief is empty (it "lifted" out) */
.plate.lifted img { visibility: hidden; }
.focus-soft { opacity: 0; animation: focus-soft-in var(--focus-in) forwards; }
@keyframes focus-soft-in { to { opacity: 1; } }
.plaque-wrap.leaving .focus-soft { opacity: 1; animation: focus-soft-out var(--focus-out) forwards; }
@keyframes focus-soft-out { from { opacity: 1; } to { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .focus-art { animation: none; } }

/* Daily arrival: a small envelope in the bottom-right corner */
html.post-arriving .dock-launcher { opacity: 0; pointer-events: none; transition: opacity 200ms; }
.post { position: fixed; right: 28px; bottom: 26px; z-index: 80; width: 132px; height: 86px; padding: 0; border: 0; background: none; cursor: pointer; perspective: 600px;
  animation: post-in 700ms cubic-bezier(0.2, 0.9, 0.25, 1.2) both; filter: drop-shadow(0 14px 22px rgba(24, 24, 27, 0.18)); }
@keyframes post-in { from { transform: translateY(140px) rotate(8deg); opacity: 0; } 60% { opacity: 1; } }
.post-back, .post-front, .post-flap { position: absolute; inset: 0; background: var(--accent); border-radius: 5px; }
.post-back { filter: brightness(0.82); }
.post-front { clip-path: polygon(0 0, 50% 54%, 100% 0, 100% 100%, 0 100%); z-index: 3; }
.post-flap { clip-path: polygon(0 0, 100% 0, 50% 58%); transform-origin: 50% 0; z-index: 4; filter: brightness(1.07); transition: transform 450ms cubic-bezier(0.5, 0, 0.2, 1), z-index 0s 220ms; }
.post-seal { position: absolute; left: 50%; top: 50%; width: 22px; height: 22px; margin: -11px; border-radius: 50%; z-index: 5; background: #8C3B24; color: #F4E9DF; font: italic 12px/22px var(--display); text-align: center; transition: opacity 200ms; }
.post-letter { position: absolute; left: 7%; right: 7%; top: 8%; bottom: 8%; z-index: 2; background: var(--card); border-radius: 3px; display: grid; place-items: start center; padding-top: 10%; transition: transform 500ms cubic-bezier(0.2, 0.8, 0.2, 1); }
.post-day { font: 15px var(--display); color: var(--ink); }
.post.open .post-flap { transform: rotateX(180deg); z-index: 1; }
.post.open .post-seal { opacity: 0; }
.post.letter .post-letter { transform: translateY(-62%); }
.post.out { animation: post-out 600ms cubic-bezier(0.4, 0, 0.2, 1) forwards; }
@keyframes post-out { to { transform: translateY(30px) scale(0.92); opacity: 0; } }
.brief.hold { opacity: 0; }
.brief.morning { animation: fade-in 500ms ease both; }

/* History footer: the stats, with a fade the cards slide under */
.machine-foot { position: absolute; left: 0; right: 0; bottom: 0; padding: 46px 0 30px; z-index: 2; pointer-events: none;
  background: linear-gradient(to top, var(--paper) 62%, rgba(255,255,255,0)); }

/* You page */
.ed { outline: none; border-radius: 6px; cursor: text; transition: background 150ms; }
.ed:hover { background: var(--paper-2); }
.ed:focus { background: var(--paper-2); box-shadow: 0 0 0 2px var(--paper-2); }
.ed:empty::before { content: attr(data-placeholder); color: var(--ink-3); }
.y-summary { display: block; font-family: var(--display); font-size: 24px; line-height: 1.35; color: var(--ink-2); margin: 6px 0 4px; }
.y-how { margin-bottom: 24px; }
.y-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; margin-top: 12px; }
.y-card { border: 1px solid var(--line); border-radius: 16px; padding: 16px 18px; background: var(--card); display: flex; flex-direction: column; gap: 8px; }
.y-card.muted { opacity: 0.7; }
.y-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.y-name { font-family: var(--display); font-size: 20px; line-height: 1.2; }
.y-goal { display: block; font-size: 14px; color: var(--ink-2); }
.y-status { flex: none; border: 0; border-radius: 999px; padding: 3px 9px; font: 600 11.5px var(--body); cursor: pointer; text-transform: capitalize; background: var(--paper-2); color: var(--ink-2); }
.y-status.s-active { background: rgba(92, 98, 66, 0.13); color: var(--accent); }
.y-status.s-done { background: var(--paper-2); color: var(--ink-3); }
.y-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.y-chip { font-size: 12px; padding: 2px 8px; border-radius: 999px; background: var(--paper-2); color: var(--ink-2); }
.y-chip.accent { background: var(--accent); color: var(--accent-ink); }
.y-chip.soft { background: none; box-shadow: inset 0 0 0 1px var(--line); }
.y-lock { font-size: 11.5px; color: var(--ink-3); }
.y-sub { list-style: none; margin: 4px 0 0; padding: 8px 0 0; border-top: 1px dashed var(--line); display: grid; gap: 4px; }
.y-sub li { display: flex; justify-content: space-between; font-size: 13.5px; }
.y-sub-status { font-size: 11.5px; color: var(--ink-3); text-transform: capitalize; }
.y-add { margin-top: 12px; }
.y-done { margin-top: 14px; } .y-done summary { cursor: pointer; color: var(--ink-3); font-size: 13.5px; }
.y-people { list-style: none; margin: 8px 0 0; padding: 0; }
.y-person { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; padding: 12px 0; border-top: 1px solid var(--line); }
.y-person:first-child { border-top: 0; }
.y-person-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.y-pname { font-weight: 600; }
.y-pnote { font-size: 13.5px; color: var(--ink-2); }
.y-rules, .y-facts { list-style: none; margin: 8px 0 0; padding: 0; }
.y-rules li, .y-facts li { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); }
.y-rules li:first-child, .y-facts li:first-child { border-top: 0; }
.y-x { border: 0; background: none; color: var(--ink-3); font-size: 18px; line-height: 1; cursor: pointer; opacity: 0; transition: opacity 150ms; }
li:hover > .y-x, .y-x:focus-visible { opacity: 1; }
.y-rule-input { width: 100%; margin-top: 10px; }
.y-add-input { margin-top: 12px; max-width: 320px; } .y-date { margin-top: 6px; max-width: 200px; }
.y-card.has-ctx > .ctx-more { top: auto; bottom: 10px; right: 10px; }
/* Plan cards: the ⋯ sits bottom right, clear of the status pill in the top corner */
.card.has-ctx > .ctx-more { top: auto; bottom: 10px; right: 10px; }
.p-custom { display: grid; gap: 6px; width: 100%; } .p-custom .p-input { width: 100%; box-sizing: border-box; } .p-custom .btn { justify-self: start; }
.menu-list button.current { background: var(--paper-2); color: var(--ink); font-weight: 600; }
/* Connector cards: secondary actions are quiet text, aligned with the card's text */
.p-card-act .btn.ghost { box-shadow: none; background: none; padding-left: 0; padding-right: 0; color: var(--ink-2); font-weight: 500; }
.p-card-act .btn.ghost:hover { color: var(--ink); transform: none; text-decoration: underline; text-underline-offset: 3px; }
.y-summary { margin: 4px 0 10px; }
.y-facts-top { margin: 0 0 44px; }
.y-facts-top li { padding: 6px 0; border-top: 0; color: var(--ink-2); font-size: 14.5px; }
.y-facts-top li::before { content: "·"; color: var(--ink-3); margin-right: 8px; }
.y-facts-top li { justify-content: flex-start; }
.y-facts-top li .ed { flex: 1; }
.y-foot { margin-top: 48px; text-align: left; }
/* A section with everything ticked off */
.section-cleared { margin-bottom: 28px; }
.cleared { display: flex; align-items: center; gap: 12px; width: 100%; padding: 14px 0; border: 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: none; cursor: pointer; text-align: left; color: var(--ink); }
.cleared-tick { width: 20px; height: 20px; color: var(--accent); flex: none; }
.cleared-title { font-family: var(--display); font-size: 22px; color: var(--ink-2); }
.cleared-count { margin-left: auto; font-size: 13.5px; color: var(--ink-3); }
.cleared-chev { width: 16px; text-align: center; color: var(--ink-3); font-size: 18px; line-height: 1; }
.cleared:hover .cleared-title { color: var(--ink); }
.section-cleared + .section-cleared .cleared { border-top: 0; }
.section-cleared:has(+ .section-cleared) { margin-bottom: 0; }
/* History cards: depth fades with a cheap overlay instead of a per-frame blur */
.mcard { will-change: transform, opacity; }
.mcard::after { content: ""; position: absolute; inset: 0; border-radius: inherit; background: var(--paper); opacity: calc(var(--depth, 0) * 0.12); pointer-events: none; }

/* Menu shortcuts: the letter sits quietly at the right of its item */
.menu-list:has(.menu-key) { align-items: stretch; min-width: 168px; }
.menu-list button { display: flex; align-items: center; justify-content: space-between; gap: 24px; text-align: left; }
/* Shortcut letters look like keys: a small rounded box */
.menu-key { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px; box-sizing: border-box; border-radius: 5px; box-shadow: inset 0 0 0 1px var(--line), inset 0 -1px 0 var(--line); background: var(--paper); font: 500 11.5px/1 var(--body); color: var(--ink-2); }
/* Cloud briefs option in Account: its own line under billing, aligned to the left edge */
.p-option-sub.p-cloud { width: 100%; margin-top: 22px; padding: 16px 0 0; border-top: 1px solid var(--line); }
/* Close pill: fades out with the page it belongs to */
.close-btn { transition: opacity 260ms var(--ease), transform 260ms var(--ease), box-shadow 150ms; }
.close-btn.leaving { opacity: 0; transform: translateY(-4px); pointer-events: none; }

/* Brief days: seven quiet pills; chosen days in olive */
.p-days { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.p-day { height: 36px; min-width: 52px; padding: 0 12px; border: 0; border-radius: 999px; background: none; box-shadow: inset 0 0 0 1px var(--line); font: 500 14px var(--body); color: var(--ink-2); cursor: pointer; transition: background 150ms, color 150ms; }
.p-day.on { background: var(--accent); color: #fff; box-shadow: none; }
.p-day:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* "Add to calendar" on a booking card */
.card-add { margin-top: 12px; }

/* Delivery cards: act from the card */
.card-acts { display: flex; gap: 8px; margin-top: 14px; }
.card-done .card-title { color: var(--ink-2); }
