/* Meetingpad shared web screens. Same tokens as the Windows app
   (windows-app/src/styles.css), so a screen shown inside its window looks
   like part of it. */
:root {
  --teal: #2e98b8; --teal-press: #2786a3; --teal-deep: #11657e;
  --ink: #1b1b1b; --muted: #5f6b70; --line: rgba(0, 0, 0, 0.09);
  --surface: #fafafa; --card: #ffffff; --chip: #f0f0f0;
  --green: #3d8f6e; --green-soft: #eaf4ef; --warn: #9a6200; --warn-soft: #fff6e0; --error: #b42318;
  font: 14px/1.45 "Segoe UI Variable", "Segoe UI", -apple-system, system-ui, sans-serif;
  color: var(--ink); background: var(--surface);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink: #f2f2f2; --muted: #a8b3b8; --line: rgba(255, 255, 255, 0.1);
    --surface: #272727; --card: #2d2d2d; --chip: #3a3a3a;
    --green-soft: #1f3a30; --warn-soft: #3a3016; --warn: #f5c062; --error: #ff8a80;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--surface); }
button, input, select, textarea { font: inherit; color: inherit; }
.pad { padding: 24px; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.error { color: var(--error); }
h1 { font-size: 24px; font-weight: 600; margin: 0 0 4px; }
h2 { font-size: 16px; font-weight: 600; margin: 22px 0 8px; }

/* Two-pane layout: list on the left, editor on the right */
.split { display: flex; height: 100vh; }
.list { width: 280px; flex: none; border-right: 1px solid var(--line); overflow-y: auto; padding: 16px 10px; }
.list h3 { font-size: 11px; font-weight: 700; letter-spacing: 0.06em; color: var(--muted); margin: 14px 8px 6px; display: flex; align-items: center; gap: 6px; }
.list button.item { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 8px 10px; border-radius: 6px; cursor: pointer; }
.list button.item:hover { background: rgba(0, 0, 0, 0.04); }
.list button.item.cur { background: rgba(46, 152, 184, 0.12); font-weight: 600; }
.list button.add { border: 0; background: none; color: var(--teal); font-weight: 600; padding: 6px 10px; cursor: pointer; font-size: 13px; }
/* No bottom padding: a sticky bar sticks to the inside of its scroller's
   padding, so 48px here left the action bar floating 48px up with the form
   scrolling underneath it. The bar's own padding gives the end spacing. */
.editor { flex: 1; min-width: 0; overflow-y: auto; padding: 24px 32px 0; }
.empty { color: var(--muted); padding: 40px 32px; }

/* Form */
.form { max-width: 640px; }
.field { margin: 12px 0; }
.field > label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 4px; }
.field .help { color: var(--muted); font-size: 12px; margin-top: 3px; }
input[type=text], input[type=number], input[type=time], input[type=date], input[type=datetime-local], select, textarea {
  border: 1px solid var(--line); border-bottom-color: rgba(0, 0, 0, 0.25); border-radius: 5px; background: var(--card);
  padding: 6px 9px; min-height: 32px; }
input[type=text], textarea, select.wide { width: 100%; }
textarea { min-height: 70px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--teal); outline-offset: -1px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.hours { display: grid; grid-template-columns: 90px auto 1fr; gap: 6px 10px; align-items: center; }
.hours .day { font-weight: 500; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 12px 16px; margin: 8px 0; }
.pro { font-size: 10.5px; font-weight: 700; color: var(--teal-deep); background: #e3f1f5; border-radius: 999px; padding: 1px 7px; margin-left: 6px; letter-spacing: 0.02em; }
.locked { opacity: 0.6; }
.linkline { display: flex; gap: 8px; align-items: center; margin: 6px 0 2px; }
.linkline code { flex: 1; min-width: 0; font: 12.5px Consolas, "Cascadia Mono", monospace; background: var(--card); border: 1px solid var(--line);
  padding: 6px 10px; border-radius: 5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cf { display: grid; grid-template-columns: 1fr 130px auto auto; gap: 8px; align-items: center; margin: 6px 0; }
.logo-preview { max-height: 48px; max-width: 160px; border-radius: 4px; border: 1px solid var(--line); background: #fff; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 32px; padding: 0 14px; border-radius: 5px;
  border: 1px solid var(--line); border-bottom-color: rgba(0, 0, 0, 0.2); background: var(--card); font-size: 13.5px; font-weight: 500; cursor: pointer; white-space: nowrap; }
.btn:disabled { opacity: 0.55; cursor: default; }
.btn.primary { background: var(--teal); border-color: var(--teal-press); color: #fff; font-weight: 600; }
.btn.danger { color: var(--error); }
.btn.small { height: 28px; padding: 0 10px; font-size: 12.5px; }
.link { border: 0; background: none; color: var(--teal); cursor: pointer; padding: 0; font-weight: 600; }
.actions { position: sticky; bottom: 0; display: flex; gap: 8px; align-items: center; padding: 12px 0 16px; margin-top: 18px;
  background: var(--surface); border-top: 1px solid var(--line); }
.note { border-radius: 6px; padding: 8px 12px; font-size: 13px; margin: 10px 0; }
.note.warn { background: var(--warn-soft); color: var(--warn); }
.note.ok { background: var(--green-soft); color: var(--green); }
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; background: var(--chip); border-radius: 4px; padding: 1px 6px; font-weight: 500; letter-spacing: 0; }

.toast { position: fixed; left: 50%; bottom: 20px; transform: translate(-50%, 30px); opacity: 0; background: #1b1b1b; color: #fff;
  padding: 8px 14px; border-radius: 6px; font-size: 13px; transition: all 0.18s; pointer-events: none; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (max-width: 720px) { .split { flex-direction: column; height: auto; } .list { width: auto; border-right: 0; border-bottom: 1px solid var(--line); } .grid2 { grid-template-columns: 1fr; } }

/* ── Mac-style calendar screens (mac-app CalendarGridParts.swift) ── */
:root { --hair: rgba(0, 0, 0, 0.06); --teal-mac: #2D9AB9; --side: #f4f5f6; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --hair: rgba(255, 255, 255, 0.07); --side: #242424; } }
.twopane { display: flex; height: 100vh; position: relative; }
.col { display: flex; flex-direction: column; min-width: 0; }
.grow { flex: 1; min-height: 0; }
.sp { flex: 1; }
.row.end { justify-content: flex-end; margin-top: 12px; }
.btn.icon { width: 28px; padding: 0; }
.btn.wide { width: 100%; }
.hr { height: 1px; background: var(--line); margin: 12px 0; }
.cap { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.banner { font-size: 12px; padding: 6px 14px; }
.banner.warn { color: var(--warn); background: var(--warn-soft); }
.banner.err { color: var(--error); background: rgba(180, 35, 24, 0.08); }
.spin { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--teal); animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 6px; background: var(--chip); padding: 2px; flex: none; }
.seg button { border: 0; background: none; padding: 3px 14px; font-size: 12.5px; border-radius: 4px; cursor: pointer; }
.seg button.on { background: var(--card); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.14); font-weight: 600; }
.seg button:disabled { cursor: default; opacity: 0.6; }

/* Toolbar */
.tb { flex: none; display: flex; align-items: center; gap: 8px; padding: 8px 14px; border-bottom: 1px solid var(--line); min-height: 46px; }
.tb .range { font-size: 15px; font-weight: 700; margin-left: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.tb .hint { font-size: 12px; font-weight: 600; color: var(--warn); }
.legend { display: flex; gap: 12px; font-size: 12px; color: var(--muted); white-space: nowrap; }
.lg i { display: inline-block; width: 16px; height: 11px; border-radius: 3px; margin-right: 5px; vertical-align: -1px;
  background: color-mix(in srgb, var(--c) 18%, transparent); border-left: 2px solid var(--c); }
.lg i.solid { background: var(--c); }

/* The grid */
.cg { flex: 1; min-height: 0; display: flex; flex-direction: column; background: var(--surface); }
.cg-head, .cg-ad, .cg-rule { display: flex; flex: none; overflow-y: hidden; scrollbar-gutter: stable; }
.cg-rule, .cg-ad { border-bottom: 1px solid var(--line); }
.cg-gut { width: 52px; flex: none; font-size: 9.5px; color: var(--muted); padding: 5px 0 0 6px; }
.cg-dh { flex: 1; min-width: 0; padding: 6px 8px; }
.cg-dh.clickable { cursor: pointer; }
.cg-dh small { display: block; font-size: 11px; color: var(--muted); }
.cg-dh b { display: inline-block; font-weight: 400; font-size: 20px; height: 30px; line-height: 30px; }
.cg-dh.today b { width: 30px; text-align: center; border-radius: 50%; background: var(--teal-mac); color: #fff; font-weight: 700; font-size: 16px; }
.cg-adc { flex: 1; min-width: 0; padding: 3px; display: flex; flex-direction: column; gap: 2px; min-height: 24px; }
.cg-chip { color: #fff; background: var(--c); font-weight: 600; font-size: 10.5px; padding: 2px 6px; border-radius: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.cg-chip.declined { opacity: 0.55; text-decoration: line-through; }
.cg-scroll { flex: 1; min-height: 0; overflow-y: auto; scrollbar-gutter: stable; }
.cg-body { display: flex; height: 1152px; }
.cg-hours { width: 52px; flex: none; }
.cg-hours div { height: 48px; font-size: 9.5px; color: var(--muted); padding: 2px 0 0 6px; }
.cg-col { flex: 1; min-width: 0; position: relative; border-left: 1px solid var(--hair); cursor: default;
  background-image: linear-gradient(var(--hair) 1px, transparent 1px); background-size: 100% 48px; }
.cg-col.today { background-color: rgba(45, 154, 185, 0.03); }
.cg-past { position: absolute; left: 0; right: 0; top: 0; background: rgba(0, 0, 0, 0.09); pointer-events: none; }
.cg-now { position: absolute; left: 0; right: 0; height: 2px; background: #e5484d; z-index: 3; pointer-events: none; }
.cg-now::before { content: ""; position: absolute; left: -4px; top: -3.5px; width: 9px; height: 9px; border-radius: 50%; background: #e5484d; }
.cg-ghost { position: absolute; left: 3px; right: 3px; border: 1.5px dashed var(--teal-mac); background: rgba(45, 154, 185, 0.1); border-radius: 5px; pointer-events: none; z-index: 2; }
.cg-blk { position: absolute; border-radius: 5px; overflow: hidden; display: flex; font-size: 10.5px; line-height: 1.25; color: var(--ink);
  background: color-mix(in srgb, var(--c) 15%, var(--card)); cursor: pointer; }
.cg-blk::before { content: ""; width: 3px; flex: none; background: var(--c); }
.cg-blk > div { padding: 2px 5px; min-width: 0; }
.cg-blk b { font-weight: 600; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cg-blk b.two { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.cg-blk small { display: block; font-size: 9.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cg-blk.solid { background: var(--c); color: #fff; }
.cg-blk.solid small { color: rgba(255, 255, 255, 0.9); }
.cg-blk.faint { background: color-mix(in srgb, var(--c) 7%, var(--card)); }
.cg-blk.stripe { background: repeating-linear-gradient(45deg, var(--card) 0 3px, color-mix(in srgb, var(--c) 16%, var(--card)) 3px 6px); }
.cg-blk.declined { opacity: 0.55; }
.cg-blk.declined b { text-decoration: line-through; }
.cg-blk.cur { outline: 2px solid var(--c); outline-offset: -1px; }

/* Month */
.mgrid { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.mhead { display: grid; grid-template-columns: repeat(7, 1fr); border-bottom: 1px solid var(--line); }
.mhead div { font-size: 11px; color: var(--muted); padding: 5px 8px; }
.mbody { flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(7, 1fr); grid-template-rows: repeat(6, 1fr); }
.mcell { border-right: 0.5px solid var(--hair); border-bottom: 0.5px solid var(--hair); padding: 4px; overflow: hidden; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.mcell.out { background: rgba(0, 0, 0, 0.025); }
.mcell.out .mnum { color: var(--muted); }
.mnum { width: 22px; height: 22px; border: 0; background: none; border-radius: 50%; font-size: 12px; padding: 0; cursor: pointer; }
.mnum.td { background: var(--teal-mac); color: #fff; font-weight: 700; }
.mitem { display: flex; align-items: center; gap: 4px; font-size: 10.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.mitem i { width: 6px; height: 6px; border-radius: 50%; flex: none; }

/* Calendar sidebar */
.cal-side { width: 210px; flex: none; background: var(--side); border-right: 1px solid var(--line); padding: 14px; overflow-y: auto; }
.sec { font-size: 10.5px; font-weight: 600; letter-spacing: 0.05em; color: var(--muted); margin: 18px 0 7px; }
.mini-hd { display: flex; justify-content: space-between; align-items: center; font-size: 12.5px; margin-bottom: 4px; }
.mini-hd .link { font-size: 14px; padding: 0 3px; }
.mini-g { display: grid; grid-template-columns: repeat(7, 1fr); text-align: center; row-gap: 2px; }
.mini-g .w { font-size: 10px; color: var(--muted); }
.mini-g button { border: 0; background: none; height: 20px; font-size: 11px; padding: 0; cursor: pointer; position: relative; z-index: 0; }
.mini-g button.out { color: var(--muted); opacity: 0.6; }
.mini-g button.rng { background: rgba(45, 154, 185, 0.10); }
.mini-g button.td { color: #fff; font-weight: 700; }
.mini-g button.td::before { content: ""; position: absolute; top: -1px; bottom: -1px; left: calc(50% - 11px); width: 22px; background: var(--teal-mac); border-radius: 50%; z-index: -1; }
.chk { display: flex; align-items: center; gap: 8px; width: 100%; border: 0; background: none; padding: 3px 0; font-size: 12.5px; cursor: pointer; text-align: left; }
.chk span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.chk i { width: 13px; height: 13px; flex: none; border-radius: 3.5px; border: 1.5px solid var(--c); color: #fff; font-size: 8px; font-style: normal; font-weight: 900; display: flex; align-items: center; justify-content: center; }
.chk i.on { background: var(--c); }
.blink { display: flex; gap: 6px; align-items: baseline; width: 100%; border: 0; background: none; padding: 3px 0; color: var(--teal-deep); font-size: 12.5px; cursor: pointer; text-align: left; }
.blink small { display: block; color: var(--muted); font-size: 10.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 160px; }

/* Settings pane beside a picker (Propose, new poll) */
.picker { flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.pside { width: 280px; flex: none; border-right: 1px solid var(--line); padding: 14px; overflow-y: auto; }
.pside h4 { margin: 0 0 12px; font-size: 14px; }
.pside .field label { font-weight: 400; font-size: 12px; color: var(--muted); }
.slotrow { display: flex; justify-content: space-between; align-items: center; font-size: 12px; padding: 3px 0; }
.minus { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 14px; padding: 0 2px; }
.linkbox { font: 11.5px Consolas, "Cascadia Mono", monospace; background: var(--card); border: 1px solid var(--line); border-radius: 5px; padding: 6px 8px; margin: 4px 0 8px; word-break: break-all; }

/* Polls: list and votes */
.plist { width: 260px; flex: none; border-right: 1px solid var(--line); padding: 14px 10px; overflow-y: auto; }
.plist button.item { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 8px 10px; border-radius: 6px; cursor: pointer; }
.plist button.item:hover { background: rgba(0, 0, 0, 0.04); }
.plist button.item.cur { background: rgba(45, 154, 185, 0.12); font-weight: 600; }
.plist button.item .muted { font-weight: 400; }
.tally-wrap { overflow-x: auto; margin-top: 8px; }
.tally { border-collapse: collapse; font-size: 12px; }
.tally th, .tally td { border-bottom: 1px solid var(--line); padding: 6px 10px; text-align: center; white-space: nowrap; }
.tally th:first-child, .tally td:first-child { text-align: left; min-width: 170px; position: sticky; left: 0; background: var(--surface); }
.tally th { font-weight: 600; font-size: 11px; color: var(--muted); }
.tally th.pickable { cursor: pointer; color: var(--teal-deep); }
.tally th.pickable:hover { background: rgba(45, 154, 185, 0.08); }
.tally th.past { opacity: 0.55; }
.tally .picked { background: rgba(45, 154, 185, 0.14); }
.tally .yes { color: var(--green); font-weight: 700; }
.tally tr.total td { border-bottom: 0; }
.tag { font-size: 10.5px; padding: 1px 7px; border-radius: 999px; background: var(--green-soft); color: var(--green); font-weight: 600; }

/* Dialogs (the Mac's sheets) */
.dlg-wrap { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.28); display: flex; align-items: center; justify-content: center; z-index: 20; padding: 16px; }
.dlg { width: 420px; max-width: 100%; max-height: calc(100vh - 32px); overflow-y: auto; background: var(--card); border-radius: 10px; box-shadow: 0 18px 50px rgba(0, 0, 0, 0.3); padding: 16px 18px; font-size: 13px; }
.dlg h3 { margin: 0 0 4px; font-size: 16px; }
.dlg input[type=text], .dlg input[type=date], .dlg input[type=datetime-local], .dlg select { width: 100%; min-width: 0; }
.dlg .row input[type=text] { width: auto; }
.dlg .field label { font-weight: 400; font-size: 12px; color: var(--muted); }
.drow { display: flex; gap: 10px; align-items: baseline; margin-top: 9px; }
.drow > i { width: 18px; flex: none; text-align: center; color: var(--muted); font-style: normal; font-size: 11px; }
.drow > div { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.guest { display: flex; justify-content: space-between; gap: 8px; margin: 3px 0; }
.notes { white-space: pre-wrap; max-height: 240px; overflow-y: auto; font-size: 12.5px; }
/* Links in an event description, blue and underlined as Google Calendar shows them. */
.notes a, .mp-web .notes a { color: #1a62d6; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; word-break: break-word; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .notes a, html.mp-web:not([data-theme="light"]) .notes a { color: #8ab4f8; } }
:root[data-theme="dark"] .notes a, html.mp-web[data-theme="dark"] .notes a { color: #8ab4f8; }
.rsvp-yes { color: var(--green); } .rsvp-maybe { color: #d08a00; } .rsvp-no { color: var(--error); }
@media (max-width: 760px) { .cal-side, .pside, .plist { display: none; } }

/* ── Browser version: Meetingpad's take on Marinegrade "Instrument" ─────────
   Only when the page is not inside an app (html.mp-web, set in app.js), so
   the Windows app's framed screens keep its own look. Instrument's rules
   (marinegrade_style): one left rail, hairline depth, mono eyebrows, two radii
   (6px controls, 10px containers), IBM Plex. Colours are Meetingpad's own
   Paper and teal deep, a deliberate exception (Justin, 2026-11-11). */
html.mp-web {
  --surface: #F7F6F2; --card: #ffffff; --side: #efede6; --hover: #ebe9e2; --chip: #efede6;
  --line: #e3e0d6; --line-2: #d6d2c6; --control: #8a8a8a;
  --ink: #0F172A; --muted: #565656; --text-3: #6b6b6b;
  --teal: #11657E; --teal-press: #0c4d60; --teal-deep: #11657E; --on-teal: #ffffff;
  --green: #14783a; --green-soft: #e3f2e8; --warn: #8a5a00; --warn-soft: #fbf0da; --error: #c0272d; --error-soft: #fbeaea;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font: 14px/1.5 "IBM Plex Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--ink); background: var(--surface);
}
@media (prefers-color-scheme: dark) {
  html.mp-web:not([data-theme="light"]) {
    --surface: #171717; --card: #1f1f1f; --side: #121212; --hover: #292929; --chip: #292929;
    --line: #2e2e2e; --line-2: #3a3a3a; --control: #7a7a7a;
    --ink: #ededed; --muted: #b4b4b4; --text-3: #9a9a9a;
    --teal: #3fbfce; --teal-press: #63d3e0; --teal-deep: #3fbfce; --on-teal: #0a2b2f;
    --green: #4ac97a; --green-soft: #12301e; --warn: #e0a53c; --warn-soft: #332612; --error: #f2726f; --error-soft: #3a1a1a;
  }
}
.mp-web body { background: var(--surface); }
.mp-web a { color: var(--teal-deep); }
.mp-web .btn { border-radius: 6px; border: 1px solid var(--control); background: var(--card); color: var(--ink); font-weight: 500; text-decoration: none; }
.mp-web .btn:hover { background: var(--hover); }
.mp-web .btn.primary { background: var(--teal); border-color: var(--teal); color: var(--on-teal); font-weight: 600; }
.mp-web .btn.primary:hover { background: var(--teal-press); }
.mp-web .btn.ghost { border-color: transparent; background: none; }
.mp-web .btn.ghost:hover { background: var(--hover); }
.mp-web .btn.big { height: 44px; font-size: 15px; }
.mp-web .link { color: var(--muted); font-weight: 500; }
/* A switch: takes effect immediately (no Save button). */
.toggle { position: relative; width: 40px; height: 22px; box-sizing: border-box; border-radius: 11px; border: 1px solid var(--control, #8a8a8a); background: var(--card); flex: none; cursor: pointer; padding: 0; }
.toggle::after { content: ""; position: absolute; left: 3px; top: 3px; width: 14px; height: 14px; border-radius: 50%; background: var(--muted); transition: left 150ms cubic-bezier(0.16, 1, 0.3, 1); }
.toggle.on { background: var(--teal); border-color: var(--teal); }
.toggle.on::after { left: 21px; background: var(--on-teal, #fff); }
.toggle:disabled { opacity: 0.5; cursor: default; }
.toggle:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .toggle::after { transition: none; } }
.mp-web .note.warn { background: var(--warn-soft); color: var(--warn); }
.mp-web .note.ok { background: var(--green-soft); color: var(--green); }
.mp-web .toast { left: auto; right: 20px; transform: translateY(30px); }
.mp-web .toast.show { transform: translateY(0); }
.mp-web input[type=text] { border-radius: 6px; border-color: var(--control); }
.eyebrow { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.13em; text-transform: uppercase; color: var(--text-3); font-weight: 500; }
.mono { font-family: var(--mono); font-size: 12px; color: var(--text-3); }
.strong { font-weight: 500; }
.min0 { min-width: 0; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* The shell: rail + content; the shell owns the viewport, only content scrolls. */
/* dvh: on a phone, the height you can actually see (100vh includes the
   area under Safari's toolbar). vh first for older browsers. */
.shell { display: flex; height: 100vh; height: 100dvh; }
.rail { width: 232px; flex: none; box-sizing: border-box; display: flex; flex-direction: column; background: var(--side); border-right: 1px solid var(--line); padding: 12px 12px 10px; }
.rail-id { display: flex; align-items: center; gap: 10px; padding: 4px 4px 18px; font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }
.emblem { display: inline-flex; }
.rail-nav { display: flex; flex-direction: column; gap: 2px; flex: 1; min-height: 0; overflow-y: auto; }
.rail-nav a, .srail a { display: flex; align-items: center; gap: 9px; padding: 7px 8px; border-radius: 6px; color: var(--muted); text-decoration: none; font-size: 13.5px; }
.rail-nav a:hover, .srail a:hover { background: var(--hover); color: var(--ink); }
.rail-nav a.on, .srail a.on { background: var(--hover); color: var(--ink); font-weight: 500; }
.ic { display: inline-flex; }
.rail-foot { position: relative; display: flex; align-items: center; gap: 4px; border-top: 1px solid var(--line); padding-top: 10px; }
.iconbtn { width: 32px; height: 32px; border: 0; background: none; border-radius: 6px; color: var(--muted); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; flex: none; }
.iconbtn:hover, .iconbtn.on { background: var(--hover); color: var(--ink); }
.acctbtn { margin-left: auto; min-width: 0; display: flex; align-items: center; gap: 8px; border: 0; background: none; padding: 4px 6px; border-radius: 6px; cursor: pointer; color: var(--ink); }
.acctbtn:hover { background: var(--hover); }
.avatar { flex: none; width: 24px; height: 24px; border-radius: 50%; background: var(--green-soft); color: var(--green); font-size: 11px; font-weight: 600; display: flex; align-items: center; justify-content: center; }
.acctname { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 110px; }
.acctmenu { position: absolute; left: 0; right: 0; bottom: 48px; background: var(--card); border: 1px solid var(--line-2); border-radius: 10px; padding: 4px; z-index: 30; }
.acctmenu-who { padding: 8px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; font-size: 13px; word-break: break-all; }
.acctmenu button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 8px 10px; border-radius: 6px; cursor: pointer; font-size: 13.5px; color: var(--ink); }
.acctmenu button:hover { background: var(--hover); }
.content { flex: 1; min-width: 0; overflow: auto; }
.menu-btn { display: none; }
.mp-web .split, .mp-web .twopane { height: 100vh; height: 100dvh; }

/* Pages */
.page { box-sizing: border-box; padding: 28px 40px 56px; max-width: 1000px; }
.ph { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; border-bottom: 1px solid var(--line); padding-bottom: 16px; margin-bottom: 24px; }
.ph h1 { margin: 4px 0 0; font-size: 27px; line-height: 1.2; letter-spacing: -0.022em; font-weight: 600; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.panel-h { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.panel-h h2 { flex: 1; margin: 0; font-size: 15px; font-weight: 600; }
.rowi { display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.rowi:last-child { border-bottom: 0; }
.pad-row { margin: 0; padding: 14px 18px; }
.grid2c { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 24px; margin-top: 24px; }
.time { width: 68px; white-space: nowrap; font-family: var(--mono); font-size: 12px; color: var(--text-3); }
.bar { width: 4px; height: 30px; border-radius: 2px; flex: none; }
.dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.pill { font-size: 12px; border-radius: 999px; padding: 2px 8px; background: var(--chip); color: var(--muted); white-space: nowrap; }
.pill.ok { background: var(--green-soft); color: var(--green); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }

/* First-run checklist */
.setup { border-color: var(--line-2); padding: 18px 20px; }
.setup-head { display: flex; align-items: center; gap: 12px; }
.setup-head h2 { margin: 4px 0 0; font-size: 17px; font-weight: 600; }
.progress { height: 4px; background: var(--chip); border-radius: 2px; margin: 14px 0 4px; overflow: hidden; }
.progress > div { height: 4px; background: var(--green); }
.steps { list-style: none; margin: 0; padding: 0; }
.steps li { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.steps li:first-child { border-top: 0; }
.steps .tick { flex: none; width: 20px; height: 20px; box-sizing: border-box; border-radius: 50%; border: 1.5px solid var(--control); font-size: 12px; display: flex; align-items: center; justify-content: center; }
.steps li.done .tick { background: var(--green); border-color: var(--green); color: #fff; }
.steps .st { font-weight: 500; }
.steps li.done .st { color: var(--text-3); font-weight: 400; text-decoration: line-through; }

/* Settings: a second rail, one topic per section */
.settings { display: flex; flex-wrap: wrap; gap: 32px; }
.srail { flex: 1 1 180px; max-width: 200px; display: flex; flex-direction: column; gap: 2px; }
.sbody { flex: 999 1 480px; min-width: 0; max-width: 720px; }
.sbody > h2 { margin: 0; font-size: 17px; font-weight: 600; }
.lede { margin: 4px 0 16px; font-size: 13.5px; color: var(--muted); }
.srow { display: flex; align-items: center; gap: 16px; padding: 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.srow:last-child { border-bottom: 0; }
.srow .what { flex: 1; min-width: 220px; }
.srow .what b { display: block; font-weight: 500; }
.srow .what div { font-size: 13px; color: var(--muted); }
.srow .full { flex-basis: 100%; }
.saved { font-size: 12.5px; color: var(--green); white-space: nowrap; }
input.text-in { font: inherit; font-size: 13.5px; width: 220px; max-width: 100%; box-sizing: border-box; border: 1px solid var(--control); border-radius: 6px; padding: 7px 10px; color: var(--ink); background: var(--card); }
.handle-row { display: flex; align-items: center; gap: 8px; flex-wrap: nowrap; }
.handle-row input.text-in { width: 200px; }
.linkline { display: flex; gap: 8px; align-items: center; }
.linkline code { flex: 1; min-width: 0; font: 12px var(--mono, monospace); background: var(--surface); border: 1px solid var(--line); padding: 6px 10px; border-radius: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Sign in: a signed-out page, so no shell */
.signin { min-height: 100vh; box-sizing: border-box; display: flex; flex-direction: column; align-items: center; padding: 64px 16px 32px; text-align: left; }
.signin-mark { display: flex; align-items: center; gap: 10px; font-size: 17px; font-weight: 600; }
.signin-card { width: 100%; max-width: 420px; box-sizing: border-box; margin: 40px 0 20px; background: var(--card); border: 1px solid var(--line-2); border-radius: 10px; padding: 28px 28px 22px; }
.signin-card h1 { margin: 6px 0 8px; font-size: 21px; line-height: 1.3; letter-spacing: -0.015em; font-weight: 600; color: var(--ink); }
.signin-card .btn { margin: 14px 0 12px; }

/* Help: a drawer on the right (Instrument V4), beside the content, not over it. */
.help-drawer { display: none; width: 400px; flex: none; box-sizing: border-box; flex-direction: column; border-left: 1px solid var(--line); background: var(--surface); }
.help-drawer.open { display: flex; }
.help-head { display: flex; align-items: center; gap: 8px; padding: 12px 12px 12px 18px; border-bottom: 1px solid var(--line); background: var(--card); }
.help-title { font-size: 15px; font-weight: 600; margin-top: 2px; }
.help-frame { flex: 1; min-height: 0; width: 100%; border: 0; background: var(--surface); }

/* Below 768px the rail becomes a drawer behind a menu button; zones keep their order. */
@media (max-width: 767px) {
  .rail { position: fixed; inset: 0 auto 0 0; z-index: 40; transform: translateX(-100%); transition: transform 200ms cubic-bezier(0.16, 1, 0.3, 1); }
  body.rail-open .rail { transform: none; }
  .menu-btn { display: inline-flex; position: sticky; top: 8px; z-index: 20; margin: 8px 0 2px 10px; background: var(--card); border: 1px solid var(--line-2); }
  .page { padding: 12px 16px 40px; }
  .handle-row { flex-wrap: wrap; }
  .help-drawer.open { position: fixed; inset: 0; width: 100%; z-index: 50; }
  /* Calendar and Propose times toolbars: wrap onto two rows instead of
     running off the right edge; the legend and keyboard hint are desktop
     extras. */
  .tb { flex-wrap: wrap; row-gap: 8px; padding: 8px 12px; }
  .tb .sp { display: none; }
  .tb .range { order: 10; flex-basis: 100%; margin-left: 0; }
  .tb .legend { display: none; }
  .btn.small.icon { width: 32px; flex: none; }
  /* The calendar body sits under the menu button: give it the rest of the screen. */
  .mp-web .split, .mp-web .twopane { height: calc(100vh - 42px); height: calc(100dvh - 42px); }
  .time { width: 60px; }
  /* Propose times, Polls and Booking links: stack the side panel above the
     grid or editor instead of hiding it (the 760px rule above hides it,
     which left no way to send proposed times or see your polls). The page
     scrolls; the Calendar keeps its row layout with the sidebar hidden. */
  .mp-web .twopane:has(> .pside), .mp-web .twopane:has(> .plist), .mp-web .split { flex-direction: column; height: auto; }
  .mp-web .pside, .mp-web .plist, .mp-web .split > .list { display: block; width: auto; flex: none; border-right: 0; border-bottom: 1px solid var(--line); overflow: visible; }
  .mp-web .twopane:has(> .pside) > .picker { flex: none; height: 75vh; height: 75dvh; }
  .mp-web .twopane:has(> .plist) > :not(.plist) { flex: none; min-height: 60vh; }
  .mp-web .split > .editor { overflow: visible; padding: 16px 16px 0; }
}
@media (prefers-reduced-motion: reduce) { .rail { transition: none; } }

/* Ask Meetingpad: the rail's primary slot and its drawer (shares .help-drawer). */
.ask-btn { display: flex; align-items: center; gap: 8px; width: 100%; box-sizing: border-box; margin: 0 0 14px; padding: 8px 9px; border: 1px solid var(--line-2); border-radius: 7px; background: var(--card); color: var(--muted); font: inherit; font-size: 13.5px; text-align: left; cursor: pointer; }
.ask-btn:hover, .ask-btn.on { border-color: var(--teal-deep); color: var(--ink); }
.ask-btn .ic { color: var(--teal-deep); }
.ask-btn kbd { font: 11px "IBM Plex Mono", ui-monospace, monospace; color: var(--muted); border: 1px solid var(--line-2); border-radius: 4px; padding: 1px 5px; }
.ask-log { flex: 1; min-height: 0; overflow-y: auto; padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; }
.ask-intro p { margin: 0 0 12px; color: var(--muted); font-size: 13.5px; line-height: 1.5; }
.ask-sugg { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.ask-sugg .chip { border: 1px solid var(--line-2); background: var(--card); color: var(--ink); border-radius: 999px; padding: 6px 12px; font: inherit; font-size: 13px; cursor: pointer; text-align: left; }
.ask-sugg .chip:hover { border-color: var(--teal-deep); }
.ask-setup { align-self: stretch; background: var(--card); border: 1px solid var(--line-2); border-radius: 8px; padding: 12px 14px; margin: 4px 0 12px; }
.ask-setup p { color: var(--ink); }
.ask-msg { font-size: 14px; line-height: 1.5; max-width: 92%; overflow-wrap: anywhere; }
.ask-msg p { margin: 0 0 6px; } .ask-msg p:last-child { margin-bottom: 0; }
.ask-msg ul { margin: 2px 0 6px; padding-left: 18px; } .ask-msg li { margin: 2px 0; }
.ask-msg.user { align-self: flex-end; background: var(--teal-deep); color: #fff; border-radius: 12px 12px 3px 12px; padding: 8px 12px; white-space: pre-wrap; }
.ask-msg.assistant { align-self: flex-start; color: var(--ink); }
.ask-msg.pending { color: var(--muted); display: flex; align-items: center; gap: 8px; }
.ask-msg.error { align-self: stretch; max-width: none; background: var(--warn-soft, #fdf1e3); color: var(--warn, #8a4b00); border-radius: 8px; padding: 8px 12px; }
.ask-msg.error .ask-setup { margin: 10px 0 2px; }
.ask-foot { border-top: 1px solid var(--line); background: var(--card); padding: 10px 12px 12px; }
.ask-box { display: flex; align-items: flex-end; gap: 6px; border: 1px solid var(--control, var(--line-2)); border-radius: 8px; padding: 6px 6px 6px 10px; background: var(--card); }
.ask-box:focus-within { outline: 2px solid var(--teal); outline-offset: -1px; }
.ask-in { flex: 1; border: 0 !important; outline: none !important; resize: none; background: transparent; font: inherit; font-size: 14px; line-height: 1.4; padding: 4px 0; min-height: 0; height: 28px; max-height: 140px; color: var(--ink); box-shadow: none; }
.ask-send { color: var(--teal-deep); }
.ask-status { margin-top: 8px; font-size: 12px; color: var(--muted); }
.ask-fine { margin-top: 4px; font-size: 11.5px; color: var(--muted); }
@media (max-width: 767px) {
  .ask-in { font-size: 16px; } /* iOS zooms into smaller inputs */
  .ask-drawer.open { height: 100dvh; }
}
