:root {
  --sidebar-width: 246px;
  color-scheme: light;
  --calendar-hour-height: 48px;
  --bg: #f7f6f2;
  --surface: #fffefa;
  --surface-alt: #f0efe9;
  --ink: #23302c;
  --muted: #7d8781;
  --line: #e7e6df;
  --green: #91aa97;
  --green-dark: #506f62;
  --green-pale: #e5eee7;
  --blue: #6f8fba;
  --blue-pale: #e9eff8;
  --terracotta: #bb7966;
  --terracotta-pale: #f6e8e3;
  --yellow: #d4a655;
  --yellow-pale: #f8f0d8;
  --focus: #759584;
  --sidebar-bg: #f5f7f3;
  --button-bg: #506f62;
  --button-text: #ffffff;
  --shadow: 0 12px 30px rgba(40, 52, 48, .06);
  --radius: 16px;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: var(--bg); color: var(--ink); font-family: 'DM Sans', system-ui, sans-serif; font-size: 14px; line-height: 1.45; }
button, input, select, textarea { font: inherit; }
button { border: 0; cursor: pointer; color: inherit; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid rgba(110,143,130,.3); outline-offset: 2px; }
.app-shell { min-height: 100vh; display: flex; align-items: flex-start; }
.sidebar { position: sticky; top: 0; width: var(--sidebar-width); height: 100vh; max-height: 100vh; min-height: 0; align-self: flex-start; border-right: 1px solid var(--line); background: var(--sidebar-bg); padding: 28px 20px max(20px, env(safe-area-inset-bottom)); display: flex; flex-direction: column; flex-shrink: 0; overflow: hidden; }
.brand-lockup { display: flex; align-items: center; gap: 11px; }
.brand-mark { position: relative; width: 28px; height: 26px; }
.brand-mark span { position: absolute; width: 17px; height: 17px; border-radius: 50%; background: var(--green); top: 4px; }
.brand-mark span:first-child { left: 0; opacity: .85; }
.brand-mark span:last-child { right: 0; background: var(--terracotta); opacity: .9; mix-blend-mode: multiply; }
.brand-name { font-size: 17px; font-weight: 700; letter-spacing: -.03em; }
.brand-subtitle { color: var(--muted); font-size: 11px; margin-top: -1px; }
.main-nav { flex: 1 1 auto; min-height: 0; margin-top: 30px; display: flex; flex-direction: column; gap: 7px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none; -ms-overflow-style: none; }
.main-nav::-webkit-scrollbar { display: none; width: 0; height: 0; }
.nav-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 13px; background: transparent; border-radius: 11px; color: var(--muted); font-weight: 600; text-align: left; transition: .2s ease; }
.nav-item[hidden], .mobile-nav-item[hidden], .mobile-menu-item[hidden] { display: none; }
.nav-item:hover { background: var(--surface-alt); color: var(--ink); }
.nav-item.is-active { background: var(--green-pale); color: var(--green-dark); box-shadow: inset 3px 0 var(--green-dark); }
.nav-item:disabled, .nav-item-disabled { cursor: not-allowed; opacity: .55; }
.nav-item-disabled:hover { background: transparent; color: var(--muted); }
.nav-icon { width: 18px; font-size: 21px; font-weight: 400; line-height: 1; text-align: center; }
.nav-count { margin-left: auto; min-width: 22px; padding: 2px 6px; border-radius: 20px; background: rgba(80,111,98,.14); color: var(--green-dark); font-size: 11px; text-align: center; }
.sidebar-bottom { flex: 0 0 auto; margin-top: 14px; display: grid; gap: 10px; }
.sidebar-settings-link { margin: 0 -2px 2px; padding-block: 9px; }
.theme-toggle { display: flex; align-items: center; gap: 9px; padding: 0 4px; background: transparent; color: var(--muted); font-size: 12px; text-align: left; }
.theme-icon { font-size: 17px; color: var(--green); }
.theme-state { margin-left: auto; font-size: 11px; }
.profile-row strong, .profile-row small { display: block; }
.profile-row small { color: var(--muted); font-size: 10px; }
.profile-row { display: flex; align-items: center; gap: 9px; padding-top: 4px; }
.profile-row strong { font-size: 11px; }
.profile-copy { min-width: 0; }
.avatar { display: grid; place-items: center; width: 29px; height: 29px; flex-shrink: 0; border-radius: 50%; font-weight: 700; font-size: 11px; }
.avatar-eoin { background: #dce9e4; color: var(--green-dark); }
.avatar-sarah { background: #f5ddd6; color: #9b5948; }
.more-button { margin-left: auto; background: transparent; color: var(--muted); letter-spacing: 2px; }
.main-content { min-width: 0; flex: 1; }
.page-wrap { max-width: 1240px; margin: 0 auto; padding: 50px clamp(26px, 5vw, 78px) 70px; }
.mobile-header, .mobile-nav { display: none; }
.mobile-header-actions { display: flex; align-items: center; gap: 8px; }
.mobile-profile-menu-trigger { display: none; }
.mobile-menu-backdrop, .mobile-menu { display: none; }
.eyebrow { color: var(--green); font-size: 10px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
h1, h2, h3, p { margin: 0; }
h1 { margin-top: 6px; font-family: Newsreader, Georgia, serif; font-size: clamp(36px, 5vw, 53px); font-weight: 500; letter-spacing: -.045em; line-height: 1.04; }
h2 { font-family: Newsreader, Georgia, serif; font-size: 25px; font-weight: 600; letter-spacing: -.03em; }
h3 { font-size: 15px; }
.page-header { display: flex; justify-content: space-between; align-items: end; gap: 24px; margin-bottom: 30px; }
.page-description { margin-top: 10px; color: var(--muted); font-size: 13px; }
.date-stamp { align-self: flex-start; padding: 8px 12px; color: var(--muted); font-size: 11px; text-align: right; }
.date-stamp strong { display: block; color: var(--ink); font-size: 13px; font-weight: 600; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(280px, .85fr); gap: 18px; }
.card { min-width: 0; padding: 22px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.card-header h2 { font-size: 21px; }
.card-header p { color: var(--muted); font-size: 12px; }
.text-button { padding: 0; background: none; color: var(--green-dark); font-size: 12px; font-weight: 600; }
.text-button:hover { color: var(--terracotta); }
.today-card { min-height: 269px; }
.event-list { display: grid; gap: 9px; }
.event-row { display: grid; grid-template-columns: 56px 4px minmax(0, 1fr) auto; align-items: center; gap: 12px; min-height: 52px; padding: 8px 10px; border-radius: 10px; background: #fcfcf9; }
.event-time { color: var(--muted); font-size: 11px; text-align: right; }
.event-marker { width: 4px; height: 31px; border-radius: 5px; }
.marker-blue { background: var(--blue); }.marker-terra { background: var(--terracotta); }.marker-green { background: var(--green); }
.event-title { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.event-meta { display: block; color: var(--muted); font-size: 11px; margin-top: 2px; }
.source-pill { padding: 4px 7px; border-radius: 6px; font-size: 10px; font-weight: 600; white-space: nowrap; }
.pill-blue { color: #5878a5; background: var(--blue-pale); }.pill-terra { color: #a56050; background: var(--terracotta-pale); }.pill-green { color: var(--green-dark); background: var(--green-pale); }
.upcoming-card { min-height: 269px; }
.upcoming-list { display: grid; gap: 13px; }
.upcoming-item { display: flex; align-items: center; gap: 12px; }
.upcoming-day { width: 38px; height: 42px; display: grid; place-content: center; border: 1px solid var(--line); border-radius: 9px; line-height: 1.1; }
.upcoming-day strong { font-size: 15px; }.upcoming-day small { color: var(--muted); font-size: 9px; text-transform: uppercase; }
.upcoming-copy { min-width: 0; }.upcoming-copy strong { display: block; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }.upcoming-copy small { color: var(--muted); font-size: 11px; }
.card-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 19px; }
.button { min-height: 34px; padding: 7px 12px; border-radius: 8px; font-size: 12px; font-weight: 600; transition: transform .15s ease, background .15s ease; }
.button:hover { transform: translateY(-1px); }.button-primary { background: var(--button-bg); color: var(--button-text); }.button-primary:hover { background: var(--green); }.button-ghost { background: var(--surface-alt); color: var(--green-dark); }
.actions-card { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; padding: 15px; background: transparent; border: 0; box-shadow: none; }
.quick-action { display: flex; align-items: center; gap: 12px; padding: 13px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); text-align: left; transition: .2s ease; }.quick-action:hover { border-color: #bfd0c7; box-shadow: var(--shadow); transform: translateY(-1px); }.quick-action-icon { display: grid; place-items: center; width: 31px; height: 31px; border-radius: 9px; font-size: 19px; }.quick-action strong { display: block; font-size: 12px; }.quick-action small { display: block; color: var(--muted); font-size: 10px; margin-top: 2px; }.action-green { background: var(--green-pale); color: var(--green-dark); }.action-terra { background: var(--terracotta-pale); color: var(--terracotta); }.action-blue { background: var(--blue-pale); color: var(--blue); }
.split-card { min-height: 275px; }.todo-list, .shopping-summary { display: grid; gap: 12px; }.todo-item, .shopping-line { display: flex; align-items: center; gap: 10px; }.check-button { display: grid; place-items: center; width: 24px; height: 24px; min-width: 24px; min-height: 24px; padding: 0; border: 1.5px solid #cbd2cd; border-radius: 6px; background: transparent; color: transparent; flex-shrink: 0; line-height: 0; }.check-button::before { content: ''; width: 5px; height: 10px; border: solid currentColor; border-width: 0 2px 2px 0; opacity: 0; transform: rotate(45deg) scale(.65); transform-origin: center; transition: opacity .15s ease, transform .15s ease; }.check-button.is-done { background: var(--green); border-color: var(--green); color: #fff; }.check-button.is-done::before { opacity: 1; transform: rotate(45deg) scale(1); }.check-button:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }.todo-copy { min-width: 0; flex: 1; }.todo-copy strong { display: block; font-size: 12px; }.todo-copy small { color: var(--muted); font-size: 10px; }.priority { width: 6px; height: 6px; border-radius: 50%; }.priority-high { background: var(--terracotta); }.priority-normal { background: var(--yellow); }.priority-low { background: #a9b8b1; }.assignee { display: inline-block; margin-left: 5px; padding: 2px 5px; border-radius: 4px; background: var(--surface-alt); color: var(--muted); font-size: 9px; }.shopping-line { justify-content: space-between; padding-bottom: 9px; border-bottom: 1px solid var(--line); }.shopping-line:last-child { border-bottom: 0; padding-bottom: 0; }.shopping-item-name { display: flex; align-items: center; gap: 9px; font-size: 12px; }.quantity { color: var(--muted); font-size: 11px; }.shopping-category { color: var(--muted); font-size: 10px; }
.page-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin: 28px 0 16px; }.toolbar-group { display: flex; gap: 5px; padding: 4px; border-radius: 10px; background: var(--surface-alt); }.segmented-button { padding: 7px 11px; border-radius: 7px; background: transparent; color: var(--muted); font-size: 11px; font-weight: 600; }.segmented-button.is-active { background: var(--surface); color: var(--green-dark); box-shadow: 0 2px 7px rgba(30,45,38,.08); }
.filters { display: flex; flex-wrap: wrap; gap: 7px; }.filter-button { padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--muted); font-size: 11px; }.filter-button.is-active { border-color: #bfd0c7; background: var(--green-pale); color: var(--green-dark); }
.calendar-card { padding: 0; overflow: hidden; }.calendar-week { display: grid; grid-template-columns: 56px repeat(7, minmax(0,1fr)); border-bottom: 1px solid var(--line); }.week-gutter { border-right: 1px solid var(--line); }.week-day { min-height: 69px; padding: 13px 7px 8px; border-right: 1px solid var(--line); text-align: center; }.week-day:last-child { border-right: 0; }.week-day small { display: block; color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }.week-day strong { display: grid; place-items: center; width: 30px; height: 30px; margin: 6px auto 0; font-size: 14px; }.week-day.is-today strong { background: var(--green-dark); border-radius: 50%; color: white; }.calendar-body { position: relative; display: grid; grid-template-columns: 56px repeat(7, minmax(0,1fr)); min-height: 445px; background-image: linear-gradient(to bottom, transparent 54px, var(--line) 55px); background-size: 100% 55px; }.time-column { padding-top: 8px; border-right: 1px solid var(--line); }.time-column span { display: block; height: 55px; padding-right: 8px; color: var(--muted); font-size: 9px; text-align: right; transform: translateY(-7px); }.calendar-col { position: relative; border-right: 1px solid var(--line); }.calendar-col:last-child { border-right: 0; }.calendar-event { position: absolute; left: 5px; right: 5px; padding: 6px 7px; border-left: 3px solid; border-radius: 6px; font-size: 10px; line-height: 1.2; overflow: hidden; }.calendar-event strong { display: block; font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }.calendar-event small { display: block; margin-top: 2px; color: inherit; opacity: .75; }.calendar-event.blue { background: var(--blue-pale); border-color: var(--blue); color: #5878a5; }.calendar-event.terra { background: var(--terracotta-pale); border-color: var(--terracotta); color: #a56050; }.calendar-event.green { background: var(--green-pale); border-color: var(--green); color: var(--green-dark); }
.list-card { padding: 0; overflow: hidden; }.list-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--line); }.list-body { padding: 4px 20px 20px; }.list-group-label { margin: 17px 0 8px; color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }.list-row { display: flex; align-items: center; gap: 12px; padding: 12px 2px; border-bottom: 1px solid var(--line); }.list-row:last-child { border-bottom: 0; }.list-row-copy { min-width: 0; flex: 1; }.list-row-copy strong { display: block; font-size: 13px; }.list-row-copy small { display: block; color: var(--muted); font-size: 11px; }.row-actions { display: flex; gap: 6px; opacity: 0; transition: opacity .2s; }.list-row:hover .row-actions { opacity: 1; }.tiny-button { width: 26px; height: 26px; border-radius: 7px; background: var(--surface-alt); color: var(--muted); }.tiny-button:hover { color: var(--green-dark); }.todo-layout { display: grid; grid-template-columns: minmax(0,1fr) 230px; gap: 18px; }.todo-filters { padding: 18px; }.todo-filters h3 { margin-bottom: 15px; }.filter-stack { display: grid; gap: 8px; }.filter-stack button { padding: 8px 9px; border-radius: 7px; background: transparent; color: var(--muted); text-align: left; font-size: 11px; }.filter-stack button.is-active { background: var(--green-pale); color: var(--green-dark); font-weight: 600; }
.modal-backdrop { position: fixed; inset: 0; z-index: 9; background: rgba(30,40,36,.28); backdrop-filter: blur(3px); }.modal { position: fixed; z-index: 10; top: 50%; left: 50%; width: min(520px, calc(100% - 30px)); max-height: calc(100vh - 30px); overflow-y: auto; padding: 24px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); box-shadow: 0 24px 70px rgba(20,30,25,.2); transform: translate(-50%, -50%); }.modal[hidden], .modal-backdrop[hidden] { display: none; }.modal-header { display: flex; justify-content: space-between; gap: 16px; margin-bottom: 20px; }.modal h2 { margin-top: 4px; }.close-button { width: 28px; height: 28px; border-radius: 50%; background: var(--surface-alt); color: var(--muted); font-size: 22px; line-height: 1; }.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }.field { display: grid; gap: 5px; }.field span { color: var(--muted); font-size: 11px; font-weight: 600; }.field em { font-style: normal; font-weight: 400; }.field input, .field select, .field textarea { width: 100%; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--ink); padding: 9px 10px; font-size: 12px; resize: vertical; }.field input::placeholder, .field textarea::placeholder { color: #acb2ae; }.full { grid-column: 1 / -1; }.form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }.toast { position: fixed; z-index: 20; right: 22px; bottom: 22px; padding: 11px 14px; border-radius: 9px; background: var(--ink); color: white; font-size: 12px; box-shadow: var(--shadow); opacity: 0; pointer-events: none; transform: translateY(8px); transition: .25s ease; }.toast.show { opacity: 1; transform: translateY(0); }
body.dark { color-scheme: dark; --blue-pale: #2b3b50; --terracotta-pale: #50342d; --shadow: 0 12px 30px rgba(0,0,0,.16); }.dark .event-row { background: color-mix(in srgb, var(--surface-alt) 82%, var(--surface)); }.dark .field input, .dark .field select, .dark .field textarea { background: color-mix(in srgb, var(--bg) 72%, var(--surface)); }.dark .source-pill, .dark .assignee { color: inherit; }
@media (max-width: 900px) { :root { --sidebar-width: 210px; }.page-wrap { padding-inline: 28px; }.dashboard-grid { grid-template-columns: 1fr; }.actions-card { grid-column: auto; }.todo-layout { grid-template-columns: 1fr; }.todo-filters { order: -1; }.filter-stack { display: flex; flex-wrap: wrap; }.filter-stack button { flex: 1; min-width: 90px; } }
@media (max-width: 680px) { .app-shell { display: block; }.sidebar { display: none; }.main-content { padding-bottom: 72px; }.mobile-header { display: flex; align-items: center; justify-content: space-between; padding: 19px 18px; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--sidebar-bg) 88%, transparent); }.mobile-header .brand-name { font-size: 15px; }.mobile-header-space { width: 30px; }.mobile-profile-menu-trigger { display: inline-flex; align-items: center; justify-content: center; min-width: 30px; min-height: 30px; padding: 0 5px; border-radius: 8px; background: var(--surface-alt); color: var(--muted); letter-spacing: 2px; }.icon-button { width: 30px; height: 30px; border-radius: 50%; background: var(--surface-alt); color: var(--green); }.page-wrap { padding: 31px 16px 38px; }.page-header { align-items: start; flex-direction: column; margin-bottom: 23px; }.date-stamp { align-self: start; padding: 0; text-align: left; }.date-stamp strong { display: inline; margin-right: 5px; }.dashboard-grid { gap: 13px; }.card { padding: 17px; border-radius: 14px; }.today-card, .upcoming-card { min-height: 0; }.card-header { margin-bottom: 13px; }.card-header h2 { font-size: 19px; }.event-row { grid-template-columns: 45px 4px minmax(0, 1fr); gap: 9px; }.source-pill { display: none; }.actions-card { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 0; }.quick-action { padding: 10px; }.quick-action:last-child { grid-column: 1 / -1; }.page-toolbar { align-items: start; flex-direction: column; margin-top: 20px; }.calendar-card { overflow-x: auto; }.calendar-week, .calendar-body { min-width: 700px; }.list-toolbar { align-items: start; flex-direction: column; padding: 15px; }.list-body { padding-inline: 15px; }.row-actions { opacity: 1; }.mobile-nav { position: fixed; z-index: 8; right: 0; bottom: 0; left: 0; display: grid; grid-template-columns: repeat(4,1fr); padding: 8px 10px max(8px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: color-mix(in srgb, var(--sidebar-bg) 92%, transparent); backdrop-filter: blur(10px); }.mobile-nav-item { display: grid; place-items: center; gap: 2px; padding: 4px; border-radius: 8px; background: transparent; color: var(--muted); }.mobile-nav-item span { font-size: 20px; line-height: 1; }.mobile-nav-item small { font-size: 9px; }.mobile-nav-item.is-active { color: var(--green-dark); background: var(--green-pale); }.form-grid { grid-template-columns: 1fr; }.full { grid-column: auto; }.modal { padding: 20px; }.toast { right: 14px; bottom: 82px; left: 14px; text-align: center; } }

/* Goals and notifications: keep detail interactions compact while making feedback readable above modals. */
.goal-card-clickable { cursor: pointer; }
.goal-card-clickable:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.goal-detail-modal { width: min(640px, calc(100% - 30px)); }
.goal-detail-summary { display: grid; gap: 13px; }
.goal-detail-meta { display: flex; flex-wrap: wrap; gap: 7px; color: var(--muted); font-size: 11px; font-weight: 600; }
.goal-detail-meta span { padding: 4px 8px; border-radius: 999px; background: var(--surface-alt); }
.goal-subgoal-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 23px 0 11px; }
.goal-subgoal-header h3 { margin-top: 3px; }
.goal-subgoal-list { display: grid; gap: 7px; }
.goal-subgoal-list[hidden] { display: none; }
.goal-subgoal-row { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 9px 0; border-bottom: 1px solid var(--line); }
.goal-subgoal-row:last-child { border-bottom: 0; }
.goal-subgoal-copy { min-width: 0; flex: 1; }
.goal-subgoal-copy strong, .goal-subgoal-copy small { display: block; overflow-wrap: anywhere; }
.goal-subgoal-copy strong { font-size: 12px; }
.goal-subgoal-copy small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.goal-subgoal-row.is-completed .goal-subgoal-copy strong { color: var(--muted); text-decoration: line-through; }
.goal-completed-section { margin-top: 10px; padding-top: 9px; border-top: 1px solid var(--line); }
.goal-completed-toggle { display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 6px 0; color: var(--muted); font-size: 11px; font-weight: 700; text-align: left; }
.goal-detail-actions { margin-top: 22px; }
.goal-editor-modal { width: min(680px, calc(100% - 30px)); max-height: calc(100vh - 24px); }
.goal-editor-modal .form-actions { position: sticky; bottom: -20px; z-index: 1; padding: 12px 0 20px; background: linear-gradient(to bottom, transparent, var(--surface) 12px); }
.goal-manual-progress-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.goal-manual-progress-fields[hidden], .goal-draft-subgoal-section[hidden] { display: none; }
.goal-draft-subgoal-section { grid-column: 1 / -1; padding-top: 5px; border-top: 1px solid var(--line); }
.goal-draft-subgoal-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin: 16px 0 10px; }
.goal-draft-subgoal-heading h3 { margin-top: 3px; }
.goal-draft-subgoal-heading .form-help { margin-top: 4px; }
.goal-draft-subgoals { display: grid; gap: 8px; }
.goal-draft-subgoal { display: flex; align-items: flex-start; gap: 8px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-alt); }
.goal-draft-subgoal-fields { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.5fr) 145px auto; align-items: end; gap: 9px; min-width: 0; flex: 1; }
.goal-draft-subgoal .field { min-width: 0; }
.goal-draft-subgoal .field input { min-width: 0; }
.goal-draft-completed { align-items: center; align-self: end; min-height: 37px; }
.goal-draft-completed span { color: var(--ink); }
.goal-draft-remove { flex: 0 0 auto; }
.goal-draft-subgoals:empty::before { content: 'No sub-goals added yet.'; padding: 8px 0 4px; color: var(--muted); font-size: 11px; }
.toast { position: fixed; z-index: 30; right: 22px; bottom: max(22px, env(safe-area-inset-bottom)); display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 9px; width: min(390px, calc(100vw - 32px)); padding: 12px 13px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); color: var(--ink); box-shadow: 0 18px 45px rgba(20, 30, 25, .2); opacity: 0; pointer-events: none; transform: translateY(8px); transition: opacity .2s ease, transform .2s ease; }
.toast.show { opacity: 1; pointer-events: auto; transform: translateY(0); }
.toast[hidden] { display: none; }
.toast-icon { display: grid; place-items: center; width: 21px; height: 21px; border-radius: 50%; background: var(--green-pale); color: var(--green-dark); font-size: 12px; font-weight: 800; }
.toast-message { min-width: 0; overflow-wrap: anywhere; font-size: 12px; line-height: 1.35; text-align: left; }
.toast-dismiss { width: 24px; height: 24px; border-radius: 6px; background: transparent; color: var(--muted); font-size: 18px; line-height: 1; }
.toast-dismiss:hover, .toast-dismiss:focus-visible { background: var(--surface-alt); color: var(--ink); }
.toast[data-variant="error"] { border-color: #c98f80; background: var(--terracotta-pale); color: #6f3328; }
.toast[data-variant="error"] .toast-icon { background: var(--terracotta); color: #fff; }
.toast[data-variant="warning"] { background: var(--yellow-pale); color: #67501d; }
.toast[data-variant="warning"] .toast-icon { background: var(--yellow); color: #fff; }
.toast[data-variant="info"] .toast-icon { background: var(--blue-pale); color: var(--blue); }
.dark .toast[data-variant="error"] { color: #f8eee9; }
@media (max-width: 680px) { .goal-subgoal-header, .goal-draft-subgoal-heading { align-items: flex-start; flex-direction: column; }.goal-subgoal-header .button, .goal-draft-subgoal-heading .button { align-self: flex-start; }.goal-draft-subgoal-fields { grid-template-columns: 1fr; gap: 8px; }.goal-draft-completed { min-height: 0; }.goal-editor-modal .form-actions { bottom: -20px; }.toast { right: 12px; bottom: calc(74px + env(safe-area-inset-bottom)); left: 12px; width: auto; } }

/* Phase 2 calendar surface: the 24-hour grid scrolls inside one predictable container. */
.calendar-toolbar { align-items: center; margin-bottom: 10px; }
.toolbar-navigation { display: flex; align-items: center; gap: 7px; min-width: 0; }
.icon-nav-button { display: grid; place-items: center; width: 32px; height: 32px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--green-dark); font-size: 17px; }
.icon-nav-button:hover { border-color: #bfd0c7; background: var(--green-pale); }
.period-label { margin-left: 6px; color: var(--muted); font-size: 12px; white-space: nowrap; }
.calendar-filters { margin-bottom: 14px; }
.week-calendar-card { padding: 0; overflow: hidden; }
.calendar-scroll { height: min(700px, calc(100vh - 250px)); min-height: 430px; overflow: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; scrollbar-gutter: stable; }
.calendar-horizontal-scroll { display: flex; min-width: 0; min-height: 0; flex: 1 1 auto; flex-direction: column; overflow-x: auto; overflow-y: hidden; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; }
.calendar-horizontal-scroll > .calendar-week, .calendar-horizontal-scroll > .all-day-strip, .calendar-horizontal-scroll > .calendar-scroll { width: max(100%, 780px); min-width: 780px; }
.calendar-week, .all-day-strip, .calendar-body { min-width: 780px; }
.all-day-strip { position: relative; z-index: 1; display: grid; grid-template-columns: 56px repeat(7, minmax(0, 1fr)); min-height: 40px; border-bottom: 1px solid var(--line); background: var(--surface); }
.all-day-label { padding: 9px 7px 7px 0; border-right: 1px solid var(--line); color: var(--muted); font-size: 9px; text-align: right; }
.all-day-day { min-width: 0; padding: 4px; border-right: 1px solid var(--line); }
.all-day-day:last-child { border-right: 0; }
.calendar-body { min-height: 1536px; background-image: linear-gradient(to bottom, transparent 63px, var(--line) 64px); background-size: 100% 64px; }
.time-column { padding-top: 8px; border-right: 1px solid var(--line); background: var(--surface); }
.time-column span { height: 64px; padding-right: 8px; transform: translateY(-7px); }
.calendar-col { min-height: 1536px; border-right: 1px solid var(--line); }
.calendar-event { z-index: 1; min-height: 28px; padding: 5px 6px; text-align: left; }
.calendar-event.both, .mini-calendar-event.both { border-color: var(--blue); background: linear-gradient(135deg, var(--blue-pale) 0 50%, var(--terracotta-pale) 50% 100%); color: var(--ink); }
.mini-calendar-event { display: block; width: 100%; margin-bottom: 3px; overflow: hidden; padding: 4px 5px; border-left: 3px solid; border-radius: 5px; background: var(--green-pale); color: var(--green-dark); font-size: 9px; line-height: 1.15; text-align: left; text-overflow: ellipsis; white-space: nowrap; }
.mini-calendar-event.blue { border-color: var(--blue); background: var(--blue-pale); color: #5878a5; }.mini-calendar-event.terra { border-color: var(--terracotta); background: var(--terracotta-pale); color: #a56050; }.mini-calendar-event.green { border-color: var(--green); }
.month-card { padding: 0; overflow: hidden; }
.month-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.month-heading { border-bottom: 1px solid var(--line); background: var(--surface-alt); }
.month-heading > div { padding: 10px 7px; color: var(--muted); font-size: 10px; font-weight: 700; text-align: center; text-transform: uppercase; }
.month-cell { min-height: 100px; overflow: hidden; padding: 7px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--surface); }
.month-cell:nth-child(7n) { border-right: 0; }.month-cell.is-adjacent { background: rgba(240,239,233,.45); }.dark .month-cell.is-adjacent { background: rgba(48,58,53,.45); }.month-cell.is-selected { box-shadow: inset 0 0 0 2px var(--green); }.month-cell.is-today .month-date { background: var(--green-dark); color: white; }
.month-date { display: grid; place-items: center; width: 25px; height: 25px; margin-bottom: 5px; border-radius: 50%; background: transparent; font-size: 11px; }.month-cell.is-adjacent .month-date { color: var(--muted); }.month-date:hover { background: var(--green-pale); color: var(--green-dark); }
.more-events { display: block; margin-top: 3px; color: var(--muted); font-size: 9px; }
.selected-date-card { margin-top: 14px; }.selected-date-card .card-header { margin-bottom: 7px; }.selected-events { display: grid; gap: 4px; }
.agenda-card { padding: 0; overflow: hidden; }.agenda-group { display: grid; grid-template-columns: 100px minmax(0, 1fr); gap: 18px; padding: 17px 4px; border-bottom: 1px solid var(--line); }.agenda-group:last-child { border-bottom: 0; }.agenda-date { display: flex; flex-direction: column; gap: 2px; padding: 2px 0 0 6px; color: var(--muted); }.agenda-date strong { color: var(--ink); font-size: 12px; }.agenda-date span { font-size: 11px; }.agenda-date.is-today strong { color: var(--green-dark); }.agenda-events { display: grid; gap: 4px; }.agenda-event-row { display: grid; grid-template-columns: 4px 80px minmax(0, 1fr); align-items: center; gap: 10px; width: 100%; padding: 8px 9px; border-radius: 8px; background: transparent; text-align: left; }.agenda-event-row:hover { background: var(--surface-alt); }.agenda-event-time { color: var(--muted); font-size: 11px; }.agenda-event-copy { min-width: 0; }.agenda-event-copy strong, .agenda-event-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }.agenda-event-copy strong { font-size: 12px; }.agenda-event-copy small { margin-top: 2px; color: var(--muted); font-size: 10px; }.agenda-empty { padding: 8px 0; color: var(--muted); font-size: 11px; }
.time-select { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }.checkbox-field { display: flex; align-items: center; gap: 8px; padding-top: 22px; }.checkbox-field input { width: 16px; height: 16px; accent-color: var(--green-dark); }.form-help { margin: -2px 0 0; color: var(--muted); font-size: 10px; }.event-details-content { display: grid; gap: 2px; margin-bottom: 18px; }.event-detail-row { display: flex; justify-content: space-between; gap: 15px; padding: 10px 0; border-bottom: 1px solid var(--line); }.event-detail-row span { color: var(--muted); font-size: 11px; }.event-detail-row strong { font-size: 12px; text-align: right; }.event-detail-note { margin-top: 11px; padding: 11px; border-radius: 8px; background: var(--surface-alt); color: var(--muted); font-size: 12px; }
.pill-both { background: linear-gradient(135deg, var(--blue-pale) 0 50%, var(--terracotta-pale) 50% 100%); color: var(--ink); }
@media (max-width: 680px) {
  .calendar-toolbar { gap: 12px; }.toolbar-navigation { width: 100%; flex-wrap: wrap; }.period-label { flex-basis: 100%; margin: 1px 0 0 2px; }.calendar-toolbar .toolbar-group { align-self: stretch; width: 100%; }.calendar-toolbar .segmented-button { flex: 1; }.calendar-scroll { height: calc(100vh - 285px); min-height: 430px; }.calendar-week, .all-day-strip, .calendar-body { min-width: 700px; }.calendar-horizontal-scroll > .calendar-week, .calendar-horizontal-scroll > .all-day-strip, .calendar-horizontal-scroll > .calendar-scroll { min-width: 700px; }.month-cell { min-height: 76px; padding: 5px 3px; }.month-heading > div { padding: 8px 2px; font-size: 8px; }.month-date { width: 22px; height: 22px; margin-bottom: 3px; font-size: 10px; }.mini-calendar-event { padding: 3px 3px; border-left-width: 2px; font-size: 8px; }.agenda-group { grid-template-columns: 70px minmax(0, 1fr); gap: 8px; padding-inline: 0; }.agenda-event-row { grid-template-columns: 4px 61px minmax(0, 1fr); gap: 7px; padding-inline: 5px; }.agenda-event-time { font-size: 10px; }
}

/* Phase 3 shared household features. */
.home-dashboard-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.home-dashboard-grid .today-card { grid-column: 1 / 2; }.home-dashboard-grid .upcoming-card { grid-column: 2 / 3; }
.week-overview-card { grid-column: 1 / -1; }.week-overview-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 15px; }.week-overview-grid span { display: grid; gap: 3px; padding: 12px; border-radius: 10px; background: var(--surface-alt); }.week-overview-grid strong { font-size: 21px; }.week-overview-grid small { color: var(--muted); font-size: 10px; }
.summary-card { width: 100%; border: 1px solid var(--line); color: var(--ink); text-align: left; cursor: pointer; }.summary-card:hover { border-color: #bfd0c7; box-shadow: var(--shadow); transform: translateY(-1px); }.summary-card .card-header { margin-bottom: 12px; }.summary-arrow { color: var(--green); font-size: 18px; }.summary-count { color: var(--muted); font-size: 11px; }.compact-summary { min-height: 165px; }.summary-lines { display: grid; gap: 10px; }.summary-lines span { display: grid; gap: 2px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }.summary-lines span:last-child { border-bottom: 0; }.summary-lines strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }.summary-lines small { color: var(--muted); font-size: 10px; }
.coming-badge { padding: 5px 7px; border-radius: 6px; background: var(--surface-alt); color: var(--muted); font-size: 9px; white-space: nowrap; }
.mobile-menu-backdrop[hidden], .mobile-menu[hidden] { display: none; }
.mobile-menu-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 13px; border-radius: 11px; background: transparent; color: var(--muted); font-weight: 600; text-align: left; }
.mobile-menu-item:hover, .mobile-menu-item:focus-visible { background: var(--surface-alt); color: var(--ink); }
.mobile-menu-item.is-active { background: var(--green-pale); color: var(--green-dark); }
.member-tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }.member-tab { display: flex; align-items: center; gap: 10px; padding: 11px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); color: var(--ink); text-align: left; }.member-tab.is-active { border-color: var(--green); background: var(--green-pale); }.member-tab strong, .member-tab small { display: block; }.member-tab strong { font-size: 12px; }.member-tab small { margin-top: 2px; color: var(--muted); font-size: 10px; }.avatar { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; font-size: 12px; font-weight: 700; }.avatar-eoin { background: var(--blue-pale); color: var(--blue); }.avatar-sarah { background: var(--terracotta-pale); color: var(--terracotta); }.avatar-space { background: var(--green-pale); color: var(--green-dark); }.training-overview { display: flex; align-items: center; gap: 20px; margin-bottom: 15px; }.training-overview > div:first-child { display: grid; gap: 3px; min-width: 140px; }.big-stat { font-size: 28px; line-height: 1; }.training-overview .progress-track { flex: 1; }.training-plan-list { display: grid; gap: 14px; }.training-plan-card { padding: 20px; }.training-plan-notes, .goal-notes { margin: -5px 0 14px; padding: 9px 11px; border-radius: 8px; background: var(--surface-alt); color: var(--muted); font-size: 11px; }.training-week-list { display: grid; gap: 6px; margin-bottom: 12px; }.training-session-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }.training-session-row:last-child { border-bottom: 0; }.training-session-row.is-focused { margin-inline: -8px; padding-inline: 8px; border-radius: 8px; background: var(--green-pale); }.training-session-row.is-completed .training-session-copy strong { color: var(--muted); text-decoration: line-through; }.training-session-copy { min-width: 0; flex: 1; }.training-session-copy strong, .training-session-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }.training-session-copy strong { font-size: 12px; }.training-session-copy small { margin-top: 3px; color: var(--muted); font-size: 10px; }.training-completed-section { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }.training-completed-toggle { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; padding: 7px 0; background: transparent; color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .08em; text-align: left; text-transform: uppercase; }.training-completed-toggle:hover { color: var(--green-dark); }.training-completed-toggle:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 5px; }.training-completed-chevron { color: var(--green-dark); font-size: 16px; line-height: 1; letter-spacing: 0; text-transform: none; }.training-completed-list { display: grid; gap: 6px; margin-top: 3px; }.training-completed-list[hidden] { display: none; }.always-visible { opacity: 1; }.empty-feature { padding: 28px; text-align: center; }.progress-track { height: 8px; overflow: hidden; border-radius: 99px; background: var(--surface-alt); }.progress-track span { display: block; height: 100%; border-radius: inherit; background: var(--green); }.form-divider { margin-top: 4px; padding-top: 12px; border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }.metric-card { display: grid; gap: 7px; padding: 15px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }.metric-card small { color: var(--muted); font-size: 10px; }.metric-card strong { font-size: 22px; }.subscription-row { gap: 10px; }.status-dot { width: 8px; height: 8px; flex: 0 0 8px; border-radius: 50%; background: var(--green); }.status-paused { background: var(--yellow); }.status-cancelled { background: var(--muted); }.status-label { margin-left: 4px; padding: 2px 5px; border-radius: 4px; background: var(--surface-alt); color: var(--muted); font-size: 9px; font-weight: 500; }.subscription-next { min-width: 80px; text-align: right; }.subscription-next strong, .subscription-next small { display: block; }.subscription-next strong { font-size: 11px; }.subscription-next small { margin-top: 2px; color: var(--muted); font-size: 9px; }.estimate-note { margin: 14px 0 0; padding: 10px; border-radius: 8px; background: var(--surface-alt); color: var(--muted); font-size: 10px; }.reminder-options { display: grid; gap: 6px; padding: 8px 0; color: var(--muted); font-size: 11px; }.reminder-option { display: flex; align-items: center; justify-content: flex-start; gap: 8px; min-height: 24px; margin: 0; cursor: pointer; }.reminder-option input { width: 14px; height: 14px; flex: 0 0 14px; margin: 0; accent-color: var(--green-dark); }.reminder-option span { line-height: 1.2; }
.meal-toolbar { margin-top: 0; }.meal-week-grid { display: grid; grid-template-columns: repeat(7, minmax(125px, 1fr)); gap: 8px; overflow-x: auto; padding-bottom: 4px; }.meal-day { min-height: 285px; padding: 12px; }.meal-day-header { display: grid; gap: 2px; padding-bottom: 9px; border-bottom: 1px solid var(--line); }.meal-day-header strong { font-size: 12px; text-transform: uppercase; }.meal-day-header small { color: var(--muted); font-size: 10px; }.meal-slot { position: relative; display: grid; gap: 4px; padding: 12px 0; border-bottom: 1px solid var(--line); }.meal-slot:last-child { border-bottom: 0; }.meal-slot > span { color: var(--muted); font-size: 9px; font-weight: 700; text-transform: uppercase; }.meal-item, .meal-empty { min-height: 31px; padding: 5px 7px; border-radius: 7px; background: var(--surface-alt); color: var(--ink); text-align: left; }.meal-item strong, .meal-item small { display: block; }.meal-item strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; }.meal-item small { margin-top: 2px; color: var(--muted); font-size: 9px; }.meal-item.is-favorite { box-shadow: inset 3px 0 var(--yellow); }.meal-empty { color: var(--muted); font-size: 10px; text-align: left; }.meal-actions { position: absolute; right: 0; top: 28px; display: flex; gap: 2px; }.meal-actions .tiny-button { width: 21px; height: 21px; padding: 0; font-size: 11px; }.favorites-card { margin-top: 14px; }.favorite-list { display: flex; flex-wrap: wrap; gap: 8px; }.favorite-chip { padding: 7px 9px; border-radius: 8px; background: var(--yellow-pale); color: var(--ink); font-size: 11px; }
.notes-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }.search-field { display: flex; align-items: center; gap: 7px; max-width: 320px; flex: 1; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--muted); }.search-field input { width: 100%; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 12px; }.notes-grid, .goals-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }.note-card { min-height: 190px; }.note-card.is-pinned { border-color: #c9b56c; }.note-card-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 17px; }.pin-label { color: var(--muted); font-size: 10px; font-weight: 700; text-transform: uppercase; }.note-card h2 { margin-bottom: 9px; font-size: 17px; }.note-card p { min-height: 64px; color: var(--muted); font-size: 12px; line-height: 1.55; white-space: normal; }.note-card > small { color: var(--muted); font-size: 10px; }.goal-card { min-height: 185px; }.goal-progress-label { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 16px 0 8px; }.goal-progress-label strong { font-size: 15px; }.goal-progress-label small { color: var(--muted); font-size: 10px; }.goal-card .progress-track { margin-bottom: 15px; }.space-card, .settings-card, .future-card { margin-bottom: 14px; }.space-heading { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }.space-heading h2 { margin-bottom: 2px; }.member-card-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }.member-card { display: flex; align-items: center; gap: 9px; padding: 10px; border-radius: 9px; background: var(--surface-alt); }.member-card strong, .member-card small { display: block; }.member-card strong { font-size: 11px; }.member-card small { margin-top: 2px; color: var(--muted); font-size: 9px; }.settings-card { padding: 0 20px 8px; }.settings-card .card-header { padding-top: 20px; }.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 14px 0; border-top: 1px solid var(--line); }.setting-row strong, .setting-row small { display: block; }.setting-row strong { font-size: 12px; }.setting-row small { margin-top: 3px; color: var(--muted); font-size: 10px; }.toggle-button { position: relative; width: 42px; height: 24px; flex: 0 0 42px; border-radius: 99px; background: var(--line); }.toggle-button span:first-child { position: absolute; top: 4px; left: 4px; width: 16px; height: 16px; border-radius: 50%; background: var(--surface); transition: transform .2s ease; }.toggle-button.is-on { background: var(--green); }.toggle-button.is-on span:first-child { transform: translateX(18px); }.toggle-button:disabled { cursor: not-allowed; opacity: .55; }.future-card { padding: 20px; }.future-card h2 { margin: 5px 0 8px; }.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
@media (max-width: 900px) { .home-dashboard-grid { grid-template-columns: 1fr; }.home-dashboard-grid .today-card, .home-dashboard-grid .upcoming-card { grid-column: auto; }.metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }.training-overview { align-items: stretch; flex-wrap: wrap; }.training-overview .progress-track { flex-basis: 100%; order: 3; } }
@media (max-width: 680px) { .mobile-nav { grid-template-columns: repeat(5, minmax(0, 1fr)); padding-inline: 6px; }.mobile-nav-item span { font-size: 18px; }.mobile-nav-item small { font-size: 8px; }.notes-grid, .goals-grid { grid-template-columns: 1fr; }.week-overview-grid { gap: 6px; }.week-overview-grid span { padding: 9px 6px; }.week-overview-grid strong { font-size: 17px; }.member-tabs { gap: 7px; }.member-tab { padding: 8px; }.training-overview { display: grid; grid-template-columns: 1fr auto; gap: 12px; }.training-overview .progress-track { grid-column: 1 / -1; }.metric-grid { gap: 8px; }.metric-card { padding: 11px; }.metric-card strong { font-size: 17px; }.subscription-row { flex-wrap: wrap; }.subscription-row .list-row-copy { min-width: calc(100% - 25px); }.subscription-next { margin-left: 18px; text-align: left; }.notes-toolbar { align-items: stretch; flex-direction: column; }.search-field { max-width: none; }.settings-card { padding-inline: 15px; }.setting-row { gap: 8px; }.setting-row small { max-width: 210px; }.modal.feature-modal { width: min(560px, calc(100% - 20px)); }.form-grid { gap: 11px; } }

/* Phase 3.1 home dashboard and current-time calendar indicator. */
.home-hero { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 18px; }.home-hero h1 { margin: 5px 0 7px; }.home-hero p { max-width: 560px; color: var(--muted); font-size: 13px; }.home-date { display: grid; gap: 4px; min-width: 145px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); text-align: right; }.home-date strong { font-size: 12px; }.home-date small { color: var(--muted); font-size: 10px; }.home-days-card { grid-column: 1 / -1; }.home-day-strip { display: grid; grid-template-columns: repeat(7, minmax(42px, 1fr)); gap: 7px; }.home-day { position: relative; display: grid; justify-items: center; gap: 5px; min-width: 0; padding: 10px 4px 8px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); color: var(--muted); }.home-day:hover { border-color: #bfd0c7; background: var(--green-pale); }.home-day span { font-size: 9px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }.home-day strong { display: grid; place-items: center; width: 29px; height: 29px; color: var(--ink); font-size: 14px; }.home-day i { height: 7px; color: var(--green); font-size: 16px; font-style: normal; line-height: 5px; }.home-day.is-today span { color: var(--green-dark); }.home-day.is-selected { border-color: var(--green); box-shadow: 0 0 0 2px var(--green-pale); }.home-day.is-selected strong { border-radius: 50%; background: var(--green-dark); color: white; }.selected-day-heading { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-top: 20px; padding-top: 17px; border-top: 1px solid var(--line); }.selected-day-heading h3 { margin-top: 4px; font-size: 17px; }.home-schedule { display: grid; gap: 3px; margin-top: 9px; }.home-schedule-item { display: grid; grid-template-columns: 67px 5px minmax(0, 1fr); align-items: center; gap: 9px; width: 100%; padding: 9px 7px; border-radius: 8px; background: transparent; color: var(--ink); text-align: left; }.home-schedule-item:hover, .upcoming-item:hover { background: var(--surface-alt); }.home-schedule-time { color: var(--muted); font-size: 10px; text-align: right; }.home-schedule-marker { width: 5px; height: 25px; border-radius: 99px; background: var(--green); }.home-schedule-marker.marker-blue { background: var(--blue); }.home-schedule-marker.marker-terra { background: var(--terracotta); }.home-schedule-copy { min-width: 0; }.home-schedule-copy strong, .home-schedule-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }.home-schedule-copy strong { font-size: 12px; }.home-schedule-copy small { margin-top: 2px; color: var(--muted); font-size: 10px; }.upcoming-list, .attention-list { display: grid; gap: 3px; }.upcoming-item { display: grid; grid-template-columns: 42px minmax(0, 1fr); gap: 10px; width: 100%; padding: 8px 6px; border-radius: 8px; color: var(--ink); text-align: left; }.upcoming-day { display: grid; align-content: center; justify-items: center; gap: 2px; border-right: 1px solid var(--line); }.upcoming-day strong { font-size: 16px; }.upcoming-day small { color: var(--muted); font-size: 9px; text-transform: uppercase; }.upcoming-copy { min-width: 0; align-self: center; }.upcoming-copy strong, .upcoming-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }.upcoming-copy strong { font-size: 12px; }.upcoming-copy small { margin-top: 2px; color: var(--muted); font-size: 10px; }.attention-item { display: grid; grid-template-columns: 25px minmax(0, 1fr) auto; align-items: center; gap: 9px; width: 100%; padding: 9px 6px; border-radius: 8px; color: var(--ink); text-align: left; }.attention-item:hover { background: var(--surface-alt); }.attention-icon { display: grid; place-items: center; width: 21px; height: 21px; border-radius: 50%; background: var(--green-pale); color: var(--green-dark); font-size: 12px; font-weight: 700; }.attention-item.is-urgent .attention-icon { background: var(--terracotta-pale); color: var(--terracotta); }.attention-item strong, .attention-item small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }.attention-item strong { font-size: 12px; }.attention-item small { margin-top: 2px; color: var(--muted); font-size: 10px; }.home-quick-actions, .home-feature-section { grid-column: 1 / -1; }.section-heading { display: flex; align-items: end; justify-content: space-between; margin: 4px 0 9px; }.section-heading h2 { margin-top: 4px; font-size: 18px; }.quick-actions-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 9px; }.quick-actions-grid .quick-action { min-height: 72px; }.home-feature-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; }.home-feature-grid .compact-summary { min-height: 170px; }.card-link { display: block; margin-top: 15px; color: var(--green); font-size: 10px; font-weight: 700; }.current-time-indicator { position: absolute; right: 0; left: 0; z-index: 3; height: 0; border-top: 2px solid var(--terracotta); pointer-events: none; }.current-time-indicator::before { position: absolute; top: -5px; left: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--terracotta); content: ''; }.current-time-indicator span { position: absolute; top: -10px; left: 4px; padding: 2px 4px; border-radius: 4px; background: var(--terracotta); color: white; font-size: 8px; font-weight: 700; line-height: 1.2; }.is-today-column { background: color-mix(in srgb, var(--green-pale) 18%, transparent); }
@media (max-width: 900px) { .quick-actions-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }.home-feature-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 680px) { .home-hero { align-items: start; flex-direction: column; gap: 12px; margin-bottom: 14px; }.home-hero p { font-size: 12px; }.home-date { min-width: 0; width: 100%; padding: 9px 11px; text-align: left; }.home-date strong, .home-date small { display: inline; }.home-date small { margin-left: 5px; }.home-days-card { padding: 14px 12px; }.home-day-strip { display: flex; gap: 4px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }.home-day { flex: 0 0 40px; padding: 8px 2px 6px; border-radius: 9px; }.home-day span { font-size: 8px; }.home-day strong { width: 26px; height: 26px; font-size: 13px; }.selected-day-heading { margin-top: 15px; padding-top: 14px; }.selected-day-heading h3 { font-size: 15px; }.home-schedule-item { grid-template-columns: 55px 4px minmax(0, 1fr); gap: 7px; padding-inline: 2px; }.home-schedule-time { font-size: 9px; }.home-schedule-copy strong { font-size: 11px; }.upcoming-item { padding-inline: 2px; }.attention-item { padding-inline: 2px; }.quick-actions-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }.quick-actions-grid .quick-action:last-child { grid-column: auto; }.home-feature-grid { grid-template-columns: 1fr; gap: 9px; }.home-feature-grid .compact-summary { min-height: 0; }.week-overview-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }.is-today-column { background: transparent; } }

/* Simplified Home dashboard. */
.home-quick-add { margin-bottom: 18px; }
.home-quick-add-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 9px; }
.home-quick-action { display: flex; align-items: center; gap: 9px; min-width: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); font-size: 11px; font-weight: 700; text-align: left; }
.home-quick-action:hover { border-color: #bfd0c7; background: var(--surface-alt); transform: translateY(-1px); }
.home-quick-icon { display: grid; place-items: center; width: 25px; height: 25px; flex: 0 0 25px; border-radius: 7px; font-size: 14px; }
.home-quick-action .action-green { background: var(--green-pale); color: var(--green-dark); }
.home-quick-action .action-terra { background: var(--terracotta-pale); color: var(--terracotta); }
.home-quick-action .action-blue { background: var(--blue-pale); color: var(--blue); }
@media (min-width: 681px) and (max-width: 900px) {
  .home-quick-add-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .home-quick-action > span:last-child { min-width: 0; overflow-wrap: anywhere; }
}
.home-main-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(280px, .85fr); gap: 14px; align-items: start; }
.home-today-card, .home-renewals-card { min-width: 0; }
.home-schedule-days { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
.home-schedule-day { min-width: 0; padding: 0 14px; }
.home-schedule-day:first-child { padding-left: 0; }
.home-schedule-day + .home-schedule-day { border-left: 1px solid var(--line); }
.home-schedule-day-heading { display: flex; align-items: end; justify-content: space-between; gap: 12px; }
.home-schedule-day-heading h3 { margin-top: 3px; font-family: Newsreader, Georgia, serif; font-size: 18px; font-weight: 600; letter-spacing: -.025em; }
.home-today-card .home-schedule { max-height: min(520px, calc(100vh - 300px)); overflow-y: auto; padding-right: 3px; }
.home-schedule-item { grid-template-columns: max-content 5px minmax(0, 1fr); padding-inline: 0; }
.home-schedule-time { text-align: left; white-space: nowrap; }
.home-today-card .home-schedule-copy strong { overflow-wrap: anywhere; white-space: normal; }
.home-schedule-copy small { white-space: normal; line-height: 1.35; }
.home-renewals-card .card-header { align-items: start; }
.renewal-list { display: grid; gap: 3px; }
.renewal-row { display: grid; grid-template-columns: 27px minmax(0, 1fr) auto; align-items: center; gap: 9px; width: 100%; padding: 9px 5px; border-radius: 8px; background: transparent; color: var(--ink); text-align: left; }
.renewal-row:hover { background: var(--surface-alt); }
.renewal-icon { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 7px; background: var(--terracotta-pale); color: var(--terracotta); font-size: 12px; font-weight: 700; }
.renewal-copy { min-width: 0; }
.renewal-copy strong, .renewal-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.renewal-copy strong { font-size: 12px; }
.renewal-copy small { margin-top: 2px; color: var(--muted); font-size: 10px; }
.renewal-amount { font-size: 12px; white-space: nowrap; }
.home-highlights-section { margin-top: 20px; }
.home-highlights-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; }
.home-highlight-card { min-height: 150px; }
.home-highlight-card .summary-lines { min-height: 48px; }

@media (max-width: 900px) {
  .home-main-grid { grid-template-columns: 1fr; }
  .home-highlights-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 680px) {
  .home-quick-add { margin-bottom: 14px; }
  .home-quick-add-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
  .home-quick-action { padding: 8px 9px; }
  .home-schedule-days { grid-template-columns: 1fr; gap: 14px; }
  .home-schedule-day { padding: 0; }
  .home-schedule-day + .home-schedule-day { padding-top: 13px; border-top: 1px solid var(--line); border-left: 0; }
  .home-today-card .home-schedule { max-height: none; overflow: visible; }
  .home-schedule-item { grid-template-columns: max-content 4px minmax(0, 1fr); gap: 7px; padding-inline: 0; }
  .home-schedule-time { font-size: 9px; }
  .home-schedule-copy strong { font-size: 11px; }
  .home-highlights-grid { grid-template-columns: 1fr; gap: 9px; }
  .home-highlight-card { min-height: 0; }
  .renewal-row { grid-template-columns: 25px minmax(0, 1fr) auto; gap: 7px; padding-inline: 2px; }
  .renewal-amount { font-size: 11px; }
}

/* Sage theme, resilient desktop shell, and full-height calendar surface. */
:root {
  --focus: rgba(80, 111, 98, .42);
  --green: #91aa97;
  --green-dark: #506f62;
  --green-pale: #e5eee7;
}
body.dark {
  --bg: #1e2623;
  --surface: #27302c;
  --surface-alt: #303a35;
  --ink: #edf2ee;
  --muted: #a8b6ad;
  --line: #3f4d45;
  --green: #a3bca7;
  --green-dark: #b4d0ba;
  --green-pale: #30473b;
  --focus: rgba(163, 188, 167, .5);
}
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline-color: var(--focus); }
.button { border: 1px solid transparent; }
.button-primary { background: var(--button-bg); color: var(--button-text); box-shadow: 0 4px 10px rgba(80,111,98,.16); }
.button-primary:hover { background: #759584; }
.button-primary:active { background: #405d51; transform: translateY(1px); }
.dark .button-primary { color: var(--button-text); }
.dark .button-primary:hover { background: var(--green); }
.dark .button-primary:active { background: var(--green-dark); }
.button-ghost { border-color: var(--line); }
.button-ghost:hover, .icon-nav-button:hover { border-color: var(--green); background: var(--green-pale); color: var(--green-dark); }
.segmented-button { border: 1px solid transparent; }
.segmented-button.is-active { border-color: var(--green); background: var(--surface); color: var(--green-dark); box-shadow: 0 0 0 2px var(--green-pale); }
.filter-button.is-active { border-color: var(--green-dark); background: var(--green-pale); color: var(--green-dark); box-shadow: inset 0 -2px var(--green-dark); font-weight: 700; }
input[type="checkbox"] { accent-color: var(--green-dark); }
.toggle-button.is-on { background: var(--green-dark); }
.toggle-button { border: 1px solid var(--line); }
.toggle-button:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.sidebar { overscroll-behavior: contain; }
.main-content { min-height: 100vh; min-width: 0; }
.calendar-page { display: flex; min-height: calc(100vh - 120px); flex-direction: column; }
.calendar-page > *, .calendar-card { min-width: 0; }
.calendar-toolbar-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.calendar-toolbar-title h1 { margin-top: 3px; font-size: clamp(32px, 4vw, 46px); }
.calendar-page .calendar-toolbar { margin-top: 17px; }
.calendar-page .calendar-filters { margin-bottom: 12px; }
.calendar-page .week-calendar-card { display: flex; min-height: 0; flex: 1 1 auto; border: 0; background: transparent; box-shadow: none; }
.calendar-page .calendar-scroll { width: 100%; height: clamp(430px, calc(100vh - 310px), 850px); min-height: 430px; flex: 1 1 auto; }
.calendar-page .month-card, .calendar-page .agenda-card, .calendar-page .selected-date-card { border: 0; box-shadow: none; }
.calendar-page .selected-date-card { padding-inline: 0; }
.calendar-event.profile, .mini-calendar-event.profile { border-color: var(--calendar-color); background: color-mix(in srgb, var(--calendar-color) 16%, var(--surface)); color: color-mix(in srgb, var(--calendar-color) 76%, var(--ink)); }
.marker-profile { background: var(--calendar-color, var(--green)); }
.pill-profile { border: 1px solid color-mix(in srgb, var(--calendar-color, var(--green)) 42%, var(--line)); background: color-mix(in srgb, var(--calendar-color, var(--green)) 16%, var(--surface)); color: var(--green-dark); }
.assignee-options { display: flex; flex-wrap: wrap; gap: 7px; padding: 3px 0; }
.assignee-option { display: inline-flex; align-items: center; gap: 6px; min-height: 30px; padding: 5px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); cursor: pointer; font-size: 11px; }
.assignee-option:has(input:checked) { border-color: var(--green); background: var(--green-pale); color: var(--green-dark); }
.assignee-option input { width: 14px; height: 14px; margin: 0; }
.field-note { color: var(--muted); font-size: 10px; }
.member-card { position: relative; align-items: center; }
.member-card-copy { min-width: 0; flex: 1; }
.member-card-copy strong, .member-card-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.member-card-copy small + small { margin-top: 2px; }
.member-card.is-archived { opacity: .62; }
.member-card .tiny-button { flex: 0 0 26px; }
.settings-add-person { margin-top: 14px; }
.avatar[style*="--avatar-color"] { background: color-mix(in srgb, var(--avatar-color) 18%, var(--surface)); color: var(--green-dark); }

@media (max-height: 760px) and (min-width: 681px) {
  .sidebar { padding-top: 18px; padding-bottom: 14px; }
  .main-nav { margin-top: 24px; }
  .sidebar-bottom { gap: 8px; margin-top: 10px; }
  .profile-row { padding-top: 0; }
}

@media (max-width: 680px) {
  .main-content { min-height: calc(100vh - 72px); }
  .calendar-page { min-height: calc(100vh - 104px); }
  .calendar-toolbar-row { align-items: flex-start; flex-direction: column; gap: 10px; }
  .calendar-toolbar-row .button { align-self: stretch; }
  .calendar-page .calendar-scroll { height: calc(100vh - 300px); min-height: 360px; }
  .calendar-page .selected-date-card { padding-inline: 0; }
  .assignee-options { gap: 5px; }
  .assignee-option { flex: 1 1 45%; }
}

@media (max-width: 680px) {
  .mobile-menu-backdrop { position: fixed; z-index: 10; inset: 0; display: block; background: rgba(35, 48, 44, .24); }
  .mobile-menu { position: fixed; z-index: 11; right: 12px; bottom: calc(66px + env(safe-area-inset-bottom)); left: 12px; display: block; max-height: min(72vh, 560px); overflow-y: auto; padding: 16px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: 0 18px 45px rgba(40, 52, 48, .18); }
  .mobile-menu-header { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 9px; }
  .mobile-menu-header h2 { font-size: 21px; }
  .mobile-menu-list { display: grid; gap: 5px; }
  .mobile-menu-item .nav-icon { flex: 0 0 18px; }
  .mobile-menu-item .coming-badge { margin-left: auto; }
  .mobile-menu-item:disabled { cursor: not-allowed; }
}

/* Space Settings: people, feature controls, and local theme editor. */
.settings-section { margin-bottom: 14px; }
.settings-section-heading { margin-bottom: 18px; }
.settings-section-heading h2 { margin-top: 4px; }
.settings-section-heading .page-description { max-width: 680px; }
.settings-group + .settings-group { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.settings-group-heading { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 10px; }
.settings-group-heading h3 { margin-bottom: 3px; }
.settings-group-heading .form-help { margin: 0; }
.theme-mode-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0 18px; border-top: 1px solid var(--line); }
.theme-mode-row strong { display: block; font-size: 12px; }
.theme-mode-options { display: flex; gap: 5px; padding: 4px; border-radius: 10px; background: var(--surface-alt); }
.theme-preset-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 9px; }
.theme-preset-card { display: grid; gap: 6px; min-width: 0; padding: 10px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); color: var(--ink); text-align: left; }
.theme-preset-card:hover, .theme-preset-card:focus-visible { border-color: var(--green); background: var(--surface-alt); }
.theme-preset-card.is-selected { border-color: var(--green-dark); box-shadow: 0 0 0 2px var(--green-pale); }
.theme-preset-card strong { font-size: 11px; }
.theme-preset-card small { min-height: 28px; color: var(--muted); font-size: 9px; line-height: 1.35; }
.theme-preset-swatches { display: flex; gap: 4px; }
.theme-preset-swatches i { width: 22px; height: 22px; border: 1px solid color-mix(in srgb, var(--ink) 14%, transparent); border-radius: 6px; background: var(--swatch); }
.theme-customise { margin-top: 16px; padding-top: 15px; border-top: 1px solid var(--line); }
.theme-customise-toggle { padding: 0; background: transparent; color: var(--green-dark); font-size: 12px; font-weight: 700; }
.theme-customise-toggle:hover { color: var(--green); }
.theme-customise-panel[hidden] { display: none; }
.theme-customise-panel > .form-help { margin: 8px 0 13px; }
.theme-colour-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px 18px; }
.theme-color-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-width: 0; padding: 6px 0; }
.theme-color-row > span:first-child { color: var(--muted); font-size: 11px; }
.theme-color-control { display: flex; align-items: center; gap: 6px; }
.theme-color-control input[type="color"] { width: 29px; height: 29px; padding: 2px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); cursor: pointer; }
.theme-hex-input { width: 80px; padding: 6px 7px; border: 1px solid var(--line); border-radius: 7px; background: var(--bg); color: var(--ink); font-size: 10px; font-family: ui-monospace, SFMono-Regular, monospace; }
.theme-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.mobile-header-space { display: block; }
@media (max-width: 900px) { .theme-preset-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 680px) { .settings-group-heading, .theme-mode-row { align-items: stretch; flex-direction: column; }.settings-group-heading .button { align-self: flex-start; }.theme-mode-options { width: 100%; }.theme-mode-options .segmented-button { flex: 1; }.theme-preset-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }.theme-colour-grid { grid-template-columns: 1fr; }.theme-color-row { align-items: start; }.theme-actions .button { flex: 1 1 100%; }.member-card-grid { grid-template-columns: 1fr; } }

@media (min-width: 681px) {
  .mobile-menu-backdrop, .mobile-menu { display: none !important; }
}

/* Compact Google Calendar-style toolbar and a shared 24-hour timeline scale. */
.calendar-page { height: calc(100vh - 120px); min-height: 0; }
body:has(.calendar-page) .page-wrap { max-width: none; padding: 24px clamp(16px, 2vw, 30px) 24px; }
.calendar-page { height: calc(100vh - 48px); }
.calendar-page .calendar-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 0 8px; }
.calendar-navigation-row { justify-content: flex-start; }
.calendar-navigation-row .toolbar-navigation { min-width: 0; width: 100%; }
.calendar-navigation-row .period-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.calendar-mobile-date-label, .calendar-options-dropdown { display: none; }
.calendar-controls-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-width: 0; margin-bottom: 10px; }
.calendar-controls-row .calendar-filters { min-width: 0; margin-bottom: 0; }
.calendar-view-actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.calendar-view-actions .toolbar-group { min-width: 0; }
.calendar-view-actions .segmented-button { min-width: 0; }
.calendar-view-actions > .button { white-space: nowrap; }
.calendar-page .calendar-scroll { width: 100%; height: auto; min-height: 0; flex: 1 1 auto; }
.calendar-page .week-calendar-card { overflow: hidden; }
.calendar-page .calendar-horizontal-scroll { width: 100%; min-height: 0; flex: 1 1 0; }
.calendar-page .calendar-horizontal-scroll > .calendar-week,
.calendar-page .calendar-horizontal-scroll > .all-day-strip,
.calendar-page .calendar-horizontal-scroll > .calendar-scroll { width: max(100%, 780px); min-width: 780px; }
.calendar-page .calendar-horizontal-scroll > .calendar-scroll { height: auto; min-height: 0; flex: 1 1 0; overflow-x: hidden; overflow-y: auto; }
.calendar-page .calendar-body { height: calc(var(--calendar-hour-height) * 24); min-height: 0; background-image: linear-gradient(to bottom, transparent calc(var(--calendar-hour-height) - 1px), var(--line) var(--calendar-hour-height)); background-size: 100% var(--calendar-hour-height); }
.calendar-page .month-card, .calendar-page .selected-date-card { flex: 0 0 auto; }
.calendar-page .time-column { height: 100%; }
.calendar-page .time-column span { height: var(--calendar-hour-height); }
.calendar-page .calendar-col { height: 100%; min-height: 0; }
.calendar-page .calendar-event { min-height: 0; }
.calendar-event-compact { display: flex; align-items: center; gap: 0; padding: 0 4px; font-size: 8px; line-height: 1; white-space: nowrap; }
.calendar-event-compact .calendar-event-time { flex: 0 0 auto; font-weight: 700; }
.calendar-event-compact .calendar-event-title { min-width: 0; overflow: hidden; font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.calendar-event-long { padding: 4px 6px; }
.calendar-event-long .calendar-event-title, .calendar-event-long .calendar-event-meta { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.calendar-event-long .calendar-event-title { font-size: 10px; }
.calendar-event-long .calendar-event-meta { margin-top: 2px; color: inherit; font-size: 9px; opacity: .82; }
.dark .calendar-event.blue, .dark .mini-calendar-event.blue { color: #d7e2f2; }
.dark .calendar-event.terra, .dark .mini-calendar-event.terra { color: #f2c1b4; }
.dark .calendar-event.green, .dark .mini-calendar-event.green { color: #d7eadc; }

@media (max-width: 680px) {
  body:has(.calendar-page) .page-wrap { padding: 18px 16px 24px; }
  .calendar-page { height: calc(100vh - 144px); min-height: 0; }
  .calendar-page .calendar-toolbar { position: relative; gap: 6px; margin-bottom: 3px; }
  .calendar-navigation-row .toolbar-navigation { width: 100%; flex-wrap: nowrap; gap: 6px; }
  .calendar-navigation-row .period-label { display: none; }
  .calendar-navigation-row .calendar-options-dropdown { display: block; position: relative; margin-left: auto; }
  .calendar-options-toggle { min-height: 32px; padding: 5px 9px; font-size: 11px; }
  .calendar-options-panel { position: absolute; z-index: 20; top: calc(100% + 7px); right: 0; display: grid; gap: 13px; width: min(310px, calc(100vw - 32px)); max-height: min(70dvh, 520px); overflow-y: auto; padding: 14px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); box-shadow: 0 18px 40px rgba(30, 42, 36, .2); }
  .calendar-options-panel[hidden] { display: none; }
  .calendar-options-heading { display: grid; gap: 2px; padding-bottom: 2px; }
  .calendar-options-heading strong { font-size: 13px; }
  .calendar-options-panel fieldset { display: grid; gap: 7px; min-width: 0; padding: 0; border: 0; }
  .calendar-options-panel legend { margin-bottom: 1px; color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
  .calendar-options-buttons { display: flex; flex-wrap: wrap; gap: 6px; }
  .calendar-options-buttons .segmented-button, .calendar-options-buttons .filter-button { flex: 1 1 auto; min-height: 32px; padding-inline: 8px; font-size: 10px; }
  .calendar-options-filters .filter-button { flex-basis: calc(50% - 6px); }
  .calendar-options-create { width: 100%; min-height: 36px; }
  .calendar-mobile-date-label { display: block; min-width: 0; flex: 0 0 auto; margin: 0 2px 7px; overflow: hidden; color: var(--muted); font-size: 11px; line-height: 1.3; text-overflow: ellipsis; white-space: nowrap; }
  .calendar-controls-row { display: none; }
  .calendar-controls-row .calendar-filters { width: 100%; flex-wrap: nowrap; overflow-x: auto; padding-bottom: 2px; scrollbar-width: thin; }
  .calendar-controls-row .filter-button { flex: 0 0 auto; min-height: 34px; }
  .calendar-view-actions { width: 100%; justify-content: space-between; }
  .calendar-view-actions .toolbar-group { flex: 1 1 auto; }
  .calendar-view-actions .segmented-button { flex: 1 1 0; min-height: 34px; padding-inline: 6px; }
  .calendar-view-actions > .button { min-height: 34px; }
  .calendar-page .day-calendar-header { display: none; }
  .calendar-page .selected-date-card { display: none; }
}

/* Independent shopping lists. */
.shopping-page { display: grid; gap: 14px; }
.shopping-heading h1 { margin: 0; font-size: clamp(28px, 3vw, 38px); }
.shopping-heading.with-action { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.shopping-list-tabs { display: flex; align-items: center; gap: 10px; min-width: 0; }
.shopping-tabs { display: flex; flex: 1 1 auto; gap: 7px; min-width: 0; overflow-x: auto; padding: 2px 1px 5px; scrollbar-width: thin; }
.shopping-tab { display: inline-flex; align-items: center; gap: 7px; flex: 0 0 auto; min-height: 34px; padding: 7px 11px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); color: var(--muted); font-size: 11px; font-weight: 700; white-space: nowrap; }
.shopping-tab span { display: grid; min-width: 18px; height: 18px; place-items: center; padding-inline: 4px; border-radius: 99px; background: var(--surface-alt); font-size: 9px; }
.shopping-tab:hover { border-color: var(--green); color: var(--green-dark); }
.shopping-tab.is-active { border-color: var(--green-dark); background: var(--green-pale); color: var(--green-dark); }
.shopping-tab.is-active span { background: var(--surface); }
.shopping-new-list { flex: 0 0 auto; white-space: nowrap; }
.shopping-list-card { min-width: 0; }
.shopping-list-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.shopping-list-header h2 { margin-top: 4px; font-size: 21px; }
.shopping-list-header p { margin-top: 4px; color: var(--muted); font-size: 11px; }
.shopping-list-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; }
.shopping-list-actions .button { white-space: nowrap; }
.todo-person-filters { display: flex; flex-wrap: wrap; gap: 7px; padding: 14px 20px 0; }
.todo-person-filters .filter-button { min-height: 30px; }
.todo-filter-toolbar { padding: 14px 20px; border-bottom: 1px solid var(--line); }
.danger-text { color: var(--terracotta); }
.shopping-items { display: grid; gap: 0; }
.shopping-item-row .row-actions { margin-left: auto; }
.shopping-empty { min-height: 220px; display: grid; place-items: center; }
.shopping-empty .empty-state { display: grid; justify-items: center; gap: 10px; text-align: center; }
.shopping-empty .empty-state span { max-width: 300px; color: var(--muted); font-size: 12px; }
.bulk-entry-count { color: var(--muted); font-size: 10px; }
.confirmation-modal { width: min(440px, calc(100% - 30px)); }
.confirmation-message { margin: -4px 0 20px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.button-danger { border: 1px solid var(--terracotta); background: var(--terracotta); color: #fff; }
.button-danger:hover { background: #a85f4e; }
.button-danger:disabled { cursor: wait; opacity: .65; }

@media (max-width: 680px) {
  .shopping-list-tabs { align-items: stretch; flex-direction: column; }
  .shopping-tabs { width: 100%; }
  .shopping-new-list { align-self: flex-start; }
  .shopping-list-header { flex-direction: column; }
  .shopping-list-actions { justify-content: flex-start; }
  .shopping-heading.with-action { align-items: flex-start; flex-direction: column; }
  .todo-person-filters { flex-wrap: nowrap; overflow-x: auto; padding-inline: 15px; scrollbar-width: thin; }
  .todo-person-filters .filter-button { flex: 0 0 auto; }
  .todo-filter-toolbar { padding-inline: 15px; }
  .confirmation-modal { width: min(440px, calc(100% - 20px)); }
}

/* Compact subscription filters and shared page-header treatment. */
#app > .shopping-heading { margin-bottom: 14px; }
.subscription-filter-controls { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; min-width: 0; }
.subscription-category-filter { position: relative; }
.subscription-category-toggle { display: inline-flex; align-items: center; gap: 7px; }
.subscription-category-toggle span { font-size: 12px; line-height: 1; }
.subscription-category-panel { position: absolute; z-index: 5; top: calc(100% + 8px); left: 0; width: min(290px, calc(100vw - 42px)); padding: 13px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); box-shadow: 0 14px 30px rgba(40, 52, 48, .16); }
.subscription-category-panel[hidden] { display: none; }
.subscription-category-panel-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 9px; border-bottom: 1px solid var(--line); }
.subscription-category-panel-header strong { font-size: 11px; }
.subscription-category-panel-header .text-button:disabled { cursor: not-allowed; opacity: .45; }
.subscription-category-options { display: grid; gap: 5px; padding-top: 9px; }
.subscription-category-option { display: flex; align-items: center; gap: 8px; min-height: 30px; padding: 5px 6px; border-radius: 7px; color: var(--ink); cursor: pointer; font-size: 11px; }
.subscription-category-option:hover { background: var(--surface-alt); }
.subscription-category-option input { width: 14px; height: 14px; flex: 0 0 14px; margin: 0; accent-color: var(--green-dark); }
.subscription-filter-summary { margin: 8px 0 12px; padding: 9px 10px; border-radius: 8px; background: var(--green-pale); color: var(--green-dark); font-size: 10px; }

@media (max-width: 680px) {
  .subscription-filter-controls { align-items: stretch; flex-direction: column; }
  .subscription-filter-controls .filters { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 2px; scrollbar-width: thin; }
  .subscription-filter-controls .filter-button { flex: 0 0 auto; }
  .subscription-category-filter { align-self: flex-start; }
}

/* Meal planning library, household planners and explicit meal actions. */
.meal-planner-tabs { display: flex; flex-wrap: wrap; gap: 7px; margin: 12px 0; }
.planner-tab { padding: 8px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--muted); font-size: 11px; font-weight: 700; }
.planner-tab:hover, .planner-tab.is-active { border-color: var(--green); background: var(--green-pale); color: var(--green-dark); }
.meal-planning-layout { display: grid; grid-template-columns: minmax(0, 1.8fr) minmax(270px, .9fr); gap: 14px; align-items: start; }
.meal-week-grid { min-width: 0; }
.meal-slot-items { display: grid; gap: 5px; min-width: 0; }
.meal-slot-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 5px; align-items: start; min-width: 0; padding: 5px; border-radius: 8px; background: var(--surface-alt); }
.meal-slot-card .meal-item { min-width: 0; min-height: 45px; padding: 3px 2px; background: transparent; }
.meal-item strong, .meal-item small { overflow-wrap: anywhere; white-space: normal; }
.meal-item strong { overflow: visible; text-overflow: clip; line-height: 1.25; }
.meal-item small { line-height: 1.25; }
.meal-slot-card .meal-actions { position: static; display: flex; flex-direction: column; gap: 3px; padding-top: 1px; }
.meal-slot-card .meal-actions .tiny-button { width: 25px; height: 25px; flex: 0 0 25px; }
.meal-slot-card .meal-actions .tiny-button[title] { font-size: 12px; }
.meal-library-card { min-width: 0; }
.meal-library-header, .meal-library-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.meal-library-toolbar { align-items: stretch; margin: 13px 0; }
.meal-library-toolbar .search-field { min-width: 0; }
.meal-filter-dropdown { position: relative; }
.meal-filter-panel { position: absolute; z-index: 8; top: calc(100% + 7px); right: 0; width: 245px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); box-shadow: var(--shadow); }
.meal-filter-panel[hidden] { display: none; }
.meal-filter-panel-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.meal-filter-panel fieldset { display: grid; gap: 5px; margin: 9px 0 0; padding: 0; border: 0; }
.meal-filter-panel legend { margin-bottom: 3px; color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.meal-filter-option, .meal-ingredient-option { display: flex; align-items: center; gap: 8px; min-height: 24px; cursor: pointer; font-size: 11px; }
.meal-filter-option input, .meal-ingredient-option input { width: 14px; height: 14px; margin: 0; accent-color: var(--green-dark); }
.favorite-library-list { display: grid; gap: 7px; }
.favorite-meal-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: start; min-width: 0; padding: 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-alt); }
.favorite-meal-card.is-dragging { opacity: .55; }
.favorite-meal-copy { min-width: 0; }
.favorite-meal-copy strong { display: block; overflow-wrap: anywhere; line-height: 1.3; }
.favorite-meal-copy small { display: block; margin-top: 3px; color: var(--muted); font-size: 9px; }
.favorite-meal-copy p { margin: 5px 0 0; color: var(--muted); font-size: 10px; line-height: 1.35; overflow-wrap: anywhere; }
.favorite-meal-actions { display: flex; flex-wrap: wrap; justify-content: end; gap: 4px; }
.favorite-meal-actions .tiny-button { width: 25px; height: 25px; }
.meal-action-label { display: inline-flex; align-items: center; gap: 4px; min-height: 25px; padding: 4px 7px; border-radius: 6px; background: var(--surface); color: var(--muted); font-size: 10px; white-space: nowrap; }
.meal-action-label:hover { background: var(--green-pale); color: var(--green-dark); }
.meal-library-hint { margin: 10px 0 0; color: var(--muted); font-size: 10px; line-height: 1.4; }
.meal-slot.is-drop-target { outline: 2px dashed var(--green); outline-offset: 3px; border-radius: 8px; background: var(--green-pale); }
.meal-type-checks, .meal-ingredient-list { display: grid; gap: 6px; }

@media (max-width: 1050px) {
  .meal-planning-layout { grid-template-columns: 1fr; }
  .meal-library-card { order: -1; }
}
@media (max-width: 680px) {
  .meal-planner-tabs { overflow-x: auto; flex-wrap: nowrap; padding-bottom: 3px; }
  .planner-tab { flex: 0 0 auto; }
  .meal-library-header, .meal-library-toolbar { align-items: stretch; flex-direction: column; }
  .meal-filter-dropdown { width: 100%; }
  .meal-filter-dropdown > .filter-button { width: 100%; }
  .meal-filter-panel { position: static; width: auto; margin-top: 7px; box-shadow: none; }
  .meal-week-grid { grid-template-columns: repeat(7, minmax(145px, 1fr)); }
}

/* Keep every desktop page aligned to the same full-width content frame as Calendar. */
@media (min-width: 681px) {
  .page-wrap { max-width: none; margin-inline: 0; padding: 24px clamp(16px, 2vw, 30px) 24px; }
}

/* The weekly planner owns the full row; the library follows it below. */
.meal-planning-layout { display: block; }
.meal-week-grid { width: 100%; min-width: 0; grid-template-columns: repeat(7, minmax(0, 1fr)); overflow-x: auto; }
.meal-library-card { order: initial; margin-top: 14px; }
.favorite-library-list { grid-template-columns: repeat(auto-fit, minmax(245px, 1fr)); }

/* Keep meal content readable while making planner actions compact and touchable. */
.meal-day { min-height: 0; }
.meal-day-header { padding-bottom: 7px; }
.meal-slot { gap: 4px; padding: 8px 0; }
.meal-slot-card { display: block; padding: 7px; }
.meal-slot-card .meal-item { display: block; width: 100%; min-height: 0; padding: 0 0 5px; }
.meal-item strong { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; line-height: 1.25; }
.meal-item small { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; line-height: 1.3; }
.meal-slot-card .meal-actions { flex-direction: row; justify-content: flex-end; gap: 4px; padding-top: 4px; border-top: 1px solid var(--line); }
.meal-slot-card .meal-actions .tiny-button { width: 25px; height: 25px; flex-basis: 25px; }
.meal-slot-card .meal-actions [data-meal-delete], .favorite-meal-actions [data-meal-library-remove] { color: var(--terracotta); }
.meal-empty { min-height: 35px; border: 1px dashed var(--line); background: transparent; }
.meal-library-toolbar { justify-content: flex-start; flex-wrap: wrap; }
.meal-library-toolbar .search-field { flex: 0 1 260px; max-width: 260px; }
.favorite-library-list { display: flex; align-items: flex-start; flex-wrap: wrap; gap: 8px; }
.favorite-meal-card { display: flex; flex: 0 1 245px; max-width: 340px; flex-direction: column; gap: 7px; padding: 9px 10px; }
.favorite-meal-actions { justify-content: flex-start; align-items: center; width: 100%; padding-top: 6px; border-top: 1px solid var(--line); }
.favorite-meal-actions .meal-action-label { min-height: 25px; padding: 4px 6px; }
.favorite-meal-actions .tiny-button { flex: 0 0 25px; }

@media (max-width: 1100px) and (min-width: 681px) {
  .meal-week-grid { grid-template-columns: repeat(7, minmax(130px, 1fr)); }
}

@media (max-width: 680px) {
  .meal-week-grid { grid-template-columns: repeat(7, minmax(145px, 1fr)); }
  .meal-day.is-today-column { background: color-mix(in srgb, var(--green-pale) 18%, transparent); }
}

/* Meal detail readability, lightweight library cards and managed cuisines. */
.meal-slot-card { padding: 8px; }
.meal-slot-card .meal-item { padding: 2px 2px 7px; overflow: visible; }
.meal-slot-card .meal-item.is-favorite { padding-left: 10px; box-shadow: inset 3px 0 var(--yellow); }
.meal-slot-card .meal-item strong, .meal-slot-card .meal-item small { display: block; max-height: none; overflow: visible; white-space: normal; text-overflow: clip; }
.meal-slot-card .meal-item strong { line-height: 1.3; }
.meal-slot-card .meal-item small { margin-top: 4px; line-height: 1.4; }
.meal-library-toolbar .filter-button { display: inline-flex; align-items: center; justify-content: center; gap: 5px; min-height: 32px; white-space: nowrap; line-height: 1; }
.filter-chevron { display: inline-flex; align-items: center; justify-content: center; line-height: 1; }
.meal-filter-panel-actions { display: inline-flex; align-items: center; gap: 8px; }
.favorite-meal-card { cursor: pointer; }
.favorite-meal-card:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
.favorite-meal-actions { justify-content: flex-end; }
.inline-field { display: flex; align-items: center; gap: 7px; min-width: 0; }
.inline-field select, .inline-field input { min-width: 0; flex: 1; }
.inline-field .text-button { flex: 0 0 auto; white-space: nowrap; }
.cuisine-management-list { display: grid; gap: 6px; max-height: 280px; overflow-y: auto; }
.cuisine-management-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 36px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-alt); }
.cuisine-management-row > span { min-width: 0; overflow-wrap: anywhere; font-size: 12px; }

@media (max-width: 680px) {
  .meal-filter-panel-actions { justify-content: flex-end; flex-wrap: wrap; }
  .inline-field { align-items: stretch; flex-wrap: wrap; }
  .inline-field select, .inline-field input { flex-basis: 100%; }
  .inline-field .text-button { margin-left: auto; }
}

/* Favourite meals are compact, content-led tiles; details and actions live in the modal. */
.favorite-library-list { display: flex; align-items: flex-start; flex-wrap: wrap; gap: 8px; }
.favorite-meal-card { display: block; flex: 0 1 auto; width: fit-content; min-width: 150px; max-width: 230px; padding: 7px 9px; border-radius: 8px; }
.favorite-meal-copy strong { display: block; line-height: 1.2; overflow-wrap: anywhere; }
.favorite-meal-copy small { display: block; margin-top: 3px; font-size: 9px; line-height: 1.2; overflow-wrap: anywhere; }
.favorite-meal-copy p, .favorite-meal-actions { display: none; }
.favorite-meal-card:hover { border-color: var(--green); background: var(--green-pale); }
.favorite-meal-card:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
.meal-detail-summary { display: grid; gap: 9px; margin-bottom: 12px; }
.meal-detail-meta { color: var(--muted); font-size: 11px; }
.meal-detail-notes, .meal-detail-ingredients { margin: 4px 0 0; padding: 9px 10px; border-radius: 8px; background: var(--surface-alt); font-size: 11px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.meal-detail-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }

@media (max-width: 680px) {
  .favorite-meal-card { min-width: 140px; max-width: 220px; padding: 7px 8px; }
  .meal-detail-actions { display: grid; grid-template-columns: 1fr; }
  .meal-detail-actions .button { width: 100%; }
}

/* Keep the library filter above cards and within the viewport at every size. */
.meal-filter-panel {
  position: fixed;
  z-index: 100;
  top: auto;
  right: auto;
  left: auto;
  width: min(320px, calc(100vw - 24px));
  max-height: min(62vh, 380px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 13px;
}
.meal-filter-panel-header { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px; }
.meal-filter-panel-header strong { min-width: 0; white-space: nowrap; }
.meal-filter-panel-actions { justify-content: flex-end; flex-wrap: nowrap; gap: 10px; }
.meal-filter-panel-actions .text-button { white-space: nowrap; }
.meal-filter-panel fieldset { min-width: 0; }

@media (max-width: 680px) {
  .meal-filter-panel { position: fixed; width: min(320px, calc(100vw - 24px)); max-height: min(62vh, 380px); margin-top: 0; box-shadow: 0 14px 32px rgba(40, 52, 48, .2); }
  .meal-filter-panel-header { grid-template-columns: 1fr; align-items: start; }
  .meal-filter-panel-actions { justify-content: flex-start; }
}

/* Local multi-space entry points and the compact sidebar switcher. */
.space-switcher-trigger { position: relative; width: 100%; padding: 0; border-radius: 10px; background: transparent; color: inherit; text-align: left; }
.space-switcher-trigger:hover { background: var(--surface-alt); }
.space-switcher-trigger .brand-subtitle { max-width: 165px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.space-switcher-chevron { margin-left: auto; color: var(--muted); font-size: 16px; }
.space-switcher-panel { position: absolute; z-index: 30; top: 72px; left: 18px; width: 265px; padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: 0 18px 40px rgba(35,48,44,.16); }
.space-switcher-panel[hidden] { display: none; }
.space-switcher-heading { display: flex; justify-content: space-between; gap: 12px; padding: 2px 4px 9px; color: var(--muted); font-size: 11px; }
.space-switcher-heading span { display: grid; place-items: center; min-width: 20px; height: 20px; border-radius: 50%; background: var(--green-pale); color: var(--green-dark); font-size: 10px; }
.space-switcher-list { display: grid; gap: 4px; max-height: 240px; overflow-y: auto; }
.space-switcher-item { display: flex; align-items: center; gap: 9px; width: 100%; padding: 9px; border-radius: 9px; background: transparent; text-align: left; }
.space-switcher-item:hover, .space-switcher-item.is-active { background: var(--green-pale); }
.space-switcher-item-icon { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 7px; background: var(--surface-alt); color: var(--green-dark); font-size: 12px; }
.space-switcher-item strong, .space-switcher-item small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.space-switcher-item strong { font-size: 11px; }.space-switcher-item small { margin-top: 2px; color: var(--muted); font-size: 9px; }
.space-switcher-actions { display: flex; justify-content: space-between; gap: 8px; margin-top: 9px; padding-top: 9px; border-top: 1px solid var(--line); }
.space-switcher-actions .text-button { font-size: 10px; }
.app-route-public .app-shell { min-height: 100vh; }
.app-route-public .sidebar, .app-route-public .mobile-header, .app-route-public .mobile-nav { display: none; }
.app-route-public .main-content { width: 100%; min-height: 100vh; }
.app-route-public .page-wrap { max-width: 1180px; padding: 34px clamp(20px, 5vw, 78px) 70px; }
.public-page { min-height: calc(100vh - 100px); }
.welcome-page { display: grid; place-items: center; gap: 28px; padding: 34px 0; }
.public-brand { display: flex; align-items: center; gap: 11px; }
.public-brand strong { display: block; font-size: 18px; letter-spacing: -.03em; }.public-brand small { display: block; margin-top: -1px; color: var(--muted); font-size: 11px; }
.welcome-card { width: min(650px, 100%); padding: clamp(28px, 6vw, 58px); text-align: center; }
.production-welcome-page { gap: 22px; }
.production-welcome-card { padding-block: clamp(30px, 6vw, 62px); }
.production-welcome-card .welcome-actions .button { min-width: min(280px, 100%); }
.welcome-card h1 { margin-top: 9px; font-size: clamp(42px, 7vw, 68px); }.welcome-card p { max-width: 510px; margin: 18px auto 0; color: var(--muted); font-size: 15px; line-height: 1.7; }
.welcome-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 9px; margin-top: 27px; }.welcome-actions .button { min-height: 42px; }.welcome-actions .coming-badge { margin-left: 6px; }
.welcome-card .form-help { display: block; max-width: 480px; margin: 17px auto 0; }
.auth-boundary { width: min(100%, 650px); }
.auth-card, .auth-status-card { width: 100%; padding: clamp(20px, 4vw, 32px); }
.auth-card-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.auth-card-heading h2, .auth-status-card h2 { margin-top: 5px; font-size: 24px; }
.auth-lock { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 10px; background: var(--green-pale); color: var(--green-dark); font-size: 17px; }
.auth-form { display: grid; gap: 12px; margin-top: 18px; text-align: left; }
.auth-form-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 5px; }
.auth-form-actions .button { flex: 1 1 150px; }
.auth-status { margin-top: 13px; padding: 10px 12px; border-radius: 10px; background: var(--surface-alt); color: var(--muted); font-size: 11px; line-height: 1.45; text-align: left; }
.auth-status-success { background: var(--green-pale); color: var(--green-dark); }
.auth-status-error { background: color-mix(in srgb, #c96e5c 12%, var(--surface)); color: color-mix(in srgb, #9b4e40 75%, var(--ink)); }
.auth-boundary-copy { margin-top: 14px; line-height: 1.55; }
.public-page-header { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 27px; }.public-page-header h1 { margin-top: 9px; }.public-page-header p { max-width: 600px; margin-top: 10px; color: var(--muted); }.public-header-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.space-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; }.public-space-card { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 14px; align-items: start; padding: 20px; }.space-card-icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 13px; background: var(--green-pale); color: var(--green-dark); font-size: 21px; }.space-card-copy { min-width: 0; }.space-card-copy h2 { margin-top: 3px; font-size: 24px; overflow-wrap: anywhere; }.space-card-copy p { min-height: 38px; margin-top: 7px; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }.space-card-copy small { display: block; margin-top: 11px; color: var(--muted); font-size: 10px; }.public-space-card > .button { grid-column: 2; justify-self: start; margin-top: 3px; }.empty-space-card { grid-column: 1 / -1; text-align: center; }.empty-space-card p { margin: 8px 0 15px; color: var(--muted); }.invitation-teaser { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-top: 18px; padding: 18px 20px; }.invitation-teaser h2 { margin-top: 4px; font-size: 20px; }.invitation-teaser p { margin-top: 5px; color: var(--muted); font-size: 12px; }.invitation-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--surface-alt); color: var(--green-dark); font-size: 19px; }
.create-space-page { max-width: 760px; margin: 0 auto; }.create-space-page .public-page-header { display: block; }.create-space-page .public-page-header .text-button { margin-top: 24px; }.create-space-card { margin-top: 22px; padding: clamp(20px, 4vw, 32px); }.space-type-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; margin-top: 6px; }.space-type-option { display: flex; align-items: flex-start; gap: 8px; min-height: 86px; padding: 11px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); cursor: pointer; }.space-type-option:has(input:checked) { border-color: var(--green); background: var(--green-pale); }.space-type-option input { margin-top: 3px; accent-color: var(--green-dark); }.space-type-option strong, .space-type-option small { display: block; }.space-type-option strong { font-size: 11px; }.space-type-option small { margin-top: 4px; color: var(--muted); font-size: 10px; line-height: 1.35; }
@media (max-width: 680px) { .app-route-public .page-wrap { padding: 22px 16px 38px; }.welcome-page { min-height: calc(100vh - 60px); padding: 20px 0; }.welcome-card { padding: 28px 20px; }.welcome-card h1 { font-size: 45px; }.welcome-actions { display: grid; }.welcome-actions .button { width: 100%; }.auth-form-actions { flex-direction: column; }.auth-form-actions .button { width: 100%; }.public-page-header { align-items: start; flex-direction: column; gap: 16px; }.public-header-actions { justify-content: flex-start; }.space-grid { grid-template-columns: 1fr; }.public-space-card { grid-template-columns: auto minmax(0, 1fr); }.space-type-options { grid-template-columns: 1fr; }.space-type-option { min-height: 0; }.space-switcher-panel { position: fixed; top: 66px; right: 12px; left: 12px; width: auto; }.invitation-teaser { align-items: start; }.invitation-icon { flex-shrink: 0; } }

/* Keep the global space menu inside the viewport on every shell size. */
.space-switcher-panel { position: fixed; top: 84px; left: 12px; width: min(265px, calc(var(--sidebar-width) - 24px), calc(100vw - 24px)); max-height: calc(100vh - 100px); overflow: hidden; }
.space-switcher-list { min-width: 0; max-height: min(240px, calc(100vh - 205px)); }
.space-switcher-item > span:last-child { min-width: 0; flex: 1; }
.space-switcher-actions { flex-wrap: wrap; }
.space-switcher-actions .text-button { min-width: 0; flex: 1 1 90px; white-space: normal; }
.mobile-space-switcher-trigger { display: none; align-items: center; gap: 5px; max-width: 126px; padding: 7px 8px; border-radius: 9px; background: transparent; color: var(--muted); text-align: right; }
.mobile-space-switcher-trigger:hover { background: var(--surface-alt); color: var(--ink); }
.mobile-space-switcher-trigger .mobile-header-space { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mobile-space-switcher-trigger .space-switcher-chevron { margin-left: 0; }

/* Public entry pages use a deliberate reading width instead of the dashboard width. */
.app-route-public .page-wrap { display: flex; justify-content: center; }
.app-route-public .public-page { width: min(100%, 1080px); margin-inline: auto; }
.app-route-public .welcome-page { width: min(100%, 760px); }
.app-route-public .spaces-page { width: min(100%, 1080px); }
.app-route-public .space-grid { align-items: stretch; }
.app-route-public .public-space-card { min-height: 170px; }
.account-settings-page { width: min(100%, 1080px); }
.account-settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.account-settings-section { min-width: 0; }
.account-settings-section.appearance-section { grid-column: 1 / -1; }
.account-profile-summary { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; padding: 12px; border-radius: 12px; background: var(--surface-alt); }
.account-avatar { display: grid; place-items: center; width: 44px; height: 44px; flex: 0 0 44px; border-radius: 50%; background: var(--green-pale); color: var(--green-dark); font-size: 18px; font-weight: 700; }
.account-profile-summary strong, .account-profile-summary small, .account-profile-summary span { display: block; }
.account-profile-summary strong { font-size: 14px; }
.account-profile-summary small, .account-profile-summary span { margin-top: 3px; color: var(--muted); font-size: 10px; }
.account-profile-summary span { color: var(--green-dark); font-weight: 700; }
.account-profile-form { gap: 10px; }
.account-profile-form .form-actions { margin-top: 2px; }
.account-future-list { display: grid; gap: 0; }
.account-future-list > div { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 0; border-top: 1px solid var(--line); }
.account-future-list strong { font-size: 12px; }
.account-future-list span { flex: 0 0 auto; color: var(--muted); font-size: 10px; }
.account-security-note { margin-top: 14px; }

@media (max-width: 680px) {
  .mobile-space-switcher-trigger { display: inline-flex; }
  .space-switcher-panel { top: 66px; right: 12px; left: 12px; width: auto; max-height: calc(100vh - 84px); }
  .space-switcher-list { max-height: min(280px, calc(100vh - 185px)); }
  .app-route-public .public-page { width: 100%; }
  .app-route-public .welcome-page { width: 100%; }
  .app-route-public .public-space-card { min-height: 0; }
  .account-settings-grid { grid-template-columns: 1fr; }
  .account-settings-section.appearance-section { grid-column: auto; }
  .account-future-list > div { align-items: flex-start; flex-direction: column; gap: 3px; }
}

/* Mobile header: keep the brand and account control together, then give the
   active space its own full-width row so normal names are never ellipsized. */
@media (max-width: 680px) {
  .mobile-header { display: block; padding: 12px 16px 10px; }
  .mobile-header-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-width: 0; }
  .mobile-header-top .brand-lockup { min-width: 0; }
  .mobile-header-top .brand-name { white-space: nowrap; }
  .mobile-space-switcher-trigger { display: flex; align-items: center; justify-content: space-between; width: 100%; max-width: none; min-width: 0; margin-top: 7px; padding: 7px 8px; text-align: left; }
  .mobile-space-switcher-trigger .mobile-header-space { width: auto; min-width: 0; flex: 1 1 auto; overflow-wrap: anywhere; white-space: normal; }
  .mobile-space-switcher-trigger .space-switcher-chevron { flex: 0 0 auto; margin-left: 10px; }
  .space-switcher-panel { top: 96px; max-height: calc(100dvh - 110px); }
}

/* A Day view uses the same 24-hour timeline and click-to-time calculation as
   Week view, but keeps the single day inside the viewport on small screens. */
.day-calendar-card { padding: 0; overflow: hidden; }
.day-calendar-header { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 0 10px; }
.day-calendar-header h2 { margin-top: 3px; font-size: 18px; }
.day-all-day-strip { grid-template-columns: 56px minmax(0, 1fr); min-width: 0; }
.day-calendar-body { grid-template-columns: 56px minmax(0, 1fr); min-width: 0; min-height: calc(var(--calendar-hour-height) * 24); }
.day-calendar-body .calendar-col { min-height: calc(var(--calendar-hour-height) * 24); }
.calendar-empty-inline { display: block; padding: 9px 5px; color: var(--muted); font-size: 10px; }
.day-calendar-card { display: flex; min-height: 0; flex-direction: column; }
.day-calendar-card .calendar-scroll { min-height: 0; flex: 1 1 auto; }

@media (max-width: 680px) {
  .day-calendar-header { align-items: flex-start; padding-inline: 2px; }
  .day-calendar-header h2 { font-size: 16px; }
  .day-calendar-header .text-button { flex: 0 0 auto; }
  .calendar-navigation-row .period-label { white-space: normal; overflow-wrap: anywhere; }
  .calendar-view-actions { gap: 5px; }
  .calendar-view-actions .toolbar-group { gap: 2px; padding: 3px; }
  .calendar-view-actions .segmented-button { padding-inline: 3px; font-size: 10px; }
  .calendar-view-actions > .button { padding-inline: 8px; font-size: 10px; }
  .day-calendar-card { overflow: hidden; }
  .day-calendar-card .calendar-scroll { min-height: 360px; }
  .day-calendar-body { min-height: calc(var(--calendar-hour-height) * 24); }
}

/* Training cards must be allowed to shrink at phone widths. The week wrapper
   previously inherited a min-content width from its unbroken metadata row,
   which made the session rows widen the document beyond the viewport. */
@media (max-width: 680px) {
  .member-tabs,
  .member-tab,
  .training-overview,
  .training-plan-list,
  .training-plan-card,
  .training-week-list,
  .training-week,
  .training-session-row { min-width: 0; max-width: 100%; }
  .member-tab { align-items: flex-start; }
  .member-tab > span:last-child,
  .training-plan-card .card-header > div:first-child,
  .training-overview > div:first-child { min-width: 0; }
  .member-tab strong,
  .member-tab small,
  .training-plan-card .card-header h2,
  .training-plan-card .card-header p,
  .training-plan-notes { overflow-wrap: anywhere; white-space: normal; }
  .training-overview { grid-template-columns: minmax(0, 1fr); }
  .training-overview .button { width: 100%; }
  .training-plan-card { padding: 15px; }
  .training-plan-card .card-header { align-items: flex-start; flex-wrap: wrap; }
  .training-plan-card .card-header > div:first-child { flex: 1 1 170px; }
  .training-plan-card .card-header .row-actions { flex: 0 0 auto; margin-left: auto; }
  .training-session-row { display: grid; grid-template-columns: 24px minmax(0, 1fr); align-items: start; gap: 8px; }
  .training-session-copy { min-width: 0; }
  .training-session-copy strong,
  .training-session-copy small { overflow: visible; overflow-wrap: anywhere; text-overflow: clip; white-space: normal; }
  .training-session-row .row-actions { grid-column: 2; justify-content: flex-start; }
}

@media (max-width: 680px) {
  /* The main page owns the remaining viewport below the mobile header and
     above the fixed bottom navigation. The calendar then scrolls internally. */
  body:has(.calendar-page) .main-content { display: flex; min-height: 100dvh; flex-direction: column; }
  body:has(.calendar-page) .main-content { height: 100dvh; max-height: 100dvh; overflow: hidden; }
  body:has(.calendar-page) .page-wrap { display: flex; width: 100%; min-height: 0; flex: 1 1 0; flex-direction: column; overflow: hidden; }
  body:has(.calendar-page) .calendar-page { width: 100%; height: auto; min-height: 0; flex: 1 1 auto; }
  body:has(.calendar-page) .day-calendar-card { display: flex; min-height: 0; flex: 1 1 auto; flex-direction: column; }
  body:has(.calendar-page) .calendar-page .calendar-scroll { height: auto; min-height: 0; flex: 1 1 0; }

  /* Month and Agenda are content-height views. Let the page scroll them
     normally instead of shrinking the month grid to zero beside its detail
     panel; Day and Week retain their independent timeline scroll above. */
  body:has(.calendar-page .month-card) .main-content,
  body:has(.calendar-page .agenda-card) .main-content { height: auto; max-height: none; overflow-y: auto; }
  body:has(.calendar-page .month-card) .page-wrap,
  body:has(.calendar-page .agenda-card) .page-wrap { flex: 0 0 auto; overflow: visible; }
  body:has(.calendar-page .month-card) .calendar-page,
  body:has(.calendar-page .agenda-card) .calendar-page { height: auto; min-height: 0; display: block; }
  body:has(.calendar-page .month-card) .month-card,
  body:has(.calendar-page .agenda-card) .agenda-card { flex: 0 0 auto; }
}

/* Keep common responsive children from contributing an accidental page width. */
.card, .page-header, .page-toolbar, .calendar-page, .shopping-page, .training-page, .subscriptions-page, .meals-page, .notes-page, .goals-page, .settings-page, .modal, .public-page { min-width: 0; }
.card > *, .page-header > *, .page-toolbar > *, .calendar-controls-row > *, .list-toolbar > *, .modal-header > * { min-width: 0; }
@media (max-width: 680px) {
  .page-wrap { min-width: 0; overflow-wrap: anywhere; }
  .button, .text-button, .filter-button, .segmented-button { max-width: 100%; }
  .modal { width: min(560px, calc(100vw - 20px)); max-width: calc(100vw - 20px); }
  .modal .form-actions { flex-wrap: wrap; }
  .modal .form-actions .button { flex: 1 1 120px; }
}

/* Public pages use their own viewport frame, separate from dashboard spacing. */
.app-route-public,
.app-route-public .main-content { min-height: 100dvh; }
.app-route-public .main-content { padding-bottom: 0; }
.app-route-public #app { min-height: 100dvh; }

/* Create Space onboarding and owner-only deletion controls. */
.app-route-public .create-space-page { max-width: 820px; }
.create-space-page .public-page-header { margin-bottom: 20px; }
.create-space-page .public-page-header .public-brand { margin-bottom: 16px; }
.create-space-page .public-page-header .text-button { margin-top: 0; }
.create-space-card { margin-top: 0; padding: clamp(22px, 4vw, 34px); }
.space-type-field { min-width: 0; margin: 2px 0 0; padding: 0; border: 0; }
.space-type-field legend { padding: 0; font-size: 13px; font-weight: 600; }
.space-type-field > .form-help { margin: 5px 0 10px; }
.space-type-options { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 0; }
.space-type-option { position: relative; display: grid; grid-template-columns: 36px minmax(0, 1fr); align-items: start; gap: 10px; min-height: 126px; padding: 15px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); cursor: pointer; transition: border-color .2s ease, background .2s ease, box-shadow .2s ease, transform .2s ease; }
.space-type-option:hover { border-color: var(--green); background: var(--surface-alt); transform: translateY(-1px); }
.space-type-option:has(input:checked) { border-color: var(--green-dark); background: var(--green-pale); box-shadow: inset 0 0 0 1px var(--green-dark); }
.space-type-option:has(input:focus-visible) { outline: 3px solid rgba(110,143,130,.3); outline-offset: 2px; }
.space-type-option input { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.space-type-icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--surface-alt); color: var(--green-dark); font-size: 21px; line-height: 1; }
.space-type-option:has(input:checked) .space-type-icon { background: var(--surface); }
.space-type-copy { min-width: 0; }
.space-type-copy strong, .space-type-copy small { display: block; }
.space-type-copy strong { font-size: 12px; }
.space-type-copy small { margin-top: 6px; color: var(--muted); font-size: 10px; line-height: 1.45; }
.confirmation-name-field { margin: -4px 0 20px; }
.confirmation-name-field input[aria-invalid="true"] { border-color: var(--terracotta); }
.space-delete-modal { z-index: 11; }

.delete-space-section { border-color: color-mix(in srgb, var(--terracotta) 28%, var(--line)); background: var(--surface); }
.delete-space-section .settings-section-heading { align-items: center; }
.delete-space-section h2 { color: var(--ink); }
.delete-space-section .button-danger { flex: 0 0 auto; }

.profile-menu { position: fixed; z-index: 40; width: min(220px, calc(100vw - 24px)); padding: 6px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); box-shadow: 0 18px 40px rgba(30, 42, 36, .18); }
.profile-menu[hidden] { display: none; }
.profile-menu button { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; padding: 9px 10px; border-radius: 8px; background: transparent; color: var(--ink); text-align: left; font-size: 11px; }
.profile-menu button:hover, .profile-menu button:focus-visible { background: var(--green-pale); color: var(--green-dark); outline: none; }
.profile-menu button[disabled] { cursor: not-allowed; opacity: .55; }
.profile-menu small { color: var(--muted); font-size: 9px; }

@media (max-width: 760px) {
  .space-type-options { grid-template-columns: 1fr; }
  .space-type-option { min-height: 0; }
  .delete-space-section .settings-section-heading { align-items: stretch; }
  .delete-space-section .button-danger { align-self: flex-start; }
}
.app-route-public .page-wrap {
  width: 100%;
  max-width: none;
  min-height: 100dvh;
  margin: 0;
  padding: clamp(28px, 5vh, 56px) clamp(16px, 5vw, 72px) clamp(32px, 6vh, 72px);
  display: flex;
  align-items: stretch;
  justify-content: center;
}
.app-route-public #app {
  width: 100%;
  min-width: 0;
  display: flex;
  align-items: stretch;
  justify-content: center;
}
.app-route-public .public-page {
  width: 100%;
  max-width: 1080px;
  margin-inline: auto;
}
.app-route-public .welcome-page {
  min-height: 100%;
  max-width: 760px;
  align-self: stretch;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 28px;
  padding-block: 24px;
}
.app-route-public .welcome-card {
  width: 100%;
}
.app-route-public .spaces-page {
  max-width: 1080px;
}
.app-route-public .space-grid {
  width: 100%;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.app-route-public .invitation-teaser {
  width: 100%;
}
@media (max-width: 760px) {
  .app-route-public .space-grid { grid-template-columns: 1fr; }
}
@media (max-width: 680px) {
  .app-route-public .page-wrap {
    min-height: 100dvh;
    padding: 24px 16px 32px;
  }
  .app-route-public #app { min-height: calc(100dvh - 56px); }
  .app-route-public .welcome-page {
    min-height: 100%;
    padding-block: 20px;
  }
}

/* The public frame fills the viewport; it does not inherit mobile dashboard sizing. */
.app-route-public #app { min-height: 100dvh; }
.app-route-public .create-space-page { max-width: 820px; }
