/* Meeting Marshal — screens. Matches the approved mockups and website look. */
:root {
  --navy: #102544;
  --ink: #0a1830;
  --muted: #4a5a70;
  --body2: #33475f;
  --teal: #007f83;
  --teal-dark: #00585b;
  --teal-light: #62d9cc;
  --mint: #e3f5f1;
  --mint-line: #a9d9cf;
  --amber: #ffb34f;
  --amber-soft: #fff6e8;
  --amber-line: #ffd9a0;
  --bg: #f6f8fb;
  --line: #dce4ee;
  --white: #ffffff;
  --chip-line: #3b5578;
  --radius: 20px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: #eef2f7;
  color: var(--navy);
  font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.4;
}
a { color: var(--teal); }
a:hover { color: var(--teal-dark); }
button, input, select, textarea { font: inherit; color: inherit; }
img { display: block; }
h1, h2, h3, h4, p, ul, dl, dd { margin: 0; }
:focus-visible { outline: 3px solid var(--teal); outline-offset: 2px; }

.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; }

/* ---------- layout ---------- */
.screen {
  max-width: 520px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  background: var(--bg);
  display: flex;
  flex-direction: column;
}
.screen.guest { background: var(--white); padding: 40px 20px 28px; }
.content {
  flex: 1;
  padding: max(24px, env(safe-area-inset-top)) 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.stack { display: flex; flex-direction: column; gap: 16px; }
.stack-sm { display: flex; flex-direction: column; gap: 8px; }
.stack-xs { display: flex; flex-direction: column; gap: 4px; }
.row { display: flex; align-items: center; gap: 12px; }
.row.top { align-items: flex-start; }
.row.wrap { flex-wrap: wrap; gap: 8px; }
.row.between { justify-content: space-between; }
.gap-sm { gap: 8px; }
.grow { flex: 1; }
.center { text-align: center; }
.center-col { align-items: center; text-align: center; padding-top: 40px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }

/* ---------- type ---------- */
.h1 { font-size: 26px; line-height: 1.2; font-weight: 800; }
.h2 { font-size: 22px; line-height: 1.2; font-weight: 800; }
.h3 { font-size: 17px; font-weight: 800; }
.h4 { font-size: 15px; font-weight: 800; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.strong { font-weight: 800; }
.eyebrow { font-size: 12px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); }
.eyebrow.teal { color: var(--teal); }
.eyebrow.mintink { color: var(--teal-dark); }

/* ---------- brand ---------- */
.lockup { height: 40px; width: auto; }
.lockup.sm { height: 34px; }
.center-col .lockup { height: 56px; }
.mark { width: 44px; height: 44px; object-fit: contain; }
.mark.sm { width: 36px; height: 36px; }

/* ---------- header ---------- */
.topbar { display: flex; align-items: center; gap: 12px; }
.topbar .mark { margin-left: auto; }
.back {
  width: 44px; height: 44px; flex: none;
  border-radius: 999px; background: var(--white); border: 1px solid var(--line);
  display: inline-flex; align-items: center; justify-content: center; color: var(--navy);
}
.avatar {
  width: 40px; height: 40px; flex: none; border-radius: 999px;
  background: var(--navy); color: var(--white); font-weight: 800;
  display: inline-flex; align-items: center; justify-content: center; text-decoration: none;
}
.initials {
  width: 32px; height: 32px; flex: none; border-radius: 999px;
  background: var(--mint); color: var(--teal-dark); font-weight: 800; font-size: 12px;
  display: inline-flex; align-items: center; justify-content: center;
}
.initials.lg { width: 36px; height: 36px; font-size: 13px; }
.initials.amber { background: var(--amber); color: var(--navy); }

/* ---------- cards ---------- */
.card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.card.navy { background: var(--navy); border-color: var(--navy); color: var(--white); }
.card.mint { background: var(--mint); border-color: var(--mint); }
.card.soft { background: var(--bg); border-color: var(--bg); }
.card.amber { background: var(--amber-soft); border-color: var(--amber-line); }
.card.list { padding: 4px 16px; }
.card.navy .muted { color: #c3cedc; }
.list-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); color: var(--navy); text-decoration: none; }
.list-row:last-child { border-bottom: 0; }
.list-row.stacked { flex-direction: column; align-items: flex-start; justify-content: flex-start; gap: 4px; }
.list-row.stacked > * { max-width: 100%; }
.pill { max-width: 100%; overflow: hidden; text-overflow: ellipsis; vertical-align: middle; }
/* Nothing should ever make the page wider than the phone (it would slide sideways). */
html, body { overflow-x: hidden; overflow-x: clip; max-width: 100%; }
.notice { border-radius: 14px; padding: 12px 14px; font-size: 14px; }
.notice.amber { background: var(--amber-soft); border: 1px solid var(--amber-line); }
.notice.mint { background: var(--mint); }

/* ---------- pills & chips ---------- */
.pill { display: inline-block; border-radius: 999px; padding: 4px 10px; font-size: 12px; font-weight: 800; background: var(--bg); color: var(--muted); white-space: nowrap; }
.pill.mint { background: var(--mint); color: var(--teal-dark); }
.pill.amber { background: var(--amber); color: var(--navy); }
.pill.white { background: var(--white); color: var(--teal-dark); }
.pill.teal { background: var(--teal-light); color: var(--ink); }
.pill.red { background: #C8372D; color: #FFF8F6; }
.chip {
  border: 1px solid var(--line); background: var(--white); border-radius: 999px;
  padding: 8px 14px; font-size: 14px; font-weight: 700; color: var(--navy); cursor: pointer; min-height: 40px;
  text-decoration: none; display: inline-flex; align-items: center;
}
.chip[aria-pressed="true"] { border: 2px solid var(--teal); background: var(--mint); font-weight: 800; }
.chip.go { background: var(--amber); border-color: var(--amber); color: var(--navy); font-weight: 800; font-size: 13px; padding: 6px 16px; min-height: 36px; cursor: pointer; }
.chip.dark { background: transparent; border-color: var(--chip-line); color: var(--mint); font-size: 13px; padding: 6px 12px; min-height: 36px; }
.person-chip {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid var(--line); background: var(--bg); border-radius: 999px;
  padding: 4px 12px 4px 4px; font-size: 14px; font-weight: 700;
}
.person-chip.ask { border: 2px dashed var(--amber); background: var(--amber-soft); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 18px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--white); color: var(--navy);
  font-weight: 800; font-size: 15px; text-decoration: none; cursor: pointer;
}
.btn:hover { color: var(--navy); filter: brightness(0.98); }
.btn.primary { background: var(--amber); border-color: var(--amber); min-height: 56px; font-size: 17px; }
.btn.navy { background: var(--navy); border-color: var(--navy); color: var(--white); }
.btn.navy:hover { color: var(--white); }
.btn.ghost { background: var(--white); }
.btn.clear { background: transparent; border-color: transparent; color: var(--teal); min-height: 40px; }
.btn.sm { min-height: 40px; font-size: 14px; padding: 0 14px; }
.btn.full { width: 100%; }
.btn[disabled] { opacity: 0.55; cursor: progress; }
.btn-row { display: flex; gap: 10px; }
.btn-row > * { flex: 1; }
.icon-btn {
  width: 48px; height: 48px; flex: none; border: 0; border-radius: 999px;
  background: var(--amber); display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
}
.icon-btn.navy { background: var(--navy); }
.icon-btn.listening { background: var(--teal-light); animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(1.06); } }
@media (prefers-reduced-motion: reduce) { .icon-btn.listening { animation: none; } }

/* ---------- forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span, .label { font-size: 13px; font-weight: 700; color: var(--muted); }
.input, select.input, textarea.input {
  width: 100%; min-height: 46px; border: 1px solid var(--line); border-radius: 14px;
  padding: 10px 14px; background: var(--white); color: var(--navy); font-size: 16px;
}
textarea.input { min-height: 120px; resize: vertical; line-height: 1.45; }
.input.pill-input { border-radius: 999px; padding: 0 18px; border: 0; height: 48px; }
textarea.input.ask-grow { flex: 1 1 auto; width: auto; min-width: 0; }
textarea.input.ask-grow { min-height: 48px; height: 48px; max-height: 200px; border-radius: 24px; padding: 13px 18px; line-height: 22px; resize: none; overflow-y: auto; }
.ask-card .row { align-items: flex-end; }
.segmented { display: flex; background: #e6ecf3; border-radius: 999px; padding: 4px; gap: 4px; }
.segmented button { flex: 1; min-height: 40px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); font-weight: 700; font-size: 14px; cursor: pointer; }
.segmented button[aria-pressed="true"] { background: var(--white); color: var(--navy); font-weight: 800; }
.choice {
  display: flex; gap: 12px; align-items: flex-start; cursor: pointer;
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px;
}
.choice:has(input:checked) { border: 2px solid var(--teal); }
.choice input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--teal); flex: none; }
.days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.day-toggle { position: relative; }
.day-toggle input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.day-toggle span { display: flex; align-items: center; justify-content: center; height: 44px; border-radius: 12px; border: 1px solid var(--line); background: var(--white); font-size: 13px; font-weight: 800; }
.day-toggle input:checked + span { background: var(--navy); color: var(--white); border-color: var(--navy); }
.day-toggle input:focus-visible + span { outline: 3px solid var(--teal); outline-offset: 2px; }

/* ---------- specific pieces ---------- */
.ask-card { background: var(--navy); border-radius: 24px; padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.ask-card label { font-size: 20px; font-weight: 800; color: var(--white); }
.bubble { align-self: flex-end; max-width: 320px; background: var(--navy); color: var(--white); border-radius: 20px 20px 6px 20px; padding: 14px 16px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 160px; overflow: auto; }
.fact { background: var(--bg); border-radius: 14px; padding: 10px 12px; display: flex; flex-direction: column; gap: 4px; }
.fact .label { font-size: 12px; }
.fact input, .fact select { border: 0; background: transparent; padding: 0; min-height: 28px; font-weight: 800; font-size: 16px; width: 100%; color: var(--navy); }
.week { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.week .d { background: var(--bg); border-radius: 12px; padding: 8px 4px; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.week .dow { font-size: 11px; font-weight: 800; color: var(--muted); }
.week .num { font-size: 16px; font-weight: 800; }
.week .lbl { font-size: 11px; color: var(--muted); }
.week .open .lbl { color: var(--teal-dark); font-weight: 700; }
.week .chosen { background: var(--navy); }
.week .chosen .dow { color: var(--teal-light); }
.week .chosen .num, .week .chosen .lbl { color: var(--white); font-weight: 700; }
.week .off { background: repeating-linear-gradient(135deg, #eef2f7 0 6px, var(--bg) 6px 12px); }
.week .off .num { color: var(--muted); }
.week .off .lbl { font-size: 10px; font-weight: 700; }
.timeline { display: grid; grid-template-columns: 112px 12px minmax(0, 1fr); column-gap: 10px; row-gap: 12px; align-items: start; }
.timeline .t { font-size: 12px; font-weight: 700; color: var(--muted); padding-top: 2px; white-space: nowrap; }
.timeline .dot { width: 10px; height: 10px; border-radius: 999px; background: var(--teal); margin-top: 5px; }
.timeline .dot.amber { background: var(--amber); }
.timeline .dot.red { background: #C8372D; }
.timeline .x { font-size: 14px; line-height: 1.4; overflow-wrap: anywhere; }
.receipt { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px 14px; font-size: 13px; }
.receipt dt { color: var(--body2); }
.receipt dd { font-weight: 700; }
.ttk { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; font-size: 14px; line-height: 1.45; color: #1e3350; }
.invite-head { padding: 16px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; }
.cal-tile { width: 60px; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); display: flex; flex-direction: column; align-items: center; flex: none; }
.cal-tile b { width: 100%; background: var(--navy); color: var(--white); font-size: 11px; text-align: center; padding: 3px 0; }
.cal-tile span { font-size: 24px; font-weight: 800; padding: 4px 0; }
.empty { text-align: center; color: var(--muted); padding: 18px 8px; font-size: 14px; }

/* ---------- nav ---------- */
/* Pinned to the bottom of the screen, always visible while scrolling. */
.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; margin: 0 auto; width: 100%; max-width: 520px; z-index: 15;
  box-sizing: border-box; background: var(--white); border-top: 1px solid var(--line);
  display: flex; justify-content: space-around; align-items: center;
  padding: 6px 0 max(10px, env(safe-area-inset-bottom));
}
.tabbar a { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 12px; font-weight: 700; color: var(--muted); text-decoration: none; min-width: 60px; padding-top: 6px; }
.tabbar a[aria-current="page"] { color: var(--teal); font-weight: 800; }

/* ---------- busy + toast ---------- */
.loading-overlay { position: fixed; inset: 0; background: rgba(246, 248, 251, 0.85); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; z-index: 20; font-weight: 800; }
.loading-overlay img { width: 72px; height: 72px; animation: spin 2.4s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .loading-overlay img { animation: none; } }
.toast { position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%); max-width: 440px; width: calc(100% - 32px); background: var(--ink); color: var(--white); border-radius: 14px; padding: 12px 16px; font-size: 14px; z-index: 30; box-shadow: 0 8px 24px rgba(10, 24, 48, 0.25); }
.toast.ok { background: var(--teal-dark); }

.place-option { display: flex; gap: 12px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line, #DCE3EE); border-radius: 14px; cursor: pointer; }
.place-option:has(input:checked) { border: 2px solid var(--teal); padding: 9px 11px; }
.place-option input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--teal); flex: none; }

[hidden] { display: none !important; }

/* ---------- calendar ---------- */
.cal-nav { gap: 8px; }
.cal-day.today { border: 2px solid var(--teal); }
.cal-item { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: 12px; }
.cal-item.marshal { background: var(--mint, #e3f6f3); border-left: 4px solid var(--teal); }
.cal-item.busy-block { background: #eef2f7; border-left: 4px solid #b9c4d3; }

.btn.danger { background: #B3261E; border-color: #B3261E; color: #fff; }
.btn.danger-outline { color: #B3261E; border-color: #F2C8C4; background: var(--white); }

.rules-link { width: 100%; text-align: left; cursor: pointer; font: inherit; color: inherit; }
.rules-link:hover { border-color: var(--teal); }
.cal-item.rule-block { background: #fff6e6; border-left: 4px solid var(--amber); }

/* ⓘ explainer next to a label */
.info-btn { width: 22px; height: 22px; min-height: 22px; border-radius: 50%; border: 1.5px solid var(--teal); background: transparent; color: var(--teal); font-weight: 800; font-size: 13px; font-style: italic; font-family: Georgia, serif; line-height: 1; padding: 0; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.info-btn[aria-expanded="true"] { background: var(--teal); color: #fff; }

/* What Meeting Marshal knows: learned items as a compact accordion */
.learned-group { padding: 6px 16px 10px; }
.learned-group > summary { list-style: none; cursor: pointer; }
.learned-group > summary::-webkit-details-marker, .learned-item > summary::-webkit-details-marker { display: none; }
.learned-head { display: flex; align-items: center; justify-content: space-between; padding: 8px 0; }
.learned-head::after { content: '›'; transform: rotate(90deg); color: var(--muted); font-weight: 800; font-size: 18px; transition: transform .15s; }
.learned-group:not([open]) > .learned-head::after { transform: rotate(0deg); }
.learned-head .pill { margin-left: auto; margin-right: 10px; }
.learned-search { margin: 4px 0 8px; }
.learned-item { border-top: 1px solid var(--line); }
.learned-item > summary { list-style: none; display: flex; align-items: center; gap: 10px; min-height: 48px; cursor: pointer; }
.learned-line { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; }
.learned-item .chev { color: var(--muted); font-weight: 800; font-size: 18px; transition: transform .15s; }
.learned-item[open] .chev { transform: rotate(90deg); }
.learned-body { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0 0 12px; }
.learned-more { width: 100%; margin-top: 4px; }

/* iPhone zooms in (and the page looks shifted) when a text box under 16px gets focus: keep every field at 16px or more. */
input, select, textarea { font-size: max(16px, 1em); }

/* Room under the last card for the pinned bottom bar. */
.screen:has(> .tabbar) { padding-bottom: calc(66px + env(safe-area-inset-bottom)); }
/* "New": what a notification was about. */
.new-card { border: 2px solid var(--teal-light); }
.new-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: #C8372D; margin-right: 4px; vertical-align: 1px; }

/* Home: the two actions fill the row (side by side, or one per line on small phones). */
.ask-card .row.wrap > .chip { flex: 1 1 auto; justify-content: center; text-align: center; }
.ask-card .row.wrap { align-items: stretch; }

/* Home: under the greeting. */
.tagline { color: var(--teal); line-height: 1.3; }

/* Home: "Block Time Instead", a text link in the second button's place (same size and tap area). */
.ask-card .link-action {
  flex: 1 1 auto; min-height: 44px; background: none; border: 0; padding: 10px 8px; cursor: pointer;
  color: var(--white); font-weight: 800; font-size: 14px; text-decoration: underline; text-underline-offset: 4px;
}

/* Block Time: the one just saved. */
.list-row.just-added { background: #EAF8F6; border-radius: 12px; padding-left: 10px; padding-right: 6px; }

/* Block Time: a quick add you already have. */
.chip.have { background: #EAF8F6; border-color: #BFE7E1; color: var(--teal-dark, #00686b); }

.just-added-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; background: #EAF8F6; border-color: #BFE7E1; }

/* Block Time, just back from connecting: the blocked times now on the calendar */
.connected-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.connected-list li { display: flex; flex-direction: column; gap: 2px; padding: 10px 0; border-top: 1px solid rgba(16, 37, 68, 0.1); min-width: 0; }
.connected-list li:last-child { padding-bottom: 0; }

/* Settings: a visible way into Block Time from the blocked-times card */
.rules-link .block-time-btn { align-self: flex-start; color: var(--teal); border-color: var(--teal); }

/* New request: who has to be there (2+ guests) */
.req-ask { border: 2px solid var(--amber-line, #F5C77E); background: var(--amber-soft, #FFF6E6); border-radius: 14px; padding: 12px 14px; margin: 4px 0 0; }
.req-ask legend { padding: 0; margin-bottom: 2px; float: left; width: 100%; color: var(--navy); }
.req-row { gap: 10px; padding-top: 4px; }
.seg { display: inline-flex; flex: none; border: 1px solid #C9D3E0; border-radius: 999px; background: #fff; padding: 3px; }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; margin: 0; }
.seg span { display: block; padding: 7px 12px; border-radius: 999px; font-size: 14px; font-weight: 600; color: #4A5A70; cursor: pointer; }
.seg input:checked + span { background: var(--navy); color: #fff; }
.seg input:focus-visible + span { outline: 2px solid var(--teal); outline-offset: 1px; }

/* You're invited: answered buttons can't be tapped */
.btn.answered { flex: 1; min-height: 48px; font-size: 16px; color: #fff; opacity: 1; cursor: default; }
.btn.answered.green { background: #0B8A7A; border-color: #0B8A7A; }
.btn.answered.red { background: #C8372D; border-color: #C8372D; }
.btn.red-line { color: #C8372D; border-color: #C8372D; }
.btn.red-solid { background: #C8372D; border-color: #C8372D; color: #fff; }
.invite-card { gap: 10px; text-decoration: none; color: inherit; border: 2px solid var(--amber-line); }

/* Calendar: a meeting you declined */
.cal-item.marshal.declined { background: #F3F4F6; border-left-color: #C8372D; }
.cal-item.marshal.declined a.strong { text-decoration: line-through; color: #6B7280; }
.cal-item.marshal.declined .small.strong { color: #6B7280 !important; }
