:root {
  --bg: #0b0c10;
  --bg-2: #12141b;
  --card: #171a22;
  --ink: #efe8dc;
  --muted: #9a9286;
  --line: rgba(239, 232, 220, 0.08);
  --gold: #d4b483;
  --gold-2: #e8d3a8;
  --sage: #8fbea8;
  --rose: #d9897a;
  --sky: #8aa4c7;
  --ember: #d7a06a;
  --on-accent: #ffffff;
  --glow-1: rgba(212, 180, 131, 0.09);
  --glow-2: rgba(138, 164, 199, 0.08);
  --panel: rgba(23, 26, 34, 0.55);
  --chrome: rgba(11, 12, 16, 0.62);
}

html[data-theme="light"] {
  --bg: #f3eee4;
  --bg-2: #e7dfd0;
  --card: #fffaf2;
  --ink: #1c1915;
  --muted: #6f675c;
  --line: rgba(28, 25, 21, 0.1);
  --gold: #9a7040;
  --gold-2: #6e4e28;
  --sage: #3f7a62;
  --rose: #b85a4c;
  --sky: #4d6f94;
  --ember: #b56b32;
  --on-accent: #ffffff;
  --glow-1: rgba(154, 112, 64, 0.14);
  --glow-2: rgba(77, 111, 148, 0.1);
  --panel: rgba(255, 250, 242, 0.62);
  --chrome: rgba(243, 238, 228, 0.72);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
html {
  color-scheme: dark;
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
html[data-theme="light"] { color-scheme: light; }

body {
  font-family: Montserrat, ui-sans-serif, system-ui, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(1200px 500px at 8% -10%, var(--glow-1), transparent 50%),
    radial-gradient(900px 420px at 100% 0%, var(--glow-2), transparent 46%),
    var(--bg);
  min-height: 100dvh;
  overflow-x: hidden;
}

h1, h2, h3, p { margin: 0; }
button, a { font-family: inherit; touch-action: manipulation; }
.hidden { display: none !important; }

.photo-layer {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.photo-layer img {
  position: absolute;
  right: -6%;
  top: 46%;
  transform: translateY(-50%);
  height: 118%;
  width: auto;
  max-width: none;
  opacity: 0.38;
  filter: saturate(0.72) contrast(1.08) brightness(0.68);
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, rgba(0,0,0,0.25) 24%, #000 58%);
  mask-image: linear-gradient(90deg, transparent 0%, rgba(0,0,0,0.25) 24%, #000 58%);
}
.photo-veil {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, var(--bg) 6%, transparent 56%),
    linear-gradient(180deg, color-mix(in srgb, var(--bg) 78%, transparent) 0%, transparent 24%, transparent 68%, var(--bg) 100%);
}
html[data-theme="light"] .photo-layer img {
  opacity: 0.28;
  filter: saturate(0.55) contrast(1.02) brightness(1.08);
}
body.on-goals .photo-layer img,
body.on-calendar .photo-layer img { opacity: 0.2; }

.site-chrome {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 18px;
  padding-top: max(10px, env(safe-area-inset-top));
  padding-left: max(18px, env(safe-area-inset-left));
  padding-right: max(18px, env(safe-area-inset-right));
  border-bottom: 1px solid var(--line);
  background: var(--chrome);
  backdrop-filter: blur(18px) saturate(1.1);
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
  flex-wrap: wrap;
}
.logo {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  white-space: nowrap;
}
.logo em {
  font-style: italic;
  font-weight: 500;
  color: var(--gold);
  padding: 0 0.12em;
}
.brand-rest {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}
.brand-sep {
  color: var(--gold);
  opacity: 0.7;
  font-weight: 400;
}
.brand-page {
  font-size: 16px;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--muted);
  white-space: nowrap;
}

.chrome-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.chrome-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.session-chip {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px 4px 3px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg-2);
}
.session-chip[hidden] { display: none !important; }
.session-chip.masha {
  border-color: color-mix(in srgb, var(--rose) 50%, var(--line));
  background: color-mix(in srgb, var(--rose) 14%, var(--bg-2));
}
.session-chip.sasha {
  border-color: color-mix(in srgb, var(--sky) 50%, var(--line));
  background: color-mix(in srgb, var(--sky) 14%, var(--bg-2));
}
.session-who {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.session-out {
  border: 0;
  background: transparent;
  color: var(--muted);
  font: 600 11px Montserrat, sans-serif;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  padding: 6px 10px;
}
.session-out:hover { color: var(--ink); }

.theme-toggle {
  border: 1px solid var(--line);
  background: var(--bg-2);
  color: var(--ink);
  padding: 7px 12px;
  font: 600 11px Montserrat, sans-serif;
  border-radius: 999px;
  cursor: pointer;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.theme-toggle:hover { border-color: var(--gold); }

.home-link {
  display: none;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--ink);
  background: var(--bg-2);
  text-decoration: none;
}
body.on-goals .home-link,
body.on-calendar .home-link { display: grid; }
html[data-locked="1"] .home-link { display: none !important; }
.home-link:hover { border-color: var(--gold); color: var(--gold); }
.home-link svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.together-clock {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}
.clock-units {
  display: flex;
  gap: 8px;
  align-items: baseline;
}
.clock-unit {
  display: flex;
  align-items: baseline;
  gap: 4px;
}
.clock-unit b {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--gold-2);
  font-variant-numeric: tabular-nums;
}
.clock-unit span {
  font-size: 10px;
  color: var(--muted);
  font-weight: 500;
}

.stage {
  position: relative;
  z-index: 1;
  width: min(1080px, calc(100% - 36px));
  margin: 0 auto;
  padding: 42px 0 64px;
  padding-bottom: max(64px, env(safe-area-inset-bottom));
}

.eyebrow {
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 600;
  margin-bottom: 14px;
}
.hero-title {
  font-size: clamp(32px, 5.4vw, 58px);
  font-weight: 700;
  letter-spacing: -0.045em;
  line-height: 0.98;
  max-width: 14ch;
}
.hero-lead {
  margin-top: 16px;
  max-width: 36ch;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.55;
}

html[data-locked="1"] .hub,
html[data-locked="1"] .goals,
html[data-locked="1"] .calendar,
html[data-locked="1"] .assist-fab,
html[data-locked="1"] .assist-panel,
html[data-locked="1"] .cal-sheet,
html[data-locked="1"] .together-clock,
html[data-locked="1"] .session-chip {
  display: none !important;
}
html:not([data-locked="1"]) .gate { display: none !important; }
html[data-locked="1"] .brand-page { color: var(--gold); }

.gate-card {
  margin-top: 36px;
  max-width: 420px;
  display: grid;
  gap: 14px;
  padding: 22px 22px 20px;
  border-radius: 24px;
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(16px);
}
.gate-card.shake {
  animation: gate-shake 0.34s ease;
}
@keyframes gate-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-7px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(3px); }
}
.gate-pass {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: stretch;
}
.gate-pass input {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink);
  border-radius: 16px;
  padding: 12px 14px;
  font: 500 16px Montserrat, sans-serif;
  outline: none;
}
.gate-pass input:focus { border-color: var(--gold); }
.gate-peek {
  border: 1px solid var(--line);
  background: var(--bg-2);
  color: var(--muted);
  border-radius: 16px;
  padding: 0 14px;
  font: 700 11px Montserrat, sans-serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  white-space: nowrap;
}
.gate-peek:hover,
.gate-peek[aria-pressed="true"] {
  border-color: var(--gold);
  color: var(--gold-2);
}
.gate-enter {
  width: 100%;
  justify-content: center;
  min-height: 48px;
  margin-top: 2px;
}
.gate-enter:disabled { opacity: 0.55; cursor: wait; }
.gate-pass input,
.gate-peek { min-height: 46px; }

.hub-tiles {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-top: 42px;
  max-width: 760px;
}
.tile {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-height: 210px;
  padding: 22px 22px 20px;
  border-radius: 24px;
  text-decoration: none;
  color: inherit;
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(16px);
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}
.tile:hover,
.tile:focus-visible {
  transform: translateY(-4px);
  border-color: color-mix(in srgb, var(--gold) 55%, var(--line));
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.22);
  outline: none;
}
.theme-toggle:focus-visible,
.session-out:focus-visible,
.gate-peek:focus-visible,
.goals-tab:focus-visible,
.back-hub:focus-visible,
.home-link:focus-visible,
.cal-nav-btn:focus-visible,
.cal-today:focus-visible,
.cal-add:focus-visible,
.cal-cell:focus-visible,
.cal-save:focus-visible,
.cal-cancel:focus-visible,
.cal-delete:focus-visible,
.cal-sheet-close:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}
.tile-icon {
  font-size: 22px;
  color: var(--gold);
  margin-bottom: 18px;
}
.tile-kicker {
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}
.tile strong {
  display: block;
  margin-top: 6px;
  font-size: 22px;
  letter-spacing: -0.03em;
  font-weight: 700;
}
.tile-copy {
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  flex: 1;
}
.tile-go {
  margin-top: 18px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
}

.hub-links {
  margin-top: 28px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 28px;
}
.goals-tab {
  margin-top: 0;
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  border: 0;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  padding: 8px 2px;
  border-bottom: 1px solid color-mix(in srgb, var(--gold) 45%, transparent);
}
.goals-star {
  color: var(--gold);
  font-size: 13px;
}
.goals-label {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.28em;
  text-transform: uppercase;
}
.goals-hint {
  font-size: 12px;
  font-style: italic;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0;
  text-transform: none;
}
.goals-tab:hover .goals-label { color: var(--gold-2); }

.back-hub {
  border: 0;
  background: transparent;
  color: var(--muted);
  font: 600 12px Montserrat, sans-serif;
  letter-spacing: 0.06em;
  cursor: pointer;
  padding: 0 0 18px;
}
.back-hub:hover { color: var(--ink); }

.goals {
  padding-bottom: 96px;
}
.goals-title {
  font-size: clamp(34px, 5vw, 52px);
  letter-spacing: -0.04em;
  font-weight: 700;
}
.goals-lead {
  margin-top: 12px;
  max-width: 42ch;
  color: var(--muted);
  line-height: 1.55;
}

.timeline {
  list-style: none;
  margin: 48px 0 0;
  padding: 0;
  position: relative;
  display: grid;
  gap: 28px;
}
.timeline::before {
  content: "";
  position: absolute;
  left: 118px;
  top: 8px;
  bottom: 8px;
  width: 1px;
  background: linear-gradient(180deg, transparent, var(--gold), var(--sage), var(--sky), var(--gold), transparent);
  opacity: 0.55;
}

.node {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 28px;
  align-items: start;
  position: relative;
}
.node::after {
  content: "";
  position: absolute;
  left: 114px;
  top: 11px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--gold);
  box-shadow: 0 0 0 6px color-mix(in srgb, var(--gold) 16%, transparent);
}
.node-rose::after { border-color: var(--rose); box-shadow: 0 0 0 6px color-mix(in srgb, var(--rose) 18%, transparent); }
.node-sage::after { border-color: var(--sage); box-shadow: 0 0 0 6px color-mix(in srgb, var(--sage) 18%, transparent); }
.node-sky::after { border-color: var(--sky); box-shadow: 0 0 0 6px color-mix(in srgb, var(--sky) 18%, transparent); }

.node-when {
  padding-top: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  text-align: right;
}
.node-rose .node-when { color: var(--rose); }
.node-sage .node-when { color: var(--sage); }
.node-sky .node-when { color: var(--sky); }

.node-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 18px 20px 20px;
  backdrop-filter: blur(16px);
  max-width: 560px;
}
.node-card h3 {
  font-size: 18px;
  letter-spacing: -0.03em;
  font-weight: 700;
  line-height: 1.25;
}
.node-card p {
  margin-top: 8px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

html:has(body.on-calendar) {
  height: 100%;
  overflow: hidden;
}
body.on-calendar {
  height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
  overscroll-behavior: none;
  display: flex;
  flex-direction: column;
}
body.on-calendar .site-chrome { flex-shrink: 0; }
body.on-calendar .stage {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  width: min(1180px, calc(100% - 28px));
  padding-top: 12px;
  padding-bottom: 12px;
}
.calendar {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding-bottom: 0;
}
.calendar .eyebrow { margin-bottom: 2px; }
.calendar .goals-title { font-size: clamp(26px, 3.4vw, 36px); }
.calendar .goals-lead {
  margin-top: 4px;
  font-size: 13px;
  line-height: 1.35;
  max-width: none;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}
.cal-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px 24px;
  flex-shrink: 0;
}
.cal-head-copy { min-width: 0; flex: 1; }
.cal-toolbar {
  margin-top: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  flex-shrink: 0;
}
.cal-nav {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.cal-nav h3 {
  font-size: 18px;
  letter-spacing: -0.03em;
  text-transform: capitalize;
  min-width: 11ch;
}
.cal-nav-btn,
.cal-today,
.cal-add,
.cal-sheet-close,
.cal-cancel,
.cal-delete {
  border: 1px solid var(--line);
  background: var(--bg-2);
  color: var(--ink);
  border-radius: 999px;
  cursor: pointer;
  font: 600 12px Montserrat, sans-serif;
}
.cal-nav-btn {
  width: 36px;
  height: 36px;
  font-size: 20px;
  line-height: 1;
  padding: 0;
}
.cal-today,
.cal-add,
.cal-sheet-close,
.cal-cancel { padding: 8px 14px; }
.cal-nav-btn:hover,
.cal-today:hover,
.cal-add:hover { border-color: var(--gold); color: var(--gold-2); }

.cal-board {
  margin-top: 10px;
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(260px, 0.85fr);
  gap: 14px;
  align-items: stretch;
}
.cal-grid,
.cal-agenda {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 24px;
  backdrop-filter: blur(16px);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.18);
  min-height: 0;
  overflow: hidden;
}
.cal-grid {
  padding: 10px 12px 12px;
  display: flex;
  flex-direction: column;
}
.cal-weekdays,
.cal-cells {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
}
.cal-weekdays { flex-shrink: 0; }
.cal-cells {
  flex: 1;
  min-height: 0;
  grid-template-rows: repeat(6, minmax(0, 1fr));
}
.cal-dow {
  text-align: center;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
  padding-bottom: 8px;
}
.cal-cell {
  min-height: 0;
  height: 100%;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink);
  border-radius: 14px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 4px;
  padding: 6px 7px 5px;
  text-align: left;
}
.cal-cell:hover { background: color-mix(in srgb, var(--gold) 10%, transparent); }
.cal-cell.is-out { opacity: 0.38; }
.cal-cell.is-today .cal-num { color: var(--gold-2); }
.cal-cell.is-selected {
  border-color: color-mix(in srgb, var(--gold) 55%, var(--line));
  background: color-mix(in srgb, var(--gold) 14%, transparent);
}
.cal-num-row {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  max-width: 100%;
}
.cal-num {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
}
.cal-bell {
  display: inline-flex;
  width: 16px;
  height: 16px;
  color: var(--gold);
  flex-shrink: 0;
}
.cal-bell svg,
.cal-item-bell svg {
  width: 100%;
  height: 100%;
  display: block;
}
.cal-dots { display: flex; gap: 3px; min-height: 6px; margin-top: 0; }
.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
}
.dot.shared { background: var(--gold); }
.dot.masha { background: var(--rose); }
.dot.sasha { background: var(--sky); }

.cal-agenda {
  padding: 12px 14px 10px;
  display: flex;
  flex-direction: column;
}
.cal-agenda-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
}
.cal-agenda h3 {
  font-size: 18px;
  letter-spacing: -0.03em;
  margin-top: 2px;
}
.cal-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin: 8px 0 8px;
  color: var(--muted);
  font-size: 11px;
  flex-shrink: 0;
}
.cal-legend span { display: inline-flex; align-items: center; gap: 6px; }
.cal-list {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: 6px;
  flex: 1;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  padding-bottom: 64px;
}
.cal-item {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 2px 12px;
  align-items: center;
  flex: 0 0 auto;
  width: 100%;
  max-width: none;
  box-sizing: border-box;
  height: auto;
  min-height: 44px;
  text-align: left;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 55%, transparent);
  color: inherit;
  border-radius: 14px;
  padding: 7px 14px 7px 12px;
  cursor: pointer;
}
.cal-item:hover { border-color: color-mix(in srgb, var(--gold) 45%, var(--line)); }
.cal-item.shared { border-left: 3px solid var(--gold); }
.cal-item.masha { border-left: 3px solid var(--rose); }
.cal-item.sasha { border-left: 3px solid var(--sky); }
.cal-item.note .cal-item-time {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  min-height: 16px;
}
.cal-item-bell {
  display: inline-flex;
  width: 16px;
  height: 16px;
  color: var(--gold);
  flex-shrink: 0;
}
.cal-item.is-done strong {
  color: var(--muted);
  text-decoration: line-through;
  text-decoration-color: color-mix(in srgb, var(--gold) 70%, transparent);
  text-decoration-thickness: 1.5px;
  text-decoration-skip-ink: none;
}
.cal-item-time {
  font-size: 12px;
  font-weight: 700;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
  padding-top: 0;
}
.cal-item-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1px;
  min-width: 0;
}
.cal-item-body em {
  font-style: normal;
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
  line-height: 1.2;
}
.cal-item-body strong {
  font-size: 13px;
  letter-spacing: -0.02em;
  line-height: 1.25;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cal-item-body small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.3;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cal-empty {
  margin: 8px 0 0;
  width: 100%;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.cal-sheet {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  background: color-mix(in srgb, var(--bg) 48%, transparent);
  backdrop-filter: blur(8px);
  padding: 20px;
  padding-top: max(20px, env(safe-area-inset-top));
  padding-bottom: max(20px, env(safe-area-inset-bottom));
  padding-left: max(20px, env(safe-area-inset-left));
  padding-right: max(20px, env(safe-area-inset-right));
}
.cal-sheet-card {
  width: min(440px, 100%);
  max-height: min(86dvh, 720px);
  overflow: auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.32);
  backdrop-filter: blur(22px);
  padding: 18px 18px 20px;
}
.cal-sheet-card.is-anchored {
  margin: 0;
  justify-self: start;
  align-self: start;
}
.cal-sheet-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
}
.cal-sheet-head strong {
  display: block;
  font-size: 22px;
  letter-spacing: -0.03em;
}
.cal-form,
.cal-cook-wrap { display: grid; gap: 14px; }
.cal-form[hidden],
#cal-cook-wrap[hidden] { display: none !important; }
.field { display: grid; gap: 6px; }
.field span {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 700;
}
.field em {
  font-style: italic;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  color: var(--muted);
  padding-left: 6px;
}
.field input,
.field textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink);
  border-radius: 16px;
  padding: 12px 14px;
  font: 500 16px Montserrat, sans-serif;
  outline: none;
}
.field textarea { resize: vertical; min-height: 84px; }
.field input:focus,
.field textarea:focus { border-color: var(--gold); }
.field input::placeholder,
.field textarea::placeholder,
.gate-pass input::placeholder {
  color: var(--muted);
  opacity: 0.7;
}
.who-toggle {
  border: 0;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}
.who-toggle legend {
  grid-column: 1 / -1;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 700;
  margin-bottom: 2px;
}
.who-chip {
  display: flex;
  cursor: pointer;
}
.who-chip input { position: absolute; opacity: 0; pointer-events: none; }
.who-chip span {
  width: 100%;
  text-align: center;
  border: 1px solid var(--line);
  background: var(--bg-2);
  border-radius: 999px;
  padding: 11px 12px;
  font: 700 14px Montserrat, sans-serif;
}
.who-chip.shared input:checked + span {
  border-color: var(--gold);
  background: color-mix(in srgb, var(--gold) 22%, var(--bg));
}
.who-chip.masha input:checked + span {
  border-color: var(--rose);
  background: color-mix(in srgb, var(--rose) 22%, var(--bg));
  color: var(--ink);
}
.who-chip.sasha input:checked + span {
  border-color: var(--sky);
  background: color-mix(in srgb, var(--sky) 22%, var(--bg));
}
.cal-dows {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.cal-dows button {
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  background: var(--bg-2);
  color: var(--muted);
  border-radius: 999px;
  cursor: pointer;
  font: 700 11px Montserrat, sans-serif;
  letter-spacing: 0.04em;
}
.cal-dows button.is-on {
  border-color: var(--gold);
  background: color-mix(in srgb, var(--gold) 22%, var(--bg));
  color: var(--ink);
}
.cal-repeat-fields {
  display: grid;
  gap: 10px;
}
.cal-repeat-fields.hidden { display: none !important; }
.cal-when {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  align-items: end;
}
.allday {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}
.allday input { accent-color: var(--gold); width: 16px; height: 16px; }
.cal-error {
  min-height: 1.2em;
  margin: 0;
  color: var(--rose);
  font-size: 13px;
}
.cal-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}
.cal-save {
  border: 0;
  background: var(--gold);
  color: var(--on-accent);
  border-radius: 999px;
  padding: 12px 18px;
  font: 700 12px Montserrat, sans-serif;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}
.cal-delete { color: var(--rose); margin-left: auto; padding: 8px 14px; }
.cal-cook-meta {
  margin: 0;
  color: var(--sage);
  font-weight: 700;
  font-size: 14px;
}
.cal-cook-copy {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
  font-size: 14px;
}
.cal-note-body {
  display: grid;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 55%, transparent);
}
.cal-note-p {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
}
.cal-note-gap { min-height: 0.7em; }
.cal-note-li {
  margin: 0;
  display: grid;
  grid-template-columns: 14px 1fr;
  gap: 8px;
  align-items: start;
  font-size: 14px;
  line-height: 1.45;
}
.cal-note-li i {
  width: 8px;
  height: 8px;
  margin-top: 6px;
  border-radius: 50%;
  border: 1.5px solid color-mix(in srgb, var(--sage) 70%, var(--line));
  display: inline-block;
}
.cal-note-li.done i {
  background: color-mix(in srgb, var(--sage) 82%, var(--gold));
  border-color: transparent;
}
.cal-note-li.done span {
  color: var(--muted);
  text-decoration: line-through;
  text-decoration-color: color-mix(in srgb, var(--gold) 75%, transparent);
  text-decoration-thickness: 1.5px;
  text-decoration-skip-ink: none;
}
html.cal-sheet-open, html.cal-sheet-open body { overflow: hidden; }

@media (max-width: 860px) {
  .cal-head { flex-wrap: wrap; align-items: flex-start; }
  .cal-toolbar { width: 100%; justify-content: space-between; }
  .cal-board {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1.05fr) minmax(220px, 1fr);
  }
  .cal-cell { min-height: 0; padding: 4px 5px; }
  .cal-agenda { padding: 12px 12px 10px; }
  .cal-list { gap: 5px; padding-bottom: 72px; }
  .cal-item {
    grid-template-columns: 48px minmax(0, 1fr);
    gap: 2px 10px;
    padding: 7px 12px 7px 10px;
    min-height: 44px;
  }
  .cal-bell { width: 15px; height: 15px; }
}

@media (max-width: 720px) {
  .cal-toolbar { flex-wrap: wrap; }
  .cal-nav h3 { font-size: 16px; min-width: 0; }
  .calendar .goals-lead { -webkit-line-clamp: 1; }
  .cal-agenda { padding: 10px 10px 8px; border-radius: 20px; }
  .cal-agenda h3 { font-size: 16px; }
  .cal-legend { font-size: 10px; gap: 6px 10px; margin: 6px 0; }
  .cal-list { gap: 5px; }
  .cal-item {
    grid-template-columns: 46px minmax(0, 1fr);
    min-height: 44px;
    padding: 8px 10px 8px 9px;
    border-radius: 12px;
  }
  .cal-bell { width: 15px; height: 15px; }
  .cal-item-bell { width: 15px; height: 15px; }
  .cal-item-time { font-size: 11px; }
  .cal-item-body strong { font-size: 13px; }
  .cal-sheet {
    padding: 16px;
    padding-top: max(16px, env(safe-area-inset-top));
    padding-bottom: max(16px, env(safe-area-inset-bottom));
    place-items: center;
  }
  .cal-sheet-card {
    width: min(420px, 100%);
    max-width: 100%;
    border-radius: 22px;
    max-height: min(82dvh, calc(100svh - 32px));
  }
  .cal-when { grid-template-columns: 1fr; }
}

@media (max-height: 740px) {
  .calendar .eyebrow,
  .calendar .goals-lead { display: none; }
  .calendar .goals-title { font-size: 24px; }
}

@media (max-width: 1100px) and (min-width: 721px) {
  .stage { width: min(100% - 48px, 1080px); padding-top: 32px; }
  .gate-card { max-width: min(440px, 100%); }
  .hero-lead { max-width: 42ch; }
  .tile { min-height: 188px; }
}

@media (max-width: 980px) {
  .hub-tiles { grid-template-columns: 1fr; max-width: none; }
  .tile { min-height: 0; }
}

@media (max-width: 820px) {
  .timeline::before { left: 16px; }
  .node {
    grid-template-columns: 1fr;
    gap: 8px;
    padding-left: 32px;
  }
  .node::after { left: 12px; }
  .node-when { text-align: left; }
}

@media (max-width: 720px) {
  .site-chrome {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "brand theme"
      "clock clock";
    align-items: center;
    gap: 8px 10px;
    padding: 10px 12px;
    padding-top: max(10px, env(safe-area-inset-top));
  }
  .brand { grid-area: brand; min-width: 0; }
  .chrome-actions { display: contents; }
  .chrome-tools { grid-area: theme; justify-self: end; }
  .home-link {
    grid-area: home;
    width: 40px;
    height: 40px;
  }
  body.on-goals .site-chrome,
  body.on-calendar .site-chrome {
    grid-template-columns: minmax(0, 1fr) auto auto;
    grid-template-areas:
      "brand theme home"
      "clock clock clock";
  }
  .together-clock {
    grid-area: clock;
    align-items: flex-start;
    width: 100%;
  }
  .stage { width: min(100% - 28px, 1080px); padding-top: 22px; padding-bottom: 96px; }
  body.on-calendar .stage { padding-top: 8px; padding-bottom: 8px; }
  .theme-toggle {
    min-height: 40px;
    padding: 8px 12px;
    font-size: 12px;
  }
  .clock-units {
    gap: 8px 10px;
    flex-wrap: wrap;
    justify-content: flex-start;
  }
  .clock-unit b { font-size: 12px; }
  .clock-unit span { font-size: 9px; }
  .logo { font-size: 16px; }
  .brand-page { font-size: 14px; }
  .hero-title { font-size: clamp(28px, 9vw, 40px); max-width: none; }
  .gate-card { max-width: none; margin-top: 24px; padding: 18px 16px 16px; }
  .gate-pass input,
  .gate-peek,
  .gate-enter,
  .who-chip span { min-height: 44px; }
  .session-chip { padding: 2px 2px 2px 10px; }
  .session-out { padding: 6px 8px; font-size: 10px; }
  .photo-layer img {
    right: 50%;
    top: 38%;
    transform: translate(42%, -50%);
    height: 78%;
    opacity: 0.26;
    -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 18%, #000 58%, transparent 100%);
    mask-image: linear-gradient(180deg, transparent 0%, #000 18%, #000 58%, transparent 100%);
  }
  .goals-tab {
    flex-wrap: wrap;
    gap: 6px 10px;
  }
  .hub-links { gap: 4px 18px; }
}

@media (max-width: 360px) {
  .gate-pass { grid-template-columns: 1fr; }
  .gate-peek { width: 100%; }
  .logo { font-size: 15px; }
  .cal-item {
    grid-template-columns: 42px minmax(0, 1fr);
    padding: 7px 8px;
    min-height: 42px;
  }
  .cal-bell { width: 14px; height: 14px; }
  .cal-item-bell { width: 14px; height: 14px; }
  .cal-item-time { font-size: 11px; }
  .cal-item-body strong { font-size: 12px; }
}

@media (max-height: 500px) and (orientation: landscape) {
  .gate .hero-lead { display: none; }
  .gate .hero-title { font-size: 28px; }
  .gate-card { margin-top: 12px; padding: 14px; }
  .stage { padding-top: 12px; }
}

.hub { padding-bottom: 28px; }

.assist-fab {
  position: fixed;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 40;
  border: 0;
  background: var(--gold);
  color: var(--on-accent);
  border-radius: 999px;
  padding: 14px 18px;
  font: 700 12px Montserrat, sans-serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.28);
}
.assist-panel {
  position: fixed;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 45;
  width: min(420px, calc(100vw - 24px));
  height: min(560px, calc(100dvh - 24px));
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 24px;
  backdrop-filter: blur(22px);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.32);
  overflow: hidden;
}
.assist-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 16px 16px 12px;
  border-bottom: 1px solid var(--line);
}
.assist-head strong { display: block; font-size: 16px; letter-spacing: -0.03em; }
.assist-close {
  border: 1px solid var(--line);
  background: var(--bg-2);
  color: var(--ink);
  border-radius: 999px;
  padding: 8px 12px;
  font: 600 11px Montserrat, sans-serif;
  cursor: pointer;
}
.assist-log {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.assist-msg {
  max-width: 92%;
  padding: 10px 12px;
  border-radius: 16px;
  font-size: 13px;
  line-height: 1.45;
}
.assist-msg.bot {
  background: var(--bg);
  border: 1px solid var(--line);
  align-self: flex-start;
}
.assist-msg.user {
  background: color-mix(in srgb, var(--gold) 22%, var(--bg));
  align-self: flex-end;
}
.assist-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  padding: 0 16px 10px;
}
.assist-chips button {
  border: 1px solid var(--line);
  background: var(--bg-2);
  color: var(--muted);
  border-radius: 999px;
  padding: 6px 10px;
  font: 600 11px Montserrat, sans-serif;
  cursor: pointer;
}
.assist-form {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  padding: 0 16px 16px;
  padding-bottom: max(16px, env(safe-area-inset-bottom));
}
.assist-form input {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink);
  border-radius: 999px;
  padding: 11px 14px;
  font: 500 16px Montserrat, sans-serif;
  outline: none;
}
.assist-form input:focus { border-color: var(--gold); }
.assist-mic {
  border: 1px solid var(--gold);
  background: color-mix(in srgb, var(--gold) 16%, var(--bg));
  color: var(--gold-2);
  border-radius: 999px;
  min-height: 46px;
  font: 700 12px Montserrat, sans-serif;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  touch-action: none;
}
.assist-mic.holding {
  background: var(--gold);
  color: var(--on-accent);
}
.assist-form button[type="submit"] {
  border: 0;
  background: var(--gold);
  color: var(--on-accent);
  border-radius: 999px;
  min-height: 42px;
  font: 700 12px Montserrat, sans-serif;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
}

@media (max-width: 720px) {
  .assist-panel {
    inset: auto 0 0 0;
    width: 100%;
    max-width: 100%;
    height: auto;
    max-height: calc(100svh - env(safe-area-inset-top, 0px) - 8px);
    border-radius: 20px 20px 0 0;
    box-sizing: border-box;
  }
  .assist-head { padding: 12px 14px 10px; gap: 8px; align-items: center; }
  .assist-head strong { font-size: 15px; }
  .assist-close { flex-shrink: 0; padding: 8px 12px; font-size: 12px; }
  .assist-log { padding: 10px 14px; min-height: 72px; max-height: 34svh; }
  .assist-msg { font-size: 15px; line-height: 1.4; max-width: 100%; }
  .assist-chips {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 0 14px 8px;
  }
  .assist-chips::-webkit-scrollbar { display: none; }
  .assist-chips button { flex: 0 0 auto; }
  .assist-form {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 0 14px max(10px, env(safe-area-inset-bottom));
  }
  .assist-form input {
    grid-column: 1 / -1;
    min-height: 44px;
    font-size: 16px;
  }
  .assist-mic,
  .assist-form button[type="submit"] { min-height: 44px; }
  .assist-fab {
    right: max(12px, env(safe-area-inset-right));
    bottom: max(12px, env(safe-area-inset-bottom));
  }
}
