/* AlignHour web app: the approved brand (Nov 2026, _design/alive). Paper #fbfaf6, white cards, forest ink #16302a,
   emerald accents, hairlines instead of shadows, square-ish corners (6px buttons, 8 to 12px cards). Dark mode is deep
   green #10231e, never black or charcoal. Same tokens as the website prototype. */
/* Figtree (SIL Open Font License, fonts/OFL-Figtree.txt), self-hosted: one variable file per script, weights 300 to 900. */
@font-face { font-family: "Figtree"; font-style: normal; font-weight: 300 900; font-display: swap; src: url("/fonts/figtree-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Figtree"; font-style: normal; font-weight: 300 900; font-display: swap; src: url("/fonts/figtree-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  /* --soft = the page ("paper"), --bg = cards and panels, --tone = a quiet tinted surface */
  --bg: #ffffff; --soft: #fbfaf6; --tone: #f3efe2; --line: #e6e1d6; --line-2: #d6cfbf;
  /* text: ink (headings) / body / quiet (5.4:1 on paper); --ink-4 only for icons and borders */
  --ink: #16302a; --ink-2: #425650; --ink-3: #5b6b65; --ink-4: #83938c;
  /* emerald accent: links and accent text #0a7550 (5.5:1 on paper, AA) */
  --accent: #0a7550; --accent-soft: #e4f1e8; --on-accent-soft: #0f5132;
  --ok: #0f5132; --ok-soft: #d4efdf; --on-ok-soft: #0f5132; --warn: #6b4500; --warn-soft: #fdf0d2; --bad: #b42318; --bad-soft: #fdecea;
  /* status: Working green, Awake amber-rust, Asleep quiet; plus the highlighter yellow */
  --rust: #7a3a12; --rust-soft: #fae6cf; --rust-dot: #b4532a; --sleep: #425650; --sleep-soft: #ebe7dc; --work-dot: #1f9d63;
  --lemon: #f2c94c; --on-lemon: #5a4500;
  /* ribbons and day bars: Working / Awake / Asleep */
  --work: #1f9d63; --awake: #e6b48a; --night: #d6cfbf;
  --r: 10px; --r-sm: 6px;
  --font: "Figtree", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  --shadow: none;
  --shadow-lg: none;
  --safe-b: env(safe-area-inset-bottom, 0px);
  /* solid = the main buttons: forest ink, like the website */
  --solid: #16302a; --solid-hover: #0d211c; --on-solid: #ffffff; --on-solid-2: #d4efdf;
  --on-accent: #ffffff; --on-bad: #ffffff; --bad-line: #f1c6c1;
  --scrim: rgba(22, 48, 42, 0.32);
  color-scheme: light;
}
/* Dark mode: deep green, never black or charcoal (theme.js sets data-theme on <html>: the device setting, or the person's own choice). */
:root[data-theme="dark"] {
  --bg: #17302a; --soft: #10231e; --tone: #1d362f; --line: #25443b; --line-2: #335a4e;
  --ink: #f2efe6; --ink-2: #c9d6cf; --ink-3: #a3b6ad; --ink-4: #7f978d;
  --accent: #7fdcaa; --accent-soft: #1a3a2f; --on-accent-soft: #c3ecd3;
  --ok: #c3ecd3; --ok-soft: #1f4a35; --on-ok-soft: #c3ecd3; --warn: #f2d68c; --warn-soft: #3b3016; --bad: #ff9f96; --bad-soft: #4a1c1a;
  --rust: #f7d7b8; --rust-soft: #4a3322; --rust-dot: #e0905e; --sleep: #c9d6cf; --sleep-soft: #25443b; --work-dot: #4cc98a;
  --lemon: #e9c75a; --on-lemon: #10231e;
  --work: #4cc98a; --awake: #b0663a; --night: #335a4e;
  --solid: #4cc98a; --solid-hover: #6fd7a2; --on-solid: #0b1f19; --on-solid-2: #1f4a35;
  --on-accent: #0b1f19; --on-bad: #2d0a08; --bad-line: #6b2f2a;
  --scrim: rgba(6, 20, 16, 0.62);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--soft); }
body { color: var(--ink-2); font: 400 15px/1.45 var(--font); -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
h1, h2, h3, strong { color: var(--ink); }
h1, h2, h3 { font-weight: 600; letter-spacing: -0.02em; }
a { color: var(--accent); }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }
.noscript { padding: 24px; text-align: center; }

.app { position: relative; display: flex; flex-direction: column; height: 100%; max-width: 560px; margin: 0 auto; background: var(--soft); box-shadow: 0 0 0 1px var(--line); }
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: max(14px, env(safe-area-inset-top)) 18px 12px; border-bottom: 1px solid var(--line); background: var(--soft); }
.brand { display: flex; align-items: center; gap: 10px; min-height: 44px; text-decoration: none; }
.brand img { display: block; width: 30px; height: 30px; }
.brand span { font-size: 19px; font-weight: 600; color: var(--ink); letter-spacing: -0.02em; }
/* The logo follows the app's own light/dark choice (the SVG file alone can only follow the device setting). */
:root[data-theme="light"] .brand img, :root[data-theme="light"] .welcome .logo { content: url("/icons/alignhour-icon-on-light.svg"); }
:root[data-theme="dark"] .brand img, :root[data-theme="dark"] .welcome .logo { content: url("/icons/alignhour-icon-on-dark.svg"); }
.top-right { display: flex; align-items: center; gap: 8px; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 4px; font-size: 15px; font-weight: 600; white-space: nowrap; }
.pill .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.ok { background: var(--ok-soft); color: var(--on-ok-soft); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.mute { background: var(--sleep-soft); color: var(--sleep); }
.pill.accent { background: var(--accent-soft); color: var(--on-accent-soft); }
.avatar, .theme-btn { position: relative; }
.avatar::after, .theme-btn::after { content: ""; position: absolute; inset: -4px; }
.avatar { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border: 0; border-radius: 6px; background: var(--accent-soft); color: var(--on-accent-soft); font-size: 15px; font-weight: 600; }

/* The menu comes before the page in the code (Tab order on a laptop), but stays at the bottom on a phone. */
.main { order: 1; } .tabs { order: 2; }
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 50; padding: 10px 14px; border-radius: var(--r-sm); background: var(--ink); color: var(--soft); font-weight: 600; text-decoration: none; }
.skip-link:focus { top: 12px; }
.main { flex: 1 1 auto; overflow-y: auto; padding: 18px 18px 28px; display: flex; flex-direction: column; gap: 20px; outline: none; -webkit-overflow-scrolling: touch; }
.loading { color: var(--ink-3); text-align: center; padding: 40px 0; }
.page-title { margin: 0; font-size: 26px; line-height: 1.2; font-weight: 600; letter-spacing: -0.025em; }
.page-sub { margin: 4px 0 0; color: var(--ink-3); font-size: 15px; }
.section { display: flex; flex-direction: column; gap: 10px; }
.label { margin: 0; font-size: 15px; font-weight: 600; color: var(--ink-3); }
.field-label { font-size: 15px; font-weight: 600; color: var(--ink); }
.muted { color: var(--ink-3); }
.small { font-size: 15px; }
.center { text-align: center; }
.num { font-variant-numeric: tabular-nums; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 18px; border: 0; border-radius: 6px; background: var(--solid); color: var(--on-solid); font-size: 16px; font-weight: 500; text-decoration: none; }
.btn:hover { background: var(--solid-hover); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: 0.55; cursor: default; }
.btn.block { width: 100%; }
.btn.ghost { background: var(--bg); color: var(--ink); border: 1px solid var(--line-2); }
.btn.ghost:hover { border-color: var(--ink); }
.btn.violet { background: var(--accent); color: var(--on-accent); }
.btn.small { min-height: 44px; padding: 0 14px; font-size: 15px; border-radius: 6px; }
.btn.light { background: var(--solid); color: var(--on-solid); }
.btn.outline-light { background: var(--bg); color: var(--ink); border: 1px solid var(--line-2); }
.btn.outline-light:hover { border-color: var(--ink); }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border: 0; border-radius: 6px; background: var(--tone); color: var(--ink-2); }
.link-btn { min-height: 44px; border: 0; background: none; padding: 6px 0; color: var(--accent); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }

/* cards */
.card { display: flex; flex-direction: column; gap: 10px; padding: 16px; border: 1px solid var(--line); border-radius: var(--r); background: var(--bg); box-shadow: var(--shadow); }
.note { padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r); background: var(--bg); color: var(--ink-2); font-size: 15px; }
.note.violet { background: var(--accent-soft); color: var(--on-accent-soft); border-color: color-mix(in srgb, var(--accent) 22%, transparent); }   /* class name kept; now a calm green-tinted note */
.note.bad { background: var(--bad-soft); color: var(--bad); border-color: var(--bad-line); }
.hscroll { display: flex; gap: 10px; overflow-x: auto; margin: 0 -18px; padding: 2px 18px 4px; scrollbar-width: none; }
.hscroll::-webkit-scrollbar { display: none; }
.now-card { flex: 0 0 148px; display: flex; flex-direction: column; gap: 6px; padding: 14px; border: 1px solid var(--line); border-radius: var(--r); background: var(--bg); box-shadow: var(--shadow); }
.now-card .city { font-size: 15px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.now-card .time { font-size: 24px; font-weight: 600; color: var(--ink); letter-spacing: -0.01em; }
.now-card .who { font-size: 15px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.now-card .pill { align-self: flex-start; }

.next { display: flex; flex-direction: column; gap: 12px; padding: 18px; border: 1px solid var(--line); border-radius: var(--r); background: var(--bg); color: var(--ink-2); }
.next .row { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.next .chip { font-size: 15px; font-weight: 600; padding: 3px 9px; border-radius: 6px; background: var(--accent-soft); color: var(--on-accent-soft); }
.next .meta { font-size: 15px; color: var(--ink-3); }
.next .title { font-size: 18px; font-weight: 600; color: var(--ink); }
.next .sub { font-size: 15px; color: var(--ink-3); }
.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.next .box { padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--soft); }
.next .box .k { font-size: 15px; color: var(--ink-3); }
.next .box .v { font-size: 16px; font-weight: 600; color: var(--ink); }
.next .actions { display: flex; gap: 8px; }
.next .actions .btn { flex: 1 1 auto; min-height: 44px; font-size: 15px; }
.box-soft { padding: 12px; border-radius: var(--r-sm); background: var(--soft); }
.box-soft .k { font-size: 15px; color: var(--ink-3); }
.box-soft .v { font-weight: 600; color: var(--ink); }

.list { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; background: var(--bg); }
.list > * + * { border-top: 1px solid var(--tone); }
.row-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; border: 0; background: var(--bg); text-align: left; text-decoration: none; color: inherit; }
button.row-item:hover { background: var(--soft); }
.row-item .grow { flex: 1 1 auto; min-width: 0; }
.row-item .title { display: block; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-item .sub { display: block; font-size: 15px; color: var(--ink-3); }
.row-item .end { flex: 0 0 auto; text-align: right; }
.date-box { flex: 0 0 auto; width: 46px; text-align: center; }
.date-box .dow { font-size: 15px; font-weight: 600; color: var(--accent); }
.date-box .day { font-size: 18px; font-weight: 600; color: var(--ink); }
.initials { flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 6px; background: var(--accent-soft); color: var(--on-accent-soft); font-weight: 600; }
.st { display: block; font-size: 15px; font-weight: 600; }
.st.Working { color: var(--ok); } .st.Awake { color: var(--rust); } .st.Asleep { color: var(--sleep); }

/* converter */
.converter { display: flex; flex-direction: column; gap: 10px; padding: 16px; border: 1px solid var(--line); border-radius: var(--r); background: var(--bg); color: var(--ink-2); }
.converter .big { font-size: 34px; font-weight: 600; color: var(--ink); letter-spacing: -0.02em; }
.converter input[type=range] { width: 100%; height: 44px; margin: 0; accent-color: var(--accent); }
.zone-row { display: flex; flex-direction: column; gap: 6px; }
.zone-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.zone-head .t { font-size: 18px; font-weight: 600; color: var(--ink); }
.ribbon { position: relative; display: grid; grid-template-columns: repeat(24, minmax(0, 1fr)); gap: 1px; height: 10px; border-radius: 3px; overflow: hidden; }
.ribbon span { display: block; height: 10px; background: var(--night); }
.ribbon span.awake { background: var(--awake); }
.ribbon span.work { background: var(--work); }
.ribbon .mark { position: absolute; top: 0; bottom: 0; width: 3px; border-radius: 2px; background: var(--ink); box-shadow: 0 0 0 2px var(--bg); }
.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 15px; color: var(--ink-3); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 12px; height: 8px; border-radius: 3px; }

/* choices */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-btn { min-height: 44px; padding: 0 14px; border: 1px solid var(--line-2); border-radius: 6px; background: var(--bg); color: var(--ink); font-weight: 500; }
.chip-btn:hover { border-color: var(--ink); }
.chip-btn[disabled] { opacity: 0.5; cursor: default; }
.chip-btn[aria-pressed="true"] { border-color: var(--solid); background: var(--solid); color: var(--on-solid); }
.days { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.day-btn { display: flex; flex-direction: column; align-items: center; padding: 8px 0; border: 1px solid var(--line-2); border-radius: 6px; background: var(--bg); color: var(--ink); }
.day-btn .dow { font-size: 15px; }
.day-btn .d { font-size: 18px; font-weight: 600; }
.day-btn[aria-pressed="true"] { border-color: var(--solid); background: var(--solid); color: var(--on-solid); }
.slot { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%; padding: 12px 14px; border: 1px solid var(--line-2); border-radius: var(--r); background: var(--bg); color: var(--ink); text-align: left; }
.slot b { font-weight: 600; color: inherit; }
.slot span { font-size: 15px; }
.slot[aria-pressed="true"] { border: 2px solid var(--accent); padding: 11px 13px; background: var(--accent-soft); color: var(--on-accent-soft); }
.slot.check { flex-direction: row; align-items: center; gap: 12px; }
.slot.check .box { flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border: 1.5px solid var(--ink-4); border-radius: 5px; color: transparent; }
.slot.check[aria-pressed="true"] .box { border-color: var(--accent); background: var(--accent); color: var(--on-accent); }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); padding: 4px; gap: 4px; border-radius: var(--r); background: var(--tone); }
.seg button { min-height: 44px; border: 0; border-radius: 6px; background: transparent; color: var(--ink-3); font-weight: 600; }
.seg button[aria-pressed="true"] { background: var(--bg); color: var(--ink); box-shadow: 0 0 0 1px var(--line-2); }
.search { display: flex; align-items: center; gap: 8px; min-height: 46px; padding: 0 14px; border: 1px solid var(--ink-4); border-radius: var(--r-sm); color: var(--ink-3); }
.search input { flex: 1 1 auto; min-width: 0; border: 0; outline: none; background: transparent; color: var(--ink); font-size: 16px; }
.search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }   /* keyboard users see where they type (UI-COV-4) */
.copybox { display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 14px; border: 1px solid var(--line-2); border-radius: var(--r-sm); }
.copybox span { flex: 1 1 auto; min-width: 0; font-size: 15px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.copybox.invite-msg { padding: 10px 14px; }
.copybox.invite-msg span { white-space: pre-wrap; overflow-wrap: anywhere; color: var(--ink-2); }   /* the whole team invite message, line by line */
.done { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 14px; padding: 30px 4px; }
.done .tick { display: inline-flex; align-items: center; justify-content: center; width: 64px; height: 64px; border-radius: 12px; background: var(--ok-soft); color: var(--on-ok-soft); }

/* sign-in screen */
.welcome { display: flex; flex-direction: column; gap: 18px; padding: 24px 2px; }
.welcome .logo { width: 72px; height: 72px; }
.welcome h1 { margin: 0; font-size: 30px; line-height: 1.15; letter-spacing: -0.02em; }
.welcome ul { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.gbtn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 52px; width: 100%; border: 1px solid var(--line-2); border-radius: 6px; background: var(--bg); color: var(--ink); font-size: 16px; font-weight: 500; }
.gbtn:hover { border-color: var(--ink); }

/* bottom tabs */
.tabs { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); align-items: center; padding: 8px 8px calc(10px + var(--safe-b)); border-top: 1px solid var(--line); background: var(--soft); }
.tab { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 0; min-height: 48px; padding: 4px 0; border: 0; background: transparent; color: var(--ink-3); font-size: 15px; font-weight: 600; letter-spacing: -0.02em; white-space: nowrap; overflow: hidden; }
/* The current tab: a tinted box, not only a colour (green and grey look alike to colour-blind people; accessibility M2). */
.tab[aria-current="page"] { background: var(--accent-soft); color: var(--on-accent-soft); border-radius: 6px; }
.tab-new { justify-self: center; display: inline-flex; align-items: center; justify-content: center; width: 54px; height: 54px; border: 0; border-radius: 8px; background: var(--solid); color: var(--on-solid); }
.badge { position: absolute; margin: -4px 0 0 18px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 6px; background: var(--bad); color: var(--on-bad); font-size: 15px; line-height: 20px; text-align: center; }

/* sheet + toast */
.sheet-backdrop { position: absolute; inset: 0; display: flex; align-items: flex-end; background: var(--scrim); z-index: 20; }
.sheet { width: 100%; max-height: 85%; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding: 18px 18px calc(18px + var(--safe-b)); border: 1px solid var(--line-2); border-bottom: 0; border-radius: 8px 8px 0 0; background: var(--bg); }
.sheet-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.sheet-head strong { font-size: 17px; }
.toast { position: absolute; left: 18px; right: 18px; bottom: calc(86px + var(--safe-b)); padding: 12px 16px; border-radius: var(--r-sm); background: var(--ink); color: var(--soft); font-weight: 600; text-align: center; z-index: 30; }
.toast.bad { background: var(--bad); color: var(--on-bad); }
/* Out of view but still in the page, so screen readers hear the next message (accessibility review, Low 6). */
.toast.off { clip-path: inset(50%); opacity: 0; pointer-events: none; }
/* A screen title gets focus when the screen opens; no ring for mouse users. */
h1[tabindex="-1"]:focus:not(:focus-visible) { outline: none; }

@media (prefers-reduced-motion: no-preference) {
  .sheet { animation: up 0.22s cubic-bezier(.2, .8, .2, 1); }
  @keyframes up { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
}
@media (min-width: 600px) { body { padding: 0; } .app { height: 100%; } }
.grow { flex: 1 1 auto; min-width: 0; }
.end { flex: 0 0 auto; text-align: right; }
.legend i.lg-work { background: var(--work); }
.legend i.lg-awake { background: var(--awake); }
.legend i.lg-night { background: var(--night); }
.tab { position: relative; }
.badge { top: 0; left: 50%; margin: 0 0 0 6px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.row-between > div { min-width: 0; overflow-wrap: anywhere; }
/* Text boxes use --ink-4 for their border (3:1 against the page, accessibility L3); other lines stay light. */
.field { width: 100%; min-height: 46px; padding: 0 14px; border: 1px solid var(--ink-4); border-radius: var(--r-sm); background: var(--bg); color: var(--ink); font-size: 16px; }
.field:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.zone-head .btn.small { flex: 0 0 auto; }
.stack { display: flex; flex-direction: column; gap: 6px; }
.inline { display: flex; gap: 8px; align-items: center; }
.inline .field { flex: 1 1 auto; min-width: 0; }
.field.area { min-height: 84px; padding: 12px 14px; line-height: 1.45; resize: vertical; font-family: inherit; }
.check-row { display: flex; align-items: flex-start; gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: var(--r); background: var(--bg); }
.check-row input { flex: 0 0 auto; width: 22px; height: 22px; margin: 1px 0 0; accent-color: var(--accent); }
.check-row strong { display: block; }
.btn.danger { color: var(--bad); border-color: var(--bad-line); }
.btn.danger:hover { border-color: var(--bad); }
/* Small text links still get a finger-sized tap area (the negative margin keeps the layout the same). */
.link-btn.tiny { padding: 12px 6px; margin: -12px 0; font-size: 15px; }
.compare-note { margin: 0; }
.link-btn.back { align-self: flex-start; text-decoration: none; }
.ok-text { color: var(--ok); font-weight: 600; }
.warn-text { color: var(--warn); }
.bad-text { color: var(--bad); font-weight: 600; }
.team-head { padding: 12px 4px 4px; font-weight: 600; letter-spacing: .02em; }
.linkrow { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.note.warn { background: var(--warn-soft); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 25%, transparent); }

/* ---------- Laptop and desktop: menu on the left, wider page, dialogs in the middle ---------- */
@media (min-width: 900px) {
  html, body { background: var(--soft); }
  .app {
    max-width: 1180px; height: 100%;
    display: grid; grid-template-columns: 232px minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr);
    grid-template-areas: "top top" "tabs main";
    box-shadow: 0 0 0 1px var(--line);
  }
  /* Signed out (sign-in, invite pages): no menu, so the page uses the full width and sits in the middle */
  .app:has(> .tabs[hidden]) { grid-template-areas: "top top" "main main"; }
  .top { grid-area: top; padding: 16px 28px; }
  .main { grid-area: main; padding: 28px 40px 48px; }
  .main > * { width: 100%; max-width: 760px; margin-left: auto; margin-right: auto; }
  .tabs {
    grid-area: tabs; display: flex; flex-direction: column; align-items: stretch; gap: 4px;
    padding: 20px 14px; border-top: 0; border-right: 1px solid var(--line); background: var(--soft);
  }
  .tab { flex-direction: row; justify-content: flex-start; gap: 12px; min-height: 44px; padding: 0 14px; border-radius: 6px; font-size: 15px; }
  .tab:hover { background: var(--tone); color: var(--ink); }
  .tab[aria-current="page"] { background: var(--accent-soft); color: var(--on-accent-soft); }
  .tab-new { order: -1; justify-self: stretch; width: 100%; height: 48px; margin-bottom: 12px; border-radius: 6px; gap: 8px; font-weight: 600; }
  .tab-new::after { content: "New meeting"; font-size: 15px; }
  .badge { position: static; order: 3; margin: 0 0 0 auto; }
  .hscroll { margin: 0; padding: 2px 0 4px; flex-wrap: wrap; }
  .now-card { flex: 0 0 164px; }
  .sheet-backdrop { position: fixed; align-items: center; justify-content: center; }
  .sheet { width: min(560px, 92vw); max-height: 86vh; border-bottom: 1px solid var(--line-2); border-radius: 8px; }
  .toast { position: fixed; left: 50%; right: auto; bottom: 28px; transform: translateX(-50%); min-width: 280px; }
  .days { grid-template-columns: repeat(8, minmax(0, 1fr)); }
}

.pill-btn { min-height: 44px; padding: 0 12px; border: 0; cursor: pointer; font: inherit; font-size: 15px; font-weight: 600; }   /* the plan button: 44 px to tap, like every target */
.pill-btn:hover { filter: brightness(0.96); }
.plans { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.plan-card { display: flex; flex-direction: column; gap: 6px; padding: 14px; border: 1px solid var(--line); border-radius: var(--r); background: var(--bg); }
.plan-card.mine { border: 2px solid var(--accent); padding: 13px; background: var(--accent-soft); }
.plan-card .plan-price { font-size: 20px; font-weight: 600; color: var(--ink); }
.plan-card .btn, .plan-card .pill { margin-top: auto; align-self: stretch; justify-content: center; }
@media (min-width: 900px) { .plans { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* ---------- Step B: history, results, follow-ups ---------- */
.seg-4 button { font-size: 15px; padding: 0 4px; }
.tagline { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.date-box .mon { font-size: 15px; color: var(--ink-3); }
.chip-btn.small { min-height: 44px; padding: 0 12px; font-size: 15px; }
.fq-actions { display: flex; gap: 6px; flex: 0 0 auto; }
.row-item.fq.due { background: var(--warn-soft); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.prewrap { white-space: pre-wrap; margin: 0; }
details summary { cursor: pointer; padding: 8px 0; color: var(--ink-3); font-weight: 600; }
.seg-4 button { line-height: 1.15; }
.inline .btn { white-space: nowrap; flex: 0 0 auto; }

/* ---------- Step C: reminder emails, feedback ---------- */
.seg-5 button { font-size: 15px; padding: 0 2px; }
.link-btn.tz-change { margin-left: 8px; }

/* ---------- light / dark switch ---------- */
.theme-btn { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border: 1px solid var(--line-2); border-radius: 6px; background: var(--bg); color: var(--ink); }
.theme-btn:hover { border-color: var(--ink); }
/* Text only screen readers hear (e.g. "Working" next to the coloured dot). */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
/* "Keep me signed in" on the sign-in screen */
.keep-row { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; margin: 4px 0; color: var(--ink-3); cursor: pointer; }
.keep-row input { width: 18px; height: 18px; margin: 0; accent-color: var(--accent); }

/* Role tests (5 Nov 2026): the booking screens (Send, Invite sent) use 15 px text like the rest; messages on a phone
   sit under the top bar and never take a tap (only an Undo inside one does). */
body.bk-on .main .small, body.bk-on .main .sub, body.bk-on .main .row-item .sub, body.bk-on .main .st, body.bk-on .main .page-sub,
body.bk-on .main .field-label, body.bk-on .main .label, body.bk-on .main .count, body.bk-on .main .slot span, body.bk-on .main .fit,
body.bk-on .main .part, body.bk-on .main .note, body.bk-on .main .chip-btn.small, body.bk-on .main .btn.small, body.bk-on .main .link-btn.tiny,
body.bk-on .main .linkrow .link-btn, body.bk-on .main .msg-box, body.bk-on .main .day-btn .dow, body.bk-on .main .tcard .p, body.bk-on .main .pill, body.bk-on .main .box-soft .k { font-size: 15px; }
body.bk-on .main .label { text-transform: none; letter-spacing: 0; }
@media (max-width: 899px) {
  .toast { top: var(--toast-top, 120px); bottom: auto; pointer-events: none; }
  .toast button { pointer-events: auto; }
}

/* ---------------------------------------------------------------- Our own calendar (owner, 6 Nov 2026)
   datepicker.js, the same calendar as the Chrome extension and the website, in the web app's colours. Never the browser's
   date box. Days 44 px wide and tall on a laptop (--dp-w); on phones lined up with the date box. */
.date-field { display: flex; align-items: center; gap: 9px; width: 100%; min-width: 0; min-height: 46px; padding: 0 12px 0 14px; border: 1px solid var(--ink-4); border-radius: var(--r-sm); background: var(--bg); color: var(--ink); font: 500 16px var(--font); text-align: left; cursor: pointer; container-type: inline-size; }
.date-field:hover { border-color: var(--ink); }
.date-field:focus-visible, .date-field[aria-expanded="true"] { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.date-field .df-ico { flex: 0 0 auto; width: 18px; height: 18px; fill: none; stroke: var(--accent); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.df-label { flex: 1 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.date-field.empty .df-label { color: var(--ink-3); font-weight: 400; }
.df-rel { flex: 0 0 auto; padding: 2px 9px; border-radius: var(--r-sm); background: var(--accent-soft); color: var(--on-accent-soft); font-size: 15px; font-weight: 500; white-space: nowrap; }
.df-rel.past { background: var(--warn-soft); color: var(--warn); }
@container (max-width: 230px) { .df-rel { display: none; } }

.dp-pop { --dp-w: 350px; position: absolute; z-index: 40; display: flex; flex-direction: column; gap: 10px; padding: 14px 14px 12px; border-radius: var(--r); border: 1px solid var(--line-2); background: var(--bg); color: var(--ink); font-family: var(--font); box-shadow: 0 12px 32px rgba(22, 48, 42, .16); overflow: auto; transform-origin: top center; animation: dp-in .18s ease-out; }
.dp-pop[hidden] { display: none; }
@keyframes dp-in { from { opacity: 0; transform: translateY(-4px) scale(.98); } }
.dp-head { display: flex; align-items: center; gap: 4px; padding: 0 0 0 6px; }
.dp-title { flex: 1 1 auto; font-size: 16px; font-weight: 600; color: var(--ink); }
.dp-nav { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 0; border: none; border-radius: 999px; background: transparent; color: var(--ink); cursor: pointer; }
.dp-nav:hover { background: var(--accent-soft); }
.dp-nav:focus-visible { outline: 2px solid var(--accent); outline-offset: 0; }
.dp-nav svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.dp-wd, .dp-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 2px; }
.dp-wd span { padding: 2px 0 4px; text-align: center; font-size: 15px; font-weight: 500; color: var(--ink-3); }
.dp-day { position: relative; height: 44px; padding: 0; border: none; border-radius: var(--r-sm); background: transparent; color: var(--ink); font: 500 15px var(--font); cursor: pointer; }
.dp-day.weekend { background: var(--tone); }
.dp-day.out { color: var(--ink-3); font-weight: 400; }
.dp-day.out.weekend { background: transparent; }
.dp-day.past { color: var(--ink-3); }
.dp-day:hover { background: var(--accent-soft); }
.dp-day:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.dp-day.today { box-shadow: inset 0 0 0 1.5px var(--ink); font-weight: 700; }
.dp-day.holiday::after { content: ""; position: absolute; left: 50%; bottom: 5px; width: 5px; aspect-ratio: 1; margin-left: -2.5px; border-radius: 999px; background: var(--rust); }
.dp-day.selected, .dp-day.selected:hover { background: var(--solid); color: var(--on-solid); box-shadow: none; font-weight: 700; }
.dp-day.selected.holiday::after { background: var(--on-solid); }
.dp-day.blocked, .dp-day.blocked:hover { color: var(--ink-3); opacity: .45; background: transparent; cursor: default; }
.dp-quick { display: flex; gap: 6px; padding-top: 10px; border-top: 1px solid var(--line); }
.dp-chip { flex: 1 1 auto; min-width: 0; height: 44px; padding: 0 8px; border: 1px solid var(--line-2); border-radius: var(--r-sm); background: var(--bg); color: var(--ink); font: 500 15px var(--font); white-space: nowrap; cursor: pointer; }
.dp-chip:hover { border-color: var(--ink); }
.dp-chip.on { background: var(--solid); border-color: var(--solid); color: var(--on-solid); }
.dp-chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.dp-note { display: none; align-items: center; gap: 6px; font-size: 15px; color: var(--ink-2); }
.dp-note.on { display: flex; }
.dp-dot { flex: 0 0 auto; width: 6px; height: 6px; border-radius: 999px; background: var(--rust); }
:root[data-theme="dark"] .dp-pop { box-shadow: 0 12px 32px rgba(0, 0, 0, .45); }
@media (max-width: 480px) { .dp-pop { --dp-w: anchor; padding: 12px 10px 10px; } }
@media (prefers-reduced-motion: reduce) { .dp-pop { animation: none; } }

/* Calendar: the month and the year are two buttons: the month opens the 12 months, the year the years to 2099 (owner, 6 Nov 2026) */
.dp-titles { flex: 1 1 auto; display: flex; align-items: center; gap: 2px; min-width: 0; margin-left: -6px; }
.dp-head .dp-title { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 4px; min-width: 0; height: 44px; margin: 0; padding: 0 8px 0 10px; border: none; border-radius: var(--r-sm); background: transparent; color: var(--ink); font: 600 16px var(--font); letter-spacing: -0.005em; cursor: pointer; padding: 0 4px 0 8px; gap: 2px; }
.dp-head .dp-title:hover, .dp-head .dp-title.open { background: var(--accent-soft); }
.dp-head .dp-title[hidden] { display: none; }
.dp-head .dp-title:focus-visible { outline: 2px solid var(--accent); outline-offset: 0; }
.dp-tt { white-space: nowrap; }
.dp-caret { flex: 0 0 auto; width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; opacity: .7; transition: transform .15s; }
.dp-title.open .dp-caret { transform: rotate(180deg); }
.dp-ylist, .dp-mlist { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; height: 300px; padding: 2px; }
.dp-ylist { align-content: start; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.dp-mlist { grid-auto-rows: 56px; align-content: center; row-gap: 14px; }
.dp-yr, .dp-mo { min-height: 44px; padding: 0 4px; border: none; border-radius: var(--r-sm); background: transparent; color: var(--ink); font: 500 16px var(--font); cursor: pointer; transition: background .12s, color .12s; }
.dp-yr { height: 48px; }
.dp-yr:hover, .dp-mo:hover { background: var(--accent-soft); }
.dp-yr:focus-visible, .dp-mo:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.dp-yr.now, .dp-mo.now { box-shadow: inset 0 0 0 1.5px var(--ink); font-weight: 700; }
.dp-yr.on, .dp-yr.on:hover, .dp-mo.on, .dp-mo.on:hover { background: var(--solid); color: var(--on-solid); box-shadow: none; font-weight: 700; }
.dp-mo.blocked, .dp-mo.blocked:hover { background: transparent; color: var(--ink-3); opacity: .45; cursor: default; }
/* the longest month (September 2026) and both arrows fit in one line, also on a 320 px phone */
.dp-head { gap: 0; }
