:root {
  color-scheme: light;
  --paper: #f2eee9;
  --paper-bright: #faf8f5;
  --ink: #252321;
  --muted: #918b86;
  --line: rgba(89, 80, 74, .15);
  --blue: #2781de;
  --blue-soft: #e4effb;
  --blue-wash: #e7f1f7;
  --violet: #b997c8;
  --deep-violet: #747599;
  --shadow: 0 12px 35px rgba(63, 52, 68, .11);
  --calendar-day-width: 74px;
  --calendar-time-width: 46px;
  font-family: "Avenir Next", "Segoe UI", -apple-system, BlinkMacSystemFont, sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
html, body { min-height: 100%; margin: 0; }
body {
  color: var(--ink);
  background:
    radial-gradient(ellipse at 3% 5%, rgba(255,255,255,.9) 0 6%, transparent 35%),
    radial-gradient(ellipse at 95% 6%, rgba(224,210,228,.33), transparent 29%),
    linear-gradient(135deg, #f5f1ed, var(--paper) 55%, #eeebe8);
}
button, input, textarea, select { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 2px solid #75aee9; outline-offset: 2px; }
.app-shell { min-height: 100dvh; max-width: 560px; margin: 0 auto; position: relative; overflow: hidden; }
.screen { min-height: 100dvh; padding: max(14px, env(safe-area-inset-top)) 19px calc(116px + var(--safe-bottom)); position: relative; }
.screen::before { content: ""; position: fixed; inset: 0; pointer-events: none; opacity: .18; z-index: -1; background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 160 160' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.12'/%3E%3C/svg%3E"); }
.topbar { display: flex; align-items: center; gap: 10px; min-height: 44px; margin: 0 0 18px; }
.topbar-spacer { flex: 1; }
.date-lockup { border: 0; padding: 0; background: transparent; text-align: left; cursor: pointer; }
.date-lockup { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }
.date-number { color: var(--blue); font-family: "Avenir Next", "Segoe UI", sans-serif; font-size: 42px; font-weight: 400; line-height: .92; letter-spacing: -3px; }
.date-small { display: flex; flex-direction: column; gap: 1px; text-transform: uppercase; font-size: 10px; letter-spacing: .045em; color: var(--muted); line-height: 1.15; }
.date-small strong { color: var(--ink); font-size: 13px; font-weight: 700; }
.round-btn { width: 44px; height: 44px; border: 1px solid rgba(71,65,70,.16); background: rgba(255,255,255,.66); border-radius: 50%; display: grid; place-items: center; cursor: pointer; box-shadow: 0 2px 8px rgba(55,48,57,.04); }
.round-btn svg { width: 20px; height: 20px; }
.round-btn.primary { background: var(--blue); color: white; border-color: transparent; box-shadow: 0 5px 14px rgba(39,129,222,.18); }
.round-btn.small { width: 37px; height: 37px; }
.content { position: relative; z-index: 1; }
.micro-title { color: var(--muted); text-transform: uppercase; font-size: 11px; font-weight: 700; letter-spacing: .1em; }
.review-card { position: relative; margin: 9px 0 20px; padding: 10px 25px 11px 0; border-top: 1px solid var(--line); color: #77716c; font-size: 11px; line-height: 1.35; }
.review-card strong { display: block; color: var(--blue); font-size: 12px; margin-bottom: 3px; }
.dismiss { position: absolute; right: 0; top: 8px; border: 0; background: transparent; color: #9a938f; cursor: pointer; }
.section { margin: 0 0 17px; }
.section-head { display: flex; align-items: center; gap: 8px; min-height: 30px; cursor: pointer; user-select: none; }
.chevron { color: #8f8984; font-size: 15px; width: 15px; transform: rotate(0deg); transition: transform .18s; }
.section.collapsed .chevron { transform: rotate(-90deg); }
.section-title { text-transform: uppercase; font-family: "Avenir Next", "Segoe UI", sans-serif; font-size: 15px; font-weight: 700; letter-spacing: .025em; }
.section-count { font-size: 12px; color: var(--muted); }
.rule { height: 1px; flex: 1; background: var(--line); }
.section-add, .list-icon-button { border: 0; background: transparent; color: var(--blue); cursor: pointer; padding: 1px 4px; display: grid; place-items: center; }
.section-add svg, .list-icon-button svg { width: 18px; height: 18px; }
.empty-hint { color: #9e9893; font-size: 12px; padding: 8px 0 6px 23px; }
.entry { display: grid; grid-template-columns: 43px 19px minmax(0,1fr) auto; align-items: center; gap: 6px; padding: 7px 0 6px; min-height: 39px; }
.entry-time { font-size: 11px; font-weight: 600; color: #484440; text-align: right; }
.check { appearance: none; width: 18px; height: 18px; border: 1.5px dotted #3e3b38; border-radius: 6px; margin: 0; cursor: pointer; position: relative; }
.check:checked { border: 0; background: var(--blue); }
.check:checked::after { content: "✓"; position: absolute; inset: 0; color: white; text-align: center; font-size: 13px; line-height: 18px; font-weight: 700; }
.entry-text { font-size: 13px; line-height: 1.25; }
.entry-copy { min-width: 0; width: 100%; text-align: left; border: 0; background: transparent; padding: 0; cursor: pointer; }
.entry.done .entry-text { color: #9e9893; text-decoration: line-through; }
.repeat { display: block; color: #928c87; margin: 2px 0 0 24px; font-size: 10px; }
.repeat b { color: #62ae75; font-size: 12px; }
.task-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; }
.task-row .task-name { flex: 1; font-size: 13px; }
.task-name-button { flex: 1; border: 0; background: transparent; padding: 0; text-align: left; font-size: 13px; cursor: pointer; }
.muted-row { color: var(--muted); }
.overdue-box { padding: 5px 0 0 18px; }
.overdue-item { display: grid; grid-template-columns: 19px minmax(0,1fr) auto; gap: 8px; align-items: center; padding: 9px 0; }
.overdue-copy { min-width: 0; }
.overdue-meta { display: flex; align-items: center; gap: 7px; font-size: 11px; font-weight: 700; text-transform: uppercase; }
.overdue-meta time { font-weight: 500; color: var(--muted); }
.move-link { border: 0; background: transparent; padding: 0; color: var(--blue); font-size: 10px; font-weight: 700; cursor: pointer; white-space: nowrap; }
.move-all { display: flex; align-items: center; gap: 8px; margin: 5px 0 5px 26px; border: 0; background: transparent; padding: 5px 0; color: var(--blue); font-size: 10px; font-weight: 700; cursor: pointer; }
.move-all svg { width: 17px; }
.day-summary { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 2px 0 14px; }
.day-summary p { margin: 5px 0 0; color: #77716c; font-size: 12px; }
.summary-add { display: inline-flex; align-items: center; gap: 7px; flex: none; border: 0; border-radius: 20px; background: rgba(255,255,255,.58); padding: 9px 12px; color: var(--blue); font-size: 11px; font-weight: 700; cursor: pointer; }
.summary-add svg { width: 14px; }
.habit-list { padding-left: 20px; }
.habit-row { display: grid; grid-template-columns: 21px 1fr auto; gap: 8px; align-items: center; padding: 7px 0; }
.habit-row .repeat { margin-left: 0; }
.habit-count { color: #66b47b; font-size: 11px; }
.wave-floor { position: fixed; height: 104px; max-width: 560px; width: 100%; bottom: calc(77px + var(--safe-bottom)); left: 50%; transform: translateX(-50%); pointer-events: none; z-index: 0; opacity: .86; background: url("data:image/svg+xml,%3Csvg viewBox='0 0 560 100' preserveAspectRatio='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 45 C70 70 85 52 154 65 S263 48 332 68 S445 54 560 29 V100 H0Z' fill='%23bb9ac8'/%3E%3Cpath d='M0 75 C89 62 128 82 208 67 S317 69 391 55 S484 62 560 75 V100 H0Z' fill='%2375799d'/%3E%3C/svg%3E") bottom/100% 100% no-repeat; }
.tabbar { position: fixed; z-index: 10; bottom: calc(10px + var(--safe-bottom)); left: 50%; transform: translateX(-50%); width: min(calc(100% - 32px), 520px); height: 58px; display: grid; grid-template-columns: repeat(4,1fr); padding: 4px; border-radius: 30px; background: rgba(251,249,247,.76); border: 1px solid rgba(255,255,255,.82); box-shadow: 0 5px 24px rgba(39,35,43,.16), inset 0 1px 1px rgba(255,255,255,.9); backdrop-filter: blur(20px); }
.tab { border: 0; border-radius: 25px; background: transparent; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 1px; color: #242220; cursor: pointer; font-size: 9px; font-weight: 600; }
.tab svg { width: 20px; height: 20px; stroke-width: 2.2; }
.tab.active { color: var(--blue); background: rgba(212,229,247,.78); }
.date-ribbon { position: fixed; z-index: 11; bottom: calc(62px + var(--safe-bottom)); left: 50%; transform: translateX(-50%); display: flex; align-items: center; justify-content: center; gap: 15px; min-width: 170px; padding: 4px 10px; border: 1px solid rgba(255,255,255,.9); border-radius: 22px; background: rgba(250,247,246,.77); backdrop-filter: blur(15px); box-shadow: 0 2px 11px rgba(60,52,62,.1); }
.ribbon-day { border: 0; background: none; color: #77716e; min-width: 28px; cursor: pointer; display: grid; justify-items: center; gap: 0; }
.ribbon-day small { font-size: 8px; text-transform: uppercase; }
.ribbon-day strong { font-size: 14px; font-weight: 500; }
.ribbon-day.selected { color: var(--blue); }
.ribbon-day.selected strong { font-weight: 800; }
.page-header { display: flex; align-items: center; margin-bottom: 17px; min-height: 43px; }
.add-task-label { display: inline-flex; align-items: center; gap: 5px; margin-left: auto; margin-right: 7px; border: 0; border-radius: 18px; padding: 9px 11px; background: var(--blue-soft); color: var(--blue); font-size: 11px; font-weight: 700; cursor: pointer; }
.add-task-label svg { width: 14px; height: 14px; }
.page-title { font-family: "Avenir Next", "Segoe UI", sans-serif; font-size: 22px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; flex: 1; }
.page-title.compact { font-size: 18px; }
.pill-toggle { display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--line); border-radius: 22px; padding: 5px; background: rgba(255,255,255,.56); }
.pill-toggle button { border: 0; border-radius: 18px; padding: 7px 11px; background: transparent; text-transform: uppercase; font-size: 10px; font-weight: 700; cursor: pointer; }
.pill-toggle button.active { background: var(--paper-bright); box-shadow: 0 1px 5px rgba(30,25,20,.09); }
.calendar-grid { overflow: auto; margin: 0 -19px; padding: 0 19px 15px; scrollbar-width: none; }
.calendar-grid::-webkit-scrollbar { display: none; }
.week-head, .week-columns { display: grid; grid-template-columns: 46px repeat(7,minmax(62px,1fr)); min-width: max-content; }
.week-head { position: sticky; top: 0; z-index: 2; background: rgba(242,238,233,.94); border-bottom: 1px solid var(--line); }
.week-head button { padding: 8px 2px 10px; border: 0; background: transparent; cursor: pointer; color: var(--muted); font-size: 10px; font-weight: 700; }
.week-head button strong { display: block; margin-top: 3px; color: var(--ink); font-size: 13px; }
.week-head button.active strong { color: var(--blue); }
.time-label { height: 62px; border-bottom: 1px dotted var(--line); color: #9c9691; font-size: 9px; padding-top: 4px; }
.week-day { position: relative; min-height: 930px; border-left: 1px solid rgba(80,72,67,.11); background: repeating-linear-gradient(to bottom, transparent 0 61px, rgba(80,72,67,.11) 61px 62px); }
.week-day .half-line { position: absolute; top: 30px; left: 0; right: 0; border-top: 1px dotted rgba(80,72,67,.13); }
.calendar-event { position: absolute; z-index: 2; left: 3px; right: 3px; min-height: 34px; overflow: hidden; border: 0; border-left: 3px solid #63b6b2; border-radius: 4px; background: rgba(193,228,223,.63); padding: 5px 4px; color: var(--ink); text-align: left; font-size: 10px; line-height: 1.25; cursor: pointer; }
.calendar-event.blue { border-left-color: var(--blue); background: rgba(189,220,248,.7); }
.calendar-event.purple { border-left-color: #aa84c1; background: rgba(224,208,232,.7); }
.calendar-event.reminder { border-left-color: #d28c54; background: rgba(249,225,201,.77); }
.calendar-event.habit { border-left-color: #80aa85; background: rgba(216,233,216,.77); }
.calendar-event.all-day { top: 2px; height: 29px; min-height: 28px; }
.calendar-event.completed, .timeline-block.completed { opacity: .38; filter: grayscale(1); cursor: default; }
.calendar-slot { position: absolute; z-index: 1; left: 0; right: 0; width: 100%; border: 0; padding: 0; background: transparent; cursor: crosshair; }
.calendar-slot:hover { background: rgba(39,129,222,.08); }
.calendar-event small { display: block; color: #716d6a; font-size: 8px; }
.day-timeline { border-top: 1px solid var(--line); }
.timeline-row { display: grid; grid-template-columns: 48px minmax(0,1fr); min-height: 52px; border-bottom: 1px dotted rgba(80,72,67,.16); }
.timeline-hour { padding-top: 4px; font-size: 14px; font-weight: 700; }
.timeline-slot { position: relative; border-left: 1px solid rgba(80,72,67,.1); }
.timeline-slot small { position: absolute; left: 4px; top: 2px; color: #aaa39f; font-size: 8px; }
.timeline-add { position: absolute; z-index: 0; inset: 0 0 50% 0; width: 100%; border: 0; background: transparent; cursor: crosshair; }
.timeline-add.half { inset: 50% 0 0 0; }
.timeline-add:hover { background: rgba(39,129,222,.08); }
.timeline-all-day { margin: 0 0 9px 48px; display: grid; gap: 4px; }
.timeline-all-day .calendar-event { position: relative; inset: auto; width: 100%; height: auto; min-height: 30px; }
.timeline-block { position: absolute; z-index: 1; left: 4px; right: 8px; min-height: 40px; border: 0; border-left: 3px solid var(--blue); border-radius: 6px; background: rgba(196,223,249,.8); padding: 6px; text-align: left; font-size: 11px; cursor: pointer; }
.timeline-block small { display: block; margin-top: 2px; color: #666; font-size: 9px; }
.list-group { padding: 8px 0; }
.list-group-head { display: grid; grid-template-columns: 18px 20px 1fr auto 20px; align-items: center; gap: 7px; padding: 8px 0; cursor: pointer; }
.list-group-head .group-title { font-size: 13px; }
.list-group-head .group-count { color: var(--muted); font-size: 12px; }
.smart-list { border-top: 1px solid var(--line); margin-top: 16px; padding-top: 13px; }
.smart-list-row { display: flex; align-items: center; padding: 12px 2px; border-bottom: 1px dotted var(--line); gap: 9px; font-size: 12px; cursor: pointer; }
.smart-list-row, .user-list-row { width: 100%; border-top: 0; border-left: 0; border-right: 0; font-family: inherit; color: var(--ink); text-align: left; }
.smart-list-row.selected, .user-list-row.selected { color: var(--blue); }
.user-lists { margin-top: 11px; border-top: 1px solid var(--line); }
.user-list-row { display: flex; align-items: center; gap: 10px; padding: 13px 3px; border-bottom: 1px dotted var(--line); background: transparent; font-size: 13px; cursor: pointer; }
.user-list-row span { flex: 1; }
.user-list-row small { color: var(--muted); }
.subhead { margin-top: 5px; color: var(--muted); font-size: 12px; }
.settings-content { max-width: 860px; margin-left: 0; }
.settings-group { margin: 18px 0 24px; }
.settings-heading { margin: 0 0 8px 4px; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .12em; }
.settings-card { display: flex; align-items: center; gap: 12px; width: 100%; padding: 14px; margin: 7px 0; border: 1px solid rgba(255,255,255,.7); border-radius: 15px; background: rgba(255,255,255,.52); text-align: left; }
.settings-copy { flex: 1; font-size: 13px; font-weight: 600; }
.settings-copy small { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; font-weight: 400; line-height: 1.35; }
.settings-icon { width: 35px; height: 35px; display: grid; place-items: center; border-radius: 11px; background: var(--blue-soft); color: var(--blue); }
.settings-link { cursor: pointer; font-family: inherit; color: var(--ink); }
.settings-arrow { color: var(--muted); font-size: 23px; }
.theme-options { display: flex; flex-wrap: wrap; gap: 6px; margin-left: auto; }
.theme-option { border: 1px solid var(--line); border-radius: 18px; background: transparent; padding: 8px 10px; font-size: 10px; cursor: pointer; }
.theme-option.selected { color: var(--blue); border-color: var(--blue); background: var(--blue-soft); }
.calendar-brand { width: 35px; height: 35px; display: grid; place-items: center; border-radius: 11px; background: white; font-size: 19px; font-weight: 800; }
.calendar-brand.google { color: #4285f4; }
.calendar-brand.apple { color: #4a4948; }
.coming-soon { color: var(--muted); font-size: 9px; white-space: nowrap; }
.muted-card { opacity: .76; cursor: default; }
.settings-footnote { margin-top: 25px; color: var(--muted); font-size: 10px; text-align: center; }
.smart-list-row .count { margin-left: auto; color: var(--muted); }
.search-box { display: flex; align-items: center; gap: 10px; background: rgba(255,255,255,.7); border-radius: 15px; padding: 12px 14px; margin: 17px 0 14px; }
.search-box input { flex: 1; width: 100%; border: 0; outline: 0; background: transparent; font-size: 13px; }
.inbox-card { display: flex; align-items: center; justify-content: space-between; padding: 14px; background: rgba(255,255,255,.65); border-radius: 13px; font-size: 13px; }
.blank-state { color: #9c9590; font-size: 12px; padding: 18px 0; }
.overlay { position: fixed; inset: 0; z-index: 30; display: flex; align-items: flex-end; justify-content: center; background: rgba(34,30,34,.2); backdrop-filter: blur(3px); }
.composer { width: min(100%,560px); max-height: min(88dvh,780px); overflow: auto; border-radius: 25px 25px 0 0; padding: 10px 15px calc(18px + var(--safe-bottom)); background: #fbfaf8; box-shadow: 0 -14px 48px rgba(34,28,38,.15); animation: rise .22s ease-out; }
@keyframes rise { from { transform: translateY(24px); opacity: .7; } to { transform: translateY(0); opacity: 1; } }
.composer-top { position: sticky; top: -10px; z-index: 2; display: flex; align-items: center; justify-content: space-between; margin: -10px -15px 10px; padding: 10px 15px 8px; background: rgba(251,250,248,.94); backdrop-filter: blur(9px); }
.composer-icon { border: 0; background: transparent; color: var(--blue); display: flex; align-items: center; gap: 6px; cursor: pointer; font-weight: 600; }
.composer-date { border: 0; background: #f0efed; border-radius: 18px; padding: 7px 11px; font-size: 12px; cursor: pointer; }
.save-btn { border: 0; width: 39px; height: 39px; border-radius: 50%; background: var(--blue); color: white; font-size: 21px; cursor: pointer; }
.composer-title { width: 100%; border: 0; border-radius: 9px; background: #f1efed; padding: 11px 12px; font-size: 16px; margin-bottom: 10px; outline: none; }
.type-grid { display: grid; grid-template-columns: repeat(3, max-content); gap: 7px; margin: 1px 0 12px; }
.type-pill { display: inline-flex; align-items: center; gap: 5px; border: 0; background: #eeecea; border-radius: 7px; padding: 8px 9px; font-size: 11px; font-weight: 600; cursor: pointer; }
.type-pill.active { background: var(--blue); color: white; }
.type-pill svg { width: 14px; height: 14px; }
.form-card { margin: 8px 0; border-radius: 12px; background: #f1f0ee; padding: 8px 10px; }
.form-row { display: flex; align-items: center; gap: 9px; min-height: 34px; font-size: 12px; color: #79736f; }
.form-row + .form-row { border-top: 1px solid rgba(100,92,86,.08); }
.form-row label { min-width: 62px; }
.form-row input[type=time], .form-row input[type=date], .form-row select { margin-left: auto; border: 0; border-radius: 14px; background: white; padding: 6px 9px; color: var(--blue); font-size: 12px; }
.form-row select { appearance: auto; }
.form-row input[type=checkbox] { accent-color: var(--blue); margin-left: auto; width: 18px; height: 18px; }
.form-row .value { margin-left: auto; color: var(--blue); font-size: 12px; }
.toggle-row { display: flex; justify-content: space-between; align-items: center; color: #79736f; font-size: 12px; min-height: 33px; }
.toggle-switch { appearance: none; width: 39px; height: 22px; border-radius: 15px; background: #cfcbc8; position: relative; cursor: pointer; transition: background .18s; }
.toggle-switch::after { content: ""; width: 18px; height: 18px; position: absolute; top: 2px; left: 2px; border-radius: 50%; background: white; transition: transform .18s; box-shadow: 0 1px 3px #999; }
.toggle-switch:checked { background: #73b584; }
.toggle-switch:checked::after { transform: translateX(17px); }
.tag-row { display: flex; align-items: center; justify-content: space-between; color: #79736f; font-size: 12px; padding: 11px 0; }
.tag-row small { color: #b2ada9; }
.rich-toolbar { display: flex; gap: 3px; border-radius: 9px; background: #f0eeec; padding: 5px; margin-bottom: 7px; }
.rich-toolbar button { flex: 1; border: 0; background: transparent; border-radius: 5px; padding: 5px; font-size: 12px; cursor: pointer; }
.rich-toolbar button:active { background: var(--blue-soft); }
.rich-text { width: 100%; min-height: 92px; resize: vertical; border: 0; border-radius: 10px; background: #f5f3f1; padding: 11px; outline: 0; }
.day-picker { position: fixed; inset: 0; z-index: 35; background: rgba(34,30,34,.25); display: grid; place-items: center; padding: 20px; }
.picker-card { background: #fbfaf8; border-radius: 20px; width: min(100%,360px); padding: 18px; box-shadow: var(--shadow); }
.picker-card h3 { margin: 0 0 13px; font: 700 16px "Avenir Next", "Segoe UI", sans-serif; }
.picker-card input { width: 100%; border: 1px solid var(--line); border-radius: 11px; background: white; padding: 11px; }
.picker-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 14px; }
.picker-actions button { border: 0; border-radius: 18px; padding: 9px 14px; cursor: pointer; }
.picker-actions .confirm { background: var(--blue); color: white; }
.toast { position: fixed; z-index: 40; left: 50%; bottom: calc(132px + var(--safe-bottom)); transform: translateX(-50%); max-width: calc(100% - 36px); padding: 10px 15px; border-radius: 20px; color: white; background: #302d32; font-size: 12px; box-shadow: var(--shadow); animation: rise .2s ease-out; }
@media (min-width: 650px) and (max-width: 899px) {
  .app-shell { max-width: 100%; }
  .screen { max-width: 820px; margin: 0 auto; padding-inline: 28px; }
  .content:has(.day-summary) { display: grid; grid-template-columns: 1fr 1fr; column-gap: 24px; }
  .day-summary, .review-card, .content:has(.day-summary) > .section:nth-of-type(1), .content:has(.day-summary) > .section:nth-of-type(6), .content:has(.day-summary) > .section:nth-of-type(7) { grid-column: 1 / -1; }
}

@media (min-width: 900px) {
  body { min-width: 760px; padding: 0; }
  .app-shell { max-width: none; width: 100%; min-height: 100dvh; overflow: visible; }
  .screen { width: 100%; min-height: 100dvh; margin: 0 auto; padding: 25px 44px 70px 300px; }
  .content { max-width: 1260px; margin: 0 auto; }
  .topbar { max-width: 1260px; margin: 0 auto 18px; }
  .tabbar { left: 24px; top: 24px; bottom: 24px; transform: none; width: 238px; height: auto; max-height: calc(100dvh - 48px); grid-template-columns: 1fr; grid-auto-rows: 51px; align-content: start; justify-items: stretch; gap: 4px; padding: 82px 13px 16px; border-radius: 26px; }
  .tabbar::before { content: "ТИХИЙ ДЕНЬ"; position: absolute; left: 27px; top: 27px; font-weight: 800; font-size: 15px; letter-spacing: .09em; color: var(--ink); }
  .tab { flex-direction: row; justify-content: flex-start; gap: 13px; padding: 0 15px; font-size: 13px; }
  .tab svg { width: 21px; height: 21px; }
  .tab.active { border-radius: 14px; }
  .date-ribbon { left: auto; right: 44px; top: 24px; bottom: auto; transform: none; min-width: 184px; padding: 7px 12px; }
  .wave-floor { display: none; }
  .date-number { font-size: 48px; }
  .round-btn { width: 46px; height: 46px; }
  .content:has(.day-summary) { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); column-gap: 34px; align-content: start; }
  .day-summary, .review-card, .content:has(.day-summary) > .section:nth-of-type(1), .content:has(.day-summary) > .section:nth-of-type(6), .content:has(.day-summary) > .section:nth-of-type(7) { grid-column: 1 / -1; }
  .section { margin-bottom: 22px; }
  .section-title { font-size: 16px; }
  .entry-text, .task-row .task-name { font-size: 14px; }
  .page-header { margin-top: 8px; margin-bottom: 22px; }
  .page-title { font-size: 25px; }
  .calendar-grid { margin-inline: 0; padding-inline: 0; }
  :root { --calendar-day-width: 130px; --calendar-time-width: 64px; }
  .week-head, .week-columns { min-width: max-content; }
  .week-day { min-height: 1000px; }
  .time-label { height: 66px; }
  .week-day { background: repeating-linear-gradient(to bottom, transparent 0 65px, rgba(80,72,67,.11) 65px 66px); }
  .week-day .half-line { top: 32px; }
  .calendar-event { font-size: 11px; padding: 6px; }
  .screen:has(.settings-content) .content { max-width: 820px; margin-left: 0; }
  .composer { border-radius: 24px; margin: auto; max-height: 88dvh; }
  .overlay { align-items: center; padding: 24px; }
}

@media (max-width: 390px) {
  .screen { padding-inline: 15px; }
  .day-summary { align-items: flex-start; flex-direction: column; gap: 10px; }
  .type-grid { grid-template-columns: repeat(2, max-content); }
  .settings-card { padding: 12px 10px; gap: 8px; }
  .theme-options { margin-left: 0; }
}
@media (max-height: 700px) and (max-width: 899px) {
  .wave-floor { height: 60px; bottom: calc(65px + var(--safe-bottom)); opacity: .75; }
}

html[data-theme="dark"] {
  color-scheme: dark;
  --paper: #191a1e;
  --paper-bright: #25262b;
  --ink: #f0eeeb;
  --muted: #aaa5a1;
  --line: rgba(235,229,224,.14);
  --blue: #72b1f3;
  --blue-soft: #26374b;
  --blue-wash: #26323a;
  --violet: #bf9bcf;
  --deep-violet: #77799d;
}
html[data-theme="dark"] body { background: radial-gradient(ellipse at 5% 3%, rgba(74,67,83,.32), transparent 34%), linear-gradient(135deg,#1b1b20,#16171b 65%,#202026); }
html[data-theme="dark"] .round-btn,
html[data-theme="dark"] .tabbar,
html[data-theme="dark"] .date-ribbon,
html[data-theme="dark"] .pill-toggle,
html[data-theme="dark"] .settings-card,
html[data-theme="dark"] .summary-add { background: rgba(39,39,45,.88); color: var(--ink); border-color: rgba(255,255,255,.08); }
html[data-theme="dark"] .tab.active,
html[data-theme="dark"] .theme-option.selected { background: #26374b; color: var(--blue); }
html[data-theme="dark"] .tabbar { background: #25262b; border-color: rgba(235,229,224,.16); box-shadow: 0 5px 24px rgba(0,0,0,.42), inset 0 1px 1px rgba(255,255,255,.05); }
html[data-theme="dark"] .tab { color: #d0ccc8; }
html[data-theme="dark"] .tab svg { color: currentColor; opacity: 1; }
html[data-theme="dark"] .tab.active { color: #a8d2ff; }
html[data-theme="dark"] .review-card,
html[data-theme="dark"] .day-summary p,
html[data-theme="dark"] .calendar-event small,
html[data-theme="dark"] .timeline-block small { color: #bcb5b0; }
html[data-theme="dark"] .calendar-event { background: rgba(63,88,106,.62); color: var(--ink); }
html[data-theme="dark"] .calendar-event.purple { background: rgba(97,76,111,.68); }
html[data-theme="dark"] .calendar-event.reminder { background: rgba(105,75,47,.65); }
html[data-theme="dark"] .calendar-event.habit { background: rgba(61,94,69,.67); }
html[data-theme="dark"] .timeline-block { background: rgba(57,87,118,.76); color: var(--ink); }
html[data-theme="dark"] .week-head { background: rgba(25,26,30,.96); }
html[data-theme="dark"] .composer,
html[data-theme="dark"] .composer-top,
html[data-theme="dark"] .picker-card { background: #24252a; color: var(--ink); }
html[data-theme="dark"] .composer-title,
html[data-theme="dark"] .form-card,
html[data-theme="dark"] .type-pill,
html[data-theme="dark"] .rich-toolbar,
html[data-theme="dark"] .rich-text,
html[data-theme="dark"] .search-box,
html[data-theme="dark"] .inbox-card { background: #303137; color: var(--ink); }
html[data-theme="dark"] .type-pill.active { background: var(--blue); color: #102238; }
html[data-theme="dark"] .form-row input,
html[data-theme="dark"] .form-row select,
html[data-theme="dark"] .calendar-brand { background: #3b3c43; color: var(--blue); }
html[data-theme="dark"] .settings-icon { background: #26374b; }
html[data-theme="dark"] .add-task-label { background: #26374b; color: var(--blue); }
html[data-theme="dark"] .calendar-brand.apple { color: #f2f0ed; }
html[data-theme="dark"] .task-name-button,
html[data-theme="dark"] .entry-copy,
html[data-theme="dark"] .settings-link { color: var(--ink); }
html[data-theme="dark"] .tab,
html[data-theme="dark"] .ribbon-day,
html[data-theme="dark"] .entry-time,
html[data-theme="dark"] .form-row,
html[data-theme="dark"] .toggle-row,
html[data-theme="dark"] .tag-row,
html[data-theme="dark"] .week-head button { color: var(--muted); }
html[data-theme="dark"] .tab.active,
html[data-theme="dark"] .ribbon-day.selected,
html[data-theme="dark"] .week-head button.active strong { color: var(--blue); }
html[data-theme="dark"] .week-head button strong,
html[data-theme="dark"] .entry-text,
html[data-theme="dark"] .task-row,
html[data-theme="dark"] .picker-actions button:not(.confirm) { color: var(--ink); }
html[data-theme="dark"] .dismiss,
html[data-theme="dark"] .chevron,
html[data-theme="dark"] .empty-hint,
html[data-theme="dark"] .blank-state,
html[data-theme="dark"] .repeat,
html[data-theme="dark"] .tag-row small,
html[data-theme="dark"] .timeline-slot small,
html[data-theme="dark"] .time-label { color: #b8b3b0; }
html[data-theme="dark"] .entry.done .entry-text { color: #aaa5a1; }
html[data-theme="dark"] .check { border-color: #c4c0bc; }
html[data-theme="dark"] .round-btn { color: var(--ink); }
html[data-theme="dark"] .settings-card { border-color: rgba(235,229,224,.12); }
html[data-theme="dark"] .settings-icon,
html[data-theme="dark"] .add-task-label { color: #a8d2ff; }
html[data-theme="dark"] .calendar-brand.apple { color: #f2f0ed; }
html[data-theme="dark"] .calendar-event { color: #f4f2ef; }
html[data-theme="dark"] .calendar-event small,
html[data-theme="dark"] .timeline-block small { color: #e0dcda; }
html[data-theme="dark"] .week-day { border-left-color: rgba(235,229,224,.16); background-image: repeating-linear-gradient(to bottom, transparent 0 61px, rgba(235,229,224,.15) 61px 62px); }
html[data-theme="dark"] .week-day .half-line { border-color: rgba(235,229,224,.2); }
html[data-theme="dark"] .calendar-slot:hover,
html[data-theme="dark"] .timeline-add:hover { background: rgba(114,177,243,.12); }
html[data-theme="dark"] .calendar-event.completed,
html[data-theme="dark"] .timeline-block.completed { opacity: .68; filter: grayscale(.85); }
html[data-theme="dark"] .composer-title::placeholder,
html[data-theme="dark"] .search-box input::placeholder { color: #b8b3b0; opacity: 1; }
html[data-theme="dark"] .form-row input[type=time],
html[data-theme="dark"] .form-row input[type=date],
html[data-theme="dark"] .form-row select,
html[data-theme="dark"] .picker-card input { background: #3b3c43; color: #b9d9fa; }
html[data-theme="dark"] .form-row + .form-row { border-color: rgba(235,229,224,.12); }
html[data-theme="dark"] .calendar-event.purple { background: rgba(103,81,119,.84); }
html[data-theme="dark"] .calendar-event.reminder { background: rgba(112,78,48,.84); }
html[data-theme="dark"] .calendar-event.habit { background: rgba(62,98,70,.84); }
html[data-theme="dark"] .calendar-event.blue { background: rgba(54,86,116,.88); }
html[data-theme="dark"] .week-head { border-bottom-color: var(--line); }
html[data-theme="dark"] .settings-card .calendar-brand { color: var(--blue); }
html[data-theme="dark"] .settings-card .calendar-brand.apple { color: #f2f0ed; }
html[data-theme="dark"] .tab:not(.active) { color: #d0ccc8; }
html[data-theme="dark"] .tab svg { stroke: currentColor; }

/* Labels and practical checklists */
.label-editor { padding: 11px 0 3px; }
.label-editor-heading, .list-section-heading, .checklist-title-row { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.label-editor-heading { margin-bottom:9px; color:#79736f; font-size:12px; }
.add-label-link, .back-link { border:0; background:transparent; color:var(--blue); padding:4px 0; font-size:11px; font-weight:700; cursor:pointer; }
.label-options { display:flex; flex-wrap:wrap; gap:7px; }
.label-option { display:inline-flex; align-items:center; gap:6px; border:1px solid color-mix(in srgb, var(--label-color), transparent 66%); border-radius:16px; padding:6px 9px; background:color-mix(in srgb, var(--label-color), white 91%); color:color-mix(in srgb, var(--label-color), #171717 24%); font-size:11px; cursor:pointer; }
.label-option input { appearance:none; width:10px; height:10px; margin:0; border:1.5px solid var(--label-color); border-radius:50%; cursor:pointer; }
.label-option input:checked { background:var(--label-color); box-shadow:inset 0 0 0 2px #fff; }
.label-chip { display:inline-flex; align-items:center; width:max-content; margin:3px 4px 0 0; border-radius:12px; padding:2px 7px; background:color-mix(in srgb, var(--label-color), white 88%); color:color-mix(in srgb, var(--label-color), #171717 28%); font-size:9px; font-weight:700; line-height:1.35; vertical-align:middle; }
.calendar-label { display:block; margin-top:2px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; color:var(--label-color); font-size:8px; font-weight:800; }
.checklists-section { margin:3px 0 23px; }
.list-section-heading { margin:0 0 12px; }
.list-section-heading h2, .checklist-title-row h2 { margin:0; font-size:15px; font-weight:700; }
.list-section-heading small, .checklist-title-row small { display:block; margin-top:4px; color:var(--muted); font-size:11px; }
.checklist-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
.checklist-card { min-width:0; display:grid; grid-template-columns:32px minmax(0,1fr); align-items:center; column-gap:8px; row-gap:3px; border:1px solid var(--line); border-radius:15px; padding:12px; background:rgba(255,255,255,.54); text-align:left; cursor:pointer; }
.checklist-card-icon { grid-row:span 2; display:grid; place-items:center; width:31px; height:31px; border-radius:11px; background:var(--blue-soft); color:var(--blue); }
.checklist-card strong { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:12px; }
.checklist-card small { color:var(--muted); font-size:10px; }
.progress-track { grid-column:1/-1; height:4px; margin-top:6px; overflow:hidden; border-radius:4px; background:var(--line); }
.progress-track i { display:block; height:100%; border-radius:inherit; background:var(--blue); }
.checklist-panel { margin:1px 0 23px; padding:14px; border:1px solid var(--line); border-radius:18px; background:rgba(255,255,255,.43); }
.back-link { margin:-3px 0 12px; }
.checklist-title-row { margin-bottom:13px; }
.checklist-title-row .round-btn { flex:none; }
.checklist-add { display:flex; gap:8px; margin:8px 0 11px; }
.checklist-add input, .label-create>input { min-width:0; flex:1; border:1px solid var(--line); border-radius:12px; background:var(--paper-bright); color:var(--ink); padding:10px 12px; font-size:12px; }
.checklist-items { display:grid; }
.checklist-item { min-height:42px; display:flex; align-items:center; gap:10px; border-top:1px solid var(--line); font-size:12px; }
.checklist-item span { flex:1; }
.checklist-item.done span { color:var(--muted); text-decoration:line-through; }
.checklist-item button { border:0; background:transparent; color:var(--muted); padding:6px 8px; font-size:18px; cursor:pointer; }
.task-list-heading { margin-top:14px; }
.task-name-button .label-chip { margin-left:5px; }
.cloud-account { border-radius:25px; }
.cloud-account>p { font-size:13px; line-height:1.5; }
.cloud-note { color:var(--muted); font-size:11px!important; }
.cloud-field { display:grid; gap:6px; margin:12px 0; color:var(--muted); font-size:11px; }
.cloud-field input { width:100%; border:1px solid var(--line); border-radius:11px; padding:10px 11px; background:var(--paper-bright); color:var(--ink); font-size:13px; }
.cloud-actions { display:flex; justify-content:flex-end; align-items:center; gap:9px; padding-top:6px; }
.cloud-create { width:auto!important; padding:0 12px; border-radius:20px!important; font-size:11px; }
.text-action { display:block; border:0; background:transparent; color:var(--blue); padding:9px 3px; font-size:11px; font-weight:700; cursor:pointer; }
.signout-action { color:#a35448; }
.label-create p { margin:14px 0 8px; color:var(--muted); font-size:12px; }
.swatch-options { display:flex; flex-wrap:wrap; gap:10px; }
.swatch-options label { cursor:pointer; }
.swatch-options input { position:absolute; opacity:0; pointer-events:none; }
.swatch-options span { display:block; width:30px; height:30px; border:3px solid transparent; border-radius:50%; background:var(--swatch); box-shadow:0 0 0 1px var(--line); }
.swatch-options input:checked+span { border-color:var(--paper-bright); box-shadow:0 0 0 2px var(--swatch); }
html[data-theme="dark"] .label-editor-heading { color:#d0ccc8; }
html[data-theme="dark"] .label-option { background:color-mix(in srgb, var(--label-color), #222329 79%); color:color-mix(in srgb, var(--label-color), white 25%); border-color:color-mix(in srgb, var(--label-color), transparent 35%); }
html[data-theme="dark"] .label-chip { background:color-mix(in srgb, var(--label-color), #222329 78%); color:color-mix(in srgb, var(--label-color), white 28%); }
html[data-theme="dark"] .checklist-card, html[data-theme="dark"] .checklist-panel { background:rgba(39,40,46,.8); }
html[data-theme="dark"] .checklist-add input, html[data-theme="dark"] .label-create>input { background:#303137; color:var(--ink); }
html[data-theme="dark"] .cloud-field input { background:#303137; color:var(--ink); }
@media (prefers-color-scheme:dark) {
 html[data-theme="system"] .label-editor-heading { color:#d0ccc8; }
 html[data-theme="system"] .label-option { background:color-mix(in srgb, var(--label-color), #222329 79%); color:color-mix(in srgb, var(--label-color), white 25%); }
 html[data-theme="system"] .label-chip { background:color-mix(in srgb, var(--label-color), #222329 78%); color:color-mix(in srgb, var(--label-color), white 28%); }
 html[data-theme="system"] .checklist-card, html[data-theme="system"] .checklist-panel { background:rgba(39,40,46,.8); }
 html[data-theme="system"] .checklist-add input, html[data-theme="system"] .label-create>input { background:#303137; color:var(--ink); }
 html[data-theme="system"] .cloud-field input { background:#303137; color:var(--ink); }
}
@media(min-width:700px) {
 .checklist-grid { grid-template-columns:repeat(3,minmax(0,1fr)); }
 .checklist-panel { max-width:760px; }
}
@media (prefers-color-scheme: dark) {
  html[data-theme="system"] { color-scheme: dark; --paper:#191a1e; --paper-bright:#25262b; --ink:#f0eeeb; --muted:#aaa5a1; --line:rgba(235,229,224,.14); --blue:#72b1f3; --blue-soft:#26374b; --blue-wash:#26323a; --violet:#bf9bcf; --deep-violet:#77799d; }
  html[data-theme="system"] body { background: linear-gradient(135deg,#1b1b20,#16171b 65%,#202026); }
  html[data-theme="system"] .round-btn, html[data-theme="system"] .tabbar, html[data-theme="system"] .date-ribbon, html[data-theme="system"] .pill-toggle, html[data-theme="system"] .settings-card { background:#27272d; color:var(--ink); }
  html[data-theme="system"] .tabbar { background:#25262b; border-color:rgba(235,229,224,.16); box-shadow:0 5px 24px rgba(0,0,0,.42),inset 0 1px 1px rgba(255,255,255,.05); }
  html[data-theme="system"] .tab { color:#d0ccc8; }
  html[data-theme="system"] .tab svg { color:currentColor; opacity:1; }
  html[data-theme="system"] .tab.active { color:#a8d2ff; background:#26374b; }
  html[data-theme="system"] .composer, html[data-theme="system"] .composer-top, html[data-theme="system"] .picker-card { background:#24252a; color:var(--ink); }
  html[data-theme="system"] .form-card, html[data-theme="system"] .type-pill, html[data-theme="system"] .composer-title, html[data-theme="system"] .rich-toolbar, html[data-theme="system"] .rich-text { background:#303137; color:var(--ink); }
  html[data-theme="system"] .tab, html[data-theme="system"] .ribbon-day, html[data-theme="system"] .entry-time, html[data-theme="system"] .form-row, html[data-theme="system"] .toggle-row, html[data-theme="system"] .tag-row, html[data-theme="system"] .week-head button { color:var(--muted); }
  html[data-theme="system"] .tab.active, html[data-theme="system"] .ribbon-day.selected, html[data-theme="system"] .week-head button.active strong { color:var(--blue); }
  html[data-theme="system"] .week-head button strong, html[data-theme="system"] .entry-text, html[data-theme="system"] .task-row { color:var(--ink); }
  html[data-theme="system"] .dismiss, html[data-theme="system"] .chevron, html[data-theme="system"] .empty-hint, html[data-theme="system"] .blank-state, html[data-theme="system"] .repeat, html[data-theme="system"] .time-label { color:#b8b3b0; }
  html[data-theme="system"] .calendar-event { color:#f4f2ef; }
  html[data-theme="system"] .calendar-event small, html[data-theme="system"] .timeline-block small { color:#e0dcda; }
  html[data-theme="system"] .week-day { border-left-color:rgba(235,229,224,.16); background-image:repeating-linear-gradient(to bottom, transparent 0 61px, rgba(235,229,224,.15) 61px 62px); }
  html[data-theme="system"] .calendar-event.completed, html[data-theme="system"] .timeline-block.completed { opacity:.68; filter:grayscale(.85); }
  html[data-theme="system"] .tab:not(.active) { color:#d0ccc8; }
  html[data-theme="system"] .tab svg { stroke:currentColor; }
}
