:root {
  color-scheme: light;
  --deep: #0f3b27;
  --sage: #8ea57d;
  --sage-light: #aebd9f;
  --cream: #f6f3eb;
  --paper: #fffdf9;
  --session-background: #f8f7f1;
  --soft: #f0eee6;
  --ink: #1d2b21;
  --muted: #647066;
  --line: #e0e2d9;
  --shadow: 0 12px 34px rgba(29, 43, 33, .075);
  --radius: 20px;

  --accent-fill: #0f3b27;
  --on-accent: #fff;
  --photo-surface: #0f3b27;
  --input-surface: #fff;
  --hero-rgb: 246,243,235;
  --hero-fallback: #e8e6db;
  --header-surface: rgba(255,253,249,.94);
  --nav-surface: rgba(255,253,249,.97);
  --border-subtle: rgba(15,59,39,.12);
  --border-08: rgba(15,59,39,.08);
  --border-12: rgba(15,59,39,.12);
  --border-07: rgba(15,59,39,.07);
  --border-13: rgba(15,59,39,.13);
  --border-09: rgba(15,59,39,.09);
  --border-15: rgba(15,59,39,.15);
  --border-16: rgba(15,59,39,.16);
  --border-1: rgba(15,59,39,.1);
  --active-surface: #edf1e9;
  --nav-hover: #eaf0e7;
  --input-border: #dce1d8;
  --selected-surface: #f0f3eb;
  --subtle-surface: #f8f7f1;
  --help-surface: #f7f7f1;
  --track: #e9ede6;
  --completed-surface: #e9ece6;
  --completed-text: #536253;
  --task-line: #eceee8;
  --danger-border: #e7d7d3;
  --danger-surface: #fff9f7;
  --warning-surface: #f8eae7;
  --warning-text: #7d302a;
  --danger-text: #8a4139;
  --end-text: #81423b;
  --checked-text: #879087;
  --note-text: #899188;
  --nav-text: #7a847b;
  --placeholder: #a0a79e;
  --hero-text: #46564a;
  --button-hover: #174a32;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --deep: #c2dfb2;
  --sage: #aacb96;
  --sage-light: #c1d9b4;
  --cream: #101d17;
  --paper: #192b21;
  --session-background: #1d3025;
  --soft: #24382b;
  --ink: #eef2e8;
  --muted: #becdbb;
  --line: #526a58;
  --shadow: 0 12px 34px rgba(0,0,0,.2);
  --accent-fill: #aacb96;
  --on-accent: #102516;
  --input-surface: #14241b;
  --hero-rgb: 16,29,23;
  --hero-fallback: #14241b;
  --header-surface: rgba(25,43,33,.97);
  --nav-surface: rgba(25,43,33,.98);
  --border-subtle: #4c6453;
  --border-08: #4c6453;
  --border-12: #4c6453;
  --border-07: #4c6453;
  --border-13: #4c6453;
  --border-09: #4c6453;
  --border-15: #4c6453;
  --border-16: #4c6453;
  --border-1: #4c6453;
  --active-surface: #263f30;
  --nav-hover: #263f30;
  --input-border: #607568;
  --selected-surface: #263f30;
  --subtle-surface: #1d3025;
  --help-surface: #1d3025;
  --track: #344d3c;
  --completed-surface: #263b2e;
  --completed-text: #bed0bd;
  --task-line: #3f5747;
  --danger-border: #a46b63;
  --danger-surface: #392622;
  --warning-surface: #392622;
  --warning-text: #ffc4b7;
  --danger-text: #ffc4b7;
  --end-text: #ffc4b7;
  --checked-text: #a9baa9;
  --note-text: #b4c5b3;
  --nav-text: #b4c5b3;
  --placeholder: #aabaaa;
  --hero-text: #d4dfcf;
  --button-hover: #b9d7a7;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; background: var(--cream); color: var(--ink); font-family: "DM Sans", sans-serif; line-height: 1.55; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; }
button { color: inherit; }
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 3px solid var(--sage); outline-offset: 3px; }
[hidden] { display: none !important; }

.app-header { position: sticky; top: 0; z-index: 20; background: var(--header-surface); border-bottom: 1px solid var(--border-08); backdrop-filter: blur(14px); }
.header-inner { position: relative; width: min(1280px, 100%); min-height: 76px; margin: auto; padding: 0 28px; display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.brand { display: flex; flex-direction: column; align-items: center; gap: 1px; flex: 0 0 auto; }
.brand img, .brand .logo-dark { width: 154px; height: auto; }
.brand span { color: var(--deep); font-size: 9px; font-weight: 700; letter-spacing: .24em; }
.topnav { display: flex; align-items: center; gap: 6px; }
.topnav button { display: inline-flex; min-height: 40px; align-items: center; justify-content: center; border: 0; border-radius: 999px; padding: 0 15px; color: var(--muted); background: transparent; cursor: pointer; font-size: 13px; font-weight: 600; line-height: 1; white-space: nowrap; transition: color .2s, background .2s; }
.topnav button:hover, .topnav button.active { color: var(--deep); background: var(--nav-hover); }
.topnav button.active { font-weight: 700; }
.header-link { color: var(--deep); font-size: 12px; font-weight: 700; white-space: nowrap; }
.header-link span { color: var(--sage); }
.settings-button { display: grid; width: 42px; height: 42px; flex: 0 0 auto; place-items: center; border: 1px solid var(--border-12); border-radius: 50%; color: var(--deep); background: var(--paper); cursor: pointer; }
.settings-button:hover { background: var(--active-surface); }
.settings-button svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2; }

.local-save-warning { margin: 0; padding: 10px 20px; color: var(--warning-text); background: var(--warning-surface); font-size: 13px; }

.app-main { min-height: calc(100vh - 160px); }
.welcome-hero { position: relative; min-height: 395px; overflow: hidden; background: var(--hero-fallback); }
.hero-photo, .hero-photo img, .hero-overlay { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-photo img { object-fit: cover; object-position: center 52%; }
.hero-overlay { background: linear-gradient(90deg, rgba(var(--hero-rgb),.98) 0%, rgba(var(--hero-rgb),.92) 31%, rgba(var(--hero-rgb),.56) 52%, rgba(var(--hero-rgb),.08) 80%), linear-gradient(0deg, rgba(15,59,39,.10), transparent 45%); }
.hero-copy { position: relative; z-index: 1; width: min(1280px, 100%); margin: auto; padding: 65px 48px 74px; }
.eyebrow { margin: 0 0 9px; color: var(--sage); font-size: 10px; line-height: 1.4; font-weight: 700; letter-spacing: .19em; }
.hero-copy .eyebrow { color: var(--deep); }
.hero-copy h1, .page-intro h1 { margin: 0; color: var(--deep); font: 500 clamp(42px, 5vw, 66px)/1.08 "Playfair Display", Georgia, serif; letter-spacing: -.035em; }
.hero-copy h1 em { color: var(--sage); font-weight: 500; }
.hero-description { margin: 17px 0 24px; color: var(--hero-text); font-size: 15px; }
.hero-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; width: min(400px, 100%); }
.button { display: inline-flex; min-height: 48px; align-items: center; justify-content: center; gap: 13px; border: 0; border-radius: 999px; padding: 0 21px; cursor: pointer; font-size: 12px; font-weight: 700; transition: transform .2s, box-shadow .2s, background .2s; }
.hero-actions .button { min-width: 0; min-height: 48px; gap: 4px; padding: 8px 6px; text-align: center; }
.button:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(15,59,39,.18); }
.button-dark { background: var(--accent-fill); color: var(--on-accent); }
.button-dark:hover { background: var(--button-hover); }
.hero-note { position: absolute; right: max(28px, calc((100% - 1184px) / 2)); bottom: 23px; display: flex; align-items: center; gap: 8px; color: var(--deep); font-size: 11px; font-weight: 600; }
.note-sparkle { color: var(--sage); font-size: 18px; }

.content-wrap { width: min(1184px, 100%); margin: 0 auto; padding: 48px 28px 72px; }
.dashboard-content { padding-top: 42px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 18px; margin-bottom: 19px; }
.section-heading h2 { margin: 0; font: 500 30px/1.2 "Playfair Display", Georgia, serif; color: var(--deep); letter-spacing: -.02em; }
.privacy-note { display: flex; align-items: center; gap: 7px; padding-bottom: 4px; color: var(--muted); font-size: 11px; }
.privacy-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--sage); }
.summary-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.summary-card, .panel { border: 1px solid var(--border-07); border-radius: var(--radius); background: var(--paper); box-shadow: var(--shadow); }
.summary-card { min-height: 194px; padding: 21px 22px; }
.summary-top { display: flex; align-items: center; gap: 9px; }
.summary-icon { display: grid; width: 29px; height: 29px; place-items: center; border-radius: 50%; background: var(--active-surface); color: var(--deep); font-size: 15px; }
.summary-label { color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: .12em; }
.metric-line { display: flex; align-items: baseline; gap: 9px; margin-top: 15px; }
.metric { color: var(--deep); font: 500 43px/.95 "Playfair Display", Georgia, serif; letter-spacing: -.03em; }
.metric-caption { color: var(--muted); font-size: 11px; }
.progress-track { width: 100%; height: 7px; margin: 13px 0 9px; overflow: hidden; border-radius: 10px; background: var(--track); }
.progress-track > div { width: 0; height: 100%; border-radius: inherit; background: var(--sage); transition: width .3s ease; }
.summary-foot { margin: 8px 0 0; color: var(--muted); font-size: 11px; }
.rooms-summary .summary-foot { margin-top: 13px; }
.text-link { display: inline-flex; align-items: center; gap: 8px; border: 0; padding: 0; color: var(--deep); background: transparent; cursor: pointer; font-size: 11px; font-weight: 700; }
.text-link span { color: var(--sage); transition: transform .2s; }
.text-link:hover span { transform: translateX(3px); }
.spaces-heading { margin-top: 42px; }
.room-card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.room-card { display: flex; min-width: 0; flex-direction: column; padding: 18px; border: 1px solid var(--border-08); border-radius: 18px; background: var(--paper); box-shadow: 0 8px 22px rgba(29,43,33,.045); transition: transform .2s, box-shadow .2s; }
.room-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.room-card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.room-emoji { display: grid; width: 38px; height: 38px; place-items: center; border-radius: 13px; background: var(--cream); font-size: 18px; }
.room-card-count { color: var(--muted); font-size: 10px; }
.room-card h3 { margin: 14px 0 2px; color: var(--deep); font: 500 20px/1.2 "Playfair Display", Georgia, serif; }
.room-card p { margin: 0; color: var(--muted); font-size: 11px; }
.room-card .progress-track { margin: auto 0 12px; }
.room-card-action { display: flex; width: 100%; align-items: center; justify-content: space-between; margin-top: auto; border: 0; padding: 0; color: var(--deep); background: none; cursor: pointer; font-size: 10px; font-weight: 700; }
.room-card-action span { color: var(--sage); font-size: 15px; }
.service-heading { margin-top: 42px; }
.service-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.service-card { position: relative; min-height: 240px; overflow: hidden; border-radius: 18px; background: var(--photo-surface); box-shadow: var(--shadow); scroll-snap-align: start; }
.service-card::after { position: absolute; inset: 0; content: ""; background: linear-gradient(0deg, rgba(15,59,39,.9), rgba(15,59,39,.03) 78%); }
.service-card img { position: absolute; width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.service-card:hover img { transform: scale(1.04); }
.service-copy { position: absolute; z-index: 1; right: 18px; bottom: 17px; left: 18px; color: #fff; }
.service-copy > span { color: var(--sage-light); font-size: 9px; font-weight: 700; letter-spacing: .14em; }
.service-copy h3 { margin: 4px 0 2px; font: 500 23px/1.1 "Playfair Display", Georgia, serif; }
.service-copy p { margin: 0; color: rgba(255,255,255,.82); font-size: 11px; }
.service-explore { display: inline-flex; min-height: 44px; align-items: center; gap: 8px; margin-top: 12px; border: 1px solid rgba(255,255,255,.4); border-radius: 999px; padding: 8px 12px; color: white; background: rgba(15,59,39,.28); cursor: pointer; font-size: 10px; font-weight: 700; transition: background .2s, border-color .2s; }
.service-explore:hover { border-color: var(--sage-light); background: rgba(15,59,39,.68); }
.service-explore:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--sage-light); }
.service-explore span { color: var(--sage-light); }
.scroll-hint { display: none; }

.inner-view { min-height: calc(100vh - 160px); }
.page-intro { margin-bottom: 30px; }
.settings-topline { margin-bottom: 14px; }
.settings-back { min-height: 42px; gap: 9px; padding: 0 16px; }
.settings-back span { font-size: 16px; }
.page-intro h1 { font-size: clamp(39px, 5vw, 55px); }
.page-intro > p:last-child, #request .page-intro > p:not(.eyebrow) { margin: 12px 0 0; color: var(--muted); font-size: 14px; }
.space-selection { min-width: 0; margin-bottom: 22px; border: 1px solid var(--border-08); border-radius: var(--radius); padding: clamp(12px, 2vw, 16px); background: var(--paper); }
.space-selection > .room-tabs { min-width: 0; margin-inline: 0; padding-inline: 2px; }
.space-selection > .space-selector-grid { margin: 0; }
.room-tabs { display: flex; gap: 9px; overflow-x: auto; padding: 2px 2px 18px; scrollbar-width: thin; }
.room-tabs button { flex: 0 0 auto; min-height: 43px; border: 1px solid var(--line); border-radius: 999px; padding: 0 17px; color: var(--muted); background: var(--paper); cursor: pointer; font-size: 12px; font-weight: 600; }
.room-tabs button.active { border-color: var(--deep); color: var(--on-accent); background: var(--accent-fill); }
.space-actions { display: flex; justify-content: flex-end; margin: -7px 0 15px; }
.panel.schedule-panel { margin: 0 0 24px; padding: 16px 20px; }
.schedule-heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; }
.schedule-heading-copy { flex: 1 1 190px; min-width: 0; }
.schedule-description { margin: 5px 0 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.schedule-heading h2 { margin: 0; color: var(--deep); font: 500 22px/1.2 "Playfair Display", Georgia, serif; }
.schedule-heading .button { min-height: 42px; padding: 0 15px; font-size: 10px; }
.schedule-list { display: grid; gap: 6px; margin-top: 9px; }
.schedule-list:empty { display: none; }
.schedule-item { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 8px 12px; border: 1px solid var(--border-07); border-radius: 12px; padding: 9px 11px; background: var(--subtle-surface); }
.schedule-item-main { min-width: 0; }
.schedule-item h3 { margin: 0; color: var(--deep); font: 500 15px/1.2 "Playfair Display", Georgia, serif; overflow-wrap: anywhere; }
.schedule-item p { margin: 3px 0 0; color: var(--muted); font-size: 9px; }
.schedule-manage { position: relative; }
.schedule-manage summary { min-height: 36px; display: inline-flex; align-items: center; border: 1px solid var(--border-12); border-radius: 999px; padding: 0 11px; color: var(--deep); background: var(--input-surface); cursor: pointer; font-size: 10px; font-weight: 700; list-style: none; }
.schedule-manage summary::-webkit-details-marker { display: none; }
.schedule-manage[open] .schedule-item-actions { position: absolute; z-index: 2; top: calc(100% + 5px); right: 0; min-width: 150px; flex-direction: column; padding: 6px; border: 1px solid var(--border-12); border-radius: 12px; background: var(--paper); box-shadow: var(--shadow); }
.schedule-item-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 5px; }
.schedule-item-actions button { min-height: 36px; border: 1px solid var(--border-13); border-radius: 999px; padding: 0 10px; color: var(--deep); background: var(--input-surface); cursor: pointer; font: 600 10px "DM Sans", sans-serif; }
.schedule-item-actions .schedule-delete { color: var(--danger-text); }
.schedule-status { display: inline-flex; margin-top: 6px; border-radius: 999px; padding: 3px 8px; color: var(--deep); background: var(--active-surface); font-size: 9px; font-weight: 700; }
.schedule-item.completed { opacity: .72; }
.schedule-item.completed .schedule-status { color: var(--completed-text); background: var(--completed-surface); }
.schedule-form-grid { display: grid; grid-template-columns: minmax(0, 1fr); width: 100%; min-width: 0; gap: 0; }
.schedule-form-grid .field { width: 100%; min-width: 0; max-width: 100%; }
.schedule-form-grid input, .schedule-form-grid select { display: block; box-sizing: border-box; flex: 0 0 auto; width: 100%; min-width: 0; max-width: 100%; height: 48px; min-height: 48px; padding: 10px 12px; border-radius: 12px; font-size: 14px; }
/* iOS native date appearance imposes intrinsic sizing inside an otherwise
   constrained field. Style the control box ourselves; its native picker remains. */
.schedule-form-grid input[type="datetime-local"] { -webkit-appearance: none; appearance: none; }
.schedule-form-grid input[type="datetime-local"]::-webkit-date-and-time-value { min-width: 0; text-align: left; }
.schedule-form-grid input[type="datetime-local"]::-webkit-datetime-edit { min-width: 0; padding: 0; }
.space-selector-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 11px; margin: 0 0 22px; }
.space-choice { min-width: 0; border: 1px solid var(--border-09); border-radius: 16px; padding: 13px; color: var(--ink); background: var(--paper); cursor: pointer; text-align: left; transition: border-color .2s, background .2s, transform .2s; }
.space-choice:hover { transform: translateY(-2px); }
.space-choice.active { border-color: var(--sage); background: var(--selected-surface); box-shadow: inset 0 0 0 1px var(--sage); }
.space-choice-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.space-choice .room-emoji { width: 31px; height: 31px; font-size: 15px; }
.space-choice-count { color: var(--muted); font-size: 9px; }
.space-choice strong { display: block; margin-top: 9px; color: var(--deep); font: 500 17px/1.2 "Playfair Display", Georgia, serif; }
.space-choice .progress-track { display: block; height: 5px; margin: 9px 0 2px; }
.checklist-layout { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(250px, .75fr); align-items: start; gap: 18px; }
.panel { padding: 27px; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.pill { display: inline-flex; align-items: center; border-radius: 999px; padding: 7px 11px; color: var(--deep); background: var(--active-surface); font-size: 9px; font-weight: 700; letter-spacing: .12em; }
.room-counter { color: var(--muted); font-size: 11px; }
.checklist-panel h2 { margin: 17px 0 2px; color: var(--deep); font: 500 30px/1.2 "Playfair Display", Georgia, serif; }
.room-description { margin: 0; color: var(--muted); font-size: 12px; }
.goal-area { margin-top: 12px; }
.goal-area:empty { display: none; }
.goal-add-button { min-height: 30px; font-size: 11px; }
.saved-goal { border: 1px solid var(--border-08); border-radius: 13px; padding: 11px 13px; background: var(--subtle-surface); }
.saved-goal-label { color: var(--sage); font-size: 8px; font-weight: 700; letter-spacing: .14em; }
.saved-goal-text { margin: 4px 0 8px; color: var(--ink); font-size: 12px; line-height: 1.45; overflow-wrap: anywhere; }
.goal-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 15px; }
.goal-actions .text-link { min-height: 28px; }
.goal-remove-button { color: var(--danger-text); }
.goal-editor { border: 1px solid var(--border-09); border-radius: 13px; padding: 12px; background: var(--subtle-surface); }
.goal-editor-label { display: block; margin-bottom: 6px; color: var(--deep); font-size: 10px; font-weight: 700; }
.goal-editor textarea { display: block; width: 100%; min-height: 72px; resize: vertical; border: 1px solid var(--input-border); border-radius: 11px; outline: none; padding: 10px 12px; color: var(--ink); background: var(--input-surface); font: 400 16px/1.4 "DM Sans", sans-serif; }
.goal-editor textarea:focus { border-color: var(--sage); box-shadow: 0 0 0 3px rgba(142,165,125,.18); }
.goal-actions { margin-top: 8px; }
.goal-editor .goal-actions { margin-top: 10px; }
.goal-save { min-height: 40px; padding: 0 15px; font-size: 11px; }
.reset-session-area { margin-top: 14px; }
.reset-session { border: 1px solid var(--border-08); border-radius: 14px; padding: 13px; background: var(--session-background); }
.reset-session-title { margin: 0; color: var(--deep); font: 500 18px/1.2 "Playfair Display", Georgia, serif; }
.session-prompt, .session-details { margin: 5px 0 0; color: var(--muted); font-size: 10px; }
.session-duration-options { display: flex; gap: 7px; margin-top: 10px; }
.session-duration { min-width: 0; min-height: 44px; flex: 1; border: 1px solid var(--input-border); border-radius: 11px; padding: 0 7px; color: var(--deep); background: var(--paper); cursor: pointer; font-size: 10px; font-weight: 600; }
.session-duration[aria-pressed="true"] { border-color: var(--sage); background: var(--active-surface); box-shadow: inset 0 0 0 1px var(--sage); }
.session-start { width: 100%; min-height: 44px; margin-top: 9px; }
.session-countdown { margin: 5px 0 8px; color: var(--deep); font: 500 32px/.98 "Playfair Display", Georgia, serif; letter-spacing: .02em; }
.session-controls { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 9px; }
.session-control { min-height: 44px; flex: 1 1 110px; border: 1px solid var(--border-15); border-radius: 999px; padding: 0 13px; color: var(--deep); background: var(--paper); cursor: pointer; font-size: 11px; font-weight: 700; }
.session-resume { border-color: var(--deep); color: var(--on-accent); background: var(--accent-fill); }
.session-end { color: var(--end-text); }
.session-message { margin: 4px 0 0; color: var(--muted); font-size: 10px; }
.session-completed { color: var(--deep); font-weight: 600; }
.custom-space-controls { display: flex; flex-wrap: wrap; gap: 17px; margin-top: 11px; }
.delete-space-link { color: var(--danger-text); }
.task-list { margin-top: 20px; }
.task { display: flex; min-height: 59px; align-items: center; gap: 13px; border-bottom: 1px solid var(--task-line); }
.task:last-child { border-bottom: 0; }
.task input { width: 20px; height: 20px; flex: 0 0 auto; margin: 0; accent-color: var(--deep); cursor: pointer; }
.task label { flex: 1; padding: 12px 0; color: var(--ink); cursor: pointer; font-size: 13px; }
.task:has(input:checked) label { color: var(--checked-text); text-decoration: line-through; text-decoration-color: var(--sage); }
.reset-checklist { display: inline-flex; align-items: center; gap: 8px; margin-top: 10px; border: 0; padding: 8px 0; color: var(--muted); background: none; cursor: pointer; font-size: 11px; }
.reset-checklist:hover { color: var(--deep); }
.helping-hand { margin-top: 20px; padding: 16px; border: 1px solid var(--border-09); border-radius: 15px; background: var(--help-surface); }
.helping-hand h3 { margin: 0; color: var(--deep); font: 500 19px/1.2 "Playfair Display", Georgia, serif; }
.helping-hand p { margin: 6px 0 8px; color: var(--muted); font-size: 11px; }
.helping-hand .text-link { min-height: 36px; }
.progress-panel { position: sticky; top: 100px; text-align: center; }
.progress-illustration { display: grid; width: 62px; height: 62px; place-items: center; margin: 0 auto 15px; border-radius: 21px; background: var(--cream); color: var(--sage); font-size: 27px; }
.progress-panel .eyebrow { margin-bottom: 7px; }
.progress-panel h3 { max-width: 230px; margin: 0 auto; color: var(--deep); font: 500 23px/1.25 "Playfair Display", Georgia, serif; }
.room-metric { margin: 20px 0 0; color: var(--deep); font: 500 48px/.95 "Playfair Display", Georgia, serif; }
.progress-panel .progress-track { height: 9px; margin: 14px 0 11px; }
.progress-encouragement { margin: 0; color: var(--muted); font-size: 11px; }
.note { margin: 22px 0 0; color: var(--note-text); font-size: 10px; }

.space-dialog { width: min(540px, calc(100% - 28px)); max-width: none; max-height: min(88dvh, 760px); overflow-y: auto; border: 1px solid var(--border-12); border-radius: 22px; padding: 0; color: var(--ink); background: var(--cream); box-shadow: 0 24px 80px rgba(15,59,39,.25); }
.space-dialog::backdrop { background: rgba(15,35,23,.48); backdrop-filter: blur(3px); }
.space-dialog-form { padding: clamp(20px, 5vw, 30px); }
.space-dialog-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; margin-bottom: 21px; }
.space-dialog-heading .eyebrow { margin-bottom: 5px; }
.space-dialog-heading h2 { margin: 0; color: var(--deep); font: 500 27px/1.2 "Playfair Display", Georgia, serif; }
.dialog-close { display: grid; width: 39px; height: 39px; flex: 0 0 auto; place-items: center; border: 1px solid var(--line); border-radius: 50%; color: var(--deep); background: var(--paper); cursor: pointer; font-size: 25px; line-height: 1; }
.space-dialog .field { margin-bottom: 13px; }
.space-dialog .field input, .space-dialog .field select { min-height: 48px; font-size: 14px; }
.schedule-dialog { width: min(500px, calc(100% - 28px)); }
.custom-task-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 20px 0 7px; }
.custom-task-heading h3 { margin: 0; color: var(--deep); font: 500 19px/1.2 "Playfair Display", Georgia, serif; }
.custom-task-heading p { margin: 3px 0 0; color: var(--muted); font-size: 10px; }
.add-task-button { min-height: 40px; flex: 0 0 auto; border: 1px solid var(--border-16); border-radius: 999px; padding: 0 13px; color: var(--deep); background: var(--paper); cursor: pointer; font-size: 11px; font-weight: 700; }
.custom-task-fields { display: grid; gap: 8px; }
.custom-task-entry { display: flex; gap: 8px; }
.custom-task-entry input { width: 100%; min-width: 0; min-height: 46px; border: 1px solid var(--input-border); border-radius: 12px; outline: none; padding: 10px 12px; color: var(--ink); background: var(--input-surface); font-size: 13px; }
.custom-task-entry input:focus { border-color: var(--sage); box-shadow: 0 0 0 3px rgba(142,165,125,.18); }
.remove-task-button { width: 46px; min-height: 46px; flex: 0 0 auto; border: 1px solid var(--danger-border); border-radius: 12px; color: var(--danger-text); background: var(--danger-surface); cursor: pointer; font-size: 23px; }
.space-dialog-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 15px; }
.button-soft { border: 1px solid var(--line); color: var(--deep); background: var(--paper); }
.space-dialog .form-status:not(:empty) { margin-top: 10px; }

.request-layout, .about-layout { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(260px, .8fr); align-items: start; gap: 20px; }
.request-form { padding: clamp(22px, 4vw, 34px); }
.form-heading { margin-bottom: 22px; }
.form-heading p { margin: 12px 0 0; color: var(--muted); font-size: 12px; }
.form-heading .enquiry-reassurance { margin-top: 8px; color: var(--deep); font-size: 11px; }
.form-heading .service-area-note { margin-top: 8px; color: var(--muted); font-size: 11px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 14px; }
.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 16px; }
.field label { color: var(--ink); font-size: 11px; font-weight: 700; }
.optional-label { color: var(--muted); font-weight: 400; }
.field input, .field select, .field textarea { width: 100%; min-height: 46px; border: 1px solid var(--input-border); border-radius: 12px; outline: none; padding: 11px 13px; color: var(--ink); background: var(--input-surface); font-size: 12px; transition: border-color .2s, box-shadow .2s; }
.field textarea { min-height: 125px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--sage); box-shadow: 0 0 0 3px rgba(142,165,125,.18); }
.field input::placeholder, .field textarea::placeholder { color: var(--placeholder); }
.submit-button { margin-top: 2px; }
.submit-button:disabled { cursor: wait; opacity: .72; }
.form-status { min-height: 0; margin: 12px 0 0; color: var(--deep); font-size: 11px; }
.form-status:not(:empty) { padding: 10px 12px; border-radius: 10px; background: var(--active-surface); }
.form-status.error:not(:empty) { color: var(--warning-text); background: var(--warning-surface); }
.form-note { margin: 12px 0 0; color: var(--muted); font-size: 10px; }
.form-note.offline-notice:not([hidden]) { padding: 10px 12px; border-radius: 10px; color: var(--warning-text); background: var(--warning-surface); }
.form-note a { color: var(--deep); font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }
.form-contact-options { display: flex; flex-wrap: wrap; align-items: center; gap: 7px 13px; margin-top: 12px; color: var(--muted); font-size: 10px; }
.form-contact-options a { color: var(--deep); font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }
.request-aside { overflow: hidden; border-radius: var(--radius); background: var(--photo-surface); color: white; box-shadow: var(--shadow); }
.request-photo { min-height: 210px; background: linear-gradient(0deg, var(--border-subtle), transparent), url("assets/home-card.jpg") center / cover; }
.aside-copy { padding: 23px; }
.aside-copy .eyebrow { color: var(--sage-light); }
.request-aside .aside-copy h2 { margin: 8px 0; font: 500 24px/1.2 "Playfair Display", Georgia, serif; white-space: normal; overflow-wrap: anywhere; }
.aside-copy > p:not(.eyebrow) { color: rgba(255,255,255,.75); font-size: 12px; }
.request-aside .aside-copy > :is(p, h2, a) { margin: 0; }
.request-aside .aside-copy > :is(p, h2, a) + :is(p, h2, a) { margin-top: 8px; }
.aside-copy a { display: inline-block; margin-top: 6px; color: var(--sage-light); font-size: 11px; font-weight: 700; }
.about-story h2 { max-width: 510px; margin: 17px 0 15px; color: var(--deep); font: 500 32px/1.2 "Playfair Display", Georgia, serif; }
.about-story p { color: var(--muted); font-size: 13px; }
.about-story .button { margin-top: 10px; }
.about-contact { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-top: 16px; }
.about-contact a { color: var(--deep); font-size: 12px; font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }
#data-storage { max-width: 860px; }
.data-backup { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px 20px; margin-top: 18px; }
.data-backup-copy h2 { margin: 9px 0 4px; color: var(--deep); font: 500 22px/1.2 "Playfair Display", Georgia, serif; }
.data-backup-copy p { max-width: 520px; margin: 0; color: var(--muted); font-size: 11px; }
.data-backup-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.data-backup-actions .button { min-height: 42px; padding: 0 14px; font-size: 10px; }
.backup-restore-status { grid-column: 1 / -1; margin: 0; color: var(--deep); font-size: 11px; overflow-wrap: anywhere; }
.backup-restore-status:empty { display: none; }
.backup-restore-status.error { color: var(--warning-text); }
.backup-restore-status a { color: var(--deep); font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }
.cloud-progress { grid-template-columns: minmax(0, 1fr); }
.cloud-progress #cloud-account { margin: 0; color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.cloud-progress #cloud-signin { justify-self: start; }
.cloud-progress .data-backup-actions .button { min-height: 44px; white-space: normal; }
.cloud-progress .button:disabled { opacity: .55; cursor: not-allowed; }
.about-services .pill { margin-bottom: 10px; }
.about-process { margin-top: 18px; }
.about-process-heading { display: flex; align-items: center; gap: 13px; margin-bottom: 15px; }
.about-process-heading h2 { margin: 0; color: var(--deep); font: 500 23px/1.2 "Playfair Display", Georgia, serif; }
.about-process-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin: 0; padding: 0; list-style: none; }
.about-process-steps li { display: grid; grid-template-columns: 33px 1fr; align-items: start; gap: 10px; }
.process-number { display: grid; width: 32px; height: 32px; place-items: center; border-radius: 11px; color: var(--deep); background: var(--active-surface); font-size: 9px; font-weight: 700; letter-spacing: .07em; }
.about-process-steps h3 { margin: 1px 0 3px; color: var(--deep); font: 500 17px/1.2 "Playfair Display", Georgia, serif; }
.about-process-steps p { margin: 0; color: var(--muted); font-size: 10px; }
.service-option { display: grid; grid-template-columns: 43px 1fr; gap: 12px; align-items: start; padding: 18px 0; border-bottom: 1px solid var(--line); }
.option-mark { display: grid; width: 38px; height: 38px; place-items: center; border-radius: 13px; color: var(--deep); background: var(--cream); font-size: 19px; }
.service-option h3 { margin: 1px 0 3px; color: var(--deep); font: 500 21px/1.2 "Playfair Display", Georgia, serif; }
.service-option p { margin: 0; color: var(--muted); font-size: 11px; }
.about-services .text-link { margin-top: 18px; }

.app-footer { border-top: 1px solid var(--border-09); background: var(--paper); }
.footer-inner { display: flex; width: min(1184px, 100%); min-height: 58px; align-items: center; justify-content: space-between; gap: 16px; margin: auto; padding: 10px 28px; color: var(--muted); font-size: 10px; }
.footer-inner a { color: var(--deep); font-weight: 700; }
.footer-brand-link { display: flex; min-width: 100px; flex-direction: column; align-items: center; gap: 1px; }
.footer-brand-link img, .footer-brand-link .logo-dark { width: 88px; height: auto; }
.footer-brand-link span { font-size: 8px; line-height: 1.2; }
.mobile-nav { display: none; }

@media (min-width: 1500px) { .welcome-hero { min-height: 440px; } }
@media (max-width: 900px) {
  .header-inner { min-height: 70px; padding: 0 20px; }
  .brand img, .brand .logo-dark { width: 140px; }
  .topnav { gap: 0; }
  .topnav button { padding: 0 11px; font-size: 11px; }
  .header-link { font-size: 10px; }
  .welcome-hero { min-height: 350px; }
  .hero-copy { padding: 56px 34px; }
  .content-wrap { padding-right: 22px; padding-left: 22px; }
  .summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .room-card-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .space-selector-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .checklist-layout { grid-template-columns: minmax(0, 1.3fr) minmax(220px, .7fr); }
}
@media (max-width: 760px) {
  .scroll-hint { display: block; margin: -6px 0 9px; color: var(--muted); font-size: 9px; text-align: right; }
  .scroll-hint span { color: var(--sage); font-size: 12px; }
  .room-card-grid, .service-grid { display: flex; align-items: stretch; overflow-x: auto; overscroll-behavior-inline: contain; scroll-snap-type: x mandatory; scroll-padding-inline: 22px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .room-card-grid::-webkit-scrollbar, .service-grid::-webkit-scrollbar { display: none; }
  .room-card-grid { gap: 12px; margin: 0 -22px; padding: 3px 22px 13px; }
  .room-card { flex: 0 0 52%; min-width: 148px; max-width: 230px; scroll-snap-align: start; }
  .service-grid { gap: 14px; margin: 0 -22px; padding: 2px 22px 15px; }
  .service-card { flex: 0 0 min(78%, 330px); }
  .room-card-grid:focus-visible, .service-grid:focus-visible { outline: 3px solid var(--sage); outline-offset: 3px; }
}
@media (max-width: 640px) {
  .room-card-grid, .service-grid { scroll-padding-inline: 18px; }
  .data-backup { grid-template-columns: 1fr; gap: 12px; }
  .data-backup-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .data-backup-actions .button { min-height: 44px; padding: 0 8px; font-size: 9px; }
  body { padding-bottom: calc(67px + env(safe-area-inset-bottom)); }
  .app-header { position: relative; }
  .header-inner { min-height: 68px; justify-content: center; padding: 8px 18px; }
  .brand img, .brand .logo-dark { width: 142px; }
  .brand span { font-size: 8px; }
  .topnav, .header-link { display: none; }
  .settings-button { position: absolute; top: 50%; right: 16px; transform: translateY(-50%); }
  .welcome-hero { min-height: 400px; }
  .hero-photo img { object-position: 58% center; }
  .hero-overlay { background: linear-gradient(90deg, rgba(var(--hero-rgb),.97), rgba(var(--hero-rgb),.82) 52%, rgba(var(--hero-rgb),.24)), linear-gradient(0deg, rgba(var(--hero-rgb),.15), transparent 60%); }
  .hero-copy { padding: 62px 23px 80px; }
  .hero-copy .eyebrow { font-size: 9px; }
  .hero-copy h1 { font-size: clamp(42px, 12vw, 56px); }
  .hero-description { max-width: 245px; font-size: 13px; }
  .hero-actions .button { font-size: 11px; line-height: 1.3; }
  .hero-note { right: 20px; bottom: 17px; font-size: 10px; }
  .content-wrap { padding: 36px 18px 46px; }
  .dashboard-content { padding-top: 32px; }
  .section-heading { align-items: end; margin-bottom: 14px; }
  .section-heading h2 { font-size: 27px; }
  .section-heading .eyebrow { font-size: 8px; }
  .privacy-note { max-width: 112px; font-size: 9px; }
  .summary-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .summary-card { min-height: 163px; padding: 15px; border-radius: 17px; }
  .summary-top { align-items: flex-start; gap: 7px; }
  .summary-icon { width: 25px; height: 25px; flex: 0 0 auto; font-size: 13px; }
  .summary-label { padding-top: 5px; font-size: 7px; letter-spacing: .09em; }
  .metric-line { flex-wrap: wrap; gap: 4px 7px; margin-top: 13px; }
  .metric { font-size: 38px; }
  .metric-caption, .summary-foot { font-size: 9px; }
  .rooms-summary .summary-foot { margin-top: 10px; }
  .summary-card .progress-track { margin: 10px 0 8px; }
  .spaces-heading, .service-heading { margin-top: 34px; }
  .spaces-heading .text-link { font-size: 9px; }
  .room-card-grid { gap: 10px; margin-right: -18px; margin-left: -18px; padding-right: 18px; padding-left: 18px; }
  .space-selector-grid { gap: 8px; margin: 0 -2px 17px; }
  .space-actions { justify-content: stretch; margin: -6px 0 13px; }
  .space-actions .button { width: 100%; min-height: 48px; }
  .space-choice { padding: 11px; border-radius: 14px; }
  .space-choice strong { font-size: 16px; }
  .room-card { flex-basis: 52%; min-width: 142px; max-width: 230px; padding: 14px; border-radius: 16px; }
  .room-emoji { width: 33px; height: 33px; border-radius: 11px; font-size: 16px; }
  .room-card-count { font-size: 8px; }
  .room-card h3 { margin-top: 11px; font-size: 18px; }
  .room-card p { font-size: 9px; }
  .room-card .progress-track { height: 6px; margin: 10px 0; }
  .room-card-action { font-size: 9px; }
  .service-grid { gap: 12px; margin-right: -18px; margin-left: -18px; padding-right: 18px; padding-left: 18px; }
  .about-process { margin-top: 13px; }
  .about-process-heading { align-items: flex-start; flex-direction: column; gap: 9px; }
  .about-process-steps { grid-template-columns: 1fr; gap: 13px; }
  .service-card { flex-basis: min(78%, 330px); min-height: 240px; border-radius: 16px; }
  .service-copy h3 { font-size: 22px; }
  .service-copy p { font-size: 11px; }
  .page-intro { margin-bottom: 24px; }
  .page-intro h1 { font-size: 43px; }
  .page-intro > p:last-child, #request .page-intro > p:not(.eyebrow) { font-size: 12px; }
  .room-tabs { margin-right: -18px; margin-left: -18px; padding-right: 18px; padding-left: 18px; }
  .room-tabs button { min-height: 40px; padding: 0 14px; font-size: 10px; }
  .checklist-layout, .request-layout, .about-layout { grid-template-columns: 1fr; gap: 13px; }
  .custom-task-heading { align-items: flex-start; }
  .custom-task-heading p { max-width: 180px; }
  .add-task-button { min-height: 42px; padding: 0 11px; font-size: 10px; }
  .space-dialog { max-height: calc(100dvh - 28px - env(safe-area-inset-top)); border-radius: 20px; }
  .space-dialog-form { padding: 20px 18px calc(20px + env(safe-area-inset-bottom)); }
  .space-dialog-actions .button { min-height: 46px; padding: 0 15px; font-size: 11px; }
  .panel { padding: 21px; border-radius: 18px; }
  .checklist-panel h2 { font-size: 27px; }
  .task { min-height: 56px; }
  .task label { font-size: 12px; }
  .progress-panel { position: static; padding: 22px; }
  .progress-illustration { width: 48px; height: 48px; border-radius: 16px; font-size: 22px; }
  .progress-panel h3 { font-size: 21px; }
  .room-metric { margin-top: 13px; font-size: 42px; }
  .note { margin-top: 14px; }
  .form-grid { grid-template-columns: 1fr; }
  .request-form { padding: 21px; }
  .request-aside { display: grid; grid-template-columns: 36% 1fr; }
  .request-photo { min-height: 100%; }
  .aside-copy { padding: 18px; }
  .aside-copy .eyebrow { font-size: 7px; }
  .request-aside .aside-copy h2 { font-size: clamp(18px, 3.8vw, 20px); }
  .aside-copy > p:not(.eyebrow) { font-size: 10px; }
  .footer-inner { min-height: 58px; padding: 8px 18px; font-size: 8px; }
  .footer-brand-link { min-width: 90px; }
  .footer-brand-link img, .footer-brand-link .logo-dark { width: 78px; }

}
@media (max-width: 560px) {
  .panel.schedule-panel { padding: 16px; }
  .schedule-heading { align-items: center; flex-wrap: wrap; }
  .schedule-heading .button { flex: 0 0 auto; }
  .schedule-item { grid-template-columns: minmax(0,1fr) auto; }
  .schedule-form-grid .field, .schedule-form-grid input, .schedule-form-grid select { width: 100%; min-width: 0; max-width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

/* Resettable Tips: scoped styles preserve the existing Home and inner views. */
/* Replace only the Tips i-dot; the bulb takes no space in the line box. */
#tipsTitle .tips-bulb-letter { position: relative; display: inline-block; }
#tipsTitle .tips-bulb-dot { position: absolute; bottom: .72em; left: 50%; width: .18em; height: .2em; transform: translateX(-50%); pointer-events: none; }
.tips-back { min-height: 44px; margin-bottom: 12px; }
.tips-collection { max-width: 760px; }
.tip-entry { width: 100%; max-width: 560px; min-width: 0; margin-inline: auto; overflow-wrap: anywhere; }
.tip-entry h2, .tip-entry h3 { margin: 0 0 14px; color: var(--deep); font: 500 clamp(23px, 4vw, 30px)/1.25 "Playfair Display", Georgia, serif; }
.tip-entry > p:not(.eyebrow) { margin: 12px 0 0; color: var(--muted); font-size: 14px; }
.tip-entry > p.tip-closing { color: var(--deep); font-weight: 600; }
.tip-entry img, .tip-discovery-image img { display: block; width: 100%; height: auto; object-fit: contain; }

.settings-option { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; margin-top: 18px; padding: 16px 20px; color: var(--deep); text-align: left; font-size: 14px; font-weight: 600; cursor: pointer; }
.settings-option:hover { background: var(--active-surface); }
.settings-option svg { width: 22px; height: 22px; flex: 0 0 auto; }
.settings-option .settings-option-chevron { margin-left: auto; width: 18px; height: 18px; }

.tips-section-title { margin: 0 0 14px; color: var(--deep); font: 500 25px/1.2 "Playfair Display", Georgia, serif; }
.tips-previous { margin-top: 28px; }
.tips-rows { display: grid; gap: 8px; }
.tip-row { display: flex; align-items: center; gap: 12px; width: 100%; min-width: 0; min-height: 76px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--paper); color: var(--deep); text-align: left; font-size: 13px; font-weight: 600; cursor: pointer; }
.tip-row:hover { background: var(--active-surface); }
.tip-row img { flex: 0 0 56px; width: 56px; height: 56px; object-fit: contain; border-radius: 6px; }
.tip-row > span:not(.tip-row-chevron) { min-width: 0; overflow-wrap: anywhere; }
.tip-row-chevron { flex: 0 0 auto; margin-left: auto; color: var(--sage); font-size: 24px; }

.tips-discover-heading { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; margin-bottom: 14px; }
.tips-discover-heading .tips-section-title { flex: 1 1 180px; margin: 0; }
.tips-shuffle { min-height: 44px; gap: 6px; padding: 0 12px; }
.tips-archive-link { min-height: 44px; margin-top: 8px; }

.tip-discovery-image { display: block; width: 100%; max-width: 560px; min-height: 44px; margin-inline: auto; padding: 0; border: 0; background: transparent; cursor: pointer; }

/* Centre only the main Tips collection; archive and detail layouts stay unchanged. */
#tipsCollection { margin-inline: auto; }
#featuredTip img, #discoveredTip img { border-radius: 12px; }
#discoveredTip .tip-discovery-image { max-width: 220px; }

/* Align collection images with their headings without affecting detail views. */
#featuredTip .tip-entry { margin-inline: 0; }
#discoveredTip .tip-discovery-image { margin-inline: 0; }
@media (min-width: 901px) {
  #discoveredTip .tip-discovery-image { max-width: 180px; }
}

/* Account tools use the same palette and controls as the rest of Settings. */
.account-panel { max-width: 520px; margin: 24px auto 0; padding: 28px; }
.account-panel h2 { color: var(--deep); font: 500 22px/1.3 "Playfair Display", Georgia, serif; }
.account-panel p, #account-account-status { overflow-wrap: anywhere; }
.account-note, #account-message { color: var(--muted); font-size: 13px; }
#account-message { margin: 16px 0; }
.account-panel fieldset { min-width: 0; border: 0; padding: 0; margin: 0; }
.account-panel form { display: grid; gap: 9px; }
.account-panel label { color: var(--deep); font-size: 13px; font-weight: 600; }
.account-panel input { min-width: 0; width: 100%; min-height: 48px; border: 1px solid var(--muted); border-radius: 10px; padding: 10px 12px; background: var(--paper); font-size: 16px; }
.account-panel form .button { margin-top: 7px; }
.account-panel button:disabled { opacity: .6; cursor: default; }
.account-panel .actions { display: flex; flex-wrap: wrap; gap: 10px; }
.account-tabs { display: flex; gap: 4px; border-radius: 14px; padding: 4px; margin-bottom: 22px; background: var(--soft); }
.account-tabs button { flex: 1; min-width: 0; min-height: 48px; border: 0; border-radius: 10px; padding: 8px; color: var(--deep); background: transparent; font-weight: 600; cursor: pointer; }
.account-tabs button[aria-selected="true"] { background: var(--accent-fill); color: var(--on-accent); }
.account-text-button { min-height: 44px; border: 0; padding: 8px 0; color: var(--deep); background: transparent; text-decoration: underline; cursor: pointer; font-size: 13px; }
#account-reset-panel { border-top: 1px solid var(--line); margin-top: 8px; padding-top: 12px; }
#account-message[data-error="true"] { color: var(--warning-text); }
@media (max-width: 480px) { .account-panel { padding: 20px; } .account-panel .actions { flex-direction: column; } }

.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }

/* Tablet layout: keep phone rules <=640px and full desktop rules >=1181px.
   At 900px the checklist and header need another row to remain comfortable. */
@media (min-width: 641px) and (max-width: 1180px) {
  .header-inner { gap: 12px; padding: 12px 28px; }
  .topnav { flex-wrap: wrap; justify-content: center; }
  .topnav button { min-height: 44px; padding: 0 12px; font-size: 12px; }
  .settings-button { width: 44px; height: 44px; }
  .header-link { display: inline-flex; align-items: center; min-height: 44px; white-space: normal; text-align: center; }
  .content-wrap { max-width: 1100px; padding: 36px 28px 56px; }
  .hero-copy { padding: 52px 36px 68px; }
  .hero-description { max-width: 420px; }
  .section-heading { flex-wrap: wrap; gap: 12px; }
  .summary-grid { gap: 18px; }
  .summary-card { min-width: 0; padding: 22px; }
  .summary-label { font-size: 10px; }
  .metric-line { flex-wrap: wrap; }
  .room-card-grid, .service-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 18px; margin: 0; padding: 0; overflow: visible; scroll-snap-type: none;
  }
  .room-card { min-width: 0; max-width: none; padding: 20px; }
  .room-card p, .service-copy p { font-size: 13px; }
  .room-card-action { min-height: 44px; font-size: 12px; }
  .scroll-hint { display: none; }
  .space-selector-grid { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; }
  .room-tabs { flex-wrap: wrap; overflow: visible; padding-bottom: 14px; }
  .room-tabs button { min-height: 44px; white-space: normal; }
  .space-choice strong, .room-card h3 { overflow-wrap: anywhere; }
  .checklist-layout { grid-template-columns: minmax(0, 1fr) minmax(240px, .55fr); gap: 20px; }
  .checklist-layout > *, .request-layout > *, .about-layout > * { min-width: 0; }
  .panel-heading { flex-wrap: wrap; }
  .task label { min-width: 0; min-height: 44px; overflow-wrap: anywhere; font-size: 14px; }
  .task-list, .reset-session, .goal-editor { min-width: 0; }
  .session-prompt, .session-details, .session-message { font-size: 12px; overflow-wrap: anywhere; }
  .session-duration-options { flex-wrap: wrap; }
  .session-duration { flex: 1 1 80px; font-size: 12px; }
  .session-countdown { font-size: 36px; }
  .progress-panel { position: static; }
  .service-explore, .schedule-heading .button, .schedule-manage summary, .schedule-item-actions button,
  .goal-add-button, .goal-actions .text-link, .goal-save, .reset-checklist,
  .custom-space-controls .text-link, .helping-hand .text-link, .settings-back,
  .add-task-button, .data-backup-actions .button, .text-link { min-height: 44px; }
  .schedule-item { padding: 12px; }
  .schedule-item p, .schedule-description, .schedule-item-actions button { font-size: 12px; }
  .schedule-manage[open] .schedule-item-actions { min-width: 180px; }
  .schedule-status { font-size: 11px; }
  .request-layout { grid-template-columns: minmax(0, 1fr); }
  .request-form { max-width: 760px; width: 100%; margin-inline: auto; }
  .request-aside { display: grid; grid-template-columns: minmax(0, .7fr) minmax(0, 1fr); }
  .request-photo { min-height: 100%; }
  .field input, .field select, .field textarea, .custom-task-entry input,
  .space-dialog .field input, .space-dialog .field select { min-width: 0; max-width: 100%; font-size: 16px; }
  .field, .custom-task-entry { min-width: 0; }
  .space-dialog { max-height: calc(100dvh - 40px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); }
  .space-dialog-form { padding-bottom: calc(28px + env(safe-area-inset-bottom)); }
  .dialog-close { width: 44px; height: 44px; }
  .space-dialog-heading > div { min-width: 0; overflow-wrap: anywhere; }
  .space-dialog-actions { flex-wrap: wrap; }
  #settings { max-width: 860px; }
  .data-backup { grid-template-columns: minmax(0, 1fr); }
  .data-backup-actions { justify-content: flex-start; }
  .data-backup-copy p { font-size: 13px; }
  .account-panel { width: 100%; max-width: 520px; }
  .account-panel .actions .button { flex: 1 1 180px; white-space: normal; padding-block: 12px; }
  .footer-inner { flex-wrap: wrap; }
}

@media (min-width: 641px) and (max-width: 900px) {
  .header-inner { flex-wrap: wrap; justify-content: space-between; }
  .topnav { order: 3; flex: 1 0 100%; gap: 4px; }
  .topnav button { flex: 1; }
  .header-link { display: none; }
  .checklist-layout, .about-layout { grid-template-columns: minmax(0, 1fr); }
  .about-process-steps { grid-template-columns: minmax(0, 1fr); }
}

/* Large tablets can have desktop-sized viewports; retain their grid geometry
   while making controls comfortable to tap, including with a trackpad attached. */
@media (min-width: 1181px) and (max-width: 1400px) and (any-pointer: coarse) {
  .topnav button, .room-tabs button, .text-link, .room-card-action,
  .schedule-manage summary, .schedule-item-actions button, .goal-save,
  .settings-back, .add-task-button, .data-backup-actions .button { min-height: 44px; }
  .settings-button, .dialog-close { width: 44px; height: 44px; }
  .field input, .field select, .field textarea, .custom-task-entry input,
  .space-dialog .field input, .space-dialog .field select { font-size: 16px; }
}

/* Installed tablet PWAs use the same width rules and respect device insets. */
@media (min-width: 641px) and (max-width: 1400px) and (display-mode: standalone) {
  .app-header { padding-top: env(safe-area-inset-top); }
  .content-wrap, .header-inner, .footer-inner {
    padding-left: max(28px, env(safe-area-inset-left));
    padding-right: max(28px, env(safe-area-inset-right));
  }
  .app-footer { padding-bottom: env(safe-area-inset-bottom); }
}

/* Shared bottom navigation uses the same DOM and data-view handlers on all touch layouts. */
@media (max-width: 1180px), (min-width: 1181px) and (max-width: 1400px) and (any-pointer: coarse) {
  .mobile-nav { position: fixed; z-index: 30; right: 0; bottom: 0; left: 0; display: grid; grid-template-columns: repeat(4, 1fr); padding: 6px 8px calc(7px + env(safe-area-inset-bottom)); border-top: 1px solid var(--border-1); background: var(--nav-surface); backdrop-filter: blur(16px); }
  .mobile-nav button { display: flex; min-height: 48px; flex-direction: column; align-items: center; justify-content: center; gap: 1px; border: 0; border-radius: 13px; color: var(--nav-text); background: transparent; cursor: pointer; font-size: 8px; font-weight: 600; }
  .mobile-nav button span { font-size: 18px; line-height: 1.1; }
  .mobile-nav button svg { display: block; flex: 0 0 auto; }
  .mobile-nav button[data-view="home"] svg { width: 23px; height: 23px; }
  .mobile-nav button[data-view="rooms"] svg { width: 20px; height: 20px; }
  .mobile-nav button.active { color: var(--deep); background: var(--active-surface); }
}
@media (min-width: 641px) and (max-width: 1180px), (min-width: 1181px) and (max-width: 1400px) and (any-pointer: coarse) {
  body { padding-bottom: calc(85px + env(safe-area-inset-bottom)); }
  html { scroll-padding-bottom: calc(85px + env(safe-area-inset-bottom)); }
  .topnav { display: none; }
  .header-inner { flex-wrap: nowrap; justify-content: space-between; }
  .mobile-nav { padding-inline: max(20px, env(safe-area-inset-left)) max(20px, env(safe-area-inset-right)); }
  .mobile-nav button { min-height: 56px; font-size: 11px; gap: 3px; }
  .space-dialog { max-height: calc(100dvh - 110px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); }
}

/* Appearance controls are a dedicated Settings view, with native radio keyboard support. */
.appearance-panel { max-width: 560px; margin-inline: auto; }
.appearance-options { min-width: 0; border: 0; padding: 0; margin: 0; }
.appearance-options legend { margin-bottom: 16px; color: var(--deep); font-weight: 600; }
.appearance-options label { display: flex; align-items: center; gap: 14px; padding: 16px; margin-top: 10px; border: 1px solid var(--line); border-radius: 14px; cursor: pointer; }
.appearance-options label:has(input:checked) { background: var(--active-surface); border-color: var(--sage); }
.appearance-options input { width: 22px; height: 22px; flex-shrink: 0; accent-color: var(--deep); }
.appearance-options strong, .appearance-options small { display: block; }
.appearance-options small { margin-top: 4px; color: var(--muted); font-size: 13px; }
#appearance-status { font-size: 13px; color: var(--muted); }
#appearance-status[data-error="true"] { color: var(--warning-text); }
/* One original silhouette, coloured by the same token as both logo captions. */
.brand .logo-dark, .footer-brand-link .logo-dark {
  display: none;
  aspect-ratio: 614 / 160;
  color: var(--deep);
  background-color: currentColor;
  -webkit-mask: url("assets/resettable-logo-mask.svg") center / contain no-repeat;
  mask: url("assets/resettable-logo-mask.svg") center / contain no-repeat;
}
:root[data-theme="dark"] .brand .logo-light,
:root[data-theme="dark"] .footer-brand-link .logo-light { display: none; }
:root[data-theme="dark"] .brand .logo-dark,
:root[data-theme="dark"] .footer-brand-link .logo-dark { display: block; }
:root[data-theme="dark"] input::placeholder, :root[data-theme="dark"] textarea::placeholder { color: var(--placeholder); }
:root[data-theme="dark"] .task input { accent-color: var(--accent-fill); }
:root[data-theme="dark"] .button-dark:hover { color: var(--on-accent); }
