:root {
  --paper: #f6f7f3;
  --surface: #ffffff;
  --surface-soft: #eef2ed;
  --ink: #20302d;
  --muted: #74807c;
  --line: #dfe5df;
  --brand: #254f4b;
  --brand-hover: #193f3b;
  --brand-gradient: #326b63;
  --brand-soft: #dfeee9;
  --accent: #efb166;
  --accent-soft: #faf0e2;
  --paper-glow: rgba(229, 239, 233, .85);
  --surface-translucent: rgba(255, 255, 255, .84);
  --surface-nav: rgba(252, 253, 250, .94);
  --card-border: rgba(209, 219, 211, .8);
  --today-gradient-end: rgba(240, 246, 241, .96);
  --brand-shadow: rgba(37, 79, 75, .17);
  --shadow-color: rgba(31, 54, 49, .09);
  --holiday: #c85454;
  --shadow: 0 18px 50px var(--shadow-color);
  --radius-lg: 26px;
  --radius-md: 18px;
  --radius-sm: 12px;
  --personal: #4f7cac;
  --family: #5b8f72;
  --work: #80669d;
  --study: #c88743;
  --other: #7d8588;
  --weather-sun: #a86f00;
  --weather-sun-fill: #f4c54a;
  --weather-cloud: #6e7d8c;
  --weather-rain: #1f78bb;
  --weather-snow: #3c809f;
  --weather-thunder: #8252c7;
  --mobile-nav-height: calc(66px + env(safe-area-inset-bottom));
}

:root[data-theme="yamabuki"] {
  --paper: #f7f2e7;
  --surface: #fffdf8;
  --surface-soft: #f2ead9;
  --ink: #3d3428;
  --muted: #786c5a;
  --line: #e2d6c0;
  --brand: #8a6e3e;
  --brand-hover: #70572e;
  --brand-gradient: #a38954;
  --brand-soft: #eee2c5;
  --accent: #c9ae72;
  --accent-soft: #f6edd9;
  --paper-glow: rgba(235, 220, 188, .72);
  --surface-translucent: rgba(255, 253, 248, .88);
  --surface-nav: rgba(251, 247, 238, .95);
  --card-border: rgba(219, 205, 178, .82);
  --today-gradient-end: rgba(247, 240, 224, .97);
  --brand-shadow: rgba(138, 110, 62, .18);
  --shadow-color: rgba(83, 66, 37, .09);
}

:root[data-theme="asagi"] {
  --paper: #eef6f7;
  --surface: #fbfefe;
  --surface-soft: #deecee;
  --ink: #19383d;
  --muted: #607b7f;
  --line: #c9dde0;
  --brand: #2f7782;
  --brand-hover: #245f68;
  --brand-gradient: #438993;
  --brand-soft: #d4e9ec;
  --accent: #82afb5;
  --accent-soft: #e1eff1;
  --paper-glow: rgba(194, 225, 230, .72);
  --surface-translucent: rgba(251, 254, 254, .88);
  --surface-nav: rgba(244, 250, 250, .95);
  --card-border: rgba(190, 216, 220, .84);
  --today-gradient-end: rgba(230, 242, 244, .97);
  --brand-shadow: rgba(47, 119, 130, .18);
  --shadow-color: rgba(29, 77, 84, .09);
}

:root[data-theme="sakura"] {
  --paper: #faf2f4;
  --surface: #fffdfd;
  --surface-soft: #f3e5e9;
  --ink: #403137;
  --muted: #7c6870;
  --line: #e4d2d8;
  --brand: #8d5e6c;
  --brand-hover: #724956;
  --brand-gradient: #a77482;
  --brand-soft: #efdee3;
  --accent: #c99ba7;
  --accent-soft: #f5e7ea;
  --paper-glow: rgba(239, 211, 220, .7);
  --surface-translucent: rgba(255, 253, 253, .88);
  --surface-nav: rgba(252, 247, 249, .95);
  --card-border: rgba(226, 205, 212, .84);
  --today-gradient-end: rgba(248, 234, 238, .97);
  --brand-shadow: rgba(141, 94, 108, .18);
  --shadow-color: rgba(83, 50, 61, .09);
}

* { box-sizing: border-box; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
[hidden] { display: none !important; }

html { color-scheme: light; background: var(--paper); }
html:has(dialog[open]), body:has(dialog[open]) { overflow: hidden; }

body {
  margin: 0;
  min-width: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background:
    radial-gradient(circle at 8% 4%, var(--paper-glow), transparent 24rem),
    var(--paper);
  color: var(--ink);
  font-family: Inter, "SF Pro Text", "Segoe UI", "Noto Sans TC", "Microsoft JhengHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font: inherit; }
button { color: inherit; }
button, label, select { -webkit-tap-highlight-color: transparent; }

.app-shell {
  display: grid;
  grid-template-columns: 214px minmax(0, 1fr) 318px;
  min-height: 100vh;
}

body.onboarding-open { overflow: hidden; }
body.category-drawer-open { overflow: hidden; }
html[data-onboarding="complete"] .onboarding-screen { display: none; }

.onboarding-screen {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  min-height: 100dvh;
  place-items: center;
  overflow: auto;
  padding: max(24px, env(safe-area-inset-top)) 18px max(24px, env(safe-area-inset-bottom));
  background:
    radial-gradient(circle at 12% 12%, rgba(223, 238, 233, .92), transparent 34rem),
    radial-gradient(circle at 88% 88%, rgba(243, 184, 107, .13), transparent 26rem),
    var(--paper);
}

.onboarding-card {
  width: min(100%, 440px);
  padding: clamp(30px, 7vw, 48px);
  border: 1px solid rgba(205, 216, 209, .84);
  border-radius: 34px;
  background: rgba(255, 255, 255, .93);
  box-shadow: 0 28px 80px rgba(31, 54, 49, .13);
  text-align: center;
}

.onboarding-wordmark {
  display: block;
  width: min(100%, 236px);
  height: auto;
  margin: 0 auto 22px;
}

.onboarding-eyebrow {
  margin-bottom: 9px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .2em;
}

.onboarding-card h1 {
  max-width: 340px;
  margin: 0 auto 12px;
  font-size: clamp(28px, 7vw, 38px);
  line-height: 1.08;
}

.onboarding-body {
  max-width: 330px;
  margin: 0 auto 8px;
  color: #53635f;
  font-size: 14px;
  line-height: 1.65;
}

.onboarding-sign-in-hint {
  margin: 0 auto 22px;
  color: var(--brand);
  font-size: 12px;
  font-weight: 700;
}

.onboarding-auth-options { display: grid; gap: 9px; }

.onboarding-auth-button,
.onboarding-local-button {
  display: grid;
  min-height: 48px;
  width: 100%;
  align-items: center;
  border-radius: 14px;
  cursor: pointer;
}

.onboarding-auth-button {
  grid-template-columns: 30px 1fr 30px;
  border: 1px solid var(--line);
  padding: 0 14px;
  background: #fff;
}

.onboarding-auth-button::after { content: ""; }
.onboarding-auth-button:hover { border-color: #b8c9c3; background: #f9fbf9; }
.onboarding-auth-button > span {
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border-radius: 50%;
  background: var(--surface-soft);
  color: var(--brand);
  font-size: 11px;
  font-weight: 850;
}
.onboarding-auth-button b { font-size: 13px; }
.onboarding-auth-button:disabled { cursor: wait; opacity: .6; }

.onboarding-divider {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
  margin: 18px 0 14px;
  color: var(--muted);
  font-size: 10px;
}
.onboarding-divider::before,
.onboarding-divider::after { content: ""; height: 1px; background: var(--line); }

.onboarding-local-button {
  border: 0;
  padding: 0 16px;
  background: var(--brand);
  color: #fff;
  font-size: 13px;
  font-weight: 750;
  box-shadow: 0 10px 24px rgba(37, 79, 75, .18);
}

.onboarding-local-hint,
.onboarding-privacy,
.onboarding-status {
  margin: 9px auto 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}

.onboarding-status:not(:empty) {
  padding: 9px 11px;
  border-radius: 10px;
  background: var(--surface-soft);
  color: var(--ink);
}
.onboarding-status[data-state="error"] { background: #f9ecea; color: #8b3b32; }
.onboarding-privacy { margin-top: 16px; }

.plus-setting > span { min-width: 0; }
.plus-setting small { max-width: 640px; }

.modal.plus-modal {
  width: min(760px, calc(100vw - 28px));
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  overflow: hidden;
}
.plus-modal > div {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: 100%;
  max-height: calc(100vh - 34px);
  max-height: calc(100dvh - 34px);
  overflow: hidden;
}
.plus-modal > div > .modal-header {
  align-items: center;
  gap: 16px;
  margin: 0;
  padding: 20px 22px 16px;
  border-bottom: 1px solid var(--line);
}
.plus-modal > div > .modal-header > div { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.plus-modal > div > .modal-header .icon-button { width: 44px; height: 44px; flex-shrink: 0; }
.plus-content {
  min-width: 0;
  min-height: 0;
  padding: 18px 22px 24px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scroll-padding-block: 18px 24px;
}
.plus-modal > div > .modal-actions { margin: 0; padding: 16px 22px 20px; }
.plus-intro { max-width: 580px; margin: 0 0 18px; color: var(--muted); line-height: 1.6; }
.plus-plan-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.plus-plan {
  position: relative;
  min-width: 0;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--surface);
}
.plus-plan.premium {
  border-color: rgba(37, 79, 75, .34);
  background: linear-gradient(145deg, #f7fbf8, #edf4f0);
  box-shadow: 0 16px 40px rgba(37, 79, 75, .09);
}
.plus-plan-badge {
  display: inline-flex;
  width: fit-content;
  min-height: 24px;
  align-items: center;
  margin-bottom: 16px;
  padding: 0 9px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .05em;
}
.plus-plan.premium .plus-plan-badge { background: var(--brand); color: #fff; }
.plus-plan h3 { margin-bottom: 5px; font-size: 19px; }
.plus-plan-price { display: block; min-height: 32px; color: var(--brand); font-size: 22px; }
.plus-plan-renewal { min-height: 38px; margin: 7px 0 0; color: #53635f; font-size: 11px; line-height: 1.55; }
.plus-plan ul { display: grid; gap: 10px; margin: 18px 0 0; padding: 0; list-style: none; }
.plus-plan li { position: relative; padding-left: 19px; color: #53635f; font-size: 12px; line-height: 1.5; }
.plus-plan li::before { content: "✓"; position: absolute; left: 0; color: var(--brand); font-weight: 900; }
.plus-benefits {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface-soft);
}
.plus-benefits span { position: relative; padding-left: 19px; color: #53635f; font-size: 11px; line-height: 1.55; }
.plus-benefits span::before { content: "✓"; position: absolute; left: 0; color: var(--brand); font-weight: 900; }
.plus-disclosure {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 16px;
  padding: 13px 14px;
  border-radius: 14px;
  background: #fff7eb;
  color: #725735;
}
.plus-disclosure i {
  display: grid;
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  background: var(--accent);
  color: #3f382f;
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
}
.plus-disclosure p { margin: 0; font-size: 11px; line-height: 1.5; }

@media (max-width: 620px) {
  .plus-content { padding-inline: 16px; }
  .plus-plan-grid { grid-template-columns: 1fr; }
  .plus-plan { padding: 19px; }
  .plus-benefits { grid-template-columns: 1fr; }
}

.side-rail {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding: 26px 18px 22px;
  border-right: 1px solid var(--line);
  background: rgba(250, 251, 248, .88);
  backdrop-filter: blur(20px);
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 3;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  width: auto;
  max-width: 100%;
  padding: 4px 5px 24px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.brand-mark:focus { outline: none; }
.brand-mark:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; }
.brand-mark > img { display: block; width: 132px; max-width: 100%; height: auto; }

.primary-nav { display: grid; gap: 7px; }
.rail-spacer { flex: 1; }

.nav-button {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 46px;
  padding: 8px 11px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: background .18s ease, color .18s ease, transform .18s ease;
}

.nav-button:hover { background: #eef2ed; color: var(--ink); transform: translateY(-1px); }
.nav-button.active { color: var(--brand); background: var(--brand-soft); font-weight: 700; }
.nav-icon {
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  border-radius: 9px;
  border: 1px solid currentColor;
  font-size: 11px;
}

.sync-note {
  display: grid;
  grid-template-columns: 10px 1fr;
  margin-top: 15px;
  padding: 13px;
  border-radius: 14px;
  background: var(--surface-soft);
}
.sync-note i { width: 7px; height: 7px; margin-top: 5px; border-radius: 50%; background: var(--accent); }
.sync-note span { font-size: 12px; font-weight: 700; }
.sync-note small { grid-column: 2; color: var(--muted); font-size: 10px; margin-top: 2px; }

.workspace { min-width: 0; padding: 28px clamp(24px, 3vw, 52px) 54px; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  max-width: 1040px;
  margin: 0 auto 24px;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .16em;
}

h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: clamp(27px, 3vw, 38px); line-height: 1.1; letter-spacing: -.04em; }
h2 { margin-bottom: 4px; font-size: 22px; letter-spacing: -.025em; }
h3 { margin-bottom: 8px; font-size: 15px; }

.top-actions, .inline-actions { display: flex; align-items: center; gap: 10px; }

.primary-button, .quiet-button, .icon-button, .danger-link {
  border: 0;
  border-radius: 12px;
  cursor: pointer;
}

.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 42px;
  padding: 0 17px;
  background: var(--brand);
  color: #fff;
  font-weight: 750;
  box-shadow: 0 8px 18px var(--brand-shadow);
}
.primary-button:hover { background: var(--brand-hover); }

.quiet-button {
  min-height: 40px;
  padding: 0 15px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font-weight: 650;
}
.quiet-button:hover { background: var(--surface-soft); }

.icon-button {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  background: transparent;
  color: var(--muted);
  font-size: 25px;
}
.icon-button:hover { background: var(--surface-soft); color: var(--ink); }
.icon-button:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

.view { max-width: 1040px; margin: 0 auto; }

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(240px, .75fr);
  gap: 18px;
}
.hero-grid.weather-hidden { grid-template-columns: 1fr; }

.today-card, .weather-card, .section-card, .date-card, .calendar-shell {
  border: 1px solid var(--card-border);
  background: var(--surface-translucent);
  box-shadow: var(--shadow);
}

.today-card {
  min-height: 250px;
  padding: clamp(24px, 4vw, 38px);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(135deg, rgba(255,255,255,.98), var(--today-gradient-end)),
    var(--surface);
}

.today-date { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.today-date strong { display: block; font-size: clamp(48px, 8vw, 76px); font-weight: 620; line-height: .95; letter-spacing: -.07em; }
.today-date span { display: block; margin-top: 10px; color: var(--muted); font-size: 14px; }

.weather-svg.weather-sun { color: var(--weather-sun); }
.weather-svg.weather-sun circle { fill: var(--weather-sun-fill); }
.weather-svg.weather-cloud { color: var(--weather-cloud); }
.weather-svg.weather-rain { color: var(--weather-rain); }
.weather-svg.weather-snow { color: var(--weather-snow); }
.weather-svg.weather-thunder { color: var(--weather-thunder); }

.weather-inline { display: flex; align-items: center; gap: 8px; color: var(--brand); }
.weather-inline .weather-svg { width: 28px; height: 28px; }
.weather-inline b { font-size: 22px; font-weight: 620; }
.weather-inline small { display: block; margin-top: 1px; color: var(--muted); font-size: 9px; text-align: right; }

.apple-calendar-mirror-setting { margin-bottom: 16px; }
.apple-calendar-mirror-setting > span > small { display: block; margin-top: 8px; }
.apple-calendar-mirror-setting [role="status"] { font-weight: 700; color: var(--brand); }
.apple-calendar-mirror-setting[data-state="error"] [role="status"],
.apple-calendar-mirror-setting[data-state="review"] [role="status"],
.apple-calendar-mirror-setting[data-state="permission"] [role="status"] { color: var(--holiday); }

.health-summary {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  width: fit-content;
  max-width: 100%;
  padding: 6px 9px;
  border: 1px solid #dce1de;
  border-radius: 9px;
  background: #f0f2f0;
  color: #68716e;
  font-size: 10px;
}
.health-summary-today { margin-top: 15px; }
.health-summary-today + .next-up { margin-top: 22px; }
.health-summary-month-toolbar { flex: 0 0 auto; min-height: 42px; padding-inline: 13px; border-radius: 13px; background: var(--surface); font-size: 10px; white-space: nowrap; }
.health-summary-month-toolbar.health-summary-empty { color: var(--muted); }
.health-summary b { color: #3f4946; font-weight: 760; }
.health-summary > i, .health-day-summary > i { width: 2px; height: 2px; border-radius: 50%; background: #98a09d; }
.health-demo-badge { padding: 2px 5px; border-radius: 99px; background: #dfe3e0; color: #5d6663; font-size: 7px; font-style: normal; font-weight: 800; letter-spacing: .03em; text-transform: uppercase; }

.next-up { margin-top: 36px; }
.next-up-label { color: var(--muted); font-size: 11px; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }
.next-up h2 { margin: 7px 0 5px; font-size: clamp(22px, 3vw, 31px); }
.next-up p { margin-bottom: 0; color: var(--muted); }

.weather-card {
  --weather-sun: #f6cc58;
  --weather-sun-fill: #f6cc58;
  --weather-cloud: #dee5ee;
  --weather-rain: #8dd4ff;
  --weather-snow: #b5e8f5;
  --weather-thunder: #e6ccff;
  display: flex; flex-direction: column; padding: 24px; border-radius: var(--radius-lg); background: var(--brand); color: #fff;
}
.weather-card .eyebrow { color: rgba(255,255,255,.62); }
.weather-card header { display: flex; justify-content: space-between; gap: 15px; }
.weather-card .weather-svg { width: 42px; height: 42px; }
.weather-card h2 { font-size: 27px; }
.weather-card p { margin-bottom: 0; color: rgba(255,255,255,.7); font-size: 12px; }
.weather-strip { display: grid; grid-template-columns: repeat(5, 1fr); gap: 5px; margin-top: auto; padding-top: 25px; }
.weather-day { text-align: center; font-size: 10px; color: rgba(255,255,255,.65); }
.weather-day .weather-svg { display: block; width: 20px; height: 20px; margin: 7px auto; }
.weather-day b { color: #fff; font-weight: 700; }
.source-link { color: rgba(255,255,255,.72); font-size: 10px; text-decoration: none; border-bottom: 1px solid rgba(255,255,255,.28); }
.source-button { padding: 0; border: 0; background: transparent; cursor: pointer; }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(250px, .65fr); gap: 18px; margin-top: 18px; }
.section-card { padding: 22px; border-radius: var(--radius-md); box-shadow: 0 9px 30px rgba(31,54,49,.055); }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 15px; margin-bottom: 15px; }
.section-head p { margin: 0; color: var(--muted); font-size: 12px; }
.text-button { padding: 4px 0; border: 0; background: none; color: var(--brand); font-weight: 750; cursor: pointer; }

.timeline { position: relative; display: grid; gap: 10px; }
.timeline::before { content: ""; position: absolute; top: 10px; bottom: 10px; left: 92px; width: 1px; background: var(--line); }
.event-row { display: grid; grid-template-columns: 80px 24px minmax(0, 1fr); align-items: center; gap: 10px; min-height: 52px; padding: 7px 8px; border-radius: 12px; cursor: pointer; }
.event-row:hover { background: var(--surface-soft); }
.event-time { color: var(--muted); font-size: 11px; text-align: right; }
.event-dot { width: 8px; height: 8px; border-radius: 50%; z-index: 1; box-shadow: 0 0 0 3px #fff; }
.event-main b { display: block; font-size: 13px; }
.event-main small { color: var(--muted); }
.event-check { position: relative; z-index: 1; display: grid; place-items: center; width: 24px; height: 24px; padding: 0; border: 2px solid var(--event-color); border-radius: 50%; background: #fff; color: #fff; font-size: 12px; font-weight: 850; cursor: pointer; box-shadow: 0 0 0 3px #fff; }
.event-check:hover, .event-check.checked { background: var(--event-color); }
.event-check.recurring { border-width: 2px; }
.event-check.compact { width: 26px; height: 26px; border-width: 1.5px; box-shadow: none; }
.event-repeat-mark { position: relative; z-index: 1; display: grid; place-items: center; width: 24px; height: 24px; border: 1px solid var(--line); border-radius: 50%; background: #fff; color: var(--brand); font-size: 13px; font-weight: 800; box-shadow: 0 0 0 3px #fff; }
.event-repeat-mark.compact { width: 26px; height: 26px; box-shadow: none; }
.event-row.checked, .tomorrow-item.checked, .panel-entry.checked { opacity: .58; }
.event-row.checked .event-main b, .tomorrow-item.checked b, .panel-entry.checked b { text-decoration: line-through; text-decoration-thickness: 1px; }

.empty-state { padding: 28px 12px; color: var(--muted); text-align: center; }
.empty-state b { display: block; margin-bottom: 5px; color: var(--ink); }

.tomorrow-list, .date-list { display: grid; gap: 10px; }
.tomorrow-item, .date-compact {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 11px;
  align-items: center;
  padding: 12px;
  border-radius: 13px;
  background: var(--surface-soft);
  cursor: pointer;
}
.tomorrow-item > span:first-child { color: var(--muted); font-size: 11px; }
.tomorrow-item b, .date-compact b { display: block; font-size: 12px; }
.tomorrow-item small, .date-compact small { color: var(--muted); }
.countdown { min-width: 40px; text-align: right; color: var(--brand); font-size: 11px; font-weight: 750; }

.calendar-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.calendar-toolbar h2 { margin: 0; min-width: 170px; text-align: center; }
.month-nav { display: flex; align-items: center; gap: 8px; }
.month-settings-button { display: none; }
.calendar-search-button { display: grid; flex: 0 0 44px; place-items: center; width: 44px; height: 44px; padding: 0; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--brand); cursor: pointer; }
.calendar-search-button svg { width: 22px; height: 22px; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.month-search-button { display: none; }
.entry-copy-tools { display: flex; justify-content: flex-end; margin: -8px 0 0; }
.entry-copy-tools button { min-height: 44px; font-size: 14px; }
.entry-copy-hint { margin: 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: 16px; background: var(--brand-soft); color: var(--brand); font-size: 14px; line-height: 1.6; overflow-wrap: anywhere; }
#entry-search-dialog { width: min(620px, calc(100vw - 28px)); height: min(760px, calc(var(--entry-search-height, 100dvh) - 40px)); overflow: hidden; }
#entry-search-form { display: flex; flex-direction: column; height: 100%; min-height: 0; padding: 0; overflow: hidden; }
#entry-search-form .modal-header { flex: 0 0 auto; align-items: center; gap: 12px; margin: 0; padding: 20px 22px 14px; }
#entry-search-title { min-width: 0; margin: 0; font-size: 22px; overflow-wrap: anywhere; }
#entry-search-form .modal-header .icon-button { flex: 0 0 44px; width: 44px; height: 44px; }
.entry-search-controls { flex: 0 1 auto; min-height: 0; padding: 0 22px 12px; border-bottom: 1px solid var(--line); overflow-y: auto; }
.entry-search-scope, .entry-search-hint { margin: 0 0 10px; color: var(--muted); font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; }
.entry-search-controls input { box-sizing: border-box; width: 100%; min-width: 0; min-height: 44px; font-size: 16px; }
.entry-search-dates { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; margin: 12px 0; }
.entry-search-dates .field > span { font-size: 13px; }
.entry-search-status { margin: 0; color: var(--brand); font-size: 14px; line-height: 1.5; }
.entry-search-results { flex: 1 1 auto; min-height: 72px; padding: 4px 22px; overflow-y: auto; overscroll-behavior: contain; }
.entry-search-result { display: flex; align-items: center; justify-content: space-between; gap: 12px; box-sizing: border-box; width: 100%; min-height: 64px; padding: 14px 0 14px 12px; border: 0; border-bottom: 1px solid var(--line); border-left: 3px solid var(--event-color); background: transparent; color: var(--ink); text-align: start; cursor: pointer; }
.entry-search-result > span { display: grid; min-width: 0; gap: 5px; }
.entry-search-result b { font-size: 16px; line-height: 1.45; overflow-wrap: anywhere; }
.entry-search-result small { color: var(--muted); font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; }
.entry-search-result .entry-search-note { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.entry-search-result i { flex-shrink: 0; color: var(--muted); font-size: 24px; font-style: normal; }
.entry-search-footer { flex: 0 0 auto; padding: 10px 22px 18px; text-align: center; }
.entry-search-footer:not(:has(button:not([hidden]))) { padding-top: 0; }
@media (max-width: 700px) {
  body[data-view="month"] .calendar-toolbar::before { content: none; }
  body[data-view="month"] .month-search-button { display: grid; }
  #entry-search-dialog { width: 100%; height: var(--entry-search-height, 100dvh); max-height: var(--entry-search-height, 100dvh); margin: 0; border-radius: 22px 22px 0 0; }
  #entry-search-form .modal-header { padding: max(14px, env(safe-area-inset-top)) max(17px, env(safe-area-inset-right)) 12px max(17px, env(safe-area-inset-left)); }
  .entry-search-controls { padding-inline: 17px; }
  .entry-search-results { padding-inline: 17px; }
  .entry-search-footer { padding-bottom: max(18px, env(safe-area-inset-bottom)); }
}
@media (max-height: 620px) { .entry-search-hint { display: none; } }
.layer-controls { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin: 0 0 12px; padding: 11px 13px; border: 1px solid var(--line); border-radius: 15px; background: rgba(255,255,255,.72); }
.layer-controls > span { flex: 0 0 auto; }
.layer-controls b, .layer-controls small { display: block; }
.layer-controls b { font-size: 10px; }
.layer-controls small { margin-top: 2px; color: var(--muted); font-size: 8px; }
.layer-chips { display: flex; justify-content: flex-end; gap: 6px; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.layer-chips::-webkit-scrollbar { display: none; }
.layer-chip { display: inline-flex; align-items: center; gap: 5px; min-height: 30px; padding: 0 10px; border: 1px solid var(--line); border-radius: 99px; background: #fff; color: var(--muted); font-size: 9px; font-weight: 750; white-space: nowrap; cursor: pointer; }
.layer-chip i { width: 7px; height: 7px; border-radius: 50%; background: var(--layer-color); }
.layer-chip.active { border-color: color-mix(in srgb, var(--layer-color, var(--brand)) 55%, var(--line)); background: color-mix(in srgb, var(--layer-color, var(--brand)) 11%, #fff); color: var(--ink); }
.layer-chip:first-child.active { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); }
.shared-calendar-controls {
  display: flex;
  align-items: center;
  gap: 13px;
  margin: 0 0 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(255,255,255,.76);
}
.shared-calendar-heading { display: flex; flex: 0 0 auto; align-items: center; gap: 7px; }
.shared-calendar-heading b, .shared-calendar-heading small { display: block; }
.shared-calendar-heading b { font-size: 10px; }
.shared-calendar-heading small { margin-top: 2px; color: var(--muted); font-size: 8px; }
.filter-collapse-button {
  display: grid;
  flex: 0 0 28px;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: var(--brand);
  cursor: pointer;
}
.shared-calendar-list { display: flex; gap: 7px; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.shared-calendar-list::-webkit-scrollbar { display: none; }
.shared-calendar-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 3px 10px 3px 5px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  font-size: 10px;
  font-weight: 720;
  white-space: nowrap;
  cursor: pointer;
}
.shared-calendar-chip.active { border-color: #a9c2b8; background: var(--brand-soft); color: var(--brand); }
.shared-calendar-chip:disabled { opacity: 1; cursor: default; }
.shared-calendar-chip small { color: var(--muted); font-size: 7px; font-weight: 700; }
.shared-calendar-avatar, .settings-calendar-avatar {
  display: grid;
  flex: 0 0 25px;
  place-items: center;
  width: 25px;
  height: 25px;
  border-radius: 8px;
  background: #eef1ef;
  color: var(--brand);
  font-size: 9px;
  font-weight: 850;
}
.shared-calendar-controls.collapsed .shared-calendar-heading small { display: none; }
.month-filter-layout { display: grid; grid-template-columns: 132px minmax(0, 1fr); align-items: start; gap: 12px; }
.month-filter-layout.category-collapsed { grid-template-columns: 48px minmax(0, 1fr); }
.month-calendar-content { min-width: 0; }
.category-filter-rail {
  min-width: 0;
  padding: 11px 9px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255,255,255,.76);
}
.category-filter-rail > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 5px; margin-bottom: 10px; }
.category-filter-rail > header b, .category-filter-rail > header small { display: block; }
.category-filter-rail > header b { font-size: 10px; }
.category-filter-rail > header small { margin-top: 3px; color: var(--muted); font-size: 8px; }
.category-filter-list { display: grid; gap: 6px; }
.category-filter-chip {
  display: flex;
  align-items: center;
  gap: 7px;
  width: 100%;
  min-width: 0;
  min-height: 34px;
  padding: 5px 8px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-size: 10px;
  font-weight: 740;
  text-align: left;
  cursor: pointer;
}
.category-filter-chip i { flex: 0 0 8px; width: 8px; height: 8px; border-radius: 50%; background: var(--layer-color, var(--brand)); }
.category-filter-chip span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.category-filter-chip.active { border-color: color-mix(in srgb, var(--layer-color, var(--brand)) 35%, var(--line)); background: color-mix(in srgb, var(--layer-color, var(--brand)) 10%, #fff); color: var(--ink); }
.category-filter-chip.all.active { border-color: #aac2b8; background: var(--brand-soft); color: var(--brand); }
.category-filter-rail.collapsed { display: grid; place-items: center; padding-inline: 7px; }
.category-filter-rail.collapsed > header { margin: 0; }
.category-filter-rail.collapsed > header > span { display: none; }
.collapsed-filter-count { display: grid; place-items: center; width: 28px; height: 28px; margin-top: 8px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); font-size: 9px; font-weight: 800; }
.mobile-filter-bar, .mobile-filter-backdrop, .mobile-filter-sheet { display: none; }
.calendar-display-settings { margin: 15px 0; padding: 13px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-soft); }
.display-order-list { display: grid; gap: 6px; margin-top: 9px; }
.display-order-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 42px; padding: 6px 7px 6px 10px; border-radius: 10px; background: #fff; }
.display-order-row > label { display: flex; flex: 1 1 auto; align-items: center; gap: 8px; min-width: 0; font-size: 10px; font-weight: 720; cursor: pointer; }
.display-order-row > label input { flex: 0 0 auto; accent-color: var(--brand); }
.display-order-row > label i { width: 8px; height: 8px; border-radius: 50%; background: var(--layer-color); }
.display-order-row > label span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.display-order-actions { display: flex; flex: 0 0 auto; gap: 4px; }
.display-order-actions button { width: 30px; height: 30px; padding: 0; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--brand); cursor: pointer; }
.display-order-actions button:disabled { color: #b6bdb9; cursor: default; }
.active-layer-note { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 18px; padding: 9px 13px; border-radius: 12px; background: var(--brand-soft); color: var(--brand); font-size: 10px; }
.active-layer-note button { padding: 2px 0; border: 0; background: transparent; color: inherit; font-weight: 800; cursor: pointer; }
.health-demo-note { display: flex; align-items: center; gap: 7px; width: fit-content; margin: -2px 0 9px auto; color: #68716e; font-size: 8px; }
.calendar-shell { overflow: hidden; border-radius: var(--radius-lg); box-shadow: 0 12px 38px rgba(31,54,49,.065); }
.weekday-row, .calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.weekday { padding: 13px 8px; background: #f0f3ef; color: var(--muted); font-size: 10px; font-weight: 760; text-align: center; letter-spacing: .06em; }
.weekday:first-child, .weekday:last-child { color: #aa6868; }
.calendar-day {
  position: relative;
  min-height: 118px;
  padding: 9px;
  border-top: 1px solid var(--line);
  border-right: 1px solid var(--line);
  background: rgba(255,255,255,.84);
  cursor: pointer;
  overflow: hidden;
}
.calendar-day:nth-child(7n) { border-right: 0; }
.calendar-day:hover { background: #f6f8f4; }
.calendar-day-placeholder { cursor: default; background: #fafbf9; }
.calendar-day-placeholder:hover { background: #fafbf9; }
.calendar-day.outside { background: #fafbf9; color: #acb3af; }
.calendar-day.selected { background: color-mix(in srgb, var(--brand-soft) 58%, #fff); box-shadow: inset 0 0 0 2px var(--brand); z-index: 1; }
.calendar-day.selected:hover { background: color-mix(in srgb, var(--brand-soft) 72%, #fff); }
.calendar-day.selected .day-number { font-weight: 850; }
.calendar-day.selected:not(.today) .day-number { background: var(--brand-soft); color: var(--brand); }
.calendar-day.today.selected .day-number { box-shadow: 0 0 0 3px var(--brand-soft); }
.calendar-day.today .day-number { background: var(--brand); color: #fff; }
.day-head { display: flex; align-items: center; justify-content: space-between; min-height: 26px; }
.day-identity { display: flex; align-items: center; gap: 5px; min-width: 0; }
.day-select { margin: 0; padding: 0; border: 0; border-radius: 9px; background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.day-select:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.day-number { display: grid; place-items: center; width: 25px; height: 25px; border-radius: 50%; font-size: 11px; font-weight: 750; }
.day-weather { display: flex; align-items: center; gap: 3px; color: var(--muted); font-size: 9px; }
.day-weather .weather-svg { width: 16px; height: 16px; }
.holiday-name { margin: 3px 0 5px; color: var(--holiday); font-size: 9px; font-weight: 750; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.health-day-summary { display: flex; align-items: center; gap: 3px; min-width: 0; margin: 3px 0 5px; color: #68716e; font-size: 7px; white-space: nowrap; }
.health-day-summary span { overflow: hidden; text-overflow: ellipsis; }
.health-day-summary .health-demo-badge { display: none; }
.cell-events { display: grid; gap: 4px; }
.cell-event { display: flex; align-items: center; gap: 5px; width: 100%; min-width: 0; margin: 0; padding: 4px 5px; border: 0; border-radius: 6px; background: #f3f5f2; color: inherit; font: inherit; font-size: 9px; text-align: left; cursor: inherit; pointer-events: none; }
.cell-event i { flex: 0 0 3px; width: 3px; height: 12px; border-radius: 2px; }
.cell-event span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cell-event.date-entry { color: var(--brand); background: var(--brand-soft); font-weight: 700; }
.cell-event.spanning { background: color-mix(in srgb, var(--event-color, var(--brand)) 10%, #fff); }
.cell-event.continues-before { border-radius: 2px 6px 6px 2px; }
.cell-event.continues-after { border-radius: 6px 2px 2px 6px; }
.cell-event.continues-before.continues-after { border-radius: 2px; }
.cell-event.checked { opacity: .48; text-decoration: line-through; }
.more-count { display: grid; align-items: center; width: 100%; min-width: 0; min-height: 18px; margin: 0; padding: 1px 5px 1px 7px; border: 0; border-radius: 6px; -webkit-appearance: none; appearance: none; background: transparent; color: var(--muted); font: inherit; font-size: 8px; text-align: left; cursor: pointer; }
.more-count:active { background: var(--surface-soft); }
.more-count:focus-visible { position: relative; z-index: 2; outline: 2px solid var(--brand); outline-offset: -2px; }
.mobile-day-agenda { display: none; margin-top: 14px; padding: 17px; border: 1px solid var(--line); border-radius: var(--radius-md); background: rgba(255,255,255,.86); box-shadow: 0 8px 26px rgba(31,54,49,.05); }
.mobile-day-agenda > header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 7px; }
.agenda-date-heading { min-width: 0; margin: 0; overflow: hidden; color: var(--ink); font-size: 11px; font-weight: 780; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
.mobile-day-agenda > header .text-button { flex: 0 0 auto; }

.day-panel {
  min-width: 0;
  padding: 29px 22px;
  border-left: 1px solid var(--line);
  background: rgba(250,251,248,.9);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.panel-date { padding: 7px 4px 22px; border-bottom: 1px solid var(--line); }
.panel-date strong { display: block; font-size: 39px; line-height: 1; letter-spacing: -.05em; }
.panel-date span { color: var(--muted); font-size: 12px; }
.panel-weather { display: flex; align-items: center; gap: 8px; margin-top: 14px; color: var(--brand); }
.panel-weather .weather-svg { width: 25px; height: 25px; }
.panel-section { padding-top: 20px; }
.panel-section header { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.panel-entry { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 2px; padding: 0; border-bottom: 1px solid var(--line); }
.panel-entry-open { display: grid; grid-template-columns: 5px minmax(0, 1fr); align-items: center; gap: 10px; width: 100%; min-width: 0; min-height: 44px; margin: 0; padding: 8px 6px 8px 0; border: 0; border-radius: 10px; -webkit-appearance: none; appearance: none; background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.panel-entry-open:hover { background: var(--surface-soft); }
.panel-entry-open:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }
.panel-entry-open > i { width: 4px; height: 30px; border-radius: 4px; }
.panel-entry-open > span { min-width: 0; }
.panel-entry b { display: block; overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.panel-entry small { display: block; overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; }
.panel-entry.checked:focus-within { opacity: 1; }
.panel-entry .event-check.compact { width: 44px; height: 44px; border-color: transparent; background: transparent; box-shadow: none; }
.panel-entry .event-check.compact:hover, .panel-entry .event-check.compact.checked { background: transparent; }
.panel-entry .event-check.compact::before { content: ""; position: absolute; inset: 9px; border: 1.5px solid var(--event-color); border-radius: 50%; background: #fff; }
.panel-entry .event-check.compact.checked::before { background: var(--event-color); }
.panel-entry .event-check.compact.recurring::before { border-width: 2px; }
.panel-entry .event-check.compact:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }
.panel-entry .lifecycle-meta { grid-template-columns: 1fr; gap: 5px; margin-top: 9px; padding-top: 8px; }
.panel-entry .lifecycle-meta span { display: block; }
.holiday-panel { margin-top: 16px; padding: 11px 13px; border-radius: 12px; background: #fbebeb; color: var(--holiday); font-size: 11px; font-weight: 700; }

.dates-hero { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 26px; border-radius: var(--radius-lg); background: var(--brand); color: #fff; }
.dates-hero p { margin-bottom: 0; max-width: 560px; color: rgba(255,255,255,.7); }
.dates-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; margin-top: 18px; }
.date-card { display: grid; grid-template-columns: 60px 1fr auto; gap: 16px; align-items: start; padding: 19px; border-radius: var(--radius-md); box-shadow: 0 8px 26px rgba(31,54,49,.05); cursor: pointer; }
.date-card:hover { border-color: #b8cbc1; }
.date-block { text-align: center; }
.date-block b { display: block; font-size: 25px; line-height: 1; }
.date-block small { color: var(--muted); font-size: 9px; }
.date-card h3 { margin: 0 0 4px; }
.date-card p { margin: 0; color: var(--muted); font-size: 11px; }
.date-card-content { min-width: 0; }
.date-summary { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lifecycle-meta { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px 13px; margin-top: 12px; padding-top: 11px; border-top: 1px solid var(--line); }
.lifecycle-meta > span { min-width: 0; }
.lifecycle-meta small, .lifecycle-meta b { display: block; }
.lifecycle-meta small { margin-bottom: 2px; color: var(--muted); font-size: 8px; font-weight: 650; }
.lifecycle-meta b { overflow: hidden; color: var(--ink); font-size: 10px; font-weight: 680; text-overflow: ellipsis; white-space: nowrap; }
.date-card.done { opacity: .55; }

.inbox-hero {
  display: grid;
  grid-template-columns: minmax(0, .8fr) minmax(360px, 1.2fr);
  gap: 24px;
  padding: 26px;
  border-radius: var(--radius-lg);
  background: linear-gradient(145deg, var(--brand), var(--brand-gradient));
  color: #fff;
}
.inbox-hero-copy p:last-child { max-width: 520px; margin-bottom: 0; color: rgba(255,255,255,.76); }
.inbox-capture-form { display: grid; gap: 10px; padding: 16px; border-radius: 18px; background: rgba(255,255,255,.96); color: var(--ink); }
.inbox-capture-form label { display: grid; gap: 7px; font-weight: 750; }
.inbox-capture-form textarea { width: 100%; min-height: 88px; padding: 12px 13px; resize: vertical; border: 1px solid var(--line); border-radius: 13px; background: #fff; color: var(--ink); line-height: 1.55; }
.inbox-capture-form textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.inbox-capture-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.inbox-capture-actions button { min-height: 44px; }
.inbox-voice-status, .inbox-destination { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.inbox-voice-button span:first-child, .quick-voice-button span:first-child { color: #b46f32; }
.inbox-voice-button.listening, .quick-voice-button.listening { border-color: #d49a5c; background: #fff5e9; }
.inbox-voice-button.listening span:first-child, .quick-voice-button.listening span:first-child { animation: voice-listening-pulse .9s ease-in-out infinite alternate; }
@keyframes voice-listening-pulse { to { opacity: .35; transform: scale(.72); } }
.voice-listening-dialog {
  width: min(360px, calc(100% - 34px));
  padding: 0;
  border: 0;
  border-radius: 24px;
  background: transparent;
  color: var(--ink);
}
.voice-listening-dialog::backdrop { background: rgba(20, 38, 34, .5); backdrop-filter: blur(5px); }
.voice-listening-card {
  display: grid;
  justify-items: center;
  gap: 12px;
  padding: 28px 24px 22px;
  border: 1px solid rgba(255,255,255,.7);
  border-radius: 24px;
  background: rgba(255,255,255,.97);
  box-shadow: 0 24px 70px rgba(19,48,43,.24);
  text-align: center;
}
.voice-listening-card h2 { margin: 2px 0 0; font-size: 22px; }
.voice-listening-card p { max-width: 270px; margin: 0 0 5px; color: var(--muted); line-height: 1.6; }
.voice-listening-card button { min-width: 120px; min-height: 44px; }
.voice-listening-indicator {
  position: relative;
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--brand-soft);
}
.voice-listening-indicator::before,
.voice-listening-indicator::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 2px solid rgba(42,95,87,.28);
  border-radius: inherit;
  animation: voice-dialog-wave 1.8s ease-out infinite;
}
.voice-listening-indicator::after { animation-delay: .6s; }
.voice-listening-indicator span {
  width: 17px;
  height: 29px;
  border: 3px solid var(--brand);
  border-radius: 12px;
}
.voice-listening-indicator span::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 17px;
  width: 24px;
  height: 13px;
  border: 3px solid var(--brand);
  border-top: 0;
  border-radius: 0 0 14px 14px;
  transform: translateX(-50%);
}
@keyframes voice-dialog-wave {
  from { opacity: .65; transform: scale(.72); }
  to { opacity: 0; transform: scale(1.28); }
}
@media (prefers-reduced-motion: reduce) {
  .voice-listening-indicator::before,
  .voice-listening-indicator::after { animation: none; }
}
.inbox-list-shell { margin-top: 18px; padding: 22px; border: 1px solid var(--line); border-radius: var(--radius-md); background: #fff; box-shadow: 0 9px 30px rgba(31,54,49,.055); }
.inbox-list-shell > header { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 13px; }
.inbox-list-shell > header h3 { margin: 0; }
.inbox-list-shell > header > b { color: var(--muted); font-size: 12px; }
.inbox-list { display: grid; gap: 10px; }
.inbox-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 14px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface-soft); }
.inbox-item-copy { min-width: 0; }
.inbox-item-copy p { margin: 0; overflow-wrap: anywhere; font-weight: 720; line-height: 1.5; }
.inbox-item-copy small { display: block; margin-top: 5px; color: var(--muted); }
.inbox-suggested-schedule { display: inline-flex; margin-top: 7px; padding: 5px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--ink); font-size: 0.78rem; font-weight: 680; line-height: 1.35; }
.inbox-item-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; }
.inbox-item-actions button { min-height: 40px; padding-inline: 11px; }
.inbox-item-actions .danger { color: var(--holiday); }
.inbox-preview-list { display: grid; gap: 8px; }
.inbox-preview-row { display: grid; grid-template-columns: 26px minmax(0, 1fr); align-items: center; gap: 9px; padding: 10px 11px; border-radius: 12px; background: var(--surface-soft); }
.inbox-note-mark { display: grid; place-items: center; width: 25px; height: 25px; border-radius: 8px; background: var(--brand-soft); color: var(--brand); font-weight: 900; }
.inbox-preview-copy { display: grid; min-width: 0; gap: 2px; }
.inbox-preview-copy small { overflow: hidden; color: var(--muted); font-size: 0.76rem; text-overflow: ellipsis; white-space: nowrap; }
.inbox-preview-row b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.complete-button { width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 50%; background: var(--surface); color: var(--brand); cursor: pointer; }
.complete-button:hover, .date-card.done .complete-button { background: var(--brand); color: #fff; }

.sync-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  padding: 28px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--brand), var(--brand-gradient));
  color: #fff;
  box-shadow: var(--shadow);
}
.sync-hero p { max-width: 620px; margin-bottom: 0; color: rgba(255,255,255,.7); }
.sync-hero .eyebrow { color: rgba(255,255,255,.58); }
.sync-illustration { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.sync-illustration i { display: grid; place-items: center; width: 61px; height: 61px; border: 1px solid rgba(255,255,255,.25); border-radius: 19px; background: rgba(255,255,255,.1); font-size: 11px; font-style: normal; }
.sync-illustration b { color: var(--accent); font-size: 22px; }
.sync-layout { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 17px; }
.sync-form > p, .invite-card > p, .disconnect-card > p { color: var(--muted); font-size: 11px; }
.full-button { width: 100%; }
.prototype-warning { display: flex; gap: 12px; margin-top: 16px; padding: 15px 18px; border: 1px solid #ead6b9; border-radius: 15px; background: #fff8eb; color: #765d35; font-size: 11px; }
.prototype-warning b { flex: 0 0 auto; }
.sync-status { display: inline-flex; align-items: center; gap: 8px; flex: 0 0 auto; padding: 8px 12px; border-radius: 99px; background: rgba(255,255,255,.12); font-size: 11px; font-weight: 750; }
.sync-status i { width: 8px; height: 8px; border-radius: 50%; background: #91d1ad; }
.sync-status.syncing i { background: var(--accent); animation: sync-pulse 1s ease infinite; }
.sync-status.error i { background: #ef8d8d; }
.sync-status.pending i { background: var(--accent); }
.verified-badge { display: inline-flex; align-items: center; width: fit-content; padding: 5px 8px; border-radius: 99px; background: var(--brand-soft); color: var(--brand); font-size: 9px; font-weight: 800; vertical-align: middle; }
.verified-badge.on-dark { background: rgba(255,255,255,.14); color: #fff; }
@keyframes sync-pulse { 50% { opacity: .35; transform: scale(.75); } }
.invite-code { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 14px 0; }
.invite-code > span, .sync-facts > span { padding: 14px; border-radius: 13px; background: var(--surface-soft); }
.invite-code small, .invite-code b, .sync-facts small, .sync-facts b { display: block; }
.invite-code small, .sync-facts small { margin-bottom: 5px; color: var(--muted); font-size: 9px; }
.invite-code b { color: var(--brand); font-size: 21px; letter-spacing: .12em; }
.sync-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-bottom: 16px; }
.sync-facts b { font-size: 12px; }
.member-card { grid-row: span 2; }
.member-list { display: grid; gap: 5px; }
.member-row { display: grid; grid-template-columns: 38px 1fr; gap: 11px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.member-avatar { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 13px; background: var(--brand-soft); color: var(--brand); font-weight: 800; }
.member-row b, .member-row small { display: block; }
.member-row b { font-size: 12px; }
.member-row small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.disconnect-card .danger-link { margin-top: 3px; }
.quiet-on-dark { min-height: 38px; padding: 0 15px; border: 1px solid rgba(255,255,255,.28); border-radius: 12px; background: rgba(255,255,255,.1); color: #fff; cursor: pointer; }
.entry-picker { display: grid; gap: 5px; max-height: 190px; margin: 3px 0 15px; padding: 8px; border: 1px solid var(--line); border-radius: 13px; overflow-y: auto; }
.entry-picker label { display: grid; grid-template-columns: 18px 1fr; align-items: center; gap: 8px; padding: 7px 8px; border-radius: 9px; cursor: pointer; }
.entry-picker label:hover { background: var(--surface-soft); }
.entry-picker input { accent-color: var(--brand); }
.entry-picker span, .entry-picker small { display: block; }
.entry-picker span { font-size: 11px; font-weight: 650; }
.entry-picker small { margin-top: 2px; color: var(--muted); font-size: 9px; font-weight: 400; }
.invite-result { margin-top: 13px; padding: 13px; border-radius: 13px; background: var(--brand-soft); color: var(--brand); overflow-wrap: anywhere; }
.invite-result small, .invite-result b { display: block; }
.invite-result small { margin-bottom: 5px; font-size: 9px; }
.invite-result b { font-size: 13px; letter-spacing: .04em; }
.invite-list { display: grid; gap: 6px; }
.invite-list > div { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.invite-list b, .invite-list small { display: block; }
.invite-list b { font-size: 11px; }
.invite-list small { margin-top: 2px; color: var(--muted); font-size: 9px; }
.mini-action { padding: 5px 8px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--brand); font-size: 9px; cursor: pointer; }
.space-list-card { margin-top: 16px; }
.space-list { display: grid; gap: 7px; }
.space-list button { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px; border: 1px solid var(--line); border-radius: 12px; background: #fbfcfa; text-align: left; cursor: pointer; }
.space-list button:hover { border-color: var(--brand); }
.space-list b, .space-list small { display: block; }
.space-list b { font-size: 12px; }
.space-list small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.account-card > p { color: var(--muted); font-size: 11px; }

.modal {
  width: min(560px, calc(100vw - 28px));
  max-height: calc(100vh - 32px);
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 28px 90px rgba(23, 42, 38, .24);
}
.modal::backdrop { background: rgba(28, 38, 35, .36); backdrop-filter: blur(4px); }
#health-setup-dialog { max-height: calc(100dvh - 32px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); overflow-y: auto; }
.health-setup-content { min-width: 0; padding: 24px max(24px, env(safe-area-inset-right)) calc(24px + env(safe-area-inset-bottom)) max(24px, env(safe-area-inset-left)); overflow-wrap: anywhere; }
.health-setup-content h2 { margin: 0 0 16px; font-size: 23px; line-height: 1.4; }
.health-setup-content p { color: var(--muted); font-size: 14px; line-height: 1.7; }
.health-setup-actions { display: grid; gap: 10px; margin-top: 22px; }
.health-setup-actions button { min-height: 46px; padding: 11px 16px; white-space: normal; }
.health-summary-empty small { flex-basis: 100%; color: var(--muted); font-size: 10px; }
.modal form { padding: 24px; overflow-y: auto; }
#entry-dialog { overflow: hidden; background: var(--paper); }
#entry-form {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  max-height: inherit;
  padding: 0;
  overflow: hidden;
}
#entry-form > .modal-header {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) 46px;
  align-items: center;
  gap: 12px;
  z-index: 2;
  margin: 0;
  padding: 18px 22px 14px;
  background: var(--paper);
}
#entry-dialog-title { margin: 0; font-size: 19px; line-height: 1.35; text-align: center; overflow-wrap: anywhere; }
#entry-form .entry-close-button, .entry-save-button { display: grid; place-items: center; width: 46px; height: 46px; padding: 0; border: 0; border-radius: 50%; cursor: pointer; }
#entry-form .entry-close-button { background: var(--surface); color: var(--ink); font-size: 32px; font-weight: 400; }
.entry-save-button { background: var(--brand); color: #fff; }
.entry-save-button svg { width: 25px; height: 25px; }
.entry-save-button:disabled { background: color-mix(in srgb, var(--muted) 26%, var(--surface)); color: var(--surface); cursor: default; }
.entry-save-button[aria-busy="true"] { opacity: .65; }
.entry-save-button:focus-visible, #entry-form .entry-close-button:focus-visible { outline: 3px solid var(--brand); outline-offset: 3px; }
.entry-form-scroll {
  min-height: 0;
  padding: 0 22px calc(24px + env(safe-area-inset-bottom));
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scroll-padding-block: 18px 28px;
}
.recurrence-scope-modal { width: min(470px, calc(100vw - 28px)); }
.recurrence-scope-modal > div { padding: 24px; }
.modal-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 22px; }
.type-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; margin-bottom: 18px; padding: 4px; border-radius: 13px; background: var(--surface-soft); }
.type-switch input { position: absolute; opacity: 0; }
.type-switch span { display: block; padding: 9px; border-radius: 10px; text-align: center; color: var(--muted); cursor: pointer; font-size: 12px; font-weight: 700; }
.type-switch input:checked + span { background: #fff; color: var(--brand); box-shadow: 0 3px 9px rgba(31,54,49,.08); }
.entry-type-switch { min-width: 0; margin: 0 0 18px; border: 0; background: color-mix(in srgb, var(--line) 72%, var(--paper)); border-radius: 99px; }
.entry-type-switch label { position: relative; min-width: 0; }
.entry-type-switch input { width: 1px; height: 1px; }
.entry-type-switch span { display: grid; place-items: center; min-height: 40px; padding: 8px 10px; border-radius: 99px; font-size: 14px; line-height: 1.3; }
.entry-type-switch input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: -2px; }
.entry-group { min-width: 0; margin: 0 0 22px; padding: 0 18px; border: 0; border-radius: 22px; background: var(--surface); }
#entry-form .entry-group .field { min-width: 0; margin: 0; }
#entry-form .entry-group .field > span:not(.sr-only) { color: var(--ink); font-size: 15px; font-weight: 550; }
#entry-form .entry-identity-field { gap: 0; }
#entry-form .entry-identity-field + .entry-identity-field { border-top: 1px solid var(--line); }
#entry-form .entry-identity-field input { min-width: 0; min-height: 54px; padding: 13px 0; border: 0; border-radius: 0; background: transparent; font: inherit; font-size: 16px; }
#entry-form .entry-identity-field input::placeholder { color: var(--muted); opacity: .8; }
#entry-form .entry-identity-field input:focus { box-shadow: inset 0 -2px var(--brand); }
.entry-switch-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 54px; padding-block: 9px; font-size: 15px; cursor: pointer; }
.entry-switch-row input { appearance: none; -webkit-appearance: none; flex: 0 0 46px; width: 46px; height: 28px; margin: 0; padding: 3px; border: 0; border-radius: 99px; background: color-mix(in srgb, var(--muted) 38%, var(--surface)); cursor: pointer; }
.entry-switch-row input::before { display: block; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.12); content: ""; }
.entry-switch-row input:checked { background: var(--brand); }
.entry-switch-row input:checked::before { transform: translateX(18px); }
.entry-switch-row input:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; }
.entry-switch-row:has(input:disabled) { opacity: .6; cursor: default; }
#entry-form .entry-schedule-row { display: grid; grid-template-columns: minmax(68px, 1fr) minmax(0, 120px) minmax(0, 100px); align-items: center; gap: 7px; min-height: 54px; padding-block: 7px; border-top: 1px solid var(--line); }
.entry-schedule-row > span { min-width: 0; font-size: 15px; overflow-wrap: anywhere; }
#entry-form .entry-schedule-row:has(.entry-time-control[hidden]) { grid-template-columns: minmax(58px, 1fr) minmax(0, 172px); }
.entry-timing-group > .entry-switch-row:not(:first-child) { border-top: 1px solid var(--line); }
#entry-form .entry-date-control input, #entry-form .entry-schedule-row .time-wheel-trigger { min-width: 0; width: 100%; min-height: 40px; padding: 7px 9px; border: 0; border-radius: 13px; background: var(--surface-soft); font-size: 15px; }
#entry-form .entry-date-control input { text-align: center; font-family: inherit; }
#entry-form .entry-date-control input::-webkit-date-and-time-value { min-height: 1.2em; text-align: center; }
#entry-form .entry-date-control { position: relative; }
#entry-form .entry-date-control [data-entry-date-display] { display: grid; place-items: center; min-height: 40px; padding: 7px 9px; border-radius: 13px; background: var(--surface-soft); font-size: 14px; font-weight: 550; white-space: nowrap; }
#entry-form .entry-date-control input { position: absolute; inset: 0; height: 100%; margin: 0; opacity: 0; cursor: pointer; font-size: 16px; }
#entry-form .entry-date-control:focus-within [data-entry-date-display] { outline: 2px solid var(--brand); outline-offset: 2px; }
#entry-form .entry-schedule-row .time-wheel-trigger { grid-template-columns: minmax(0, 1fr) auto; gap: 3px; text-align: center; }
#entry-form .entry-schedule-row .time-wheel-trigger > span { font-size: 14px; font-weight: 550; }
#entry-form .entry-schedule-row .time-wheel-trigger > i { grid-row: auto; font-size: 13px; color: var(--muted); }
#entry-form .entry-select-row { display: grid; grid-template-columns: minmax(70px, .8fr) minmax(0, 1.2fr); align-items: center; gap: 12px; min-height: 56px; padding-block: 5px; }
#entry-form .entry-select-row select, #entry-form .entry-select-row input { min-width: 0; min-height: 44px; padding: 10px 4px; border: 0; border-radius: 9px; background-color: transparent; color: var(--muted); font: inherit; font-size: 15px; text-align: right; text-align-last: right; }
#entry-form .entry-select-row + .entry-select-row { border-top: 1px solid var(--line); }
.entry-select-row .field-hint { grid-column: 1 / -1; padding-bottom: 7px; }
#entry-form .entry-repeat-group .series-edit-hint { margin: 0; padding: 10px 0 14px; background: transparent; border-radius: 0; font-size: 11px; }
#entry-form .entry-common-reminders { padding: 14px 18px 18px; }
#entry-form .entry-common-reminders legend { float: left; width: 100%; margin: 0 0 12px; color: var(--ink); font-size: 15px; }
#entry-form .entry-common-reminders .choice-chips { clear: both; }
#entry-form .quick-capture { margin: 0 0 16px; border: 0; border-radius: 20px; background: var(--surface); }
#entry-form .entry-advanced-options { margin-bottom: 16px; border: 0; border-radius: 20px; background: var(--surface); }
#entry-form .entry-advanced-options > summary, #entry-form .quick-capture summary { padding: 15px 18px; }
#entry-form .entry-advanced-options > summary b, #entry-form .quick-capture summary b { color: var(--ink); font-size: 14px; }
#entry-form .entry-advanced-options > summary small, #entry-form .quick-capture summary small { font-size: 10px; }
#entry-form .entry-secondary-actions { justify-content: center; flex-wrap: wrap; margin: 0; padding: 8px 12px; border: 0; border-radius: 18px; background: var(--surface); }
#entry-form .entry-secondary-actions:not(:has(> button:not([hidden]))) { display: none; }
#entry-form .entry-secondary-actions button { min-height: 44px; }
.external-entry-structure-lock { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 9px 12px; margin: 0 0 16px; padding: 10px 12px; border: 1px solid #dcc8ad; border-radius: 11px; background: #faf0e2; }
.external-entry-structure-hint { flex: 1 1 240px; margin: 0; color: #77552f; font-size: 9px; line-height: 1.55; }
.external-entry-structure-lock .quiet-button { flex: 0 0 auto; background: #fff; }
.quick-capture { margin: -3px 0 17px; border: 1px solid var(--line); border-radius: 15px; background: #fbfcfa; }
.quick-capture summary { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 13px 14px; list-style: none; cursor: pointer; }
.quick-capture summary::-webkit-details-marker { display: none; }
.quick-capture summary:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 14px; }
.quick-capture summary span, .quick-capture summary b, .quick-capture summary small { display: block; }
.quick-capture summary b { margin-bottom: 2px; color: var(--brand); font-size: 11px; }
.quick-capture summary small { color: var(--muted); font-size: 9px; font-weight: 550; }
.quick-capture summary > i { color: var(--brand); font-size: 18px; font-style: normal; line-height: 1; transition: transform .18s ease; }
.quick-capture[open] summary > i { transform: rotate(45deg); }
.quick-capture-panel { padding: 2px 14px 14px; border-top: 1px solid var(--line); }
.quick-text-field { margin-top: 13px; }
.quick-capture-actions { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; margin: -2px 0 11px; }
.quick-capture-actions .primary-button, .quick-capture-actions .quiet-button { min-height: 39px; padding-inline: 12px; font-size: 10px; }
.quick-capture-actions button:disabled, .quick-capture-actions label:has(input:disabled) { cursor: wait; opacity: .55; }
.quick-capture-status { display: grid; grid-template-columns: 12px minmax(0, 1fr); align-items: center; gap: 9px; min-height: 48px; padding: 10px 11px; border-radius: 11px; background: var(--surface-soft); }
.quick-capture-status > i { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.quick-capture-status b, .quick-capture-status small { display: block; }
.quick-capture-status b { font-size: 10px; }
.quick-capture-status small { margin-top: 2px; color: var(--muted); font-size: 9px; line-height: 1.45; }
.quick-capture-status[data-state="working"] > i { width: 12px; height: 12px; border: 2px solid rgba(37,79,75,.2); border-top-color: var(--brand); background: transparent; animation: quick-capture-spin .75s linear infinite; }
.quick-capture-status[data-state="success"] { background: var(--brand-soft); }
.quick-capture-status[data-state="success"] > i { background: var(--brand); }
.quick-capture-status[data-state="error"] { background: #f8e9e7; }
.quick-capture-status[data-state="error"] > i { background: var(--holiday); }
.quick-capture-status[data-state="unsupported"] { background: #faf0e2; }
.quick-capture-status[data-state="unsupported"] > i { background: var(--accent); }
.quick-capture-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.quick-capture-meta > span { min-width: 0; padding: 9px 10px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.quick-capture-meta small, .quick-capture-meta b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.quick-capture-meta small { margin-bottom: 3px; color: var(--muted); font-size: 8px; }
.quick-capture-meta b { font-size: 10px; }
.quick-capture-review { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px; margin-top: 10px; }
.quick-capture-review label { display: flex; align-items: flex-start; gap: 8px; color: var(--muted); font-size: 9px; line-height: 1.45; cursor: pointer; }
.quick-capture-review input { flex: 0 0 auto; width: 16px; height: 16px; margin: 0; accent-color: var(--brand); }
.quick-capture-review .primary-button { min-height: 38px; padding-inline: 13px; font-size: 10px; white-space: nowrap; }
.quick-capture .field-hint { margin-top: 9px; }
@keyframes quick-capture-spin { to { transform: rotate(360deg); } }
.entry-advanced-options { margin: -1px 0 14px; border: 1px solid var(--line); border-radius: 15px; background: #fbfcfa; }
.entry-advanced-options > summary { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 48px; padding: 12px 14px; list-style: none; cursor: pointer; }
.entry-advanced-options > summary::-webkit-details-marker { display: none; }
.entry-advanced-options > summary:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 14px; }
.entry-advanced-options > summary span, .entry-advanced-options > summary b, .entry-advanced-options > summary small { display: block; }
.entry-advanced-options > summary b { margin-bottom: 2px; color: var(--brand); font-size: 11px; }
.entry-advanced-options > summary small { color: var(--muted); font-size: 9px; font-weight: 550; }
.entry-advanced-options > summary > i { color: var(--brand); font-size: 18px; font-style: normal; line-height: 1; transition: transform .18s ease; }
.entry-advanced-options[open] > summary > i { transform: rotate(45deg); }
.entry-advanced-panel { padding: 14px 14px 2px; border-top: 1px solid var(--line); }
.event-schedule-options { margin: -1px 0 14px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); }
.event-schedule-options > header { display: block; padding: 11px 13px; background: var(--surface-soft); border-radius: 13px 13px 0 0; }
.event-schedule-options > header b, .event-schedule-options > header small { display: block; }
.event-schedule-options > header b { margin-bottom: 2px; color: var(--brand); font-size: 11px; }
.event-schedule-options > header small { color: var(--muted); font-size: 9px; font-weight: 550; }
.event-schedule-panel { padding: 13px 14px 1px; border-top: 1px solid var(--line); }
.schedule-toggle { display: grid; grid-template-columns: 18px minmax(0, 1fr); align-items: start; gap: 9px; margin-bottom: 14px; cursor: pointer; }
.schedule-toggle input { width: 17px; height: 17px; margin: 1px 0 0; accent-color: var(--brand); }
.schedule-toggle b, .schedule-toggle small { display: block; }
.schedule-toggle b { font-size: 10px; }
.schedule-toggle small { margin-top: 2px; color: var(--muted); font-size: 9px; line-height: 1.45; }
.series-edit-hint { margin: -2px 0 13px; padding: 9px 11px; border-radius: 10px; background: var(--brand-soft); color: var(--brand); font-size: 9px; line-height: 1.5; }
.occurrence-edit-hint { background: #fff4e6; color: #8a5b20; }
.recurrence-scope-summary { display: grid; gap: 4px; margin: -7px 0 15px; padding: 12px 14px; border-radius: 12px; background: var(--surface-soft); }
.recurrence-scope-summary b { font-size: 12px; }
.recurrence-scope-summary span { color: var(--muted); font-size: 10px; }
.recurrence-scope-actions { display: grid; gap: 9px; }
.scope-choice { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px; width: 100%; padding: 13px 14px; border: 1px solid var(--line); border-radius: 13px; background: #fff; color: var(--ink); text-align: left; cursor: pointer; }
.scope-choice:hover, .scope-choice:focus-visible { border-color: var(--brand); outline: none; box-shadow: 0 0 0 3px var(--brand-soft); }
.scope-choice span, .scope-choice b, .scope-choice small { display: block; }
.scope-choice b { font-size: 11px; }
.scope-choice small { margin-top: 3px; color: var(--muted); font-size: 9px; line-height: 1.45; }
.scope-choice i { color: var(--brand); font-size: 18px; font-style: normal; }
.scope-choice.danger { border-color: #efd7d3; background: #fffafa; }
.scope-choice.danger b, .scope-choice.danger i { color: var(--holiday); }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.field { display: grid; gap: 7px; margin-bottom: 14px; }
.field > span { color: var(--muted); font-size: 10px; font-weight: 750; }
.field input, .field select, .field textarea {
  width: 100%;
  min-height: 43px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  outline: none;
  background: #fbfcfa;
  color: var(--ink);
}
.field textarea { resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.time-wheel-trigger {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 2px 10px;
  width: 100%;
  min-height: 43px;
  margin: 0;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 11px;
  outline: none;
  background: #fbfcfa;
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.time-wheel-form-value {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
  border: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
}
.time-wheel-trigger > span { overflow: hidden; font-size: 12px; font-weight: 750; text-overflow: ellipsis; white-space: nowrap; }
.time-wheel-trigger > small { grid-column: 1; overflow: hidden; color: var(--muted); font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.time-wheel-trigger > i { grid-column: 2; grid-row: 1 / span 2; color: var(--brand); font-size: 18px; font-style: normal; }
.time-wheel-trigger[data-has-value="false"] > span { color: var(--muted); font-weight: 650; }
.time-wheel-trigger:hover { border-color: color-mix(in srgb, var(--brand) 38%, var(--line)); background: #fff; }
.time-wheel-trigger:focus-visible { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.time-wheel-trigger:disabled { cursor: not-allowed; opacity: .62; }

.time-wheel-dialog {
  width: min(430px, calc(100vw - 28px));
  max-height: calc(100vh - 28px);
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 28px 90px rgba(23, 42, 38, .27);
}
.time-wheel-dialog::backdrop { background: rgba(28, 38, 35, .46); backdrop-filter: blur(5px); }
.time-wheel-sheet { padding: 22px; }
.time-wheel-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.time-wheel-header h2 { margin: 2px 0 0; font-size: 22px; }
.time-wheel-output { display: block; margin: 17px 0 12px; color: var(--brand); font-size: 34px; font-weight: 820; letter-spacing: -.03em; text-align: center; }
.time-wheel-picker {
  position: relative;
  display: grid;
  grid-template-columns: minmax(84px, 1fr) 22px minmax(84px, 1fr);
  align-items: center;
  gap: 0;
  height: 240px;
  overflow: hidden;
  border-block: 1px solid var(--line);
  background: linear-gradient(#f7f9f6, rgba(255,255,255,.95) 27%, rgba(255,255,255,.95) 73%, #f7f9f6);
}
.time-wheel-picker.twelve-hour { grid-template-columns: minmax(68px, 1fr) 18px minmax(68px, 1fr) minmax(72px, .85fr); }
.time-wheel-column {
  position: relative;
  z-index: 2;
  height: 240px;
  padding-block: 96px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scroll-snap-type: y mandatory;
  scrollbar-width: none;
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
  -webkit-mask-image: linear-gradient(transparent, #000 24%, #000 76%, transparent);
  mask-image: linear-gradient(transparent, #000 24%, #000 76%, transparent);
}
.time-wheel-column::-webkit-scrollbar { display: none; }
.time-wheel-option {
  display: grid;
  place-items: center;
  width: 100%;
  height: 48px;
  margin: 0;
  padding: 0 4px;
  border: 0;
  border-radius: 10px;
  scroll-snap-align: center;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 17px;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}
.time-wheel-option.selected { color: var(--ink); font-size: 21px; font-weight: 820; }
.time-wheel-column:focus-visible { outline: 2px solid var(--brand); outline-offset: -3px; }
.time-wheel-separator { position: relative; z-index: 2; color: var(--ink); font-size: 22px; font-weight: 820; text-align: center; }
.time-wheel-selection { position: absolute; z-index: 1; top: 96px; right: 6px; left: 6px; height: 48px; border-block: 1px solid color-mix(in srgb, var(--brand) 28%, var(--line)); border-radius: 11px; background: color-mix(in srgb, var(--brand-soft) 72%, #fff); pointer-events: none; }
.time-wheel-hint { margin: 11px 0 0; color: var(--muted); font-size: 9px; text-align: center; }
.time-wheel-actions { display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 9px; margin-top: 17px; padding-top: 15px; border-top: 1px solid var(--line); }
.time-wheel-actions button { min-height: 44px; }
.lifecycle-fields { margin: 2px 0 15px; padding: 15px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface-soft); }
.lifecycle-fields .field:last-of-type { margin-bottom: 0; }
.lifecycle-reminders { padding: 0; border: 0; }
.lifecycle-reminders legend { margin-bottom: 8px; color: var(--muted); font-size: 10px; font-weight: 750; }
.choice-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.choice-chips label { position: relative; cursor: pointer; }
.choice-chips input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.choice-chips span { display: block; padding: 8px 10px; border: 1px solid var(--line); border-radius: 99px; background: #fff; color: var(--muted); font-size: 10px; font-weight: 700; }
.choice-chips input:checked + span { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); }
.choice-chips input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }
.field-hint { margin: 0; color: var(--muted); font-size: 9px; line-height: 1.55; }
.modal-actions { display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 9px; margin-top: 8px; padding-top: 18px; border-top: 1px solid var(--line); }
.modal-leading-actions { display: flex; align-items: center; gap: 12px; }
.entry-secondary-actions { min-height: 44px; margin-top: 4px; padding: 3px 1px 12px; }
.entry-secondary-actions:has(> button:not([hidden])) { border-top: 1px solid var(--line); padding-top: 12px; }
#entry-form > .entry-form-actions {
  z-index: 3;
  grid-template-columns: minmax(0, 1fr);
  margin: 0;
  padding: 12px 22px calc(12px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: var(--surface);
  box-shadow: 0 -10px 24px rgba(31, 54, 49, .05);
}
#entry-form > .entry-form-actions:has(.entry-form-error[hidden]) { display: none; }
.entry-form-actions .quiet-button, .entry-form-actions .primary-button { min-width: 96px; min-height: 44px; }
.entry-form-error {
  grid-column: 1 / -1;
  margin: 0 0 2px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #f8e9e7;
  color: #9b3d35;
  font-size: 10px;
  font-weight: 650;
  line-height: 1.5;
}
#entry-form [aria-invalid="true"] { border-color: var(--holiday); box-shadow: 0 0 0 3px rgba(174, 75, 64, .12); }
.danger-link { padding: 8px 0; background: none; color: var(--holiday); }

.settings-modal { width: min(650px, calc(100vw - 28px)); }
#settings-form {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  max-height: inherit;
  padding: 0;
  overflow: hidden;
}
#settings-form > .modal-header {
  align-items: center;
  margin: 0;
  padding: 20px 24px 15px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
#settings-form > .modal-header > div { flex: 1; min-width: 0; }
#settings-form > .modal-header h2 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.settings-back-button { flex: 0 0 auto; margin-right: 2px; font-size: 24px; }
.settings-content {
  min-height: 0;
  padding: 14px 24px 18px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scroll-padding-block: 14px;
}
.settings-overview { display: grid; gap: 12px; }
.settings-overview-themes { margin: 0; }
.settings-overview-themes .interface-theme-option > span { min-height: 78px; }
.settings-overview-themes .interface-theme-option small { display: none; }
.settings-overview-menu {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
}
.settings-overview-menu > button {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) 18px;
  align-items: center;
  gap: 11px;
  width: 100%;
  min-height: 62px;
  padding: 9px 13px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}
.settings-overview-menu > button:last-child { border-bottom: 0; }
.settings-overview-menu > button:hover { background: var(--surface-soft); }
.settings-overview-menu i {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 11px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}
.settings-overview-menu i svg {
  display: block;
  width: 18px;
  height: 18px;
}
.settings-overview-menu b, .settings-overview-menu small { display: block; }
.settings-overview-menu b { font-size: 11px; }
.settings-overview-menu small { margin-top: 2px; color: var(--muted); font-size: 9px; line-height: 1.4; }
.settings-overview-menu em { color: var(--muted); font-size: 18px; font-style: normal; }
.settings-overview-note { margin: 0; color: var(--muted); font-size: 9px; text-align: center; }
#settings-form [data-settings-group] { display: none; }
#settings-form[data-settings-view="calendar"] [data-settings-group="calendar"],
#settings-form[data-settings-view="language"] [data-settings-group="language"],
#settings-form[data-settings-view="region"] [data-settings-group="region"],
#settings-form[data-settings-view="sync"] [data-settings-group="sync"],
#settings-form[data-settings-view="account"] [data-settings-group="account"] { display: block; }
#settings-form:not([data-settings-view="home"]) .settings-overview { display: none; }
#settings-form[data-settings-view="home"] .settings-actions { display: none; }
.settings-section-toggle {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 20px;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 58px;
  padding: 8px 2px;
  border: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}
.settings-section-toggle span, .settings-section-toggle b, .settings-section-toggle small { display: block; }
.settings-section-toggle b { font-size: 11px; }
.settings-section-toggle small { margin-top: 3px; color: var(--muted); font-size: 9px; line-height: 1.45; }
.settings-section-toggle i { color: var(--muted); font-size: 17px; font-style: normal; transition: transform .16s ease; }
.settings-section.is-collapsed > :not(.settings-section-toggle) { display: none !important; }
.settings-section:not(.is-collapsed) > .settings-section-toggle i { transform: rotate(90deg); }
.settings-section[data-settings-collapsible] > h3,
.settings-section[data-settings-collapsible] > h3 + p { display: none; }
#settings-form > .settings-actions {
  z-index: 3;
  margin: 0;
  padding: 13px 24px calc(15px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: var(--surface);
  box-shadow: 0 -8px 22px rgba(31, 54, 49, .04);
}
.settings-section { padding: 17px 0; border-top: 1px solid var(--line); }
.settings-section > p { color: var(--muted); font-size: 11px; }
.interface-theme-settings {
  min-width: 0;
  margin: 15px 0;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-soft);
}
.interface-theme-settings legend { padding: 0 5px; color: var(--ink); font-size: 11px; font-weight: 780; }
.interface-theme-settings > p { margin: 0 0 11px; color: var(--muted); font-size: 9px; line-height: 1.5; }
.interface-theme-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.interface-theme-option { position: relative; min-width: 0; cursor: pointer; }
.interface-theme-option > input {
  position: absolute;
  z-index: 2;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}
.interface-theme-option > span {
  display: grid;
  min-height: 102px;
  align-content: start;
  gap: 4px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}
.interface-theme-option:hover > span { transform: translateY(-1px); }
.interface-theme-option > input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }
.interface-theme-option > input:checked + span { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand-soft); }
.interface-theme-option > input:checked + span::after {
  content: "✓";
  position: absolute;
  top: 14px;
  right: 13px;
  display: grid;
  width: 18px;
  height: 18px;
  place-items: center;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  font-size: 10px;
  font-weight: 900;
}
.interface-theme-option strong { overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.interface-theme-option small { color: var(--muted); font-size: 8px; line-height: 1.35; }
.theme-swatches { display: grid; grid-template-columns: 1.7fr 1fr 1fr; gap: 3px; height: 31px; margin-bottom: 4px; font-style: normal; }
.theme-swatches b { border-radius: 6px; }
.theme-classic b:nth-child(1) { background: #254f4b; }
.theme-classic b:nth-child(2) { background: #dfeee9; }
.theme-classic b:nth-child(3) { background: #f6f7f3; border: 1px solid #dfe5df; }
.theme-yamabuki b:nth-child(1) { background: #8a6e3e; }
.theme-yamabuki b:nth-child(2) { background: #eee2c5; }
.theme-yamabuki b:nth-child(3) { background: #f7f2e7; border: 1px solid #e2d6c0; }
.theme-asagi b:nth-child(1) { background: #2f7782; }
.theme-asagi b:nth-child(2) { background: #d4e9ec; }
.theme-asagi b:nth-child(3) { background: #eef6f7; border: 1px solid #c9dde0; }
.theme-sakura b:nth-child(1) { background: #8d5e6c; }
.theme-sakura b:nth-child(2) { background: #efdee3; }
.theme-sakura b:nth-child(3) { background: #faf2f4; border: 1px solid #e4d2d8; }
.country-picker { display: grid; grid-template-columns: minmax(0, 1fr) minmax(190px, .72fr); gap: 12px; align-items: start; }
.country-picker .field { margin-bottom: 8px; }
.country-result-select .field-hint:empty { display: none; }
.device-calendar-card { margin-top: 12px; }
.device-calendar-native-hint { margin-top: 9px; }
.device-calendar-native { margin-top: 12px; }
.device-calendar-native-card { display: grid; gap: 13px; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: #fbfcfa; }
.device-calendar-native-card.has-error { border-color: #e8c9c5; background: #fff9f8; }
.device-calendar-native-head { display: grid; grid-template-columns: 38px minmax(0, 1fr); align-items: center; gap: 11px; }
.device-calendar-native-head b, .device-calendar-native-head small { display: block; }
.device-calendar-native-head b { font-size: 12px; }
.device-calendar-native-head small { margin-top: 3px; color: var(--muted); font-size: 9px; line-height: 1.45; }
.device-calendar-native-mark, .device-calendar-spinner { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 11px; background: var(--brand-soft); color: var(--brand); font-size: 10px; font-weight: 800; }
.device-calendar-native-mark.is-ready { background: #e5f2e9; color: #32654a; }
.device-calendar-spinner { border: 3px solid var(--brand-soft); border-top-color: var(--brand); border-radius: 50%; background: transparent; animation: device-calendar-spin .8s linear infinite; }
@keyframes device-calendar-spin { to { transform: rotate(360deg); } }
.device-calendar-privacy { display: grid; gap: 5px; padding: 10px 11px; border-radius: 10px; background: var(--surface-soft); color: var(--muted); font-size: 8px; line-height: 1.45; }
.device-calendar-picker { display: grid; gap: 6px; }
.device-calendar-picker-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 2px 1px 5px; }
.device-calendar-picker-head b { font-size: 10px; }
.device-calendar-picker-head small { color: var(--muted); font-size: 8px; }
.device-calendar-row { display: grid; grid-template-columns: 20px minmax(0, 1fr) 130px; align-items: center; gap: 9px; padding: 10px; border: 1px solid var(--line); border-radius: 11px; background: #fff; cursor: pointer; }
.device-calendar-row > input { width: 16px; height: 16px; accent-color: var(--brand); }
.device-calendar-row b, .device-calendar-row small { display: block; }
.device-calendar-row b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; }
.device-calendar-row small { margin-top: 2px; color: var(--muted); font-size: 8px; }
.device-calendar-row select { min-width: 0; padding: 7px 8px; border: 1px solid var(--line); border-radius: 8px; background: #fbfcfa; color: var(--ink); font-size: 9px; }
.device-calendar-row select:disabled { opacity: .5; }
.device-calendar-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.device-calendar-actions > small { color: var(--muted); font-size: 8px; }
.device-calendar-actions > span { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.field.is-source-locked input, .field.is-source-locked select { background: var(--surface-soft); color: var(--muted); cursor: not-allowed; }
.weather-location-picker { margin: 12px 0 4px; }
.location-search-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: stretch; gap: 8px; }
.location-search-row input { min-width: 0; }
.location-search-row .quiet-button, .location-search-row .text-button { min-height: 42px; white-space: nowrap; }
.weather-location-status { min-height: 18px; margin-top: 7px; color: var(--muted); font-size: 9px; }
.weather-location-status[data-state="error"] { color: var(--holiday); }
.provider-attribution { margin: 4px 0 0; color: var(--muted); font-size: 8px; }
.provider-attribution a { color: var(--brand); text-underline-offset: 2px; }
.weather-city-results { display: grid; gap: 6px; margin: 8px 0 10px; padding: 7px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-soft); }
.weather-city-result { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px; width: 100%; min-height: 46px; padding: 9px 10px; border: 0; border-radius: 9px; background: #fff; color: var(--ink); text-align: left; cursor: pointer; }
.weather-city-result:hover, .weather-city-result:focus-visible { background: var(--brand-soft); outline: none; }
.weather-city-result b, .weather-city-result small { display: block; }
.weather-city-result b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.weather-city-result small { margin-top: 2px; color: var(--muted); font-size: 9px; }
.weather-city-result > span:last-child { color: var(--brand); font-size: 10px; font-weight: 750; }
.selected-weather-location { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px; margin: 8px 0 4px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.selected-weather-location[data-empty="true"] { background: var(--surface-soft); }
.selected-weather-location b, .selected-weather-location small { display: block; }
.selected-weather-location b { font-size: 11px; }
.selected-weather-location small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.selected-weather-location > i { flex: 0 0 auto; width: 9px; height: 9px; border-radius: 50%; background: var(--brand); }
.selected-weather-location[data-empty="true"] > i { background: var(--muted); }
.notification-setting { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-top: 12px; padding: 13px; border: 1px solid var(--line); border-radius: 13px; background: #fbfcfa; }
.notification-setting + .notification-setting { margin-top: 9px; }
.notification-setting[data-state="ready"] { border-color: #c6ddd0; background: #f7fbf8; }
.notification-setting[data-state="error"] { border-color: #e8c9c5; background: #fff9f8; }
.notification-setting .quiet-button { white-space: nowrap; }
.notification-setting b, .notification-setting small { display: block; }
.notification-setting b { display: flex; align-items: center; gap: 7px; font-size: 12px; }
.notification-setting b::before { width: 8px; height: 8px; border-radius: 50%; background: #a8afac; content: ""; }
.notification-setting[data-state="ready"] b::before { background: #4f8a69; }
.notification-setting[data-state="error"] b::before { background: var(--holiday); }
.notification-setting small { margin-top: 4px; color: var(--muted); font-size: 9px; line-height: 1.45; }
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 12px 0; cursor: pointer; }
.toggle-row b, .toggle-row small { display: block; }
.toggle-row b { font-size: 12px; }
.toggle-row small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.toggle-row input { width: 42px; height: 24px; accent-color: var(--brand); }
.health-connection-setting { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 13px; border: 1px solid var(--line); border-radius: 13px; background: #fbfcfa; }
.health-connection-setting > span { min-width: 0; }
.health-connection-setting b, .health-connection-setting small { display: block; }
.health-connection-setting b { font-size: 11px; }
.health-connection-setting small { margin-top: 3px; color: var(--muted); font-size: 9px; line-height: 1.45; }
.health-connection-setting .quiet-button { flex: 0 0 auto; white-space: nowrap; }
.health-connection-setting .inline-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px; }
.health-provider-hint { margin: 9px 2px 0; line-height: 1.55; }
.category-color-settings { margin-top: 8px; padding: 13px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface-soft); }
.category-color-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; color: var(--muted); font-size: 10px; font-weight: 750; }
.category-customization-hint { margin: -2px 0 11px; color: var(--muted); font-size: 9px; line-height: 1.5; }
.category-name-grid { display: grid; gap: 7px; }
.category-name-grid label { display: grid; grid-template-columns: minmax(64px, .36fr) minmax(0, 1fr); align-items: center; gap: 9px; min-width: 0; padding: 7px 8px; border-radius: 10px; background: #fff; }
.category-name-grid span { overflow: hidden; color: var(--muted); font-size: 9px; font-weight: 750; text-overflow: ellipsis; white-space: nowrap; }
.category-name-grid input { width: 100%; min-width: 0; min-height: 38px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: var(--ink); font: inherit; font-size: 11px; }
.category-name-grid input:focus { outline: 2px solid color-mix(in srgb, var(--brand) 24%, transparent); border-color: var(--brand); }
.category-color-controls { margin-top: 12px; padding-top: 11px; border-top: 1px solid var(--line); }
.category-color-controls[hidden] { display: none; }
.category-color-subheading { display: block; margin-bottom: 9px; color: var(--muted); font-size: 9px; font-weight: 750; }
.category-color-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.category-color-grid label { display: grid; justify-items: center; gap: 6px; min-width: 0; padding: 9px 5px; border-radius: 10px; background: #fff; color: var(--muted); font-size: 9px; font-weight: 700; }
.category-color-grid input[type="color"] { width: 34px; height: 28px; padding: 2px; border: 1px solid var(--line); border-radius: 8px; background: #fff; cursor: pointer; }
.file-button { position: relative; display: inline-grid; place-items: center; }
.file-button input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.data-transfer-grid { display: grid; gap: 9px; margin-top: 13px; }
.data-transfer-card { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 13px; border: 1px solid var(--line); border-radius: 13px; background: #fbfcfa; }
.data-transfer-card > span { min-width: 0; }
.data-transfer-card b, .data-transfer-card small { display: block; }
.data-transfer-card b { font-size: 11px; }
.data-transfer-card small { margin-top: 3px; color: var(--muted); font-size: 9px; line-height: 1.45; }
.data-transfer-card .inline-actions { flex: 0 0 auto; }

.external-calendar-setting { padding-top: 8px; }
.external-calendar-setting-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.external-pending-badge { display: inline-grid; min-width: 22px; min-height: 22px; padding: 3px 7px; place-items: center; border-radius: 99px; background: #faf0e2; color: #77552f; font-size: 9px; font-weight: 850; }
.external-pending-badge[hidden] { display: none; }
.external-calendar-modal { width: min(820px, calc(100vw - 28px)); }
.external-calendar-modal > div { padding: 24px; overflow-y: auto; }
.external-calendar-content { display: grid; gap: 14px; }
.external-provider-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.external-provider-card { display: grid; gap: 12px; padding: 15px; border: 1px solid var(--line); border-radius: 15px; background: #fbfcfa; }
.external-provider-head { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; align-items: center; gap: 10px; }
.external-provider-mark { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; background: #fff; color: var(--brand); box-shadow: inset 0 0 0 1px var(--line); font-size: 15px; font-weight: 850; }
.external-provider-copy { min-width: 0; }
.external-provider-copy b, .external-provider-copy small { display: block; }
.external-provider-copy b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.external-provider-copy small { margin-top: 3px; color: var(--muted); font-size: 10px; line-height: 1.45; overflow-wrap: anywhere; }
.external-provider-state { padding: 4px 7px; border-radius: 99px; background: #e6eee9; color: var(--brand); font-size: 8px; font-weight: 800; white-space: nowrap; }
.external-provider-state[data-state="unavailable"], .external-provider-state[data-state="reconnect"] { background: #faf0e2; color: #77552f; }
.external-provider-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px 10px; }
.external-auto-check-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 11px; border-radius: 11px; background: #fff; box-shadow: inset 0 0 0 1px var(--line); cursor: pointer; }
.external-auto-check-copy { min-width: 0; }
.external-auto-check-copy b, .external-auto-check-copy small { display: block; overflow-wrap: anywhere; }
.external-auto-check-copy b { font-size: 10px; }
.external-auto-check-copy small { margin-top: 3px; color: var(--muted); font-size: 10px; line-height: 1.45; }
.external-auto-check-row input { flex: 0 0 auto; width: 38px; height: 22px; accent-color: var(--brand); }
.external-monitor-controls { display: grid; gap: 8px; }
.external-monitor-frequency { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 11px; }
.external-monitor-frequency select { min-width: 112px; min-height: 44px; padding: 7px 30px 7px 10px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); }
.external-monitor-privacy, .external-monitor-cloud-note { color: var(--muted); font-size: 10px; line-height: 1.45; overflow-wrap: anywhere; }
.external-step { padding: 15px; border: 1px solid var(--line); border-radius: 15px; background: #fff; }
.external-step > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; margin-bottom: 12px; }
.external-step > header h3, .external-step > header p { margin: 0; }
.external-step > header h3 { font-size: 13px; }
.external-step > header p { margin-top: 4px; color: var(--muted); font-size: 9px; line-height: 1.5; }
.external-calendar-picker { display: grid; gap: 7px; }
.external-calendar-row { display: grid; grid-template-columns: 20px minmax(0, 1fr) 145px; align-items: center; gap: 10px; min-height: 52px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface-soft); }
.external-calendar-row > input { accent-color: var(--brand); }
.external-calendar-row > span { min-width: 0; }
.external-calendar-row b, .external-calendar-row small { display: block; }
.external-calendar-row b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.external-calendar-row small { margin-top: 3px; color: var(--muted); font-size: 8px; }
.external-calendar-row select { min-height: 36px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: var(--ink); font-size: 10px; }
.external-range { display: grid; grid-template-columns: 1fr 1fr auto; align-items: end; gap: 10px; }
.external-range .field { margin: 0; }
.external-range .primary-button { min-height: 43px; white-space: nowrap; }
.external-privacy-note { padding: 10px 12px; border-radius: 11px; background: #faf0e2; color: #77552f; font-size: 9px; line-height: 1.55; }
.external-preview-summary { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.external-preview-summary b { font-size: 11px; }
.external-preview-summary small { color: var(--muted); font-size: 9px; }
.external-preview-list { display: grid; gap: 7px; max-height: min(38vh, 360px); overflow-y: auto; }
.external-preview-row { display: grid; grid-template-columns: 18px minmax(0, 1fr); align-items: flex-start; gap: 9px; padding: 10px 11px; border: 1px solid var(--line); border-radius: 11px; background: #fff; cursor: pointer; }
.external-preview-row[data-status="duplicate"] { background: var(--surface-soft); opacity: .72; cursor: default; }
.external-preview-row input { margin-top: 3px; accent-color: var(--brand); }
.external-preview-row b, .external-preview-row small { display: block; }
.external-preview-row b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.external-preview-row small { margin-top: 3px; color: var(--muted); font-size: 9px; line-height: 1.45; }
.external-preview-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 11px; }
.external-preview-actions small { color: var(--muted); font-size: 9px; line-height: 1.45; }
.external-status-card { padding: 14px; border: 1px dashed var(--line); border-radius: 14px; background: var(--surface-soft); }
.external-status-card b, .external-status-card span { display: block; }
.external-status-card b { font-size: 12px; }
.external-status-card span { margin-top: 5px; color: var(--muted); font-size: 10px; line-height: 1.5; }
.external-update-section { background: var(--surface-soft); }
.external-update-limit { margin: 0 0 9px; padding: 8px 10px; border-radius: 10px; background: #faf0e2; color: #77552f; font-size: 9px; line-height: 1.45; }
.external-update-list { display: grid; gap: 8px; }
.external-update-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 13px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.external-update-card[data-update-status="conflict"], .external-update-card[data-update-status="unavailable"] { border-color: #dcc8ad; }
.external-update-copy { min-width: 0; }
.external-update-copy b, .external-update-copy small { display: block; }
.external-update-copy b { margin-top: 5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.external-update-copy small { margin-top: 4px; overflow: hidden; color: var(--muted); font-size: 9px; line-height: 1.4; text-overflow: ellipsis; white-space: nowrap; }
.external-update-state { display: inline-block; padding: 3px 7px; border-radius: 99px; background: var(--brand-soft); color: var(--brand); font-size: 8px; font-weight: 800; }
.external-update-card[data-update-status="conflict"] .external-update-state, .external-update-card[data-update-status="unavailable"] .external-update-state { background: #faf0e2; color: #77552f; }
.external-update-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 7px; }

.ics-modal { width: min(760px, calc(100vw - 28px)); }
.ics-file-meta { margin: -9px 0 15px; color: var(--muted); font-size: 10px; overflow-wrap: anywhere; }
.ics-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.ics-summary > div { padding: 11px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-soft); }
.ics-summary b, .ics-summary small { display: block; }
.ics-summary b { color: var(--brand); font-size: 19px; }
.ics-summary small { margin-top: 2px; color: var(--muted); font-size: 8px; }
.ics-messages { display: grid; gap: 6px; margin: 11px 0; }
.ics-message { padding: 9px 11px; border-radius: 10px; background: #faf0e2; color: #77552f; font-size: 9px; line-height: 1.45; }
.ics-message[data-kind="error"] { background: #f8e9e7; color: var(--holiday); }
.ics-preview-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin: 15px 0 8px; }
.ics-preview-toolbar label { display: flex; align-items: center; gap: 7px; font-size: 10px; font-weight: 700; cursor: pointer; }
.ics-preview-toolbar input, .ics-item-select input { accent-color: var(--brand); }
.ics-preview-toolbar small { color: var(--muted); font-size: 9px; text-align: right; }
.ics-preview-list { display: grid; gap: 7px; max-height: min(43vh, 410px); padding-right: 3px; overflow-y: auto; }
.ics-preview-row { display: grid; grid-template-columns: minmax(0, 1fr) 142px; align-items: center; gap: 14px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.ics-preview-row[data-status="duplicate"], .ics-preview-row[data-status="unsupported"] { background: var(--surface-soft); opacity: .72; }
.ics-preview-row[data-status="unchanged"], .ics-preview-row[data-status="local_changed"], .ics-preview-row[data-status="conflict"], .ics-preview-row[data-status="baseline_missing"] { background: var(--surface-soft); }
.ics-item-select { display: grid; grid-template-columns: 18px minmax(0, 1fr); align-items: flex-start; gap: 9px; min-width: 0; cursor: pointer; }
.ics-item-select input { margin: 3px 0 0; }
.ics-item-copy { min-width: 0; }
.ics-item-copy b, .ics-item-copy small { display: block; }
.ics-item-copy b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.ics-item-copy small { margin-top: 3px; color: var(--muted); font-size: 9px; line-height: 1.4; }
.ics-item-state { display: inline-block; margin-top: 6px; padding: 3px 7px; border-radius: 99px; background: var(--brand-soft); color: var(--brand); font-size: 8px; font-weight: 750; }
.ics-preview-row[data-status="duplicate"] .ics-item-state { background: #e5e8e5; color: var(--muted); }
.ics-preview-row[data-status="unsupported"] .ics-item-state { background: #faf0e2; color: #77552f; }
.ics-preview-row[data-status="source_changed"] .ics-item-state { background: #e5f2e9; color: #32654a; }
.ics-preview-row[data-status="unchanged"] .ics-item-state { background: #e5e8e5; color: var(--muted); }
.ics-preview-row[data-status="local_changed"] .ics-item-state, .ics-preview-row[data-status="conflict"] .ics-item-state, .ics-preview-row[data-status="baseline_missing"] .ics-item-state { background: #faf0e2; color: #77552f; }
.ics-category-field { display: grid; gap: 5px; color: var(--muted); font-size: 8px; font-weight: 700; }
.ics-category-field select { width: 100%; min-height: 36px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 9px; background: #fbfcfa; color: var(--ink); font-size: 10px; }
.ics-empty { padding: 24px 15px; border: 1px dashed var(--line); border-radius: 12px; color: var(--muted); text-align: center; font-size: 10px; }

.security-modal { width: min(680px, calc(100vw - 28px)); }
.security-modal > div { padding: 24px; overflow-y: auto; }
.security-section { padding: 17px 0; border-top: 1px solid var(--line); }
#account-deletion-dialog .security-section { line-height: 1.6; }
#account-deletion-identity { margin-bottom: 0; overflow-wrap: anywhere; }
#account-deletion-message:empty { display: none; }
#account-deletion-dialog .account-deletion-actions { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
#account-deletion-dialog .account-deletion-actions > button { min-height: 44px; white-space: normal; }
#account-deletion-dialog .account-delete-confirm { border-color: currentColor; color: var(--holiday); }
#account-deletion-setting .danger-link { min-height: 44px; }
.session-list, .activity-list { display: grid; gap: 4px; }
.session-list > div { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.session-list b, .session-list small, .activity-list b, .activity-list small { display: block; }
.session-list b, .activity-list b { font-size: 11px; }
.session-list small, .activity-list small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.activity-list > div { display: grid; grid-template-columns: 9px 1fr; align-items: center; gap: 10px; padding: 9px 0; }
.activity-list i { width: 8px; height: 8px; border-radius: 50%; background: var(--brand-soft); box-shadow: inset 0 0 0 2px var(--brand); }

.weather-svg { display: inline-block; flex: 0 0 auto; }
.weather-svg * { vector-effect: non-scaling-stroke; }

@media (max-width: 700px) {
  #settings-form > .modal-header { padding: 14px 14px 11px; }
  .settings-content { padding: 10px 14px 14px; }
  #settings-form > .settings-actions { padding: 10px 14px calc(11px + env(safe-area-inset-bottom)); }
  .settings-overview-themes .interface-theme-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .settings-overview-themes .interface-theme-option > span { min-height: 72px; padding: 7px 5px; }
  .settings-overview-themes .interface-theme-option strong { font-size: 9px; text-align: center; white-space: normal; }
  .settings-overview-themes .theme-swatches { height: 26px; }
  .settings-overview-menu > button { min-height: 60px; }
  .interface-theme-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .interface-theme-option > span { min-height: 96px; }
  body[data-view="month"] .calendar-shell-paged { touch-action: auto; }
  body[data-view="month"] .calendar-month-viewport {
    position: relative;
    display: block;
    min-width: 0;
    min-height: 0;
    height: min(68vh, 492px);
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: none;
    overscroll-behavior-x: contain;
    overflow-anchor: none;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    touch-action: auto;
  }
  .calendar-month-viewport::-webkit-scrollbar { display: none; }
  .calendar-month-viewport:not([data-month-ready]) { visibility: hidden; }
  body[data-view="month"] .calendar-month-track {
    position: relative;
    width: calc(var(--month-page-width, 100vw) * var(--month-slot-count, 3));
    height: 100%;
    overflow: hidden;
    overflow: clip;
    contain: layout style paint;
  }
  body[data-view="month"] .calendar-month-page {
    position: absolute;
    top: 0;
    left: 0;
    transform: translate3d(calc(var(--month-slot, 1) * var(--month-page-width, 100vw)), 0, 0);
    will-change: transform;
    contain: layout style paint;
    display: grid;
    grid-template-rows: minmax(0, 1fr);
    width: var(--month-page-width, 100vw);
    min-width: 0;
    height: 100%;
    min-height: 0;
    overflow: hidden;
    background: var(--surface-translucent);
  }
  body[data-view="month"] .calendar-month-grid {
    grid-template-rows: repeat(var(--month-week-count, 6), minmax(0, 1fr));
    min-height: 0;
  }
  body[data-view="month"] .calendar-month-page .calendar-day { min-height: 0; }

  .device-calendar-row { grid-template-columns: 20px minmax(0, 1fr); }
  .device-calendar-row select { grid-column: 2; width: 100%; min-height: 38px; }
  .device-calendar-actions { align-items: stretch; flex-direction: column; }
  .device-calendar-actions > span { justify-content: stretch; }
  .device-calendar-actions button { flex: 1 1 130px; min-height: 42px; }
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  width: max-content;
  max-width: calc(100% - 32px);
  overflow-wrap: anywhere;
  transform: translate(-50%, 18px);
  padding: 11px 16px;
  border-radius: 12px;
  background: #1f302d;
  color: #fff;
  box-shadow: 0 12px 36px rgba(0,0,0,.18);
  font-size: 12px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
  z-index: 100;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.mobile-nav { display: none; }
.mobile-settings-button { display: none; }

@media (max-width: 1160px) {
  .app-shell { grid-template-columns: 186px minmax(0, 1fr) 280px; }
  .workspace { padding-inline: 26px; }
}

@media (max-width: 960px) {
  .app-shell { grid-template-columns: 92px minmax(0, 1fr); }
  .side-rail { padding-inline: 8px; }
  .brand-mark { justify-content: center; width: 100%; padding-inline: 0; }
  .brand-mark > img { width: 76px; }
  .brand-mark > span { grid-row: auto; }
  .brand-mark strong, .brand-mark small, .side-rail .nav-button > span:last-child, .sync-note span, .sync-note small { display: none; }
  .side-rail .nav-button { justify-content: center; }
  .sync-note { grid-template-columns: 1fr; place-items: center; }
  .day-panel { display: none; }
  .mobile-day-agenda { display: block; }
  .hero-grid, .dashboard-grid { grid-template-columns: 1fr; }
  .weather-strip { margin-top: 16px; }
  .month-filter-layout { grid-template-columns: 112px minmax(0, 1fr); gap: 9px; }
  .month-filter-layout.category-collapsed { grid-template-columns: 44px minmax(0, 1fr); }
}

@media (max-width: 700px) {
  body { padding-bottom: calc(78px + env(safe-area-inset-bottom)); }
  .app-shell { display: block; min-height: auto; }
  .side-rail, .day-panel { display: none; }
  .workspace {
    padding: calc(21px + env(safe-area-inset-top)) max(15px, env(safe-area-inset-right)) 34px max(15px, env(safe-area-inset-left));
  }
  .topbar { align-items: flex-end; margin-bottom: 18px; }
  .top-actions .quiet-button { display: none; }
  .top-actions .primary-button { display: none; }
  .top-actions .mobile-settings-button { display: grid; place-items: center; width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); color: var(--brand); font-weight: 800; }
  h1 { font-size: 29px; }
  .today-card, .weather-card { border-radius: 22px; }
  .today-card { min-height: 215px; padding: 23px; }
  .today-date strong { font-size: 58px; }
  .next-up { margin-top: 27px; }
  .weather-card { min-height: 205px; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .timeline::before { left: 82px; }
  .event-row { grid-template-columns: 70px 24px minmax(0, 1fr); }
  .dates-grid { grid-template-columns: 1fr; }
  .dates-hero { display: block; padding: 23px; }
  .dates-hero .primary-button { margin-top: 18px; }
  .sync-hero { display: block; padding: 23px; }
  .sync-illustration { margin-top: 20px; }
  .sync-layout { grid-template-columns: 1fr; }
  .prototype-warning { display: grid; }
  .sync-status { margin-top: 18px; }
  .invite-code b { font-size: 18px; }
  .calendar-toolbar { flex-wrap: wrap; }
  .calendar-toolbar > .quiet-button { display: none; }
  body[data-view="month"] .health-summary-month-toolbar { display: none; }
  .calendar-toolbar h2 { min-width: 150px; font-size: 18px; }
  body[data-view="month"] .topbar { display: none; }
  body[data-view="month"] .calendar-toolbar { flex-wrap: nowrap; gap: 4px; }
  body[data-view="month"] .calendar-toolbar::before { content: none; }
  body[data-view="month"] .month-nav { flex: 1 1 auto; min-width: 0; }
  body[data-view="month"] .month-nav h2 { flex: 1 1 auto; min-width: 0; }
  body[data-view="month"] .month-nav .icon-button {
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    touch-action: manipulation;
  }
  body[data-view="month"] .month-nav .icon-button:hover { background: transparent; color: var(--muted); }
  body[data-view="month"] .month-nav .icon-button:active { background: var(--surface-soft); color: var(--ink); }
  body[data-view="month"] .month-settings-button {
    display: grid;
    flex: 0 0 44px;
    place-items: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface);
    color: var(--brand);
    font-weight: 800;
    cursor: pointer;
  }
  .shared-calendar-controls { display: none; }
  .month-filter-layout, .month-filter-layout.category-collapsed { display: block; min-height: 0; }
  .category-filter-rail { display: none; }
  .mobile-filter-bar {
    display: grid;
    flex: 0 0 auto;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    min-height: 38px;
    margin-bottom: 5px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(255,255,255,.82);
  }
  .mobile-filter-trigger {
    display: grid;
    grid-template-columns: minmax(0, auto) minmax(0, 1fr) auto;
    align-items: center;
    gap: 5px;
    min-width: 0;
    min-height: 36px;
    padding: 5px 9px;
    border: 0;
    background: transparent;
    color: var(--brand);
    cursor: pointer;
  }
  .mobile-filter-trigger + .mobile-filter-trigger { border-left: 1px solid var(--line); }
  .mobile-filter-trigger span { min-width: 0; overflow: hidden; font-size: 10px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
  .mobile-filter-trigger b { min-width: 0; overflow: hidden; color: var(--muted); font-size: 8px; font-weight: 720; text-overflow: ellipsis; white-space: nowrap; }
  .mobile-filter-trigger i { color: var(--muted); font-size: 12px; font-style: normal; transform-origin: center; transition: transform .18s ease; }
  .mobile-filter-trigger.open { background: var(--brand-soft); }
  .mobile-filter-trigger.open i { transform: rotate(180deg); }
  .mobile-filter-trigger:focus-visible { position: relative; z-index: 1; outline: 2px solid var(--brand); outline-offset: -2px; }
  .mobile-filter-backdrop { position: fixed; inset: 0; z-index: 34; background: rgba(28,38,35,.32); opacity: 0; pointer-events: none; transition: opacity .18s ease; }
  .mobile-filter-backdrop.open { display: block; opacity: 1; pointer-events: auto; }
  .mobile-filter-sheet {
    position: fixed;
    right: 10px;
    bottom: 10px;
    left: 10px;
    z-index: 35;
    display: block;
    max-height: 60vh;
    max-height: min(60dvh, 440px);
    padding: 14px 12px calc(14px + env(safe-area-inset-bottom));
    overflow-y: auto;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: #fff;
    box-shadow: 0 22px 60px rgba(31,54,49,.22);
    opacity: 0;
    pointer-events: none;
    transform: translateY(calc(100% + 20px));
    transition: transform .22s ease, opacity .18s ease;
  }
  .mobile-filter-sheet.open { opacity: 1; pointer-events: auto; transform: translateY(0); }
  .mobile-filter-sheet > header { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
  .mobile-filter-sheet > header b, .mobile-filter-sheet > header small { display: block; }
  .mobile-filter-sheet > header b { font-size: 15px; }
  .mobile-filter-sheet > header small { margin-top: 3px; color: var(--muted); font-size: 10px; }
  .mobile-sheet-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .mobile-sheet-list .category-filter-chip { min-height: 46px; padding-inline: 11px; font-size: 13px; }
  .mobile-shared-calendar-list { display: grid; gap: 8px; }
  .mobile-shared-calendar-list .shared-calendar-chip { width: 100%; min-height: 46px; padding: 6px 11px 6px 7px; font-size: 12px; }
  .mobile-shared-calendar-list .shared-calendar-chip > span:nth-child(2) { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
  .layer-controls { display: block; margin-bottom: 9px; padding: 9px; }
  .layer-controls > span { display: none; }
  .layer-chips { justify-content: flex-start; }
  .layer-chip { min-height: 32px; }
  .calendar-shell { border-radius: 18px; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
  .weekday { padding: 10px 2px; font-size: 9px; }
  .calendar-day { min-height: 83px; padding: 3px; }
  .day-head { min-height: 20px; }
  .day-number { width: 20px; height: 20px; font-size: 10px; }
  .day-identity { gap: 2px; }
  .day-weather span { display: none; }
  .day-weather .weather-svg { width: 14px; height: 14px; }
  .holiday-name { margin-block: 1px; font-size: 8px; line-height: 1.15; }
  .health-day-summary { gap: 1px; margin-block: 2px 3px; font-size: 5px; }
  .health-day-summary .health-demo-badge { display: none; }
  .cell-events { position: relative; gap: 1px; }
  .cell-event { display: grid; grid-template-columns: 4px minmax(0, 1fr); gap: 3px; min-height: 12px; padding: 1px 2px; background: color-mix(in srgb, var(--event-color, var(--brand)) 8%, #fff); font-size: 8px; line-height: 1.15; }
  .cell-event.has-more { padding-inline-end: min(22px, 44%); }
  .cell-event i { align-self: stretch; width: 4px; height: auto; min-height: 9px; }
  .cell-event span { display: block; min-width: 0; overflow: hidden; color: var(--ink); text-overflow: ellipsis; white-space: nowrap; }
  .cell-event.date-entry { background: var(--brand-soft); }
  .more-count { position: absolute; inset-inline-end: 0; bottom: 0; width: max-content; min-width: 14px; max-width: 44%; min-height: 11px; padding: 0 2px; border-radius: 3px; background: var(--surface-soft); font-size: 7px; font-weight: 750; line-height: 1.15; }
  .cell-events.overflow-below .more-count { position: static; width: 100%; max-width: none; background: transparent; }
  .field-grid { grid-template-columns: 1fr; gap: 0; }
  .country-picker { grid-template-columns: 1fr; gap: 0; }
  .location-search-row { grid-template-columns: minmax(0, 1fr) auto; }
  .location-search-row .location-button { grid-column: 1 / -1; justify-self: start; min-height: 36px; padding-inline: 0; }
  .quick-capture-actions { grid-template-columns: 1fr 1fr; }
  .quick-analyze-button { grid-column: 1 / -1; }
  .quick-capture-actions .primary-button, .quick-capture-actions .quiet-button { min-height: 42px; }
  .quick-capture-meta { grid-template-columns: 1fr; }
  .quick-capture-review { grid-template-columns: 1fr; }
  .quick-capture-review .primary-button { width: 100%; min-height: 42px; }
  .modal { border-radius: 22px 22px 0 0; width: 100%; max-width: none; max-height: 92vh; max-height: 92dvh; margin: auto 0 0; }
  .modal form { padding: 21px 17px calc(23px + env(safe-area-inset-bottom)); }
  #entry-dialog {
    bottom: var(--entry-dialog-bottom-offset, 0px);
    max-height: var(--entry-dialog-height, 92dvh);
  }
  #entry-form { max-height: inherit; padding: 0; }
  #entry-form > .modal-header { padding: 15px 17px 13px; }
  .entry-form-scroll { padding: 0 16px calc(24px + env(safe-area-inset-bottom)); scroll-padding-block: 14px 30px; }
  .entry-advanced-options > summary { min-height: 48px; }
  .entry-secondary-actions button { min-height: 44px; }
  #entry-form > .entry-form-actions {
    grid-template-columns: minmax(0, 1fr);
    width: 100%;
    padding: 12px 17px calc(12px + env(safe-area-inset-bottom));
  }
  .entry-form-actions .quiet-button, .entry-form-actions .primary-button { width: 100%; min-width: 0; min-height: 44px; }
  .security-modal > div, .recurrence-scope-modal > div, .external-calendar-modal > div { padding: 21px 17px calc(23px + env(safe-area-inset-bottom)); }
  .modal-actions { grid-template-columns: auto 1fr auto auto; }
  .notification-setting { display: grid; grid-template-columns: minmax(0, 1fr); align-items: stretch; gap: 10px; }
  .notification-setting > span { min-width: 0; }
  .notification-setting > .quiet-button { width: 100%; white-space: normal; overflow-wrap: anywhere; }
  .notification-setting > .inline-actions { display: flex; flex-wrap: wrap; width: 100%; justify-content: flex-start; }
  .notification-setting > .inline-actions > button { flex: 1 1 180px; max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
  .health-connection-setting { display: grid; gap: 10px; }
  .health-connection-setting .inline-actions { display: grid; grid-template-columns: 1fr; width: 100%; }
  .health-connection-setting .quiet-button, .health-connection-setting .text-button { width: 100%; min-height: 44px; white-space: normal; }
  .external-calendar-setting-actions { width: 100%; justify-content: flex-start; }
  .external-calendar-setting-actions .quiet-button { flex: 1 1 auto; min-height: 44px; white-space: normal; }
  .category-color-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .category-name-grid label { grid-template-columns: 72px minmax(0, 1fr); }
  .data-transfer-card { display: grid; }
  .data-transfer-card .inline-actions { justify-content: flex-start; }
  .ics-summary { grid-template-columns: 1fr 1fr; }
  .ics-preview-toolbar { display: grid; }
  .ics-preview-toolbar small { text-align: left; }
  .ics-preview-row { grid-template-columns: 1fr; gap: 10px; }
  .ics-preview-list { max-height: none; padding-right: 0; overflow: visible; }
  .external-provider-grid { grid-template-columns: 1fr; }
  .external-provider-head { grid-template-columns: 38px minmax(0, 1fr); }
  .external-provider-state { grid-column: 2; justify-self: start; }
  .external-calendar-row { grid-template-columns: 20px minmax(0, 1fr); }
  .external-calendar-row select { grid-column: 2; }
  .external-range { grid-template-columns: 1fr 1fr; }
  .external-range .primary-button { grid-column: 1 / -1; }
  .external-preview-list { max-height: none; overflow: visible; }
  .external-preview-actions { align-items: stretch; flex-direction: column; }
  .external-preview-actions .primary-button { width: 100%; min-height: 44px; }
  .external-provider-actions { justify-content: flex-start; }
  .external-update-card { grid-template-columns: 1fr; }
  .external-update-copy small { overflow: visible; text-overflow: clip; white-space: normal; }
  .external-update-actions { justify-content: flex-start; }
  .external-calendar-modal button, .external-calendar-modal .danger-link { min-height: 44px; }
  .external-calendar-modal .icon-button { width: 44px; height: 44px; }
  .external-calendar-modal .external-calendar-row select,
  .external-calendar-modal .external-range input,
  .external-calendar-modal .external-range select { min-height: 44px; }
  .external-update-actions .primary-button, .external-update-actions .quiet-button, .external-update-actions .danger-link { min-height: 44px; }
  .mobile-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    align-items: end;
    height: var(--mobile-nav-height);
    min-height: var(--mobile-nav-height);
    padding: 7px max(8px, env(safe-area-inset-right)) calc(7px + env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
    border-top: 1px solid var(--line);
    background: var(--surface-nav);
    backdrop-filter: blur(20px);
  }
  .mobile-nav .nav-button { flex-direction: column; justify-content: center; gap: 2px; min-height: 48px; padding: 3px; font-size: 9px; }
  .mobile-nav .nav-icon { width: 24px; height: 24px; border: 0; font-size: 10px; }
  .mobile-add { align-self: start; justify-self: center; display: grid; place-items: center; width: 47px; height: 47px; margin-top: -23px; border: 5px solid var(--paper); border-radius: 50%; background: var(--brand); color: #fff; font-size: 25px; box-shadow: 0 9px 24px var(--brand-shadow); }
  .toast { bottom: 84px; }
}

@media (max-width: 700px), (max-height: 560px) and (pointer: coarse) {
  #settings-dialog, #plus-dialog {
    position: fixed;
    inset: 0;
    width: 100%;
    max-width: none;
    height: 100vh;
    height: 100dvh;
    max-height: 100vh;
    max-height: 100dvh;
    margin: 0;
    border: 0;
    border-radius: 0;
    overflow: hidden;
  }
  #settings-form { height: 100%; max-height: 100%; padding: 0; }
  #settings-form > .modal-header {
    padding: calc(14px + env(safe-area-inset-top)) max(17px, env(safe-area-inset-right)) 14px max(17px, env(safe-area-inset-left));
  }
  .settings-content {
    padding-inline: max(17px, env(safe-area-inset-left)) max(17px, env(safe-area-inset-right));
  }
  #settings-form[data-settings-view="home"] .settings-content { padding-bottom: calc(18px + env(safe-area-inset-bottom)); }
  #settings-form > .modal-header .icon-button { width: 44px; height: 44px; flex-shrink: 0; }
  .plus-modal > div { height: 100%; max-height: 100%; }
  .plus-modal > div > .modal-header {
    padding: calc(14px + env(safe-area-inset-top)) max(17px, env(safe-area-inset-right)) 14px max(17px, env(safe-area-inset-left));
  }
  .plus-content { padding: 18px max(17px, env(safe-area-inset-right)) 24px max(17px, env(safe-area-inset-left)); }
  .plus-modal > div > .modal-actions {
    padding: 12px max(17px, env(safe-area-inset-right)) calc(12px + env(safe-area-inset-bottom)) max(17px, env(safe-area-inset-left));
  }
}

@media (max-width: 700px) and (orientation: portrait) {
  body[data-view="month"] {
    height: 100vh;
    height: 100dvh;
    padding-bottom: 0;
    overflow: hidden;
  }
  body[data-view="month"] .app-shell {
    height: calc(100vh - var(--mobile-nav-height));
    height: calc(100dvh - var(--mobile-nav-height));
    min-height: 0;
    overflow: hidden;
  }
  body[data-view="month"] .workspace {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    padding-top: calc(12px + env(safe-area-inset-top));
    padding-bottom: 7px;
    overflow: hidden;
  }
  body[data-view="month"] .topbar { flex: 0 0 auto; margin-bottom: 7px; }
  body[data-view="month"] .topbar .eyebrow { display: none; }
  body[data-view="month"] .view {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    width: 100%;
    min-height: 0;
    overflow: hidden;
  }
  body[data-view="month"] .calendar-toolbar { flex: 0 0 auto; margin-bottom: 7px; }
  body[data-view="month"] .mobile-filter-bar { flex: 0 0 auto; }
  body[data-view="month"] .month-filter-layout { flex: 1 1 auto; min-height: 0; overflow: hidden; }
  body[data-view="month"] .month-calendar-content { display: flex; flex-direction: column; height: 100%; min-height: 0; }
  body[data-view="month"] .health-demo-note { flex: 0 0 auto; margin-bottom: 5px; }
  body[data-view="month"] .calendar-shell {
    display: grid;
    flex: 8 1 352px;
    grid-template-rows: auto minmax(0, 1fr);
    min-height: 172px;
    min-height: clamp(172px, 36vh, 220px);
    min-height: clamp(172px, 36dvh, 220px);
    max-height: 532px;
  }
  body[data-view="month"] .calendar-month-viewport { height: 100%; max-height: 100%; }
  body[data-view="month"] .mobile-day-agenda {
    position: relative;
    isolation: isolate;
    flex: 1 1 100px;
    min-height: 92px;
    min-height: clamp(92px, 18vh, 104px);
    min-height: clamp(92px, 18dvh, 104px);
    margin-top: 7px;
    padding: 12px;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }
  body[data-view="month"] .mobile-day-agenda > header {
    position: sticky;
    top: -12px;
    z-index: 3;
    margin: -12px -12px 7px;
    padding: 12px 12px 7px;
    background: #fff;
    box-shadow: 0 1px 0 var(--line);
  }
}

@media (max-width: 700px) and (orientation: landscape) {
  body[data-view="month"] .calendar-month-viewport { height: 452px; }
}

@media (max-width: 700px) and (max-height: 740px) and (orientation: portrait) {
  body[data-view="month"] .calendar-day { padding: 2px; }
  body[data-view="month"] .day-head { min-height: 18px; }
  body[data-view="month"] .day-number { width: 18px; height: 18px; font-size: 9px; }
  body[data-view="month"] .weekday { padding-block: 7px; }
}

@media (max-width: 700px) and (max-height: 620px) and (orientation: portrait) {
  body[data-view="month"] { height: auto; min-height: 100dvh; padding-bottom: var(--mobile-nav-height); overflow: auto; }
  body[data-view="month"] .app-shell { height: auto; overflow: visible; }
  body[data-view="month"] .workspace { height: auto; overflow: visible; }
  body[data-view="month"] .view { display: block; overflow: visible; }
  body[data-view="month"] .month-filter-layout { overflow: visible; }
  body[data-view="month"] .month-calendar-content { height: auto; }
  body[data-view="month"] .calendar-shell { flex: none; height: 332px; min-height: 332px; max-height: none; }
  body[data-view="month"] .mobile-day-agenda { flex: none; height: 190px; min-height: 112px; }
}

@media (max-width: 700px) {
  .inbox-hero { grid-template-columns: 1fr; gap: 17px; padding: 18px; }
  .inbox-capture-form { padding: 13px; }
  .inbox-capture-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .inbox-capture-actions button { width: 100%; padding-inline: 8px; white-space: normal; }
  .inbox-list-shell { margin-top: 10px; padding: 14px; }
  .inbox-item { grid-template-columns: 1fr; gap: 11px; }
  .inbox-item-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .inbox-item-actions button { width: 100%; white-space: normal; }
  .inbox-item-actions .danger { grid-column: 1 / -1; }
  .time-wheel-dialog {
    width: 100%;
    max-width: none;
    max-height: 88dvh;
    margin: auto 0 0;
    border-radius: 24px 24px 0 0;
  }
  .time-wheel-sheet { padding: 19px 17px calc(17px + env(safe-area-inset-bottom)); }
  .time-wheel-header .icon-button { width: 44px; height: 44px; }
  .time-wheel-output { margin-block: 10px 8px; }
  .time-wheel-picker, .time-wheel-column { height: 240px; }
  .time-wheel-actions { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .time-wheel-actions > span { display: none; }
  .time-wheel-actions .text-button { justify-self: start; }
  .time-wheel-actions .text-button, .time-wheel-actions .quiet-button, .time-wheel-actions .primary-button { width: 100%; padding-inline: 7px; font-size: 10px; white-space: normal; }
}

@media (max-width: 700px) and (max-height: 560px) {
  .time-wheel-dialog { max-height: 100dvh; }
  .time-wheel-sheet { padding-top: 12px; }
  .time-wheel-header h2 { font-size: 18px; }
  .time-wheel-output { font-size: 26px; }
  .time-wheel-picker, .time-wheel-column { height: 192px; }
  .time-wheel-column { padding-block: 72px; }
  .time-wheel-selection { top: 72px; }
  .time-wheel-hint { margin-top: 6px; }
  .time-wheel-actions { margin-top: 9px; padding-top: 9px; }
}

.nav-button.needs-review .nav-icon { position: relative; }
.nav-button.needs-review .nav-icon::after {
  content: "";
  position: absolute;
  top: -1px;
  right: -2px;
  width: 7px;
  height: 7px;
  border: 2px solid var(--paper);
  border-radius: 999px;
  background: #b46f32;
}
.sync-recovery-card { grid-column: 1 / -1; }
.sync-recovery-card.needs-review {
  border-color: #e6c9a7;
  background: linear-gradient(145deg, #fffdf9, #fbf1e5);
}
.sync-recovery-card .section-head { align-items: flex-start; }
.sync-recovery-list { display: grid; gap: 12px; margin-top: 16px; }
.sync-recovery-item {
  display: grid;
  gap: 13px;
  padding: 15px;
  border: 1px solid #ead8c2;
  border-radius: 16px;
  background: rgba(255,255,255,.86);
}
.sync-recovery-item > header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.sync-recovery-item > header span { display: grid; gap: 4px; min-width: 0; }
.sync-recovery-item > header b { overflow-wrap: anywhere; color: #3d342b; }
.sync-recovery-item > header small { color: #77552f; line-height: 1.45; }
.sync-recovery-item > header time { flex: 0 0 auto; color: var(--muted); font-size: 11px; }
.sync-recovery-versions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.sync-recovery-version {
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 12px;
  border-radius: 13px;
  background: #f5f6f2;
}
.sync-recovery-version small { color: var(--muted); font-size: 11px; }
.sync-recovery-version b,
.sync-recovery-version span { overflow-wrap: anywhere; }
.sync-recovery-version span { color: var(--muted); font-size: 12px; line-height: 1.45; }
.sync-recovery-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.sync-recovery-actions button { min-height: 44px; }
.sync-storage-status .sync-recovery-actions button {
  max-width: 100%;
  min-width: 0;
  white-space: normal;
  overflow-wrap: anywhere;
}
#entry-form[aria-busy="true"] .entry-form-scroll { cursor: progress; }
.sync-storage-status {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  padding: 13px 14px;
  border: 1px solid #c8ded5;
  border-radius: 16px;
  background: #f1faf6;
}
.sync-storage-status > span {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #d8eee4;
  color: #245f50;
  font-weight: 800;
}
.sync-storage-status > div { display: grid; gap: 3px; min-width: 0; }
.sync-storage-status small { color: var(--muted); line-height: 1.45; }
.sync-storage-status.sync-storage-memory,
.sync-storage-status.sync-storage-unavailable {
  border-color: #e5b98b;
  background: #fff7ed;
}
.sync-storage-status.sync-storage-memory > span,
.sync-storage-status.sync-storage-unavailable > span { background: #f5d6b5; color: #8a431e; }
.sync-storage-status.sync-storage-saving > span { animation: sync-storage-pulse 1.2s ease-in-out infinite; }
@keyframes sync-storage-pulse { 50% { opacity: .45; } }
.sync-recovery-local {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  padding: 14px;
  border: 1px solid #e5c79f;
  border-radius: 14px;
  background: #fff8ed;
}
.sync-recovery-retained-preview { display: grid; gap: .35rem; margin-top: .65rem; }
.sync-recovery-retained-preview > span { display: flex; flex-wrap: wrap; gap: .25rem .55rem; align-items: baseline; }
.sync-recovery-retained-preview b { font-size: .82rem; }
.sync-recovery-retained-preview small { color: var(--muted); font-size: .72rem; }
.sync-recovery-local > span {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #f3dfc3;
  color: #7a542b;
  font-weight: 800;
}
.sync-recovery-local > div { display: grid; gap: 3px; min-width: 0; }
.sync-recovery-local > .sync-recovery-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.sync-recovery-local small { color: var(--muted); line-height: 1.45; }
.sync-recovery-local button { min-height: 44px; }
.sync-recovery-empty {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  padding: 14px;
  border-radius: 14px;
  background: #f3f7f4;
}
.sync-recovery-empty > span {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #dcebe3;
  color: var(--brand);
  font-weight: 800;
}
.sync-recovery-empty > div { display: grid; gap: 3px; }
.sync-recovery-empty small,
.sync-recovery-retention { color: var(--muted); line-height: 1.45; }
.sync-recovery-retention { margin: 14px 0 0; font-size: 11px; }

/* Settings use readable text at the fixed iPhone page scale. Scope these
   sizes to the dialog so compact calendar cells keep their own typography. */
#settings-dialog {
  --settings-label-size: 1rem;
  --settings-help-size: .875rem;
  font-size: var(--settings-label-size);
  line-height: 1.5;
}
#settings-dialog .modal-header h2 {
  overflow: visible;
  font-size: 1.5rem;
  line-height: 1.3;
  text-overflow: clip;
  white-space: normal;
  overflow-wrap: anywhere;
}
#settings-dialog .modal-header .eyebrow { font-size: .75rem; }
#settings-dialog :where(h3) { font-size: 1.125rem; line-height: 1.45; }
#settings-dialog :where(b, strong, legend, .field > span, .category-color-heading, .display-order-row > label) {
  font-size: var(--settings-label-size);
  line-height: 1.45;
}
#settings-dialog :where(p:not(.eyebrow), small, .field-hint, .provider-attribution,
  .device-calendar-privacy, .device-calendar-picker-head, .weather-location-status,
  .category-color-subheading, .category-color-grid label, .category-name-grid span) {
  font-size: var(--settings-help-size);
  line-height: 1.55;
}
#settings-dialog :where(button:not(.icon-button), .file-button, select, textarea,
  input:not([type="checkbox"]):not([type="radio"]):not([type="color"]):not([type="file"])) {
  min-height: 44px;
  font-family: inherit;
  font-size: var(--settings-label-size);
  line-height: 1.45;
}
#settings-dialog :where(button:not(.icon-button), .file-button) {
  white-space: normal;
  overflow-wrap: anywhere;
}
#settings-dialog :where(.settings-overview-menu > button > span, .settings-section-toggle > span,
  .notification-setting > span, .toggle-row > span, .data-transfer-card > span,
  .health-connection-setting > span, .device-calendar-row > span) { min-width: 0; }
#settings-dialog :where(.settings-overview-menu b, .settings-overview-menu small,
  .settings-section-toggle b, .settings-section-toggle small, .settings-overview-note,
  .field-hint, .category-color-heading, .category-color-grid label, .display-order-row > label > span,
  .device-calendar-row b, .device-calendar-row small, .category-name-grid span,
  .selected-weather-location b, .weather-city-result b) {
  overflow: visible;
  white-space: normal;
  text-overflow: clip;
  overflow-wrap: anywhere;
  hyphens: auto;
}
#settings-dialog :where(.settings-overview-menu small, .settings-overview-note,
  .settings-section-toggle small, .settings-section > p, .field-hint) {
  color: color-mix(in srgb, var(--ink) 75%, var(--surface));
}
#settings-dialog .settings-overview-menu > button {
  grid-template-columns: 44px minmax(0, 1fr) 18px;
  min-height: 86px;
  gap: 12px;
  padding: 13px 14px;
}
#settings-dialog .settings-overview-menu i { width: 44px; height: 44px; font-size: 20px; }
#settings-dialog .settings-overview-menu i svg { width: 22px; height: 22px; }
#settings-dialog .settings-overview-menu b, #settings-dialog .settings-section-toggle b { font-size: 1.0625rem; }
#settings-dialog .settings-overview-menu small { margin-top: 4px; }
#settings-dialog .settings-overview-note { margin: 3px 0 0; }
#settings-dialog .settings-section-toggle { min-height: 76px; padding-block: 13px; }
#settings-dialog .interface-theme-option > span { min-height: 105px; height: 100%; gap: 7px; }
#settings-dialog .interface-theme-option strong {
  overflow: visible;
  font-size: .9375rem;
  line-height: 1.4;
  white-space: normal;
  text-overflow: clip;
  overflow-wrap: anywhere;
}
#settings-dialog :where(.category-color-heading, .device-calendar-picker-head, .device-calendar-actions) { flex-wrap: wrap; }
#settings-dialog .display-order-actions button { min-width: 36px; }
#settings-dialog .notification-setting b::before { flex-shrink: 0; }
#settings-dialog :where(.settings-calendar-avatar, .external-pending-badge, .device-calendar-native-mark) { font-size: var(--settings-help-size); }
#settings-dialog :where(.notification-setting, .health-connection-setting, .data-transfer-card) {
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
}
#settings-dialog :where(.inline-actions, .external-calendar-setting-actions) { min-width: 0; flex-wrap: wrap; }
#settings-dialog :where(.notification-setting, .health-connection-setting, .data-transfer-card) .inline-actions { justify-content: flex-start; }

@media (max-width: 700px) {
  #settings-dialog .interface-theme-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #settings-dialog .interface-theme-option > span { min-height: 98px; }
  #settings-dialog .theme-swatches { height: 30px; }
  #settings-dialog .country-picker { grid-template-columns: minmax(0, 1fr); }
  #settings-dialog .location-search-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #settings-dialog .location-search-row input { grid-column: 1 / -1; }
  #settings-dialog .device-calendar-row { grid-template-columns: 20px minmax(0, 1fr); }
  #settings-dialog .device-calendar-row select { grid-column: 2; width: 100%; }
  #settings-dialog .category-name-grid label { grid-template-columns: minmax(0, 1fr); }
  #settings-dialog .category-color-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #settings-dialog .device-calendar-actions > span { width: 100%; justify-content: flex-start; }
}

@media (max-width: 700px) {
  .sync-recovery-versions { grid-template-columns: 1fr; }
  .sync-recovery-item > header { display: grid; }
  .sync-recovery-item > header time { font-size: 10px; }
  .sync-recovery-actions { display: grid; grid-template-columns: 1fr; }
  .sync-recovery-actions button { width: 100%; white-space: normal; }
  .sync-recovery-local { grid-template-columns: auto minmax(0, 1fr); }
  .sync-recovery-local > .sync-recovery-actions { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr; }
  .sync-recovery-local button { width: 100%; white-space: normal; }
  .sync-storage-status { grid-template-columns: auto minmax(0, 1fr); }
  .sync-storage-status > .sync-recovery-actions { grid-column: 1 / -1; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
  .quick-capture-status[data-state="working"] > i { animation: none; }
  .sync-storage-status.sync-storage-saving > span { animation: none; }
  .inbox-voice-button.listening span:first-child, .quick-voice-button.listening span:first-child { animation: none; }
}

@media (max-width: 360px) {
  #entry-form .entry-schedule-row { grid-template-columns: minmax(62px, .7fr) minmax(0, 1.3fr); }
  #entry-form .entry-schedule-row .entry-time-control { grid-column: 2; }
  #entry-form .entry-schedule-row:has(.entry-time-control[hidden]) { grid-template-columns: minmax(62px, .7fr) minmax(0, 1.3fr); }
  #entry-form .entry-group { padding-inline: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  .calendar-month-page .calendar-month-grid { animation: none !important; transition: none !important; }
}
