/*
  1. Prevent padding and border from affecting element width. (https://github.com/mozdevs/cssremedy/issues/4)
  2. Remove default margins and padding
  3. Reset all borders.
*/

*,
::after,
::before,
::backdrop,
::file-selector-button {
  box-sizing: border-box; /* 1 */
  margin: 0; /* 2 */
  padding: 0; /* 2 */
  border: 0 solid; /* 3 */
}

/*
  1. Use a consistent sensible line-height in all browsers.
  2. Prevent adjustments of font size after orientation changes in iOS.
  3. Use a more readable tab size.
  4. Use the user's configured `sans` font-family by default.
  5. Use the user's configured `sans` font-feature-settings by default.
  6. Use the user's configured `sans` font-variation-settings by default.
  7. Disable tap highlights on iOS.
*/

html,
:host {
  line-height: 1.5; /* 1 */
  -webkit-text-size-adjust: 100%; /* 2 */
  tab-size: 4; /* 3 */
  font-family: --theme(
    --default-font-family,
    -apple-system,
    BlinkMacSystemFont,
    'Segoe UI',
    Roboto,
    'Helvetica Neue',
    'Noto Sans',
    Arial,
    sans-serif,
    'Apple Color Emoji',
    'Segoe UI Emoji',
    'Segoe UI Symbol',
    'Noto Color Emoji'
  ); /* 4 */
  font-feature-settings: --theme(--default-font-feature-settings, normal); /* 5 */
  font-variation-settings: --theme(--default-font-variation-settings, normal); /* 6 */
  -webkit-tap-highlight-color: transparent; /* 7 */
}

/*
  1. Add the correct height in Firefox.
  2. Correct the inheritance of border color in Firefox. (https://bugzilla.mozilla.org/show_bug.cgi?id=190655)
  3. Reset the default border style to a 1px solid border.
*/

hr {
  height: 0; /* 1 */
  color: inherit; /* 2 */
  border-top-width: 1px; /* 3 */
}

/*
  Add the correct text decoration in Chrome, Edge, and Safari.
*/

abbr:where([title]) {
  -webkit-text-decoration: underline dotted;
  text-decoration: underline dotted;
}

/*
  Remove the default font size and weight for headings.
*/

h1,
h2,
h3,
h4,
h5,
h6 {
  font-size: inherit;
  font-weight: inherit;
}

/*
  Reset links to optimize for opt-in styling instead of opt-out.
*/

a {
  color: inherit;
  -webkit-text-decoration: inherit;
  text-decoration: inherit;
}

/*
  Add the correct font weight in Edge and Safari.
*/

b,
strong {
  font-weight: bolder;
}

/*
  1. Use the user's configured `mono` font-family by default.
  2. Use the user's configured `mono` font-feature-settings by default.
  3. Use the user's configured `mono` font-variation-settings by default.
  4. Correct the odd `em` font sizing in all browsers.
*/

code,
kbd,
samp,
pre {
  font-family: --theme(
    --default-mono-font-family,
    ui-monospace,
    SFMono-Regular,
    Menlo,
    Monaco,
    Consolas,
    'Liberation Mono',
    'Courier New',
    monospace
  ); /* 1 */
  font-feature-settings: --theme(--default-mono-font-feature-settings, normal); /* 2 */
  font-variation-settings: --theme(--default-mono-font-variation-settings, normal); /* 3 */
  font-size: 1em; /* 4 */
}

/*
  Add the correct font size in all browsers.
*/

small {
  font-size: 80%;
}

/*
  Prevent `sub` and `sup` elements from affecting the line height in all browsers.
*/

sub,
sup {
  font-size: 75%;
  line-height: 0;
  position: relative;
  vertical-align: baseline;
}

sub {
  bottom: -0.25em;
}

sup {
  top: -0.5em;
}

/*
  1. Remove text indentation from table contents in Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=999088, https://bugs.webkit.org/show_bug.cgi?id=201297)
  2. Correct table border color inheritance in all Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=935729, https://bugs.webkit.org/show_bug.cgi?id=195016)
  3. Remove gaps between table borders by default.
*/

table {
  text-indent: 0; /* 1 */
  border-color: inherit; /* 2 */
  border-collapse: collapse; /* 3 */
}

/*
  Use the modern Firefox focus style for all focusable elements.
*/

:-moz-focusring:where(:not(iframe)) {
  outline: auto;
}

/*
  Add the correct vertical alignment in Chrome and Firefox.
*/

progress {
  vertical-align: baseline;
}

/*
  Add the correct display in Chrome and Safari.
*/

summary {
  display: list-item;
}

/*
  Make lists unstyled by default.
*/

ol,
ul,
menu {
  list-style: none;
}

/*
  1. Make replaced elements `display: block` by default. (https://github.com/mozdevs/cssremedy/issues/14)
  2. Add `vertical-align: middle` to align replaced elements more sensibly by default. (https://github.com/jensimmons/cssremedy/issues/14#issuecomment-634934210)
      This can trigger a poorly considered lint error in some tools but is included by design.
*/

img,
svg,
video,
canvas,
audio,
iframe,
embed,
object {
  display: block; /* 1 */
  vertical-align: middle; /* 2 */
}

/*
  Constrain images and videos to the parent width and preserve their intrinsic aspect ratio. (https://github.com/mozdevs/cssremedy/issues/14)
*/

img,
video {
  max-width: 100%;
  height: auto;
}

/*
  1. Inherit font styles in all browsers.
  2. Remove border radius in all browsers.
  3. Remove background color in all browsers.
  4. Ensure consistent opacity for disabled states in all browsers.
*/

button,
input,
select,
optgroup,
textarea,
::file-selector-button {
  font: inherit; /* 1 */
  font-feature-settings: inherit; /* 1 */
  font-variation-settings: inherit; /* 1 */
  letter-spacing: inherit; /* 1 */
  color: inherit; /* 1 */
  border-radius: 0; /* 2 */
  background-color: transparent; /* 3 */
  opacity: 1; /* 4 */
}

/*
  Restore default font weight.
*/

:where(select:is([multiple], [size])) optgroup {
  font-weight: bolder;
}

/*
  Restore indentation.
*/

:where(select:is([multiple], [size])) optgroup option {
  padding-inline-start: 20px;
}

/*
  Restore space after button.
*/

::file-selector-button {
  margin-inline-end: 4px;
}

/*
  Reset the default placeholder opacity in Firefox. (https://github.com/tailwindlabs/tailwindcss/issues/3300)
*/

::placeholder {
  opacity: 1;
}

/*
  Set the default placeholder color to a semi-transparent version of the current text color in browsers that do not
  crash when using `color-mix(…)` with `currentcolor`. (https://github.com/tailwindlabs/tailwindcss/issues/17194)
*/

@supports (not (-webkit-appearance: -apple-pay-button)) /* Not Safari */ or
  (contain-intrinsic-size: 1px) /* Safari 17+ */ {
  ::placeholder {
    color: color-mix(in oklab, currentcolor 50%, transparent);
  }
}

/*
  Prevent resizing textareas horizontally by default.
*/

textarea {
  resize: vertical;
}

/*
  Remove the inner padding in Chrome and Safari on macOS.
*/

::-webkit-search-decoration {
  -webkit-appearance: none;
}

/*
  1. Ensure date/time inputs have the same height when empty in iOS Safari.
  2. Ensure text alignment can be changed on date/time inputs in iOS Safari.
*/

::-webkit-date-and-time-value {
  min-height: 1lh; /* 1 */
  text-align: inherit; /* 2 */
}

/*
  Prevent height from changing on date/time inputs in macOS Safari when the input is set to `display: block`.
*/

::-webkit-datetime-edit {
  display: inline-flex;
}

/*
  Remove excess padding from pseudo-elements in date/time inputs to ensure consistent height across browsers.
*/

::-webkit-datetime-edit-fields-wrapper {
  padding: 0;
}

::-webkit-datetime-edit,
::-webkit-datetime-edit-year-field,
::-webkit-datetime-edit-month-field,
::-webkit-datetime-edit-day-field,
::-webkit-datetime-edit-hour-field,
::-webkit-datetime-edit-minute-field,
::-webkit-datetime-edit-second-field,
::-webkit-datetime-edit-millisecond-field,
::-webkit-datetime-edit-meridiem-field {
  padding-block: 0;
}

/*
  Center dropdown marker shown on inputs with paired `<datalist>`s in Chrome. (https://github.com/tailwindlabs/tailwindcss/issues/18499)
*/

::-webkit-calendar-picker-indicator {
  line-height: 1;
}

/*
  Remove the additional `:invalid` styles in Firefox. (https://github.com/mozilla/gecko-dev/blob/2f9eacd9d3d995c937b4251a5557d95d494c9be1/layout/style/res/forms.css#L728-L737)
*/

:-moz-ui-invalid {
  box-shadow: none;
}

/*
  Correct the inability to style the border radius in iOS Safari.
*/

button,
input:where([type='button'], [type='reset'], [type='submit']),
::file-selector-button {
  appearance: button;
}

/*
  Correct the cursor style of increment and decrement buttons in Safari.
*/

::-webkit-inner-spin-button,
::-webkit-outer-spin-button {
  height: auto;
}

/*
  Make elements with the HTML hidden attribute stay hidden by default.
*/

[hidden]:where(:not([hidden='until-found'])) {
  display: none !important;
}

:root {
  font-family: Inter, 'Segoe UI', system-ui, sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  background: #101114;
  color: #f5f5f5;
}

body { margin: 0; min-width: 320px; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button:not(:disabled), select, summary { cursor: pointer; }
button:disabled { opacity: .52; cursor: default; }
button, input, select, textarea { font: inherit; }
textarea { resize: vertical; }
a { color: inherit; }
button, a, input, select, textarea { outline-offset: 4px; }
:focus-visible { outline: 2px solid var(--accent, #5577f5); }

[data-theme] {
  color-scheme: dark;
  --bg: #101114;
  --surface: #191b20;
  --surface-up: #22252b;
  --text: #f5f5f5;
  --muted: #a1a5ae;
  --line: #2a2d35;
  --accent: #5577f5;
  --accent-text: #a8b8ff;
  --accent-surface: #1b2340;
  --accent-button: #6f8aff;
  --accent-ink: #101425;
  --green: #34c78b;
  --amber: #eab54d;
  --violet: #ac99f4;
  --danger: #ff8989;
  background: var(--bg);
  color: var(--text);
}

[data-theme='light'] {
  color-scheme: light;
  --bg: #f7f8fa;
  --surface: #fff;
  --surface-up: #edf0f6;
  --text: #17191d;
  --muted: #535962;
  --line: #dce0e8;
  --accent-text: #344bb1;
  --accent-surface: #e7edff;
  --green: #107a51;
  --amber: #89570a;
  --violet: #6545a6;
  --danger: #a02020;
}

@media (prefers-color-scheme: light) {
  [data-theme='system'] {
    color-scheme: light;
    --bg: #f7f8fa;
    --surface: #fff;
    --surface-up: #edf0f6;
    --text: #17191d;
    --muted: #535962;
    --line: #dce0e8;
    --accent-text: #344bb1;
    --accent-surface: #e7edff;
    --green: #107a51;
    --amber: #89570a;
    --violet: #6545a6;
    --danger: #a02020;
  }
}

h1, h2, h3, h4, p { margin: 0; }
h1 { font-size: clamp(2.65rem, 5vw, 4.1rem); font-weight: 700; line-height: 1.07; letter-spacing: -.065em; }
h2 { font-size: 1.125rem; line-height: 1.25; letter-spacing: -.022em; font-weight: 640; }
small, .metadata { color: var(--muted); font-size: .8125rem; line-height: 1.4; }
.muted { color: var(--muted); }
.eyebrow { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; color: var(--muted); font-size: .8125rem; font-weight: 650; letter-spacing: .10em; text-transform: uppercase; }
.actions { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem; }
.plain-button { border: 0; padding: 0; background: transparent; color: inherit; text-align: left; }
.button, .icon-button { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; min-height: 36px; border: 1px solid transparent; border-radius: 5px; background: transparent; color: var(--text); font-size: .875rem; line-height: 1.2; font-weight: 650; }
.button { padding: .45rem .75rem; }
.button svg, .icon-button svg { flex: none; }
.button.primary { background: var(--accent-button); color: var(--accent-ink); }
.button.primary:hover:enabled { background: color-mix(in srgb, var(--accent-button), white 16%); }
.button.quiet { border-color: var(--line); }
.button.quiet:hover:enabled, .icon-button:hover:enabled { background: var(--surface-up); }
.button.compact { min-height: 32px; padding-inline: .6rem; }
.icon-button { width: 36px; }
.text-button { background: transparent; color: var(--accent-text); border: 0; padding: .25rem .1rem; font-size: .875rem; font-weight: 650; text-align: start; }
.text-button:hover:enabled { text-decoration: underline; }

.app-shell { min-height: 100dvh; display: grid; grid-template-columns: 190px minmax(0,1fr); }
.app-shell[data-collapsed='true'] { grid-template-columns: 58px minmax(0,1fr); }
.skip-link { position: fixed; inset: .5rem auto auto .5rem; z-index: 5; background: var(--accent-button); color: var(--accent-ink); padding: .45rem .6rem; transform: translateY(-150%); }
.skip-link:focus { transform: none; }
.sidebar { position: sticky; top: 0; display: flex; flex-direction: column; align-self: start; min-height: 100dvh; padding: 0 .7rem .7rem; background: var(--surface); border-right: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: .65rem; padding: .95rem .5rem; color: var(--text); font-size: .9375rem; font-weight: 750; letter-spacing: .15em; white-space: nowrap; }
.brand img { flex: none; }
.side-links { display: grid; gap: .2rem; }
.side-links a { display: flex; align-items: center; min-height: 37px; gap: .65rem; padding: .4rem .5rem; color: var(--muted); border-radius: 4px; text-decoration: none; font-size: .875rem; white-space: nowrap; }
.side-links a svg { flex: none; }
.side-links a:hover { color: var(--text); background: var(--surface-up); }
.side-links a[aria-current='page'] { color: var(--accent-text); background: var(--accent-surface); font-weight: 650; }
.secondary-nav { margin-top: 1.05rem; padding-top: .8rem; border-top: 1px solid var(--line); }
.sidebar-footer { display: flex; justify-content: space-between; align-items: center; gap: .25rem; margin-top: auto; padding-top: 1.25rem; }
.workspace-label { padding-left: .5rem; font-size: .75rem; color: var(--muted); }
[data-collapsed='true'] .sidebar .brand span, [data-collapsed='true'] .sidebar .side-links a span, [data-collapsed='true'] .workspace-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.app-body { min-width: 0; }
.topbar { min-height: 58px; display: flex; justify-content: space-between; align-items: center; gap: .5rem; padding: .5rem clamp(1rem, 3vw, 2rem); border-bottom: 1px solid var(--line); }
.topbar-name { display: flex; align-items: center; gap: .45rem; color: var(--muted); font-size: .875rem; font-weight: 620; }
.topbar-name img, .mobile-nav { display: none; }
.search-trigger kbd { display: inline-block; padding: .12rem .25rem; margin-left: .1rem; border: 1px solid var(--line); border-radius: 3px; color: var(--muted); font-size: .6875rem; }
.active-focus { color: var(--green); }
.page-content { width: 100%; max-width: 1400px; margin-inline: auto; padding: clamp(1.25rem,3vw,2.5rem) clamp(1rem,3.5vw,3rem) 2.5rem; }
.page-heading { display: flex; justify-content: space-between; align-items: end; flex-wrap: wrap; gap: .65rem 1rem; margin-bottom: 1.3rem; }
.page-heading .eyebrow { margin-bottom: .3rem; }
.section-heading { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: .25rem .55rem; margin-bottom: .65rem; }
.brief { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); border-block: 1px solid var(--line); padding-block: .85rem; margin-bottom: 1.55rem; }
.brief > div { min-width: 0; display: grid; gap: .15rem; align-content: start; padding-inline: clamp(.7rem,2vw,1.25rem); border-left: 1px solid var(--line); }
.brief > div:first-child { border-left: 0; padding-left: 0; }
.brief > div > span { color: var(--muted); font-size: .8125rem; }
.brief strong { font-size: clamp(1.25rem, 3vw, 1.85rem); line-height: 1.2; letter-spacing: -.045em; font-weight: 675; font-variant-numeric: tabular-nums; }
.brief small { overflow-wrap: anywhere; }
.brief progress { display: block; appearance: none; height: 3px; width: min(100%,85px); margin-top: .35rem; background: var(--surface-up); border: 0; }
.brief progress::-webkit-progress-bar { background: var(--surface-up); }
.brief progress::-webkit-progress-value { background: var(--accent); }
.brief progress::-moz-progress-bar { background: var(--accent); }
.today-grid { display: grid; grid-template-columns: minmax(0,1.55fr) minmax(0,1fr); gap: clamp(1rem, 3vw, 2.15rem); }
.event-list { display: grid; gap: .35rem; list-style: none; padding: 0; margin: 0; }
.event-row, .now-line { min-width: 0; display: grid; grid-template-columns: 48px minmax(0,1fr); align-items: center; gap: .45rem; }
.event-row time, .now-line time { font-variant-numeric: tabular-nums; color: var(--muted); font-size: .8125rem; }
.event-body { display: grid; gap: .1rem; min-width: 0; padding: .45rem .65rem; background: var(--surface); border-left: 2px solid var(--muted); border-radius: 0 4px 4px 0; overflow-wrap: anywhere; }
.event-body:hover { background: var(--surface-up); }
.event-next { background: var(--accent-surface); }
.event-body strong { font-size: .875rem; font-weight: 620; }
.type-fixed { border-left-color: var(--amber); }
.type-focus { border-left-color: var(--accent); }
.type-routine { border-left-color: var(--violet); }
.now-line { padding: .1rem 0; }
.now-line time, .now-line span { color: var(--accent-text); }
.now-line span { display: flex; align-items: center; gap: .35rem; font-size: .75rem; }
.now-line span::after { content: ''; height: 1px; flex: 1; background: var(--accent); }
.next-action { padding: clamp(.85rem,2vw,1.25rem); background: var(--accent-surface); border: 1px solid color-mix(in srgb,var(--line),var(--accent) 45%); border-radius: 6px; }
.next-action .eyebrow { color: var(--accent-text); }
.next-action h2 { margin-block: .4rem .25rem; font-size: clamp(1.2rem,2.1vw,1.6rem); overflow-wrap: anywhere; }
.next-action p:not(.eyebrow) { color: var(--muted); font-size: .9rem; }
.next-action .button { margin-top: .75rem; }
.priority-section { margin-top: 1.1rem; }
.empty { border-block: 1px solid var(--line); padding: .85rem 0; color: var(--muted); }
.empty strong { font-size: .9375rem; font-weight: 650; color: var(--text); }
.empty > div { margin-top: .55rem; }
.empty p + .actions { margin-top: .65rem; }
.task-row { display: grid; grid-template-columns: 32px minmax(0,1fr); gap: .35rem; align-items: center; border-top: 1px solid var(--line); }
.task-check { width: 32px; color: var(--muted); }
.task-done .task-check { color: var(--green); }
.task-done .task-body strong { color: var(--muted); text-decoration: line-through; }
.task-body, .note-row, .search-result { min-width: 0; padding: .55rem .2rem; overflow-wrap: anywhere; }
.task-body { display: grid; gap: .15rem; }
.task-body strong, .note-row strong { font-size: .9375rem; font-weight: 620; }
.recurrence-icon { display: inline-flex; margin-inline-start: .35em; color: var(--muted); vertical-align: -.13em; }
.task-body:hover strong, .note-row:hover strong { color: var(--accent-text); }
.note-row { display: flex; width: 100%; align-items: center; justify-content: space-between; gap: .65rem; border-top: 1px solid var(--line); }
.note-row > span { display: grid; gap: .15rem; }
.note-row svg { color: var(--accent-text); flex: none; }
.inbox-row { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: .65rem; align-items: center; border-top: 1px solid var(--line); }
.inbox-row > :first-child { border-top: 0; }
.history-row { display: flex; justify-content: space-between; gap: 1rem; border-top: 1px solid var(--line); padding: .75rem 0; }
.history-row > div { display: grid; gap: .15rem; overflow-wrap: anywhere; }
.history-row p { white-space: pre-wrap; color: var(--muted); }
.habit-checkin-row { display: flex; align-items: center; justify-content: space-between; gap: .65rem; padding: .48rem 0; border-top: 1px solid var(--line); }
.habit-checkin-row strong, .routine-row strong { overflow-wrap: anywhere; }
.habit-status { flex: none; max-width: 100%; min-height: 34px; border: 1px solid var(--line); border-radius: 5px; padding: .2rem .4rem; background: var(--surface); color: var(--text); font-size: .875rem; }
.habit-week-days { display: grid; grid-template-columns: repeat(7,minmax(0,1fr)); gap: .25rem; max-width: 630px; margin-bottom: .9rem; }
.habit-week-days > .button { min-width: 0; flex-direction: column; gap: .12rem; padding: .28rem .08rem; }
.habit-week-days > [aria-pressed='true'] { background: var(--accent-surface); color: var(--accent-text); border-color: var(--accent); }
.habit-marks { margin-bottom: .65rem; }
.habit-mark { display: grid; place-items: center; min-height: 1.7rem; border-radius: 4px; background: var(--surface); color: var(--muted); font-size: .875rem; }
.habit-mark.habit-done { color: var(--green); font-weight: 700; }
.habit-mark.habit-skipped { color: var(--amber); }
.habit-mark.habit-rest { color: var(--accent-text); }
.habit-mark.habit-unscheduled { background: transparent; }
.habit-starters { border-top: 1px solid var(--line); padding-top: .7rem; margin-top: 1rem; }
.habit-starters .actions { margin-top: .6rem; }
.routine-library-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: .5rem; margin-bottom: .65rem; }
.routine-row { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .5rem .75rem; padding: .65rem 0; border-top: 1px solid var(--line); }
.routine-row > div:first-child { display: grid; min-width: 0; }
.routine-steps legend { margin-bottom: .4rem; }
.routine-step { display: grid; grid-template-columns: minmax(0,1fr) minmax(3.5rem,5rem) auto; align-items: end; gap: .45rem; }
.routine-step > button { min-height: 38px; }
.routine-preview { display: grid; margin: 0; padding: 0; }
.routine-preview li { display: grid; grid-template-columns: minmax(3.3rem,auto) minmax(0,1fr) auto; align-items: center; gap: .45rem; border-top: 1px solid var(--line); padding: .4rem 0; }
.routine-preview strong { overflow-wrap: anywhere; }
.routine-preview time, .routine-overlap { color: var(--muted); font-size: .875rem; }
.routine-overlap { color: var(--amber); }
.history-row > span { white-space: nowrap; color: var(--accent-text); }

.planner-toolbar, .list-tools { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .7rem; border-block: 1px solid var(--line); padding: .55rem 0; margin-bottom: .9rem; }
.list-tools { justify-content: start; align-items: end; }
.segments { display: inline-flex; flex-wrap: wrap; gap: .15rem; padding: .2rem; border: 1px solid var(--line); border-radius: 5px; }
.segments button { border: 0; padding: .3rem .55rem; min-height: 32px; color: var(--muted); background: transparent; border-radius: 3px; text-transform: capitalize; font-size: .875rem; }
.segments button[aria-pressed='true'] { background: var(--accent-surface); color: var(--accent-text); font-weight: 650; }
.planner-groups { display: grid; }
.planner-groups > section { min-width: 0; padding: .7rem; border: 1px solid var(--line); }
.planner-week { grid-template-columns: repeat(7,minmax(0,1fr)); }
.planner-week > section { min-height: 270px; padding: .45rem; }
.planner-week > section + section { border-left: 0; }
.planner-current { background: color-mix(in srgb,var(--accent-surface) 45%,var(--bg)); }
.planner-week .event-row { grid-template-columns: minmax(0,1fr); gap: .15rem; }
.planner-week .event-body { padding: .35rem; }
.planner-week .section-heading .icon-button { min-height: 26px; width: 26px; }
.planner-agenda { gap: .6rem; }
.month-grid { display: grid; grid-template-columns: repeat(7,minmax(0,1fr)); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.month-grid > * { min-width: 0; border: 0; border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.month-weekday { padding: .25rem; text-align: center; color: var(--muted); font-size: .8rem; }
.month-day { display: grid; gap: .15rem; align-content: start; min-height: 66px; padding: .4rem .55rem; text-align: start; }
.month-day:hover { background: var(--surface-up); }
.month-day[aria-current='date'] { background: var(--accent-surface); color: var(--accent-text); }
.month-day.outside-month { color: var(--muted); }
.month-day small { overflow-wrap: anywhere; }

.dialog { position: fixed; inset: 0; width: min(100% - 2rem, 520px); max-height: calc(100dvh - 2rem); margin: auto; padding: clamp(.9rem,3vw,1.25rem); color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; overflow: auto; }
.dialog::backdrop { background: #08090bd9; }
.dialog-heading { display: flex; justify-content: space-between; align-items: center; gap: .5rem; margin-bottom: .8rem; }
.dialog-heading h2 { font-size: 1.25rem; }
.form-grid { display: grid; gap: .8rem; min-width: 0; padding: 0; border: 0; }
.occurrence-repeat { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .55rem; font-size: .875rem; }
.field-row { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .65rem; }
.form-grid label, .compact-field { display: grid; gap: .25rem; min-width: 0; font-size: .875rem; }
.form-grid input:not([type='checkbox']), .form-grid textarea, .form-grid select, .compact-field input, .compact-field select, .search-input input {
  width: 100%; min-width: 0; min-height: 38px; padding: .45rem .6rem; border: 1px solid var(--line); border-radius: 5px; background: var(--bg); color: var(--text); font-size: 1rem;
}
.form-grid .check-field, .check-field { display: flex; align-items: center; gap: .5rem; min-height: 31px; overflow-wrap: anywhere; }
.check-field input { flex: none; width: 16px; height: 16px; accent-color: var(--accent); }
.align-end { align-self: end; }
.form-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: .5rem; padding-top: .25rem; }
.form-error, .error-banner { color: var(--danger); }
.choice-list { display: grid; gap: .25rem; max-height: 270px; overflow: auto; }
.choice-list label { padding: .35rem 0; border-top: 1px solid var(--line); }
.reset-choice span { display: grid; }
.banner { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .5rem .65rem; margin-bottom: .75rem; border: 1px solid var(--line); border-radius: 4px; }
.banner:not(.error-banner) { color: var(--green); }
.search-field { flex: 1 1 175px; }
.search-input { display: flex; align-items: center; gap: .45rem; margin-bottom: .55rem; }
.search-input svg { color: var(--muted); flex: none; }
.search-results { display: grid; }
.search-result { display: flex; align-items: baseline; justify-content: space-between; gap: .55rem; border-top: 1px solid var(--line); }
.search-result:hover { color: var(--accent-text); }
.markdown { display: grid; gap: .35rem; min-height: 125px; overflow-wrap: anywhere; }
.markdown a { color: var(--accent-text); text-decoration: underline; }
.settings-section { display: grid; gap: .65rem; max-width: 540px; margin-bottom: 1.5rem; padding-block: .75rem; border-block: 1px solid var(--line); }
.focus-clock { display: grid; gap: .25rem; justify-items: center; margin-bottom: 1rem; text-align: center; overflow-wrap: anywhere; }
.timer-digits { font-size: clamp(2.5rem, 13vw, 4.75rem); font-weight: 650; font-variant-numeric: tabular-nums; letter-spacing: -.035em; line-height: 1.2; }
.focus-actions { display: flex; justify-content: center; gap: .6rem; }
.focus-presets { justify-self: start; }
.entry { min-height: 100dvh; display: grid; place-items: center; padding: 1.25rem; }
.entry-content { width: min(100%,420px); }
.entry-content .brand { padding: 0 0 1.1rem; }
.entry-content .brand span { display: none; }
.entry-intro { color: var(--muted); margin-block: .65rem 1.35rem; max-width: 32ch; }
.entry-account, .entry-local { border-top: 1px solid var(--line); padding-block: 1rem; }
.entry-local p { margin-top: .6rem; }

@media (max-width: 1060px) {
  .planner-week { grid-template-columns: repeat(4,minmax(0,1fr)); }
  .planner-week > section { min-height: 142px; border: 1px solid var(--line); }
  .planner-week > section + section { border-left: 1px solid var(--line); }
}

@media (max-width: 760px) {
  .app-shell, .app-shell[data-collapsed='true'] { display: block; }
  .sidebar, .desktop-capture, .search-trigger kbd { display: none; }
  .topbar-name img { display: inline-block; }
  .page-content { padding-bottom: calc(5rem + env(safe-area-inset-bottom)); }
  .mobile-nav { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); position: fixed; inset: auto 0 0; z-index: 2; border-top: 1px solid var(--line); background: var(--surface); padding-bottom: env(safe-area-inset-bottom); }
  .mobile-nav a, .mobile-nav button { display: grid; align-content: center; justify-items: center; gap: .15rem; min-height: 54px; min-width: 0; color: var(--muted); text-decoration: none; text-align: center; font-size: .75rem; }
  .mobile-nav [aria-current='page'], .mobile-nav .mobile-add { color: var(--accent-text); font-weight: 650; }
}

@media (max-width: 525px) {
  .today-grid { display: flex; flex-direction: column; }
  .today-aside { order: -1; }
  .brief { grid-template-columns: repeat(2,minmax(0,1fr)); gap: .7rem 0; }
  .brief > div:nth-child(3) { border-left: 0; padding-left: 0; }
  .planner-week { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .month-day { min-height: 48px; padding: .25rem; }
  .month-day small span { display: none; }
  .topbar .search-trigger span { display: none; }
}

@media (pointer: coarse) {
  .button, .icon-button, .text-button, .segments button, .task-body, .side-links a, .planner-week .section-heading .icon-button { min-height: 44px; }
  .check-field { min-height: 44px; }
  .habit-status { min-height: 44px; font-size: 1rem; }
}
