@charset "UTF-8";

:root {
  font-family: "Segoe UI", "Yu Gothic UI", "Hiragino Kaku Gothic ProN", Meiryo, sans-serif;
  font-synthesis: none;
  color-scheme: light;
  --background: #f7f3ed;
  --surface: #fffdf9;
  --surface-raised: #fffefa;
  --surface-soft: #f2ece4;
  --surface-hover: #eee5db;
  --text: #352e29;
  --muted: #786e65;
  --subtle: #817267;
  --line: #e5dcd1;
  --line-strong: #ccbeb0;
  --accent: #b75e46;
  --accent-text: #a9503a;
  --accent-button: #b35b43;
  --accent-hover: #a04d37;
  --accent-soft: #f6e8e0;
  --accent-ink: #fffdf9;
  --success: #52725d;
  --success-soft: #eaf0e7;
  --warning: #8d632b;
  --warning-soft: #faf0dd;
  --danger: #b3423a;
  --danger-soft: #faeae5;
  --sleep: #776388;
  --sleep-soft: #f0eaf4;
  --travel: #587887;
  --travel-soft: #eaf0f2;
  --focus: #b75e46;
  --shadow: 0 4px 20px rgb(72 49 31 / 3%);
  --dialog-shadow: 0 24px 100px rgb(41 29 20 / 22%);
  --backdrop: rgb(40 30 24 / 40%);
  --green: var(--accent);
  --green-light: var(--accent-soft);
  --card: var(--surface);
  background: var(--background);
  color: var(--text);
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --background: #1e1b19;
  --surface: #28231f;
  --surface-raised: #302923;
  --surface-soft: #342c26;
  --surface-hover: #40352d;
  --text: #f4eee7;
  --muted: #c2b3a6;
  --subtle: #b1a092;
  --line: #43392f;
  --line-strong: #796757;
  --accent: #e3987e;
  --accent-text: #e3987e;
  --accent-button: #e3987e;
  --accent-hover: #efaf97;
  --accent-soft: #453027;
  --accent-ink: #281c16;
  --success: #a5c3a6;
  --success-soft: #2c382c;
  --warning: #dfbb7c;
  --warning-soft: #403422;
  --danger: #f19c91;
  --danger-soft: #432b26;
  --sleep: #c5b1db;
  --sleep-soft: #342c3d;
  --travel: #a4c4d0;
  --travel-soft: #29373c;
  --focus: #e3987e;
  --shadow: 0 4px 20px rgb(0 0 0 / 8%);
  --dialog-shadow: 0 24px 100px rgb(0 0 0 / 45%);
  --backdrop: rgb(10 8 7 / 65%);
}

* { box-sizing: border-box; }
body { margin: 0; font-size: 14px; line-height: 1.65; -webkit-font-smoothing: antialiased; }
button, input, textarea, select { font: inherit; color: inherit; }
button, a, input, textarea, select { -webkit-tap-highlight-color: transparent; }
button, a { touch-action: manipulation; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .55; }
a { color: inherit; text-decoration: none; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
input, textarea, select { accent-color: var(--accent); }
input::placeholder, textarea::placeholder { color: var(--subtle); opacity: 1; }
button .icon, .icon { flex-shrink: 0; vertical-align: middle; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { line-height: 1.4; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.tiny, .small { font-size: 12px !important; }
.disabled { opacity: .45; pointer-events: none; }
.danger { color: var(--danger) !important; }
.custom-scroll { scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
.boot { min-height: 100dvh; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 22px; color: var(--muted); }
.brand-mark { width: 46px; height: 46px; display: grid; place-items: center; flex-shrink: 0; background: var(--accent-button); color: var(--accent-ink); border-radius: 15px; font-size: 27px; line-height: 1; font-weight: 650; }

/* App navigation */
.shell { display: flex; min-height: 100dvh; }
.rail { position: fixed; inset: 0 auto 0 0; width: 192px; z-index: 20; display: flex; align-items: flex-start; flex-direction: column; padding: 30px 16px 22px; background: var(--surface); border-right: 1px solid var(--line); }
.rail > .brand-mark { margin-left: 12px; }
.rail > .wordmark { margin: 3px 0 0 13px; font-size: 28px; }
.rail > .wordmark > span { font-size: 12px; color: var(--muted); letter-spacing: .12em; }
.rail nav { display: flex; flex-direction: column; gap: 7px; width: 100%; margin-top: 46px; }
.rail-button { position: relative; display: flex; align-items: center; gap: 13px; min-height: 48px; width: 100%; padding: 0 14px; text-align: left; border: 0; border-radius: 12px; background: transparent; color: var(--muted); font-size: 14px; font-weight: 550; transition: background .15s, color .15s; }
.rail-button .icon { width: 21px; height: 21px; }
.rail-button:hover { background: var(--surface-soft); color: var(--text); }
.rail-button.active { background: var(--accent-soft); color: var(--accent-text); font-weight: 650; }
.nav-label { overflow-wrap: anywhere; }
.rail-bottom { margin-top: auto; width: 100%; display: flex; flex-direction: column; align-items: flex-start; gap: 18px; padding-top: 28px; }
.avatar { width: 36px; height: 36px; display: grid; place-items: center; background: var(--surface-soft); border: 2px solid var(--line); color: var(--muted); border-radius: 50%; font-weight: 600; font-size: 12px; }
.rail-bottom .avatar { margin-left: 14px; }
.rail-bottom > .muted { padding: 0 12px; font-size: 12px; line-height: 1.9; }
.mobile-nav { display: none; }
.workspace { margin-left: 192px; width: calc(100% - 192px); display: flex; flex-direction: column; min-width: 0; }
.topbar { min-height: 84px; padding: 15px 36px; display: flex; align-items: center; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--line); }
.wordmark { display: flex; align-items: center; gap: 11px; font-size: 24px; font-weight: 700; letter-spacing: .12em; white-space: nowrap; }
.wordmark > span:first-child { font-size: 12px; font-weight: 550; color: var(--muted); letter-spacing: .16em; }
.topbar-divider { width: 1px; height: 20px; background: var(--line-strong); margin: 0 7px; }
.workspace-label { font-size: 12px; font-weight: 450; letter-spacing: 0; color: var(--muted); }
.topbar-right { display: flex; align-items: center; gap: 19px; min-width: 0; }
.search-box { display: flex; align-items: center; gap: 9px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); min-height: 44px; padding: 0 12px; color: var(--muted); }
.search-box .icon { width: 17px; height: 17px; }
.search-box input { min-width: 0; width: 260px; border: 0; padding: 10px 0; background: transparent; font-size: 12px; }
.search-box input:focus { outline: 0; }
.search-box:focus-within { outline: 2px solid var(--focus); outline-offset: 2px; }
.search-box kbd { padding: 0 5px; border: 1px solid var(--line); border-radius: 4px; background: var(--surface-soft); color: var(--subtle); font: inherit; font-size: 12px; }
.live-clock { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.icon-button { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; border: 0; border-radius: 11px; background: transparent; color: var(--muted); transition: background .15s, color .15s; }
.icon-button .icon { width: 19px; height: 19px; }
.icon-button:hover, .icon-button.soft { background: var(--surface-soft); color: var(--accent); }
.primary-button, .secondary-button, .danger-button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 17px; border: 1px solid transparent; border-radius: 11px; font-size: 14px; font-weight: 600; line-height: 1.5; text-align: center; transition: background .15s, border-color .15s; }
.primary-button { background: var(--accent-button); color: var(--accent-ink); }
.primary-button:hover { background: var(--accent-hover); }
.secondary-button { background: var(--surface); color: var(--text); border-color: var(--line-strong); }
.secondary-button:hover { background: var(--surface-soft); }
.danger-button { background: var(--danger); color: var(--surface); }
:root[data-theme="dark"] .danger-button { color: var(--background); }
.primary-button .icon, .secondary-button .icon, .danger-button .icon { width: 17px; height: 17px; }
.text-button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 7px 3px; border: 0; border-radius: 6px; background: transparent; color: var(--accent-text); font-size: 13px; line-height: 1.5; }
.text-button .icon { width: 15px; height: 15px; }
.text-button:hover { text-decoration: underline; text-underline-offset: 4px; }

/* Home and feature layouts */
main#main { padding: 35px 36px 0; flex: 1; outline: none; min-width: 0; }
.welcome { display: flex; align-items: flex-end; justify-content: space-between; gap: 22px; margin-bottom: 28px; }
.eyebrow { font-size: 12px; color: var(--muted); font-weight: 600; letter-spacing: .12em; }
.welcome h1 { margin: 8px 0 10px; font-size: clamp(25px, 2.3vw, 34px); font-weight: 700; letter-spacing: -.03em; }
.heading-dot { color: var(--accent); }
.welcome p { font-size: 13px; color: var(--muted); line-height: 1.8; }
.welcome-actions, .welcome-buttons { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.welcome-actions { justify-content: flex-end; }
.connection-pill { display: inline-flex; align-items: center; gap: 7px; min-height: 34px; padding: 5px 11px; border: 1px solid var(--line); border-radius: 24px; background: var(--surface); color: var(--muted); font-size: 12px; line-height: 1.5; white-space: nowrap; }
.connection-pill.connected { color: var(--success); background: var(--success-soft); border-color: color-mix(in srgb, var(--success) 25%, var(--line)); }
.connection-pill .icon { width: 14px; height: 14px; }
.google-g { font-family: Arial, sans-serif; display: inline-block; color: #4285c4; font-weight: 750; font-size: 15px; line-height: 1; }
:root[data-theme="dark"] .google-g { color: #9abdf5; }
.dashboard { min-width: 0; }
.home-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; align-items: start; }
.home-primary, .home-aside, .calendar-column { display: flex; flex-direction: column; gap: 22px; min-width: 0; }
.home-calendar .section-kicker, .home-calendar .calendar-bottom, .home-calendar .calendar-summary, .home-aside .tasks-card > .section-kicker { display: none; }
.home-aside .home-calendar .calendar-card { padding: 14px 16px 16px; }
.home-calendar .week-labels { margin-top: 8px; }
.home-calendar .calendar-day { min-height: 44px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); min-width: 0; }
.next-event-card { display: flex; align-items: center; gap: 20px; width: 100%; padding: 25px 28px; text-align: left; border: 1px solid color-mix(in srgb, var(--accent) 25%, var(--line)); border-radius: 18px; background: linear-gradient(110deg, var(--accent-soft), var(--surface)); color: var(--text); box-shadow: var(--shadow); }
.next-event-icon { display: grid; place-items: center; width: 49px; height: 49px; background: var(--surface); color: var(--accent); border: 1px solid var(--line); border-radius: 15px; flex-shrink: 0; }
.next-event-icon .icon { width: 23px; height: 23px; }
.next-event-copy { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.next-event-copy small { font-size: 12px; font-weight: 600; letter-spacing: .07em; color: var(--accent-text); }
.next-event-copy strong { font-size: clamp(20px, 2vw, 26px); font-weight: 650; line-height: 1.5; overflow-wrap: anywhere; }
.next-event-copy span { font-size: 13px; color: var(--muted); line-height: 1.8; font-variant-numeric: tabular-nums; }
.next-event-copy strong > span { font-size: inherit; color: var(--text); line-height: inherit; margin-left: 6px; }
.next-event-card > .icon { width: 20px; height: 20px; color: var(--accent); margin-left: auto; }
.section-kicker { font-size: 12px; letter-spacing: .1em; color: var(--muted); font-weight: 600; margin-bottom: 12px; }
.card-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-width: 0; }
.card-heading h2 { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; font-size: 18px; font-weight: 650; min-width: 0; }
.count { padding: 2px 8px; min-width: 25px; border-radius: 7px; background: var(--surface-soft); color: var(--muted); text-align: center; font-size: 12px; font-weight: 550; }
.dashboard[data-view="calendar"] { display: block; }
.calendar-layout { display: grid; grid-template-columns: minmax(285px, 360px) minmax(0, 1fr); align-items: start; gap: 24px; min-width: 0; }
.dashboard[data-view="tasks"] { max-width: 1080px; margin: 0 auto; }
.dashboard[data-view="tasks"] .tasks-card { min-height: 600px; }
.feature-page { width: min(960px, 100%); margin: 0 auto; padding: 30px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); min-width: 0; }
.feature-page > .settings-modal, .feature-page > .sleep-modal, .feature-page > .payroll-modal { width: 100%; padding: 0; }
.feature-page .modal-heading { margin-bottom: 22px; }
.feature-page .modal-heading h2 { font-size: 23px; }
.page-tabs, .feature-tabs { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; padding: 6px; margin-bottom: 26px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface-soft); }
.page-tabs button, .feature-tab { flex: 1; min-height: 44px; border: 1px solid transparent; border-radius: 9px; padding: 10px 14px; background: transparent; color: var(--muted); font-size: 14px; white-space: nowrap; }
.page-tabs button.active, .page-tabs button[aria-selected="true"], .feature-tab.active, .feature-tab[aria-selected="true"] { border-color: var(--line); background: var(--surface); color: var(--accent-text); font-weight: 600; box-shadow: var(--shadow); }
.settings-tab-panel, .feature-tab-panel { min-width: 0; }
.feature-form-actions { position: sticky; bottom: 0; padding: 18px 0 0; background: var(--surface); }
.theme-preference { padding: 18px; margin: 18px 0; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-soft); }
.more-menu { display: grid; gap: 10px; }
.more-menu-item { display: flex; align-items: center; gap: 15px; min-height: 78px; padding: 16px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface-raised); color: var(--text); font-size: 15px; text-align: left; }
.more-menu-item:hover { background: var(--surface-soft); }
.more-menu-item .icon { width: 24px; height: 24px; color: var(--accent); }
.more-menu-item span { flex: 1; }
.more-menu-item strong { font-size: 15px; }
.more-menu-item small { display: block; color: var(--muted); font-size: 12px; margin-top: 4px; }

/* Month calendar and notes */
.calendar-card { padding: 21px 19px 0; }
.calendar-card .card-heading { gap: 5px; }
.calendar-card .card-heading h2 { font-size: 18px; letter-spacing: -.02em; }
.calendar-controls { display: flex; gap: 0; flex-shrink: 0; }
.calendar-controls .icon { width: 15px; height: 15px; }
.week-labels { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); margin: 14px 0 6px; text-align: center; font-size: 12px; color: var(--muted); }
.week-labels .sunday { color: var(--accent-text); }
.week-labels .saturday { color: var(--travel); }
.month-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 2px; }
.calendar-day { display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 3px; min-width: 0; min-height: 44px; padding: 5px 0 2px; border: 0; border-radius: 11px; background: transparent; color: var(--text); font-size: 14px; font-variant-numeric: tabular-nums; }
.calendar-day:hover { background: var(--surface-soft); }
.calendar-day.outside { color: var(--subtle); }
.calendar-day.today:not(.selected) { color: var(--accent-text); font-weight: 700; background: var(--accent-soft); }
.calendar-day.selected { background: var(--accent-button); color: var(--accent-ink); font-weight: 650; }
.date-dots { height: 4px; display: flex; gap: 3px; }
.date-dots i, .legend-dot { width: 4px; height: 4px; border-radius: 50%; background: var(--accent); display: inline-block; }
.date-dots i.task-dot, .legend-dot.task-dot { background: var(--warning); }
.selected .date-dots i { background: var(--accent-ink); }
.legend-dot.task-dot { margin-left: 5px; }
.calendar-bottom { margin-top: 12px; padding: 8px 0; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 5px; color: var(--muted); font-size: 12px; flex-wrap: wrap; }
.calendar-bottom > span { display: flex; align-items: center; gap: 4px; }
.calendar-summary { display: flex; align-items: center; gap: 7px; padding: 12px 0; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.calendar-summary .icon { width: 15px; height: 15px; }
.calendar-summary strong { color: var(--accent-text); font-weight: 600; }
.notes-card { display: flex; flex-direction: column; min-height: 210px; padding: 22px; }
.notes-card h2 { font-size: 16px; }
.notes-card h2 .icon { width: 18px; height: 18px; color: var(--warning); }
.notes-card textarea { width: 100%; min-height: 132px; border: 0; border-radius: 0; background: repeating-linear-gradient(transparent 0, transparent 31px, var(--line) 31px, var(--line) 32px); color: var(--text); resize: vertical; line-height: 32px; padding: 8px 0 0; margin-top: 9px; font-size: 14px; }
.notes-card textarea:focus-visible { outline-offset: 7px; }
.module-card { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 125px; padding: 22px; border: 1px dashed var(--line-strong); border-radius: 18px; background: var(--surface-soft); color: var(--muted); text-align: left; }
.module-icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); flex-shrink: 0; }
.module-icon .icon { width: 21px; height: 21px; }
.module-card strong { font-size: 14px; color: var(--text); }
.module-card small { display: block; margin-top: 6px; font-size: 12px; }
.module-card > .icon { width: 16px; height: 16px; }

/* Daily agenda: every event bar keeps the exact time scale. */
.agenda-card, .tasks-card { display: flex; flex-direction: column; padding: 25px 25px 0; min-width: 0; }
.agenda-card { height: clamp(600px, calc(100dvh - 275px), 860px); }
.agenda-date { display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); padding: 10px 0; margin-top: 10px; color: var(--muted); }
.agenda-date strong { font-size: 14px; font-weight: 500; }
.agenda-date > div { display: flex; gap: 0; flex-shrink: 0; }
.agenda-date .icon { width: 15px; height: 15px; }
#agenda-panel .agenda-list { flex: 1; padding: 12px 4px 20px 0; min-height: 230px; overflow: auto; overscroll-behavior: contain; scrollbar-gutter: stable; }
.day-timeline { position: relative; margin: 8px 0 18px; min-width: 0; }
.timeline-hour { position: absolute; left: 52px; right: 0; height: 1px; border-top: 1px solid var(--line); pointer-events: none; }
.timeline-hour > span { position: absolute; left: -52px; top: -10px; width: 44px; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; background: var(--surface); }
.timeline-events { position: absolute; inset: 0 0 0 52px; }
.timeline-event { position: absolute; display: flex; flex-direction: column; gap: 4px; min-width: 0; padding: 9px 10px; border: 1px solid color-mix(in srgb, var(--event-color) 35%, var(--line)); border-left: 3px solid var(--event-color); border-radius: 8px; background: color-mix(in srgb, var(--event-color) 12%, var(--surface)); color: var(--text); text-align: left; line-height: 1.45; overflow: hidden; cursor: pointer; }
.timeline-event:hover { background: color-mix(in srgb, var(--event-color) 21%, var(--surface)); z-index: 3; }
.timeline-event:focus-visible { outline-offset: 1px; z-index: 4; }
.timeline-event strong { font-size: 14px; font-weight: 600; overflow-wrap: anywhere; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.timeline-event-time { font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex-shrink: 0; }
.timeline-event small { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.timeline-event.travel-event { border-left-style: dashed; background: var(--travel-soft); color: var(--travel); }
.timeline-event.sleep-event { border-color: color-mix(in srgb, var(--sleep) 35%, var(--line)); border-left-color: var(--sleep); background: var(--sleep-soft); color: var(--sleep); }
.timeline-event.sleep-event small { color: var(--sleep); }
.timeline-event.sleep-event-conflict { border-right: 2px solid var(--warning); }
.timeline-event.compact-event { padding: 2px 7px; gap: 0; }
.timeline-event.compact-event strong { display: block; font-size: 12px; white-space: nowrap; text-overflow: ellipsis; }
.timeline-event.compact-event .timeline-event-time { font-size: 12px; }
.timeline-event.short-event { padding: 0; border-top-width: 0; border-bottom-width: 0; border-radius: 3px; }
.timeline-event.short-event > * { display: none; }
.timeline-event.instant-event { height: 2px !important; padding: 0; border-radius: 0; border-width: 0; background: var(--event-color); }
.timeline-shortcuts { margin: 14px 0 8px 52px; padding-top: 14px; border-top: 1px solid var(--line); }
.timeline-shortcuts summary, .timeline-shortcuts h3 { color: var(--muted); font-size: 12px; font-weight: 550; margin-bottom: 9px; }
.timeline-shortcuts summary { cursor: pointer; min-height: 44px; padding: 10px 0; }
.short-events { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
details.short-events { display: block; flex-shrink: 0; max-height: 175px; overflow: auto; margin: 0; padding: 10px 0; border-top: 1px solid var(--line); }
.short-events summary { position: sticky; top: -10px; z-index: 1; min-height: 44px; padding: 10px 0; background: var(--surface); color: var(--muted); font-size: 12px; cursor: pointer; }
.short-events > div { display: grid; gap: 7px; padding: 2px 0 8px; }
.short-event-button { display: flex; align-items: flex-start; gap: 11px; width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid var(--line); border-left: 3px solid var(--event-color, var(--accent)); border-radius: 9px; background: var(--surface-raised); color: var(--text); text-align: left; font-size: 13px; line-height: 1.7; }
.short-event-button time { flex-shrink: 0; font-variant-numeric: tabular-nums; color: var(--muted); font-size: 12px; }
.short-event-button span { overflow-wrap: anywhere; }
.short-event-button .icon { width: 15px; height: 15px; margin: 3px 0 0 auto; color: var(--muted); }
.timeline-now { position: absolute; left: 48px; right: 0; height: 2px; background: var(--accent); z-index: 2; pointer-events: none; }
.timeline-now::before { content: ""; position: absolute; left: 0; top: -3px; width: 8px; height: 8px; background: var(--accent); border-radius: 50%; }
.event-row { position: relative; display: flex; gap: 10px; width: 100%; padding: 0 0 16px; border: 0; border-radius: 8px; background: transparent; text-align: left; }
.event-time { display: flex; flex-direction: column; gap: 4px; width: 43px; flex-shrink: 0; padding-top: 11px; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.event-time > span { color: var(--subtle); font-size: 12px; }
.event-block { display: flex; flex-direction: column; gap: 7px; flex: 1; min-width: 0; padding: 12px; border-left: 3px solid var(--event-color); border-radius: 0 9px 9px 0; background: color-mix(in srgb, var(--event-color) 10%, var(--surface)); }
.event-row:hover .event-block { background: color-mix(in srgb, var(--event-color) 18%, var(--surface)); }
.event-title { font-size: 14px; font-weight: 600; line-height: 1.7; overflow-wrap: anywhere; color: var(--text); }
.event-notes { font-size: 12px; color: var(--muted); line-height: 1.8; white-space: pre-line; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.event-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; font-size: 12px; color: var(--muted); }
.event-meta .icon { width: 13px; height: 13px; }
.event-meta .google-g { font-size: 12px; }
.event-calendar { min-width: 0; overflow-wrap: anywhere; }
.now-badge { margin-left: auto; background: var(--success-soft); color: var(--success); border-radius: 5px; padding: 2px 5px; }
.ongoing .event-block { box-shadow: 0 0 0 1px var(--success); }
.agenda-all-day { display: flex; align-items: flex-start; gap: 8px; max-height: 160px; overflow: auto; flex-shrink: 0; padding: 12px 0; border-bottom: 1px solid var(--line); }
.agenda-all-day > span { width: 44px; padding-top: 10px; flex-shrink: 0; color: var(--muted); font-size: 12px; }
.agenda-all-day > div { flex: 1; min-width: 0; }
.agenda-all-day .event-row { padding: 0; margin-bottom: 5px; }
.agenda-all-day .event-time, .agenda-all-day .event-meta, .agenda-all-day .event-notes { display: none; }
.agenda-all-day .event-block { min-height: 44px; padding: 9px 10px; }
.agenda-all-day .event-title { font-size: 13px; }
.timeline-empty { color: var(--muted); padding: 10px 0; font-size: 12px; flex-shrink: 0; }
.agenda-bottom { display: flex; align-items: center; gap: 8px; min-height: 61px; padding: 8px 0; border-top: 1px solid var(--line); flex-wrap: wrap; flex-shrink: 0; }
.source-label { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.agenda-bottom .text-button { margin-left: auto; }
.sync-caption { font-size: 12px; color: var(--subtle); }
.sleep-overlap-badge { max-width: 100%; align-self: flex-start; padding: 1px 5px; border-radius: 4px; background: var(--warning-soft); color: var(--warning); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* TODO */
.tasks-card { min-height: 450px; }
.task-progress { margin: 21px 0 20px; }
.task-progress > div:first-child { display: flex; align-items: center; justify-content: space-between; font-size: 12px; color: var(--muted); }
.task-progress strong { color: var(--accent-text); font-size: 18px; font-weight: 600; }
.task-progress strong span { color: var(--muted); font-size: 12px; font-weight: 400; }
.progress-track { height: 5px; border-radius: 8px; margin-top: 10px; overflow: hidden; background: var(--surface-soft); }
.progress-track > span { display: block; height: 100%; border-radius: 8px; background: var(--accent); transition: width .3s; }
.quick-task { display: flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 9px; margin-bottom: 18px; border: 1px solid var(--line-strong); border-radius: 11px; background: var(--surface-raised); flex-shrink: 0; }
.quick-task > .icon { width: 17px; height: 17px; color: var(--subtle); }
.quick-task input { width: 100%; min-width: 0; padding: 12px 0; border: 0; background: transparent; font-size: 14px; }
.quick-task input:focus { outline: 0; }
.quick-task:focus-within { outline: 2px solid var(--focus); outline-offset: 2px; }
.quick-task button { border: 0; border-radius: 8px; background: transparent; color: var(--accent); min-height: 44px; min-width: 32px; }
.quick-task button .icon { width: 17px; height: 17px; }
.task-tabs { display: flex; gap: 22px; border-bottom: 1px solid var(--line); flex-shrink: 0; }
.task-tabs button { position: relative; min-height: 44px; padding: 0 0 10px; border: 0; background: transparent; color: var(--muted); font-size: 13px; }
.task-tabs button.active { color: var(--accent-text); font-weight: 600; }
.task-tabs button.active::after { content: ""; position: absolute; bottom: -1px; left: 0; right: 0; height: 2px; border-radius: 2px; background: var(--accent); }
.task-list { flex: 1; min-height: 180px; max-height: 500px; padding-top: 6px; overflow: auto; }
.home-aside .task-list { max-height: 280px; }
.home-aside .task-progress { display: flex; align-items: center; flex-direction: row-reverse; gap: 12px; margin: 8px 0 12px; }
.home-aside .task-progress > div:first-child > span { display: none; }
.home-aside .task-progress strong { font-size: 14px; line-height: 1.5; white-space: nowrap; }
.home-aside .task-progress .progress-track { flex: 1; height: 4px; margin: 0; }
.task-row { display: flex; align-items: flex-start; gap: 11px; min-height: 70px; padding: 17px 0 14px; border-bottom: 1px solid var(--line); }
.task-checkbox { position: relative; display: flex; align-items: center; justify-content: center; min-width: 22px; width: 22px; height: 22px; margin-top: 2px; padding: 1px; border: 1.5px solid var(--line-strong); border-radius: 7px; background: var(--surface); }
.task-checkbox::before { content: ""; position: absolute; inset: -11px; }
.task-checkbox.checked { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.task-checkbox:hover { border-color: var(--accent); }
.task-checkbox .icon { width: 16px; height: 16px; }
.task-content { flex: 1; min-width: 0; padding: 0; min-height: 28px; border: 0; background: transparent; text-align: left; }
.task-title { display: block; font-size: 14px; line-height: 1.8; color: var(--text); overflow-wrap: anywhere; }
.completed .task-title { text-decoration: line-through; color: var(--subtle); }
.task-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; margin-top: 5px; color: var(--muted); }
.task-meta > .icon { width: 13px; height: 13px; }
.due-badge, .priority-badge { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); }
.due-badge .icon, .priority-badge .icon { width: 12px; height: 12px; }
.due-badge.due-today { color: var(--success); }
.due-badge.overdue { color: var(--danger); }
.priority-badge { color: var(--warning); }
.task-more { margin-top: -9px; min-width: 32px; opacity: .7; }
.task-more .icon { width: 16px; height: 16px; }
.task-row:hover .task-more, .task-more:focus-visible { opacity: 1; }
.task-footer { display: flex; align-items: center; gap: 6px; min-height: 61px; padding: 8px 0; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; flex-shrink: 0; flex-wrap: wrap; }
.task-footer > .icon { width: 15px; height: 15px; color: var(--warning); }
.task-footer .text-button { margin-left: auto; }

/* Empty, loading and feedback states */
.empty-state { display: flex; align-items: center; justify-content: center; flex-direction: column; text-align: center; padding: 40px 10px; min-height: 230px; }
.empty-art { position: relative; display: grid; place-items: center; width: 72px; height: 72px; margin-bottom: 22px; border-radius: 23px; background: var(--surface-soft); color: var(--accent); }
.empty-art > .icon { width: 31px; height: 31px; stroke-width: 1.4; }
.art-spark { position: absolute; top: -7px; right: -4px; font-size: 23px; color: var(--warning); }
.empty-state h3 { font-size: 16px; font-weight: 600; color: var(--text); margin-bottom: 10px; }
.empty-state p { font-size: 13px; line-height: 2; color: var(--muted); }
.empty-state .secondary-button { margin-top: 22px; }
.task-empty { min-height: 220px; padding: 30px 8px; }
.task-empty .empty-art { width: 60px; height: 60px; border-radius: 20px; margin-bottom: 18px; }
.task-empty h3 { font-size: 14px; }
.inline-warning, .form-error:not(:empty) { border-radius: 10px; padding: 12px; margin-bottom: 12px; background: var(--warning-soft); color: var(--warning); font-size: 12px; line-height: 1.9; overflow-wrap: anywhere; }
.form-error { font-size: 13px; line-height: 1.9; color: var(--danger); overflow-wrap: anywhere; }
.form-error:not(:empty) { background: var(--danger-soft); color: var(--danger); margin-top: 12px; }
.page-footer { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; padding: 26px 36px 22px; color: var(--muted); font-size: 12px; }
.page-footer > span { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.page-footer > span:last-child { font-size: 12px; letter-spacing: .03em; }
.status-dot { display: inline-block; width: 6px; height: 6px; background: var(--success); border-radius: 50%; flex-shrink: 0; }
.footer-sep { color: var(--line-strong); margin: 0 2px; }
.toast { position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 14px); z-index: 100; padding: 13px 21px; width: max-content; max-width: calc(100vw - 32px); background: var(--text); color: var(--surface); border-radius: 12px; box-shadow: var(--dialog-shadow); font-size: 14px; line-height: 1.7; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; }
.toast.visible { opacity: 1; transform: translate(-50%, 0); }
.toast.error { background: var(--danger); color: var(--surface); }
:root[data-theme="dark"] .toast.error { color: var(--background); }
.spinning { animation: spin 1s linear infinite; }
.focus-flash { animation: flash 1.2s; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes flash { 40% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 35%, transparent); } }

/* Shared dialogs and forms */
dialog { width: min(560px, calc(100vw - 40px)); max-height: 90dvh; padding: 28px; border: 1px solid var(--line); border-radius: 22px; background: var(--surface); color: var(--text); box-shadow: var(--dialog-shadow); overflow: auto; overscroll-behavior: contain; scroll-padding: 20px; }
dialog::backdrop { background: var(--backdrop); backdrop-filter: blur(5px); }
.modal-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; margin-bottom: 26px; }
.modal-heading h2 { font-size: 22px; font-weight: 650; }
.modal-heading p { color: var(--muted); font-size: 13px; line-height: 1.9; margin-top: 9px; }
.modal-heading .icon-button { margin: -7px -7px 0 0; flex-shrink: 0; }
:where(dialog, .feature-page, .login-card) label:not(.checkbox-label):not(.calendar-choice):not(.color-picker label):not(.payroll-month label):not(.sleep-hours-fields label), .form-row > label { display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; color: var(--muted); font-size: 14px; font-weight: 550; min-width: 0; }
:where(dialog, .feature-page, .login-card) input:not([type="checkbox"]):not([type="radio"]), :where(dialog, .feature-page, .login-card) textarea, :where(dialog, .feature-page, .login-card) select { width: 100%; min-width: 0; min-height: 46px; padding: 11px 12px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface-raised); color: var(--text); font-size: 14px; font-weight: 400; line-height: 1.6; }
:where(dialog, .feature-page) textarea { min-height: 95px; resize: vertical; }
.form-row { display: flex; gap: 16px; }
.form-row > label, .form-row > fieldset { flex: 1; min-width: 0; }
.checkbox-label { display: flex; align-items: center; flex-direction: row !important; gap: 10px !important; min-height: 44px; font-size: 14px !important; font-weight: 400 !important; line-height: 1.7; color: var(--text); }
.checkbox-label input, input[type="checkbox"], input[type="radio"] { width: 18px; height: 18px; flex-shrink: 0; margin: 0; cursor: pointer; accent-color: var(--accent); }
.modal-actions { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding-top: 21px; margin-top: 25px; border-top: 1px solid var(--line); }
.modal-actions > div { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; }
.modal-actions .primary-button { margin-left: auto; }
.color-picker { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; margin: 0 0 18px; padding: 0; border: 0; }
.color-picker legend { color: var(--muted); font-size: 14px; font-weight: 550; margin-bottom: 8px; }
.color-picker label { display: flex; align-items: center; justify-content: center; position: relative; min-width: 40px; min-height: 44px; cursor: pointer; }
.color-picker input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; }
.color-picker label > span { display: block; width: 24px; height: 24px; border: 3px solid var(--surface); border-radius: 50%; background: var(--swatch); pointer-events: none; }
.color-picker input:checked + span { box-shadow: 0 0 0 2px var(--swatch); }
.color-picker input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 4px; }
.field-help { margin: 10px 0; color: var(--muted); font-size: 12px; line-height: 1.95; overflow-wrap: anywhere; }
.settings-section { padding: 24px 0; border-top: 1px solid var(--line); min-width: 0; }
.feature-tab-panel > .settings-section:first-child, .feature-page .settings-section:first-child { border-top: 0; padding-top: 0; }
.settings-section h3 { display: flex; align-items: center; gap: 9px; margin-bottom: 16px; font-size: 17px; font-weight: 600; }
.settings-section h3 .icon { width: 20px; height: 20px; color: var(--accent); }
.settings-section p:not(.field-help):not(.inline-warning) { margin-bottom: 16px; font-size: 13px; color: var(--muted); line-height: 1.9; }
.settings-section .google-g { border-radius: 4px; background: var(--surface-raised); padding: 2px 4px; }
.settings-connection { display: flex; align-items: flex-start; flex-wrap: wrap; gap: 12px; margin-bottom: 16px; }
.calendar-current { min-width: 0; overflow-wrap: anywhere; line-height: 1.9; }
.button-row, .google-actions, .calendar-picker-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; }
.settings-modal .modal-actions { margin-top: 0; }
.calendar-picker { margin: 18px 0 22px; }
.calendar-picker .field-help { margin: 9px 0 12px; }
.calendar-options { padding: 0; margin: 0; min-width: 0; border: 0; }
.calendar-options legend { font-size: 14px; font-weight: 550; color: var(--muted); margin-bottom: 12px; }
.calendar-options-list { max-height: 340px; overflow: auto; border: 1px solid var(--line-strong); border-radius: 12px; padding: 5px; background: var(--surface-raised); }
.calendar-options-list .calendar-choice { display: flex; align-items: center; gap: 12px; margin: 0; padding: 13px 12px; min-height: 66px; border-radius: 9px; cursor: pointer; font-size: 14px; color: var(--text); }
.calendar-choice:hover { background: var(--surface-soft); }
.calendar-choice:has(input:checked) { background: var(--accent-soft); }
.calendar-choice:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: -2px; }
.calendar-choice > span { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.calendar-choice-name { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; line-height: 1.7; font-weight: 550; overflow-wrap: anywhere; }
.calendar-choice-name small, .calendar-access { font-size: 12px; font-weight: 400; color: var(--muted); }
.readonly-badge { display: inline-block; width: fit-content; padding: 2px 6px; border-radius: 5px; background: var(--surface-soft); color: var(--muted); font-size: 12px; line-height: 1.6; white-space: nowrap; }
.calendar-selection-count { color: var(--accent-text) !important; font-size: 12px !important; margin-bottom: 12px !important; }
.event-details h3 { font-size: 19px; line-height: 1.8; font-weight: 600; overflow-wrap: anywhere; }
.event-details dl { display: grid; grid-template-columns: 75px minmax(0, 1fr); gap: 17px 12px; margin: 24px 0 0; font-size: 14px; line-height: 1.9; }
.event-details dt { color: var(--muted); }
.event-details dd { margin: 0; color: var(--text); overflow-wrap: anywhere; }
.event-details dd .readonly-badge { margin-left: 7px; }
.event-detail-notes { white-space: pre-wrap; }
.available-module { display: flex; align-items: center; flex-wrap: wrap; gap: 14px; padding: 24px 0; border-block: 1px solid var(--line); }
.available-module > div { flex: 1; }
.available-module h3 { font-size: 16px; margin-bottom: 8px; }
.available-module p, .module-future { color: var(--muted); font-size: 13px; line-height: 1.9; }
.module-future { padding-top: 22px; text-align: center; }
.delete-copy { color: var(--muted); font-size: 14px; line-height: 2; overflow-wrap: anywhere; }

/* Payroll */
.payroll-modal { width: min(840px, calc(100vw - 40px)); }
.payroll-settings-modal { width: min(690px, calc(100vw - 40px)); }
.feature-page.payroll-modal, .feature-page.sleep-modal, .feature-page.settings-modal { width: min(960px, 100%); }
.payroll-source { display: flex; align-items: center; justify-content: space-between; gap: 17px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-raised); padding: 19px 20px; margin-bottom: 24px; }
.payroll-source > div { min-width: 0; overflow-wrap: anywhere; }
.payroll-source strong { color: var(--text); font-size: 15px; line-height: 1.8; font-weight: 600; }
.payroll-source p { margin-top: 6px; color: var(--muted); font-size: 12px; line-height: 1.9; }
.payroll-source > button { flex-shrink: 0; }
.payroll-month { display: flex; align-items: center; justify-content: center; gap: 16px; margin-bottom: 24px; }
.payroll-month > label { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 14px; white-space: nowrap; }
.payroll-month input { width: 178px !important; max-width: 100%; }
.payroll-summary { display: grid; grid-template-columns: 1.15fr 1fr; gap: 24px; padding: 26px; border: 1px solid color-mix(in srgb, var(--accent) 20%, var(--line)); border-radius: 16px; background: var(--accent-soft); }
.payroll-summary > div { display: flex; flex-direction: column; gap: 9px; min-width: 0; }
.payroll-summary > div + div { border-left: 1px solid color-mix(in srgb, var(--accent) 23%, var(--line)); padding-left: 24px; }
.payroll-summary span, .payroll-summary small { color: var(--muted); font-size: 12px; }
.payroll-summary strong { font-size: clamp(25px, 2.8vw, 36px); font-weight: 650; color: var(--accent); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.payroll-summary > div + div strong { font-size: 24px; margin-top: 6px; }
.payroll-summary .payroll-instant-total strong { font-size: clamp(25px, 2.8vw, 36px); margin-top: 0; }
.payroll-summary small { line-height: 1.9; }
.payroll-days { margin: 26px 0; }
.payroll-days h3, .payroll-list-heading h3 { font-size: 16px; font-weight: 600; }
.payroll-days-scroll { max-height: 340px; overflow: auto; border: 1px solid var(--line); border-radius: 12px; }
.payroll-days table { border-collapse: collapse; width: 100%; font-size: 14px; font-variant-numeric: tabular-nums; }
.payroll-days th, .payroll-days td { padding: 14px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
.payroll-days th:first-child { text-align: left; }
.payroll-days thead th { position: sticky; top: 0; background: var(--surface-soft); color: var(--muted); font-size: 12px; font-weight: 550; }
.payroll-days tbody th { font-weight: 500; color: var(--text); }
.payroll-days tbody small { display: block; margin-top: 5px; color: var(--muted); font-size: 12px; font-weight: 400; white-space: normal; }
.payroll-days td:last-child { font-weight: 600; color: var(--accent-text); }
.payroll-days tr:last-child :is(th, td) { border-bottom: 0; }
.payroll-calculation { margin: 15px 0 25px; color: var(--muted); }
.payroll-list-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.payroll-list-heading > span { color: var(--muted); font-size: 12px; line-height: 1.9; }
.payroll-list { max-height: 520px; overflow: auto; }
.feature-page .payroll-list { max-height: none; }
.payroll-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 19px 0; border-bottom: 1px solid var(--line); }
.payroll-event-info { display: flex; flex-direction: column; gap: 6px; min-width: 0; overflow-wrap: anywhere; }
.payroll-event-info > strong { color: var(--text); font-size: 15px; line-height: 1.8; font-weight: 600; }
.payroll-event-info > span, .payroll-event-info > small { color: var(--muted); font-size: 12px; line-height: 1.9; }
.payroll-row-actions { display: flex; align-items: flex-end; flex-direction: column; gap: 5px; flex-shrink: 0; }
.payroll-row-actions > strong { color: var(--accent-text); font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; }
.payroll-row-actions > small { color: var(--muted); font-size: 12px; }
.payroll-row-actions > button { font-size: 13px; }
.payroll-event-info > .payroll-row-error { color: var(--danger); }
.payroll-empty { padding: 40px 12px; color: var(--muted); text-align: center; font-size: 14px; line-height: 2; }
.payroll-event-detail { border: 1px solid var(--line); border-radius: 12px; background: var(--surface-raised); padding: 18px; margin-bottom: 24px; overflow-wrap: anywhere; }
.payroll-event-detail h3 { font-size: 16px; font-weight: 600; line-height: 1.8; }
.payroll-event-detail p { margin-top: 8px; color: var(--muted); font-size: 13px; line-height: 1.9; }
.payroll-preview { padding: 17px; border-radius: 12px; background: var(--accent-soft); color: var(--text); font-size: 14px; line-height: 1.9; }
.payroll-preview > span, .payroll-preview > strong, .payroll-preview > small { display: block; }
.payroll-preview > strong { font-size: 19px; font-weight: 600; color: var(--accent-text); margin-top: 8px; }
.payroll-preview > small { color: var(--muted); font-size: 12px; margin-top: 7px; }
.payroll-badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 6px; border-radius: 5px; background: var(--success-soft); color: var(--success); font-variant-numeric: tabular-nums; white-space: nowrap; }
.payroll-badge.needs-review { background: var(--warning-soft); color: var(--warning); }
.pay-rules { min-width: 0; margin: 24px 0; padding: 19px; border: 1px solid var(--line); border-radius: 13px; }
.pay-rules legend { font-size: 16px; font-weight: 600; padding: 0 7px; }
.pay-rules:disabled { opacity: .55; }
.pay-rule-group + .pay-rule-group, .pay-overlap { border-top: 1px solid var(--line); padding-top: 17px; margin-top: 19px; }
.pay-rules .form-row { margin: 13px 0 0; }
.pay-rules input, .pay-rules select, .pay-break-row input { width: 100%; min-width: 0; }
.pay-overlap > label { display: block; margin-top: 13px; }
.pay-rules .field-help { margin: 12px 0 0; }
.pay-break-fields { margin: 0 0 22px; }
.pay-break-fields > .field-help { margin: 6px 0 14px; }
.pay-break-row { margin-bottom: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 11px; }
.pay-break-row .form-row { margin-bottom: 0; gap: 12px; }
.pay-break-row > .text-button { display: flex; margin-left: auto; }
.payroll-estimate-note { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); color: var(--warning); font-size: 12px; line-height: 1.9; }

/* Travel */
.travel-calendar-row, .event-travel-fields, .travel-direction { min-width: 0; border: 1px solid var(--line); border-radius: 13px; padding: 17px; margin: 18px 0; }
.travel-calendar-row legend, .event-travel-fields legend, .travel-direction legend { padding: 0 7px; color: var(--text); font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.travel-calendar-row .form-row { margin: 14px 0 0; }
.travel-calendar-row input[type="number"] { width: 100%; min-width: 0; }
.event-travel-fields .field-help { margin: 0 0 13px; }
.event-travel-fields .field-help:last-child { margin-bottom: 0; }
#travel-settings .form-error:empty { display: none; }
.event-travel-button { width: 100%; min-height: 44px; white-space: normal; margin-bottom: 20px; }
.event-travel-modal { width: min(650px, calc(100vw - 40px)); }
.travel-parent-summary { display: flex; flex-direction: column; gap: 8px; padding: 17px; background: var(--surface-soft); border-radius: 12px; margin-bottom: 22px; overflow-wrap: anywhere; }
.travel-parent-summary strong { font-size: 16px; }
.travel-parent-summary span { color: var(--muted); font-size: 13px; line-height: 1.9; }
.travel-direction-inputs > label { margin-top: 17px; }
.travel-direction .form-row { gap: 13px; margin-bottom: 0; }
.travel-direction .field-help { margin: 11px 0 16px; }
.travel-direction-inputs > label { display: grid !important; grid-template-columns: 70px minmax(0, 1fr); gap: 12px; align-items: center; }
.travel-preview { padding: 18px; border-radius: 12px; background: var(--travel-soft); color: var(--travel); font-size: 14px; line-height: 1.9; }
.travel-preview > strong { display: block; margin-bottom: 10px; }
.travel-preview > div { display: flex; gap: 16px; margin: 5px 0; }
.travel-preview b { font-weight: 550; }
.travel-preview small { display: block; margin-top: 11px; color: var(--muted); font-size: 12px; }
.travel-preview.invalid { color: var(--warning); background: var(--warning-soft); }
.travel-setup-copy { margin: 22px 0; font-size: 14px; line-height: 2; }
.travel-form-actions { align-items: flex-start; }
.travel-form-actions > div { margin-left: auto; display: flex; gap: 9px; }
.travel-form-actions .text-button { white-space: normal; text-align: left; }
.travel-minute-pair { align-items: flex-start; }
.travel-addition { align-self: flex-end; display: flex; align-items: center; height: 46px; margin-bottom: 18px; color: var(--muted); font-size: 17px; flex-shrink: 0; }
.travel-order { display: flex; align-items: center; gap: 7px; margin-top: 3px; font-size: 12px; color: var(--muted); }
.travel-order-stage { flex: 1; text-align: center; border-radius: 7px; padding: 7px; background: var(--travel-soft); color: var(--travel); }
.travel-order-stage.buffer-stage { background: var(--warning-soft); color: var(--warning); }
.travel-order-arrow { color: var(--muted); }

/* Sleep */
.sleep-modal { width: min(740px, calc(100vw - 40px)); }
.sleep-timezone { color: var(--muted); font-size: 12px; line-height: 1.9; margin-bottom: 22px; }
.sleep-section { padding: 26px 0 8px; border-top: 1px solid var(--line); scroll-margin-top: 20px; }
.sleep-section + .sleep-section { margin-top: 22px; }
.page-tabs + .sleep-section, .sleep-section:first-child { border-top: 0; padding-top: 0; }
.sleep-section-heading { display: flex; align-items: center; gap: 13px; margin-bottom: 24px; }
.sleep-section-heading > div { min-width: 0; }
.sleep-section-heading h3 { color: var(--text); font-size: 18px; font-weight: 600; }
.sleep-section-heading p { color: var(--muted); font-size: 13px; line-height: 1.9; margin-top: 6px; }
.sleep-section-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 13px; background: var(--sleep-soft); color: var(--sleep); flex-shrink: 0; }
.sleep-section-icon .icon { width: 22px; height: 22px; }
.sleep-section .checkbox-label { margin-bottom: 19px; }
.sleep-duration-fields { gap: 20px; align-items: flex-start; }
.sleep-duration-fields > fieldset { margin: 0 0 18px; padding: 0; border: 0; min-width: 0; }
.sleep-duration-fields legend { color: var(--muted); font-size: 14px; font-weight: 550; margin-bottom: 8px; }
.sleep-hours-fields { display: flex; gap: 10px; }
.sleep-hours-fields > label { display: flex; align-items: center; gap: 8px; min-width: 0; flex: 1; }
.sleep-hours-fields input { width: 100%; min-width: 0; }
.sleep-hours-fields span { color: var(--muted); font-size: 13px; flex-shrink: 0; }
.sleep-preview { padding: 20px; border: 1px solid color-mix(in srgb, var(--sleep) 25%, var(--line)); border-radius: 14px; background: var(--sleep-soft); color: var(--sleep); font-size: 14px; line-height: 1.9; overflow-wrap: anywhere; }
.sleep-preview.invalid { background: var(--warning-soft); border-color: color-mix(in srgb, var(--warning) 25%, var(--line)); color: var(--warning); }
.sleep-preview > small { display: block; color: var(--muted); font-size: 12px; }
.sleep-range-summary { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.sleep-range-summary > div { flex: 1; min-width: 0; }
.sleep-range-summary > div > span { display: block; color: var(--muted); font-size: 12px; margin-bottom: 6px; }
.sleep-range-summary strong { font-size: 14px; font-weight: 500; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sleep-range-summary b { display: block; font-size: 30px; font-weight: 600; line-height: 1.5; color: var(--sleep); }
.sleep-range-summary b.sleep-precise-time { font-size: 21px; }
.sleep-range-arrow { color: var(--sleep); margin: 15px 8px 0; }
.sleep-duration { padding-top: 13px; margin: 15px 0 8px; border-top: 1px solid color-mix(in srgb, var(--sleep) 25%, var(--line)); font-size: 14px; font-weight: 550; }
.sleep-preview-note { margin-bottom: 15px; color: var(--muted); font-size: 12px; line-height: 1.9; }
.sleep-conflict-warning { padding-top: 14px; margin-top: 14px; border-top: 1px solid var(--line); color: var(--warning); font-size: 12px; }
.sleep-conflict-warning > strong { display: block; font-size: 14px; font-weight: 600; }
.sleep-conflict-warning ul { padding-left: 20px; margin: 7px 0; }
.sleep-conflict-warning li { margin-bottom: 4px; }
.sleep-conflict-warning p { margin-top: 8px; }
.sleep-conflict-warning small { display: block; font-size: 12px; }
.sleep-day-status { margin: 18px 0 22px; padding: 14px; border-radius: 11px; background: var(--sleep-soft); color: var(--sleep); font-size: 13px; line-height: 1.9; overflow-wrap: anywhere; }
.sleep-date-fields { min-width: 0; margin: 19px 0; padding: 17px 16px 0; border: 1px solid var(--line); border-radius: 12px; }
.sleep-date-fields legend { font-size: 14px; font-weight: 550; color: var(--sleep); padding: 0 7px; }
.sleep-modal .modal-actions { align-items: flex-start; }
.sleep-modal .modal-actions > .text-button { text-align: left; white-space: normal; }
.sleep-manual-actions > div > button { text-align: left; white-space: normal; }
.sleep-close { display: flex; justify-content: flex-end; padding-top: 22px; margin-top: 20px; border-top: 1px solid var(--line); }
.sleep-sync-warning { flex-shrink: 0; }
.sleep-sync-warning p { margin-top: 7px; font-size: 12px; }
.sleep-sync-warning button { display: flex; font-size: 12px; }

/* Login and connection errors share the same appearance. */
.login-page { display: grid; grid-template-columns: minmax(0, 1fr); place-items: center; min-height: 100dvh; padding: 28px; background: radial-gradient(ellipse at 10% 0, var(--accent-soft), transparent 65%), var(--background); }
.login-card { width: min(460px, 100%); min-width: 0; max-width: 100%; padding: 42px; background: var(--surface); border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--shadow); }
.login-card > .brand-mark { margin-bottom: 32px; }
.login-card > .eyebrow { font-size: 12px; letter-spacing: .08em; }
.login-card h1 { margin: 15px 0; font-size: 28px; font-weight: 650; letter-spacing: -.02em; }
.login-card > p { margin-bottom: 30px; color: var(--muted); font-size: 14px; line-height: 2; overflow-wrap: anywhere; }
.login-card .primary-button { width: 100%; margin-top: 8px; min-height: 48px; }
.login-card > small { display: block; margin-top: 30px; text-align: center; font-size: 12px; color: var(--muted); letter-spacing: .03em; }
.login-card .form-error { margin-bottom: 12px; }

@media (min-width: 1600px) {
  main#main { padding: 40px 48px 0; }
  .topbar, .page-footer { padding-left: 48px; padding-right: 48px; }
  .home-layout { grid-template-columns: minmax(0, 1fr) 360px; gap: 28px; }
  .home-primary, .home-aside { gap: 24px; }
  .calendar-card { padding: 25px 24px 0; }
  .calendar-day { min-height: 47px; }
}
@media (min-width: 768px) {
  .home-aside .tasks-card { height: 410px; min-height: 0; padding-top: 18px; }
  .home-aside .task-list { min-height: 0; max-height: none; flex: 1; }
  .home-aside .quick-task { min-height: 44px; margin-bottom: 10px; }
  .home-aside .quick-task input { padding-top: 10px; padding-bottom: 10px; }
  .home-aside .task-row { min-height: 64px; padding-top: 12px; padding-bottom: 12px; }
  .home-aside .task-footer { min-height: 48px; gap: 4px; }
}
@media (min-width: 1024px) and (max-width: 1199px) {
  .topbar { padding: 16px 24px; }
  main#main { padding: 28px 24px 0; }
  .home-layout { grid-template-columns: minmax(0, 1fr) 296px; gap: 18px; }
  .home-aside .card { padding-left: 17px; padding-right: 17px; }
  .home-aside .calendar-controls .icon-button { min-width: 38px; }
  .home-aside .card-heading h2 { font-size: 16px; }
  .workspace-label, .topbar-divider { display: none; }
  .topbar-right { gap: 10px; }
  .welcome { align-items: flex-start; }
  .welcome-actions { max-width: 200px; }
  .sync-caption { display: none; }
  .agenda-card { padding-left: 20px; padding-right: 20px; }
  .page-footer { padding-left: 24px; padding-right: 24px; }
}
@media (max-width: 1023px) {
  .rail { display: none; }
  .workspace { margin-left: 0; width: 100%; padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px)); }
  .mobile-nav { position: fixed; inset: auto 0 0; z-index: 30; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; padding: 7px max(12px, env(safe-area-inset-right, 0px)) calc(7px + env(safe-area-inset-bottom, 0px)) max(12px, env(safe-area-inset-left, 0px)); border-top: 1px solid var(--line); background: var(--surface); box-shadow: 0 -3px 18px rgb(40 25 15 / 3%); }
  .mobile-nav button, .mobile-nav a { display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 3px; min-width: 0; min-height: 58px; border: 0; border-radius: 12px; padding: 5px 4px; background: transparent; color: var(--muted); font-size: 12px; line-height: 1.4; }
  .mobile-nav .icon { width: 21px; height: 21px; }
  .mobile-nav .active, .mobile-nav [aria-current="page"] { background: var(--accent-soft); color: var(--accent-text); font-weight: 600; }
  .topbar { padding: 15px 28px; min-height: 76px; }
  main#main { padding: 30px 28px 0; }
  .home-layout { grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; }
  .home-aside .card { padding-left: 17px; padding-right: 17px; }
  .home-aside .card-heading h2 { font-size: 17px; }
  .home-aside .calendar-controls .icon-button { min-width: 38px; }
  .workspace-label, .topbar-divider { display: none; }
  .live-clock { display: none; }
  .welcome { align-items: flex-start; }
  .welcome-actions { max-width: 250px; }
  .calendar-layout { grid-template-columns: minmax(280px, .8fr) minmax(0, 1.2fr); gap: 20px; }
  .agenda-card { padding-left: 22px; padding-right: 22px; }
  .sync-caption { display: none; }
  .toast { bottom: calc(91px + env(safe-area-inset-bottom, 0px)); }
  .page-footer { padding-left: 28px; padding-right: 28px; }
  .feature-page { padding: 26px; }
  .feature-form-actions { bottom: calc(73px + env(safe-area-inset-bottom, 0px)); padding-bottom: 12px; }
}
@media (max-width: 767px) {
  .topbar { display: grid; grid-template-columns: minmax(0, 1fr) auto; padding: 12px 18px; min-height: 72px; gap: 11px 12px; }
  .wordmark { gap: 8px; font-size: 23px; }
  .wordmark > span:first-child { display: none; }
  .topbar > .wordmark { grid-column: 1; grid-row: 1; }
  .topbar-right { display: contents; }
  .topbar-right > .primary-button { grid-column: 2; grid-row: 1; }
  .search-box { grid-column: 1 / -1; grid-row: 2; width: 100%; padding: 0 12px; gap: 9px; }
  .search-box input { flex: 1; width: 100%; font-size: 16px; }
  .search-box kbd { display: none; }
  main#main { padding: 26px 16px 0; }
  .welcome { gap: 15px; align-items: flex-start; flex-direction: column; margin-bottom: 24px; }
  .welcome h1 { font-size: 27px; }
  .welcome p { font-size: 13px; }
  .welcome-actions { width: 100%; max-width: none; justify-content: space-between; gap: 10px; }
  .welcome-buttons { gap: 8px; }
  .welcome-buttons > button { font-size: 13px; padding-left: 13px; padding-right: 13px; }
  .home-layout { display: flex; flex-direction: column; gap: 18px; }
  .home-primary, .home-aside { display: contents; }
  .home-layout .next-event-card { order: 0; width: 100%; }
  .home-layout .agenda-card { order: 1; width: 100%; }
  .home-layout .tasks-card { order: 2; width: 100%; }
  .home-layout .notes-card, .home-layout .module-card { order: 3; width: 100%; }
  .home-layout .calendar-card { display: none; }
  .home-layout .home-calendar { display: none; }
  .home-layout .calendar-column { display: contents; }
  .next-event-card { padding: 22px; gap: 15px; }
  .next-event-copy strong { font-size: 21px; }
  .next-event-icon { width: 42px; height: 42px; border-radius: 13px; }
  .agenda-card, .tasks-card { padding: 22px 20px 0; }
  .agenda-card { height: auto; min-height: 0; }
  #agenda-panel .agenda-list { height: 420px; max-height: 420px; min-height: 240px; flex: none; }
  .agenda-date { margin-top: 8px; gap: 5px; }
  .agenda-date strong { font-size: 13px; }
  .agenda-date > div .icon-button { min-width: 40px; }
  .timeline-hour { left: 46px; }
  .timeline-hour > span { left: -46px; width: 40px; }
  .timeline-events { left: 46px; }
  .timeline-now { left: 43px; }
  .timeline-shortcuts { margin-left: 46px; }
  .timeline-event { padding-left: 7px; padding-right: 7px; }
  .timeline-event strong { font-size: 13px; }
  .timeline-event.short-event { padding: 0; }
  .tasks-card { min-height: 440px; }
  .task-list, .home-aside .task-list { max-height: 400px; }
  .notes-card { padding: 22px; }
  .calendar-layout { display: flex; flex-direction: column; gap: 18px; }
  .calendar-layout > * { width: 100%; }
  .dashboard[data-view="calendar"] > *, .dashboard[data-view="calendar"] .calendar-column { width: 100%; }
  .dashboard[data-view="calendar"] .calendar-card { padding: 23px 22px 0; }
  .calendar-day { min-height: 46px; }
  .dashboard[data-view="tasks"] .tasks-card { min-height: 580px; }
  .feature-page { padding: 24px 20px; }
  .feature-page .modal-heading h2 { font-size: 21px; }
  .page-tabs, .feature-tabs { gap: 5px; margin-bottom: 22px; padding: 5px; }
  .page-tabs button, .feature-tab { padding: 10px; font-size: 13px; }
  .page-footer { padding: 24px 18px 18px; align-items: flex-start; flex-direction: column; gap: 9px; }
  dialog, dialog.payroll-modal, dialog.payroll-settings-modal, dialog.sleep-modal, dialog.event-travel-modal { width: calc(100vw - 20px); max-height: calc(100dvh - 20px); padding: 23px 20px; border-radius: 19px; }
  dialog .modal-actions { position: sticky; bottom: -23px; z-index: 5; padding: 16px 0 calc(16px + env(safe-area-inset-bottom, 0px)); margin-top: 22px; background: var(--surface); }
  dialog .modal-heading { margin-bottom: 23px; }
  .modal-heading h2 { font-size: 21px; }
  :where(dialog, .feature-page, .login-card) input:not([type="checkbox"]):not([type="radio"]), :where(dialog, .feature-page, .login-card) textarea, :where(dialog, .feature-page, .login-card) select, .quick-task input { font-size: 16px; }
  .form-row { gap: 12px; }
  .payroll-source { align-items: flex-start; flex-direction: column; padding: 17px; gap: 13px; }
  .payroll-source > button { align-self: flex-end; }
  .payroll-month { gap: 8px; }
  .payroll-month > label { flex-direction: column; gap: 7px; font-size: 13px; }
  .payroll-month input { width: 160px !important; }
  .payroll-summary { padding: 20px 16px; gap: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .payroll-summary > div + div { padding-left: 14px; }
  .payroll-summary strong, .payroll-summary .payroll-instant-total strong { font-size: clamp(19px, 5.6vw, 28px); }
  .payroll-summary > div + div strong { font-size: 20px; }
  .payroll-days th, .payroll-days td { padding: 13px 10px; font-size: 13px; }
  .payroll-days tbody small { max-width: 130px; }
  .payroll-list-heading { align-items: flex-start; }
  .payroll-list-heading > span { text-align: right; }
  .payroll-row { gap: 12px; }
  .payroll-row-actions { max-width: 125px; }
  .payroll-row-actions > small { text-align: right; }
  .payroll-row-actions > button { padding: 10px; }
  .payroll-modal .modal-actions .text-button { text-align: left; }
  .pay-rules { padding: 15px; }
  .pay-rules .form-row { gap: 10px; }
  .pay-break-row .form-row { flex-direction: column; }
  .travel-direction, .travel-calendar-row { padding: 14px; }
  .travel-direction .form-row { gap: 9px; }
  .travel-preview { padding: 15px; }
  .travel-preview > div { gap: 10px; }
  .travel-form-actions { gap: 12px; }
  .travel-form-actions > div { width: 100%; justify-content: flex-end; }
  .travel-order { gap: 5px; }
  .travel-order-stage { padding: 7px 3px; }
  .sleep-section-heading { align-items: flex-start; gap: 11px; }
  .sleep-section-heading h3 { font-size: 17px; }
  .sleep-duration-fields { flex-direction: column; gap: 0; }
  .sleep-duration-fields > label, .sleep-duration-fields > fieldset { width: 100%; }
  .sleep-hours-fields { gap: 16px; }
  .sleep-date-fields { padding: 14px 12px 0; }
  .sleep-date-fields .form-row { gap: 10px; }
  .sleep-preview { padding: 16px; }
  .sleep-range-summary { gap: 8px; }
  .sleep-range-summary strong { font-size: 12px; }
  .sleep-range-summary b { font-size: 26px; }
  .sleep-range-summary b.sleep-precise-time { font-size: 18px; }
  .sleep-range-arrow { margin-left: 2px; margin-right: 2px; width: 17px; }
  .sleep-manual-actions > div { justify-content: space-between; width: 100%; gap: 7px; }
  .sleep-manual-actions > .primary-button { width: 100%; }
  .login-page { padding: 18px; }
  .login-card { padding: 32px 26px; }
  .login-card h1 { font-size: 25px; }
}
@media (max-width: 380px) {
  .topbar { padding-left: 13px; padding-right: 13px; }
  .topbar-right { gap: 0; }
  .search-box input { width: 100%; }
  main#main { padding-left: 12px; padding-right: 12px; }
  .welcome h1 { font-size: 25px; }
  .welcome-actions { align-items: flex-start; }
  .connection-pill { padding-left: 8px; padding-right: 8px; }
  .agenda-card, .tasks-card { padding-left: 16px; padding-right: 16px; }
  .agenda-date { flex-wrap: wrap; }
  .agenda-date > div { margin-left: auto; }
  .feature-page { padding: 22px 16px; }
  .payroll-summary { padding: 17px 12px; gap: 10px; }
  .payroll-summary > div + div { padding-left: 10px; }
  .payroll-summary strong, .payroll-summary .payroll-instant-total strong { font-size: 19px; }
  .payroll-summary > div + div strong { font-size: 18px; }
  .sleep-date-fields .form-row { flex-direction: column; gap: 0; }
  .sleep-range-summary b { font-size: 23px; }
  .sleep-range-summary b.sleep-precise-time { font-size: 16px; }
  .sleep-modal .modal-actions > .primary-button { width: 100%; }
  .sleep-modal .sleep-section .modal-actions > .text-button { justify-content: flex-start; }
  .color-picker { gap: 1px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
