@font-face { font-family: 'Manrope'; font-style: normal; font-weight: 200 800; font-display: swap; src: url('../fonts/Manrope.ttf') format('truetype'); }
/* Family Calendar — styles. Matches the approved "C · Hybrid" prototype. */

:root {
  --bg: #FFFBF5;
  --surface: #FFFFFF;
  --ink: #1F2328;
  --ink-2: #2B2F34;
  --ink-3: #3A3F45;
  --muted: #5B6168;
  --faint: #6B7178;
  --line: #ECE9E4;
  --line-2: #F0EAE0;
  --field-line: #D6D1C9;
  --seg: #F0EEEA;
  --accent: #FFC83D;
  --accent-soft: #FFE9A8;
  --accent-wash: #FFF1C7;
  --accent-border: #E0A800;
  --today-col: #FFF6E0;
  --past-day: #F1F0ED;
  --past-saturation: .72;
  --now: #C8473B;
  --danger: #B3261E;
  --danger-soft: #FDECEA;
  --success: #0B6B5F;
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --calendar-gutter: 44px;
  --gutter: var(--calendar-gutter);
  --name-h: 44px;
  --name-gap: 6px;
  --name-pad: 12px;
  --seg-h: 36px;
  --calendar-hour-height: 72px;
  --calendar-week-hour-height: 40px;
  --font: -apple-system, BlinkMacSystemFont, system-ui, 'Segoe UI', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: #EFE9DF;
  color: var(--ink);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
button { font: inherit; color: inherit; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}
a { color: #2F5BD8; }
.hide-scrollbar { scrollbar-width: none; }
.hide-scrollbar::-webkit-scrollbar { display: none; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ------------------------------------------------------------ app shell */
.app {
  position: relative;
  height: 100%;
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg);
  padding-top: env(safe-area-inset-top, 0px);
  padding-left: env(safe-area-inset-left, 0px);
  padding-right: env(safe-area-inset-right, 0px);
}
#hdr { flex: none; }
#body { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.tabbar {
  flex: none;
  display: flex;
  gap: 8px;
  padding: 4px 12px calc(10px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--line);
  background: var(--bg);
}
.tab {
  flex: 1;
  height: 52px;
  border: 0;
  border-radius: 16px;
  background: transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-size: 0.6875rem;
  font-weight: 500;
  color: var(--faint);
  cursor: pointer;
}
.tab.is-active { background: var(--accent-soft); color: var(--ink); font-weight: 700; }

/* ------------------------------------------------------------ header */
.hdr-row { display: flex; align-items: center; gap: 2px; padding: 10px 12px 6px 6px; }
.hdr-title { margin: 0; font-size: 1.125rem; font-weight: 700; letter-spacing: -0.01em; white-space: nowrap; }
.page-title { margin: 0; font-size: 1.5rem; font-weight: 700; letter-spacing: -0.01em; }
.spacer { flex: 1; }
.icon-btn {
  width: 44px; height: 44px; flex: none;
  border: 0; border-radius: 12px; padding: 0;
  background: transparent; color: var(--ink-3);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
}
.add-btn {
  width: 44px; height: 44px; flex: none;
  border: 0; border-radius: 22px; padding: 0;
  background: var(--accent); color: var(--ink);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
}
.today-btn {
  height: 34px; padding: 0 14px; margin-right: 8px; flex: none;
  border: 0; border-radius: 999px;
  background: var(--accent-soft); font-size: 0.8125rem; font-weight: 700;
  cursor: pointer;
}
.seg-wrap { display: flex; align-items: center; gap: 8px; padding: 0 12px 8px; }
.seg { display: flex; flex: 1; min-width: 0; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: 12px; background: var(--seg); }
.seg-btn {
  flex: 1; height: var(--seg-h); padding: 0;
  border: 0; border-radius: var(--radius-sm);
  background: transparent; color: var(--muted);
  font-size: 0.8125rem; font-weight: 600; cursor: pointer;
}
.seg-btn[aria-pressed="true"] { background: var(--surface); color: var(--ink); font-weight: 700; box-shadow: 0 0 0 1px #E3DFD8; }

/* ------------------------------------------------------------ day view */
.day-wrap { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; }
.day-scroll { flex: 1; min-height: 0; overflow: auto; position: relative; overscroll-behavior: contain; }
.day-content { position: relative; }
.day-head { position: sticky; top: 0; z-index: 5; display: flex; background: var(--bg); border-bottom: 1px solid var(--line); }
.gutter-spacer { position: sticky; left: 0; z-index: 6; width: var(--gutter); flex: none; background: var(--bg); }
.pill-cell { flex: none; min-width: 0; display: flex; align-items: center; justify-content: center; padding: var(--name-gap); height: calc(var(--name-h) + 2 * var(--name-gap)); }
.day-grid { display: flex; }
.gutter { position: sticky; left: 0; z-index: 4; width: var(--gutter); flex: none; background: var(--bg); }
.hour-label { height: var(--calendar-hour-height); padding: 4px 8px 0 0; font-size: 0.6875rem; color: var(--faint); text-align: right; }
.hour-label.is-hidden { color: transparent; }
.hour-end { height: 28px; }
.now-label {
  position: absolute; right: 3px; z-index: 6;
  padding: 4px 5px; border-radius: 6px;
  background: var(--now); color: #FFFFFF;
  font-size: 0.625rem; font-weight: 700; line-height: 1;
  pointer-events: none;
}
.cols { position: relative; display: flex; }
.col { position: relative; flex: none; border-left: 1px solid var(--line-2); }
.slot { display: block; width: 100%; height: var(--calendar-hour-height); padding: 0; border: 0; border-top: 1px solid var(--line-2); background: transparent; cursor: pointer; }
.col-end { height: 28px; border-top: 1px solid #E6E2DC; }
.now-line { position: absolute; left: 0; right: 0; height: 0; border-top: 2px solid var(--now); z-index: 3; pointer-events: none; }

.ev {
  position: absolute; left: 4px; right: 4px; z-index: 1;
  display: flex; flex-direction: column; align-items: flex-start; gap: 1px;
  padding: 6px 8px; border: 0; border-radius: var(--radius-sm);
  text-align: left; overflow: hidden; cursor: pointer;
  transition: opacity 0.2s;
}
.ev-shared { border: 1px solid #E6DFD3; padding-top: 9px; }
.ev-compact { justify-content: center; padding: 0 8px; }
.ev-shared.ev-compact { padding-top: 3px; }
.ev-title { font-size: 0.75rem; font-weight: 700; line-height: 1.25; }
.ev-time { font-size: 0.6875rem; line-height: 1.3; }
.ev-line { display: flex; align-items: baseline; gap: 6px; width: 100%; min-width: 0; }
.ev-line .ev-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; line-height: 1.2; }
.ev-line .ev-time { flex: none; line-height: 1.2; }
.mini-row { display: flex; margin-top: 2px; }
.mini {
  width: 18px; height: 18px; margin-left: -5px;
  border: 1.5px solid #FFFFFF; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 0.625rem; font-weight: 700;
}
.mini:first-child { margin-left: 0; }
.is-past { opacity: 0.45; }
/* Keep past days readable; only their event and dot colors are quieter. */
.day-wrap.is-past-day .ev,
.wk-col.is-past-day .wk-ev,
.mo-cell.is-past-day .mo-dots .dot { filter: saturate(var(--past-saturation)); }
.pop { animation: popIn 0.4s ease-out; }

.day-fade {
  position: absolute; top: 0; right: 0; bottom: 0; width: 36px; z-index: 8;
  pointer-events: none; display: none;
  background: linear-gradient(to right, rgba(255, 251, 245, 0), rgba(255, 251, 245, 0.96));
}

.empty { margin: auto; padding: 32px; text-align: center; color: var(--muted); }

/* ------------------------------------------------------------ chips */
.chip-row { display: flex; align-items: center; gap: 6px; padding: var(--name-gap) 12px; overflow-x: auto; flex: none; border-bottom: 1px solid var(--line); }
.day-head, .chip-row { box-shadow: 0 2px 6px rgba(31, 35, 40, 0.025); }
.chip-wrap { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  min-height: 36px; padding: 0 14px;
  display: inline-flex; align-items: center; gap: 7px; flex: none;
  border: 1px solid #E3DED5; border-radius: 999px;
  background: var(--surface); color: var(--ink-3);
  font-size: 0.8125rem; font-weight: 700; white-space: nowrap; cursor: pointer;
}
.who-chip { min-height: 40px; padding: 0 14px 0 10px; font-size: 0.875rem; font-weight: 600; border-color: var(--field-line); }
.person-chip { height: var(--name-h); min-height: var(--name-h); max-width: 100%; min-width: 0; padding: 0 var(--name-pad); letter-spacing: 0.01em; }
.chip-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.option-chip { min-height: 38px; font-size: 0.875rem; font-weight: 600; border-color: var(--field-line); color: var(--ink); }
.option-chip[aria-pressed="true"] { background: var(--accent-wash); border-color: var(--accent-border); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; }
.dot-sm { width: 6px; height: 6px; }
.notice { margin: 0 16px 10px; padding: 10px 14px; border-radius: 12px; background: var(--accent-wash); font-size: 0.8125rem; font-weight: 600; color: var(--ink-3); }

/* ------------------------------------------------------------ week view */
.wk-scroll { flex: 1; min-height: 0; overflow-y: auto; position: relative; }
.wk-head { position: sticky; top: 0; z-index: 5; display: flex; padding-left: var(--gutter); background: var(--bg); border-bottom: 1px solid var(--line); }
.wk-day {
  flex: 1; min-width: 0; height: 54px; padding: 0;
  border: 0; background: transparent;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  cursor: pointer;
}
.wk-dow { font-size: 0.6875rem; font-weight: 600; color: var(--faint); }
.wk-num { font-size: 0.9375rem; font-weight: 700; }
.wk-day.is-today .wk-dow, .wk-day.is-today .wk-num { color: var(--danger); }
.wk-grid { display: flex; }
.wk-gutter { width: var(--gutter); flex: none; }
.wk-hour { height: var(--calendar-week-hour-height); padding: 3px 8px 0 0; font-size: 0.6875rem; color: var(--faint); text-align: right; }
.wk-col { position: relative; flex: 1; min-width: 0; height: calc(var(--calendar-week-hour-height) * 16); border-left: 1px solid var(--line-2); }
.wk-col.is-today { background: var(--today-col); }
.wk-day.is-past-day, .wk-col.is-past-day { background: var(--past-day); }
.wk-day.is-past-day .wk-dow, .wk-day.is-past-day .wk-num { color: var(--muted); }
.wk-ev {
  position: absolute; left: 2px; right: 2px;
  padding: 3px 4px; border: 0; border-radius: 6px;
  font-size: 0.625rem; font-weight: 600; line-height: 1.2; text-align: left;
  overflow: hidden; word-break: break-word; cursor: pointer;
}
.wk-shared { border: 1px solid #E6DFD3; padding-top: 5px; }

/* ------------------------------------------------------------ month view */
.mo-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 10px 12px 16px; }
.mo-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.mo-dows { margin-bottom: 6px; }
.mo-dows span { font-size: 0.6875rem; font-weight: 600; color: var(--faint); text-align: center; }
.mo-blank { height: 64px; }
.mo-cell {
  height: 64px; width: 100%; padding: 8px 0 0;
  border: 0; border-radius: 12px; background: transparent;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 6px;
  cursor: pointer;
}
.mo-cell.is-selected { background: var(--accent-wash); }
.mo-cell.is-past-day { background: var(--past-day); }
.mo-cell.is-past-day .mo-num { color: var(--muted); }
.mo-cell.is-selected.is-past-day { box-shadow: inset 0 0 0 2px var(--accent-border); }
.mo-num { width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 0.875rem; font-weight: 500; }
.mo-cell.is-today .mo-num { background: var(--accent); font-weight: 700; }
.mo-cell.is-selected .mo-num { font-weight: 700; }
.mo-dots { display: flex; flex-wrap: wrap; justify-content: center; gap: 3px; }
.legend { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 18px; padding: 0 4px; }
.legend-item { display: flex; align-items: center; gap: 6px; font-size: 0.75rem; color: var(--ink-3); }

/* ------------------------------------------------------------ family */
.page { flex: 1; min-height: 0; overflow-y: auto; padding: 4px 16px 20px; display: flex; flex-direction: column; gap: 10px; }
.invite-card { padding: 16px; border-radius: var(--radius-lg); background: var(--accent-wash); }
.invite-title { margin: 0; font-size: 1.0rem; font-weight: 700; }
.invite-text { margin: 4px 0 10px; font-size: 0.8125rem; line-height: 1.45; color: var(--ink-3); }
.invite-code { margin: 0 0 12px; font-size: 2.0rem; font-weight: 700; letter-spacing: 0.18em; font-variant-numeric: tabular-nums; }
.invite-code.is-expired { color: var(--faint); text-decoration: line-through; }
.invite-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.member-card { display: flex; align-items: center; gap: 14px; padding: 12px 6px 12px 14px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); }
.member-info { flex: 1; min-width: 0; }
.member-name { margin: 0; font-size: 1.0rem; font-weight: 700; }
.member-sub { margin: 2px 0 0; font-size: 0.8125rem; color: var(--muted); }
.avatar {
  width: var(--size); height: var(--size); flex: none; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: calc(var(--size) * 0.38); font-weight: 700;
}
.btn-dashed { min-height: 52px; border: 1px dashed #CFCAC2; border-radius: 16px; background: transparent; font-size: 0.875rem; font-weight: 600; color: var(--ink-3); cursor: pointer; }
.link-btn { align-self: center; min-height: 40px; margin-top: 6px; border: 0; background: transparent; font-size: 0.8125rem; color: var(--faint); text-decoration: underline; cursor: pointer; }

/* ------------------------------------------------------------ buttons */
.btn {
  min-height: 48px; padding: 0 16px;
  border: 0; border-radius: var(--radius);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-size: 0.9375rem; font-weight: 700; cursor: pointer;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-lg { min-height: 52px; font-size: 1.0rem; }
.btn-primary { background: var(--accent); color: var(--ink); }
.btn-secondary { background: var(--surface); color: var(--ink); border: 1px solid var(--field-line); }
.btn-danger { background: var(--danger-soft); color: var(--danger); }
.btn-ghost { background: transparent; color: var(--ink-3); }
.btn-danger-text { color: var(--danger); }
.btn-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 4px; }
.btn-stack { display: flex; flex-direction: column; gap: 10px; }

/* ------------------------------------------------------------ sheets */
.overlay { position: absolute; inset: 0; z-index: 30; display: flex; flex-direction: column; background: rgba(24, 26, 29, 0.32); }
.backdrop { flex: 1; min-height: 40px; border: 0; background: transparent; cursor: pointer; }
.sheet {
  max-height: calc(100% - 40px); overflow-y: auto;
  display: flex; flex-direction: column; gap: 14px;
  padding: 10px 20px calc(28px + env(safe-area-inset-bottom, 0px));
  border-radius: 22px 22px 0 0; background: var(--surface);
  overscroll-behavior: contain;
}
.overlay.is-entering { animation: fadeIn 0.18s ease-out; }
.overlay.is-entering .sheet { animation: sheetUp 0.28s cubic-bezier(0.2, 0.8, 0.2, 1); }
.handle { flex: none; align-self: center; width: 36px; height: 4px; border-radius: 2px; background: #DAD6CF; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.sheet-title { margin: 0; font-size: 1.25rem; font-weight: 700; letter-spacing: -0.01em; }
.sheet-sub { margin: -8px 0 0; font-size: 0.875rem; line-height: 1.45; color: var(--muted); }
.meta-line { margin: -4px 0 0; display: flex; align-items: flex-start; gap: 8px; font-size: 0.875rem; line-height: 1.4; color: var(--ink-3); }
.meta-line svg { flex: none; margin-top: 2px; color: var(--muted); }
.meta-notes span { white-space: pre-wrap; }
.badge { align-self: flex-start; padding: 5px 10px; border-radius: 999px; background: var(--seg); font-size: 0.75rem; font-weight: 600; color: var(--ink-2); }
.who-list { display: flex; flex-direction: column; gap: 10px; }
.who-row { display: flex; align-items: center; gap: 12px; font-size: 0.9375rem; font-weight: 600; }
.field { display: flex; flex-direction: column; gap: 8px; }
.field-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.label { font-size: 0.8125rem; font-weight: 600; color: var(--ink-3); }
.input {
  width: 100%; height: 48px; padding: 0 14px;
  border: 1px solid var(--field-line); border-radius: 12px;
  background: var(--surface); color: var(--ink);
  font: inherit; font-size: 1.0rem; /* 16px stops iOS from zooming in */
}
.textarea { height: auto; min-height: 84px; padding: 12px 14px; line-height: 1.4; resize: none; }
.paste-box { min-height: 120px; }
.stepper { display: flex; align-items: center; justify-content: space-between; height: 48px; padding: 0 2px; border: 1px solid var(--field-line); border-radius: 12px; }
.stepper-value { font-size: 1.0rem; font-weight: 700; white-space: nowrap; }
.hint { margin: -2px 0 0; font-size: 0.8125rem; color: var(--muted); }
.range-note { margin: -6px 0 0; font-size: 0.8125rem; color: var(--muted); }
.paste-btn {
  min-height: 46px; flex: none;
  border: 1px dashed #E3C77A; border-radius: 12px; background: #FFF8E3;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  font-size: 0.875rem; font-weight: 700; cursor: pointer;
}
.error { margin: -6px 0 0; font-size: 0.8125rem; color: var(--danger); }
.swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.swatch { width: 40px; height: 40px; border: 0; border-radius: 50%; cursor: pointer; }
.swatch[aria-pressed="true"] { box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--ink); }

/* ------------------------------------------------------------ toast */
.toast {
  position: absolute; left: 50%; bottom: calc(84px + env(safe-area-inset-bottom, 0px)); z-index: 40;
  padding: 10px 16px; border-radius: 999px;
  background: var(--ink); color: #FFFFFF; font-size: 0.875rem; font-weight: 600;
  transform: translate(-50%, 12px); opacity: 0; pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }
.toast.is-visible:has(button) { pointer-events: auto; }

/* ------------------------------------------------------------ motion */
@keyframes sheetUp { from { transform: translateY(40px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes popIn { 0% { transform: scale(0.9); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ------------------------------------------------------------ inbox */
/* The badge hangs on the icon's corner, so it stays put when the label sits beside the icon (landscape). */
.tab-icon { position: relative; display: flex; }
.tab-badge {
  position: absolute; top: -4px; left: 17px;
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  background: var(--now); color: #FFFFFF; font-size: 0.6875rem; font-weight: 700;
}
/* Landscape: pinned to the icon's right edge, so a wider count grows over the icon, not the label. */
@media (orientation: landscape) and (max-height: 500px) { .tab-badge { left: auto; right: -9px; top: -7px; } }
.search-wrap { flex: none; padding: 0 12px 10px; }
.search { height: 42px; border-radius: 999px; padding: 0 16px; font-size: 0.9375rem; }
.inbox-section { margin: 8px 4px 0; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--faint); }
.inbox-card {
  display: flex; align-items: stretch; gap: 12px; width: 100%; padding: 10px; text-align: left;
  border: 1px solid var(--line); border-radius: 16px; background: var(--surface); cursor: pointer;
}
.inbox-card.is-past { opacity: 0.55; }
.inbox-info { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: 3px; }
.inbox-title { margin: 0; font-size: 0.9375rem; font-weight: 700; line-height: 1.25; }
.inbox-when { margin: 0; font-size: 0.8125rem; color: var(--muted); }
.inbox-meta { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.dots { display: inline-flex; gap: 4px; }
.status { padding: 3px 9px; border-radius: 999px; font-size: 0.6875rem; font-weight: 700; white-space: nowrap; }
.badge-new { background: var(--accent-soft); color: var(--ink); }
.badge-maybe { background: #FFFFFF; border: 1px dashed var(--accent-border); color: #7A5B00; }
.badge-added { background: #D7F1EA; color: var(--success); }
.inbox-note { margin: 4px 8px 0; font-size: 0.75rem; line-height: 1.4; color: var(--faint); text-align: center; }
.flyer-art { position: relative; flex: none; width: 64px; height: 84px; border-radius: 8px; overflow: hidden; border: 1px solid rgba(0, 0, 0, 0.07); display: flex; flex-direction: column; }
.flyer-head { flex: none; height: 34%; color: #FFFFFF; font-weight: 700; }
.flyer-bars { padding: 8px 7px; display: flex; flex-direction: column; gap: 5px; }
.flyer-bars i { display: block; height: 5px; border-radius: 3px; }
.flyer-pdf { position: absolute; right: 4px; bottom: 4px; padding: 1px 4px; border-radius: 4px; background: #B3261E; color: #FFFFFF; font-size: 0.5625rem; font-weight: 700; }
.flyer-art.is-big { width: min(100%, 250px); height: auto; aspect-ratio: 3 / 3.4; border-radius: 12px; }
.flyer-art.is-big .flyer-head { height: auto; min-height: 38%; padding: 16px; display: flex; align-items: flex-end; font-size: 1.25rem; line-height: 1.15; }
.flyer-art.is-big .flyer-bars { padding: 14px 16px; gap: 9px; }
.flyer-art.is-big .flyer-bars i { height: 8px; }
.flyer-art.is-big .flyer-pdf { font-size: 0.6875rem; padding: 2px 6px; }
.flyer-wrap { display: flex; justify-content: center; }
.inbox-from { margin: -6px 0 0; font-size: 0.75rem; color: var(--faint); text-align: center; }
.inbox-summary { margin: 0; font-size: 0.9375rem; line-height: 1.45; color: var(--ink-2); }
.facts { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 14px; }
.fact { display: flex; gap: 12px; align-items: center; padding: 10px 14px; font-size: 0.875rem; border-top: 1px solid var(--line); }
.fact:first-child { border-top: 0; }
.fact-k { flex: none; width: 52px; font-size: 0.75rem; font-weight: 700; color: var(--faint); text-transform: uppercase; letter-spacing: 0.04em; }
.missing { padding: 2px 8px; border-radius: 6px; background: var(--accent-wash); color: #7A5B00; font-weight: 600; }
.who-minis { display: flex; flex-wrap: wrap; gap: 10px; }
.who-mini { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.inbox-removed { margin: 0; font-size: 0.75rem; font-weight: 600; color: var(--muted); }
/* Possible copies: every match gets its own row and its own Open it. */
.dup-notice { display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; border-radius: var(--radius); background: var(--accent-wash); border: 1px solid var(--accent-soft); }
.dup-notice.is-info { background: var(--bg); border-color: var(--line); }
.dup-title { margin: 0; font-size: 0.875rem; font-weight: 700; color: var(--ink); }
.dup-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.dup-row { display: flex; align-items: center; gap: 12px; }
.dup-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; overflow-wrap: anywhere; }
.dup-info strong { font-size: 0.875rem; }
.dup-info small { font-size: 0.75rem; color: var(--muted); }
.dup-open { flex: none; }
.large-text .dup-row { flex-direction: column; align-items: stretch; }
.muted-inline { color: var(--faint); }

/* Day-view refinement: scoped so the other prototype screens keep their layout. */
.hdr-date { flex: 1; min-width: 0; padding: 0 2px; }
/* With no week strip, this line is the only sign of the selected day, so it reads clearly. */
.hdr-subtitle { margin: 2px 0 0; font-size: 0.8125rem; line-height: 1.25; font-weight: 700; color: var(--ink-2); white-space: nowrap; }
.hdr-subtitle.is-past-day { color: var(--muted); }
.day-wrap .day-fade { top: calc(var(--name-h) + 2 * var(--name-gap) + 1px); width: 16px; }
.hour-label { color: var(--muted); font-weight: 500; font-variant-numeric: tabular-nums; }
.col, .slot { border-color: rgba(82, 70, 52, 0.055); }
.day-wrap .ev { padding: 6px; border-radius: 10px; }
.day-wrap .ev-shared { padding-top: 9px; border-color: #E5DFD5; }
.day-wrap .ev-title { font-size: 0.8125rem; overflow-wrap: anywhere; }
.day-wrap .ev-time { font-variant-numeric: tabular-nums; }
.day-wrap .ev-compact { padding: 0 6px; }
.day-wrap .ev-shared.ev-compact { padding-top: 3px; }
.day-wrap .ev-compact .ev-title { font-size: 0.75rem; }
.day-wrap .ev-line { gap: 4px; }
.day-wrap .ev-line .ev-title { flex: 1; }
.day-wrap .is-past { opacity: 0.68; }
.day-wrap .ev:focus-visible { z-index: 7; outline-offset: -2px; }

/* Keep all three calendar views at the same available tablet width. */
@media (min-width: 700px) {
  .app.is-cal-view { max-width: none; }
}

/* Event editor: one scrolling body between a persistent header and save action. */
.editor-overlay {
  position: fixed; left: 0; right: 0; bottom: auto;
  top: var(--editor-vv-top, 0px); height: var(--editor-vv-height, 100dvh);
  justify-content: flex-end; align-items: center;
}
.editor-backdrop { position: absolute; inset: 0; border: 0; background: transparent; cursor: pointer; }
.editor-sheet {
  position: relative; width: 100%; height: min(860px, calc(100% - 16px));
  max-height: calc(100% - 16px); min-height: 0;
  padding: 0; gap: 0; overflow: hidden;
  box-shadow: 0 -8px 40px rgba(31, 35, 40, 0.12);
}
.editor-header { flex: none; padding: 10px 20px 12px; border-bottom: 1px solid var(--line); }
.editor-header .handle { margin: 0 auto 6px; display: block; }
.editor-body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 20px; display: flex; flex-direction: column; gap: 22px; scroll-padding: 16px; }
.editor-form { min-width: 0; display: flex; flex-direction: column; gap: 18px; }
.editor-who, .inbox-who { border: 0; padding: 0; margin: 0; min-width: 0; }
.editor-who legend, .inbox-who legend { padding: 0; margin-bottom: 8px; }
.editor-form .who-chip, .inbox-who .who-chip { max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
.editor-date-control { display: flex; align-items: center; gap: 4px; }
.editor-date-control .input { flex: 1; min-width: 0; text-align: center; padding: 0 8px; }
.editor-form select.input { min-width: 0; padding-right: 8px; }
.editor-form .range-note { margin: -8px 0 0; font-variant-numeric: tabular-nums; }
.editor-reading-note { margin: 0; padding: 12px 14px; border-radius: 12px; background: var(--accent-wash); font-size: 0.8125rem; line-height: 1.5; color: #624900; }
.editor-details { border-top: 1px solid var(--line); }
.editor-details-toggle { width: 100%; min-height: 52px; padding: 0; border: 0; background: transparent; display: flex; justify-content: space-between; align-items: center; font-size: 0.875rem; font-weight: 700; cursor: pointer; }
.editor-details-chevron { display: flex; color: var(--muted); transition: transform 0.2s; }
.editor-details-toggle[aria-expanded="true"] .editor-details-chevron { transform: rotate(90deg); }
.editor-more { display: flex; flex-direction: column; gap: 18px; padding: 4px 0 2px; }
.editor-more[hidden] { display: none; }
.editor-footer { flex: none; padding: 14px 20px calc(14px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--line); background: var(--surface); }
.editor-footer .btn { width: 100%; }
.editor-footer .error { margin: 0 0 10px; }
.editor-form [aria-invalid="true"] { border-color: var(--danger); }
.editor-source { padding: 16px; border: 1px solid var(--line); border-radius: 16px; background: var(--bg); }
.editor-source h3 { margin: 0 0 12px; font-size: 0.8125rem; font-weight: 700; color: var(--ink-3); }
.editor-source .flyer-art.is-big { width: min(100%, 220px); }
.editor-source-caption { margin: 12px 0 0; font-size: 0.75rem; line-height: 1.4; color: var(--muted); text-align: center; }
.editor-source-title { margin: 8px 0 0; font-size: 0.875rem; font-weight: 700; line-height: 1.4; overflow-wrap: anywhere; }
@media (min-width: 700px) {
  .editor-overlay { justify-content: center; }
  .editor-sheet { width: min(560px, calc(100% - 48px)); height: min(860px, calc(100% - 64px)); max-height: calc(100% - 64px); border-radius: 22px; box-shadow: 0 20px 70px rgba(31, 35, 40, 0.18); }
  .editor-header .handle { display: none; }
  .editor-header { padding-top: 16px; }
}
@media (min-width: 1000px) {
  .editor-sheet.has-source { width: min(960px, calc(100% - 48px)); }
  .editor-sheet.has-source .editor-body { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1fr); align-items: start; gap: 28px; }
  .editor-sheet.has-source .editor-source { position: sticky; top: 0; }
  .editor-sheet.has-source .editor-source .flyer-art.is-big { width: min(100%, 280px); }
}

/* ------------------------------------------------------------ signature moment: flyer → event (js/flight.js) */
.overlay.is-leaving { animation: dimOut 0.22s ease-in forwards; pointer-events: none; }
.overlay.is-leaving .sheet { animation: sheetDown 0.22s cubic-bezier(0.4, 0, 1, 1) forwards; }
.flight-ghost { position: fixed; z-index: 60; overflow: hidden; pointer-events: none; background: var(--surface); }
.flight-ghost .flight-art { position: absolute; top: 0; left: 0; max-width: none; aspect-ratio: auto; border: 0; border-radius: 0; transform-origin: 0 0; }
.flight-tint { position: absolute; inset: 0; padding: 6px 8px; overflow: hidden; opacity: 0; color: var(--ink); font-size: 0.75rem; font-weight: 700; line-height: 1.25; }
.day-wrap .is-landing { opacity: 0; transition: none; }
.inbox-who + .btn-stack .error { margin: 0; }
@keyframes sheetDown { to { transform: translateY(100%); } }
@keyframes dimOut { to { background-color: rgba(24, 26, 29, 0); } }

/* Equal side columns keep dates and page titles centered, independent of the logo. */
.hdr-brand { --hdr-side: 100px; display: grid; grid-template-columns: var(--hdr-side) minmax(0, 1fr) var(--hdr-side); height: 58px; align-items: center; gap: 0; padding: 8px 12px 6px; }
/* Keep the larger logo inset from the edge without moving the centered date. */
.hdr-mark { display: block; width: calc(var(--hdr-side) + 8px); height: auto; }
.hdr-page .page-title { text-align: center; }
.hdr-cal > .add-btn { justify-self: end; }
.hdr-center { display: flex; align-items: center; justify-content: center; min-width: 0; }
.hdr-cal .hdr-date { flex: 0 1 auto; min-width: 0; padding: 0 2px; text-align: center; }
.hdr-cal .hdr-title { font-size: 1.0rem; line-height: 1.25; letter-spacing: -0.025em; overflow: hidden; text-overflow: ellipsis; }
.hdr-center .icon-btn { width: 40px; }
.hdr-month-compact { display: none; }
@media (max-width: 699px) {
  .hdr-month-full { display: none; }
  .hdr-month-compact { display: inline; }
}
@media (max-width: 429px) { .hdr-center .icon-btn { width: 32px; } }
@media (max-width: 389px) { .hdr-brand { --hdr-side: 80px; } }
@media (max-width: 359px) {
  .hdr-brand { --hdr-side: 72px; }
  .hdr-mark { margin-left: -4px; }
  .hdr-subtitle { font-size: 0.75rem; }
}
@media (min-width: 700px) { .hdr-brand { --hdr-side: 120px; } }
.seg-wrap .today-btn { flex: none; height: calc(var(--seg-h) + 8px); margin: 0; padding: 0 14px; font-size: 0.8125rem; }

/* Premium prototype: measured geometry and reusable interaction surfaces. */
:root { color-scheme: light; --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px; --space-6: 24px; }
:root[data-font="manrope"] { --font: 'Manrope', ui-sans-serif, -apple-system, 'Segoe UI', sans-serif; }
[hidden] { display: none !important; }
button, input, select, textarea, summary { touch-action: manipulation; }
button { transition: background-color .12s, opacity .12s; }
button:active:not(:disabled) { filter: brightness(.95); }
button:disabled { opacity: .55; cursor: default; }
button, input, select, textarea { min-width: 0; }
.hdr-brand { --hdr-side: clamp(72px, calc(36vw - 43.2px), 112px); padding-left: 8px; padding-right: 8px; }
.hdr-mark { width: min(100%, 112px); margin: 0; }
.hdr-center .icon-btn { width: 44px; height: 44px; }
.hdr-cal .hdr-title { font-size: .9375rem; }
.hdr-cal .hdr-date { padding: 0; }
.hdr-page .page-title { font-size: 1.375rem; }
.seg-btn { min-height: 44px; height: auto; }
.seg-wrap .today-btn { min-height: 44px; height: auto; padding: 0 12px; margin: 0; }
.tab { height: auto; min-height: 52px; padding: 4px; }
.tab svg { flex: none; }
.chip { min-height: 44px; }
.option-chip { padding: 8px 12px; white-space: normal; text-align: left; }
.person-chip { min-height: 44px; height: auto; }
.day-head .name-pill { border: 0; background: transparent; font-weight: 600; border-radius: 8px; padding: 0 8px; }
.day-head .name-pill:hover { background: var(--seg); }
.slot, .hour-label { height: var(--calendar-hour-height); }
.hour-end, .col-end { height: 28px; }
.wk-hour { height: var(--calendar-week-hour-height); }
.day-wrap .ev, .wk-ev { gap: 2px; padding: 4px 5px; justify-content: flex-start; }
.day-wrap .ev-shared, .wk-shared { padding-top: 6px; }
.ev-title { flex: none; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: var(--title-lines, 2); overflow: hidden; overflow-wrap: anywhere; line-height: 1.25; }
.ev-time { flex: none; display: block; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.3; font-variant-numeric: tabular-nums; }
.ev .mini-row { flex: none; }
.ev[data-density="compact"], .wk-ev[data-density="compact"] { flex-direction: row; align-items: center; }
.ev[data-density="compact"] .ev-title, .wk-ev[data-density="compact"] .ev-title { flex: 1; min-width: 0; display: block; white-space: nowrap; text-overflow: ellipsis; }
.ev[data-density="compact"] .ev-time, .wk-ev[data-density="compact"] .ev-time { flex: none; }
.wk-ev { display: flex; flex-direction: column; }
.wk-ev .ev-title { font-size: .6875rem; }
.wk-ev .ev-time { font-size: .625rem; }
.day-wrap .day-fade { top: 0; width: 12px; display: none; }
.day-fade-left { left: var(--gutter); right: auto; transform: rotate(180deg); }
.has-overflow:not(.at-end) .day-fade-right, .has-overflow:not(.at-start) .day-fade-left { display: block; }
/* One-time swipe coach mark (Day people columns, Week strip): a small hand slides in the swipe direction. */
.swipe-hint {
  position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%); z-index: 10;
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; max-width: calc(100% - 32px); padding: 8px 10px 8px 14px;
  border: 1px solid var(--accent-border); border-radius: 999px; background: var(--accent-wash); color: var(--ink);
  font: inherit; font-size: .8125rem; font-weight: 700; white-space: nowrap; box-shadow: 0 4px 14px #1f23281f; cursor: pointer;
}
.swipe-hint > span:not(.swipe-close) { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.swipe-close { color: var(--muted); font-weight: 500; padding-left: 2px; }
.swipe-hand { flex: none; color: var(--ink); animation: swipeRight 1.6s ease-in-out infinite; }
.swipe-hint[data-dir="left"] .swipe-hand { animation-name: swipeLeft; }
@keyframes swipeRight { 0%, 15% { transform: translateX(-9px); opacity: 1; } 70% { transform: translateX(9px); opacity: .2; } 100% { transform: translateX(-9px); opacity: 0; } }
@keyframes swipeLeft { 0%, 15% { transform: translateX(9px); opacity: 1; } 70% { transform: translateX(-9px); opacity: .2; } 100% { transform: translateX(9px); opacity: 0; } }
/* Sideways swipes stop at the edges, so the sticky hour column never bounces with the grid. */
.day-scroll, .wk-scroll { overscroll-behavior-x: none; }
.sheet-frame { padding: 0; gap: 0; overflow: hidden; max-height: calc(100dvh - 40px); }
.sheet-body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 16px 20px 24px; display: flex; flex-direction: column; gap: 16px; }
.sheet-footer { flex: none; padding: 12px 20px calc(12px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; background: var(--surface); max-height: 48dvh; overflow-y: auto; }
.sheet-footer .error { margin: 0; }
.sheet-compact .sheet-body { flex: 0 1 auto; }
.sheet-frame:has(#preview-title) { height: calc(100dvh - 40px); }
.sheet-sub { margin: 0; }
.sheet-title { white-space: normal; overflow-wrap: anywhere; }
.btn { min-height: 44px; height: auto; white-space: normal; padding: 10px 16px; }
.btn-lg { min-height: 52px; }
.secondary-actions { display: flex; gap: 8px; }
.secondary-actions .btn { flex: 1; }
.flyer-preview { display: flex; align-items: center; gap: 16px; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 12px; text-align: left; }
.flyer-preview > span { min-width: 0; overflow-wrap: anywhere; }
.flyer-preview small { display: block; font-size: .75rem; color: var(--muted); margin-top: 4px; }
.flyer-expand { border: 0; background: transparent; padding: 0; width: 100%; }
.flyer-summary summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; font-size: .875rem; font-weight: 600; }
.flyer-summary p { margin: 8px 0 0; }
.estimated-label { display: inline-block; padding: 2px 6px; border-radius: 8px; background: var(--accent-wash); font-size: .75rem; font-weight: 600; color: #624900; }
.fact { align-items: flex-start; }
.fact > span:last-child { min-width: 0; overflow-wrap: anywhere; }
.inbox-card.is-past { opacity: .8; }
.inbox-card .inbox-title { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.member-list { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.member-list .member-card { border: 0; border-radius: 0; border-bottom: 1px solid var(--line); background: transparent; }
.member-list .member-card:last-child { border-bottom: 0; }
.member-name, .member-sub { overflow-wrap: anywhere; }
.invite-card { padding: 16px; }
.invite-text { font-size: .875rem; }
.demo-tools { margin-top: 8px; padding: 12px; border-top: 1px solid var(--line); }
.demo-tools summary { min-height: 44px; cursor: pointer; display: flex; align-items: center; font-size: .875rem; color: var(--muted); }
.permission-options { border: 0; padding: 0; margin: 0; }
.permission-row { display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; }
.permission-row input { width: 24px; height: 24px; flex: none; accent-color: var(--success); }
.permission-row strong { display: block; font-size: .9375rem; }
.permission-row small { display: block; color: var(--muted); font-size: .8125rem; margin-top: 4px; }
.swatch { min-width: 44px; min-height: 44px; color: #fff; font-size: 1.25rem; }
.swatches { flex-wrap: wrap; }
.input { height: auto; min-height: 48px; padding: 10px 12px; }
.stepper { min-width: 0; height: auto; min-height: 48px; }
.stepper-value { min-width: 0; }
.toast { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: max-content; max-width: calc(100% - 32px); }
.toast button { flex: none; border: 0; background: transparent; color: var(--accent); min-width: 44px; min-height: 44px; font-weight: 700; }
.persistence-status { flex: none; padding: 8px 16px; background: var(--accent-wash); font-size: .8125rem; }
.action-spinner { display: inline-block; width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: actionSpin .8s linear infinite; margin-right: 8px; }
@keyframes actionSpin { to { transform: rotate(360deg); } }
.large-text .hdr-brand { grid-template-columns: 1fr auto; height: auto; row-gap: 8px; }
.large-text .hdr-center { grid-column: 1 / -1; grid-row: 2; }
.large-text .hdr-cal > .add-btn { grid-column: 2; grid-row: 1; }
.large-text .hdr-page .page-title { grid-column: 1 / -1; grid-row: 2; }
.large-text .field-pair, .large-text .btn-pair { grid-template-columns: 1fr; }
.large-text .editor-date-control { display: grid; grid-template-columns: 44px 1fr 44px; gap: var(--space-2); }
.large-text .editor-date-control input { grid-column: 1 / -1; grid-row: 1; width: 100%; }
.large-text .editor-date-control button { grid-row: 2; }
.large-text .editor-date-control button:last-child { grid-column: 3; }
.large-text .chip-row { padding-bottom: 8px; }
.large-text .seg-btn { min-height: 48px; }
.large-text .secondary-actions { flex-wrap: wrap; }
.wk-scroll { overflow: auto; }
.wk-head, .wk-grid { min-width: calc(var(--gutter) + 308px); }
.wk-gutter { position: sticky; left: 0; z-index: 4; background: var(--bg); }
.large-text .wk-head, .large-text .wk-grid { min-width: calc(var(--gutter) + 448px); }
/* Week: a sticky corner keeps day headers from sliding under the hours; narrow layouts swipe a strip of fixed-width days. */
.wk-wrap { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; }
.wk-head { padding-left: 0; }
.wk-wrap.is-strip .wk-day, .wk-wrap.is-strip .wk-col { flex: none; }
.wk-wrap.is-strip .wk-head, .wk-wrap.is-strip .wk-grid { min-width: 0; }
.wk-wrap .day-fade { top: 0; width: 12px; display: none; }
.large-text .wk-day { height: 88px; }
.large-text .mo-cell { height: 96px; }
.large-text .mo-num { width: 44px; height: 48px; }
.large-text .seg-wrap { flex-wrap: wrap; }
.large-text .seg { flex-basis: 100%; }
.large-text .today-btn { margin-left: auto; }
@media (max-width: 359px) {
  .mo-scroll { padding-left: 6px; padding-right: 6px; }
  .mo-grid { gap: 0; }
}
@media (max-width: 359px) { .field-pair { grid-template-columns: 1fr; } }
@media (min-width: 700px) {
  .sheet-frame { width: min(560px, calc(100% - 48px)); border-radius: 16px; max-height: calc(100dvh - 64px); box-shadow: 0 16px 40px #1f23281a; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }

.ev[data-density="empty"], .wk-ev[data-density="empty"] { padding: 0; border: 0; }

.sheet-frame { position: relative; z-index: 2; }
.large-text { --calendar-gutter: 72px; }
.large-text .tabbar { gap: 0; padding-left: 4px; padding-right: 4px; }
.large-text .tab { padding-left: 0; padding-right: 0; }
.tab > span { max-width: 100%; overflow-wrap: anywhere; }

/* ------------------------------------------------------------ landscape phones */
/* Short landscape viewport (phone turned sideways): compact bars, month and date on one line.
   Header arrows, + and tabs are 32px; the view switch, Day names and filter chips are thinner (24–28px).
   Last in the file so it wins over the 44px rules above. */
@media (orientation: landscape) and (max-height: 500px) {
  :root { --name-h: 24px; --name-gap: 1px; --seg-h: 24px; }
  .hdr-brand { height: 44px; padding-top: 4px; padding-bottom: 2px; }
  .hdr-cal .hdr-date { display: flex; flex-wrap: wrap; justify-content: center; align-items: baseline; column-gap: 8px; }
  .hdr-subtitle { margin: 0; }
  .hdr-center .icon-btn, .hdr-cal > .add-btn { width: 36px; height: 36px; }
  .hdr-mark { max-height: 28px; width: auto; }
  .seg-wrap { padding-bottom: 2px; }
  .seg { padding: 1px; }
  .seg-btn, .seg-wrap .today-btn { min-height: 24px; }
  .pill-cell { height: auto; min-height: calc(var(--name-h) + 2 * var(--name-gap)); }
  .person-chip { min-height: 24px; }
  .chip-row { padding-top: 2px; padding-bottom: 2px; }
  .chip-row .chip { min-height: 28px; }
  .tab { min-height: 32px; flex-direction: row; gap: 8px; padding: 2px 4px; font-size: .8125rem; }
  .tabbar { padding-top: 2px; padding-bottom: calc(2px + env(safe-area-inset-bottom, 0px)); }
  /* Large text: the header grows instead of clipping; month and date may wrap. */
  .large-text .hdr-brand { height: auto; }
}

/* Portrait phone: slimmer bars (owner, Oct 7). Switch, names and filter chips 36px; header buttons and tabs keep 44px+. */
@media (orientation: portrait) and (max-width: 699px) {
  :root { --name-h: 36px; --name-gap: 2px; --seg-h: 36px; }
  .hdr-brand { height: 52px; padding-top: 4px; padding-bottom: 4px; }
  .seg-wrap { padding-bottom: 6px; }
  .seg { padding: 2px; }
  .seg-btn, .seg-wrap .today-btn { min-height: 36px; }
  .pill-cell { height: auto; min-height: calc(var(--name-h) + 2 * var(--name-gap)); }
  .person-chip { min-height: 36px; }
  .chip-row { padding-top: 4px; padding-bottom: 4px; }
  .chip-row .chip { min-height: 36px; }
  .tab { min-height: 48px; }
  .tabbar { padding-top: 4px; padding-bottom: calc(4px + env(safe-area-inset-bottom, 0px)); }
  .large-text .hdr-brand { height: auto; }
}
