:root {
  --ink: #191b1f;
  --muted: #72777f;
  --muted-2: #9ba0a8;
  --paper: #f3f4f6;
  --card: #ffffff;
  --line: #e5e7eb;
  --line-soft: #eff0f2;
  --blue: #1d54f2;
  --blue-dark: #123ab0;
  --blue-weak: #e9efff;
  --green: #53b986;
  --orange: #f0a04b;
  --red: #e56158;
  --violet: #8d6be8;
  --radius-lg: 24px;
  --radius-md: 16px;
  --shadow: 0 14px 40px rgba(25, 29, 39, .055);
  --sidebar: 236px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-width: 320px; background: var(--paper); color: var(--ink); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; -webkit-font-smoothing: antialiased; }
body { margin: 0; min-height: 100vh; padding-top: env(safe-area-inset-top); background: var(--paper); }
body.dialog-open { overflow: hidden; }
body.dialog-open:before { content: ""; position: fixed; inset: 0; z-index: 88; background: rgba(15, 17, 21, .46); backdrop-filter: blur(4px); }
button, input, select, textarea { font: inherit; }
button { color: inherit; }
button, label[for] { -webkit-tap-highlight-color: transparent; }
svg { display: block; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); }

.sidebar { position: sticky; top: 0; height: 100vh; padding: 21px 16px 18px; border-right: 1px solid var(--line); background: #f8f9fa; display: flex; flex-direction: column; gap: 25px; z-index: 5; }
.brand { border: 0; background: transparent; padding: 0 8px; display: flex; align-items: center; gap: 11px; font-size: 20px; font-weight: 850; letter-spacing: -.55px; cursor: pointer; }
.brand-mark { width: 34px; height: 34px; border-radius: 12px; display: grid; place-items: center; background: var(--blue); color: #fff; box-shadow: 0 8px 20px rgba(29, 84, 242, .24); }
.brand-mark svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.side-nav { display: grid; gap: 6px; }
.nav-item { width: 100%; min-height: 44px; padding: 10px 12px; border: 0; border-radius: 13px; background: transparent; display: flex; align-items: center; gap: 11px; color: #5f646d; font-size: 14px; font-weight: 720; text-align: left; cursor: pointer; transition: .18s ease; }
.nav-item:hover { background: #eef0f2; color: var(--ink); }
.nav-item.active { background: var(--ink); color: #fff; box-shadow: 0 7px 20px rgba(20, 21, 25, .13); }
.nav-item svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.nav-item svg .fill { fill: currentColor; stroke: none; }
.nav-count { margin-left: auto; min-width: 20px; padding: 2px 6px; border-radius: 99px; background: rgba(128, 134, 145, .14); font-size: 11px; text-align: center; }
.nav-item.active .nav-count { background: rgba(255, 255, 255, .14); }
.side-summary { margin-top: auto; padding: 15px; border: 1px solid #dce4f7; border-radius: 18px; background: linear-gradient(145deg, #e9efff 0%, #f5f0ff 100%); }
.side-summary strong { display: block; margin-bottom: 5px; font-size: 14px; }
.side-summary span { display: block; min-height: 36px; color: #626975; font-size: 12px; line-height: 1.45; }
.summary-bar { height: 5px; margin-top: 11px; background: rgba(29, 84, 242, .12); border-radius: 99px; overflow: hidden; }
.summary-bar i { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--blue); transition: width .3s ease; }
.side-footer { display: grid; gap: 8px; padding: 0 7px; }
.side-footer span { color: #92969d; font-size: 11px; line-height: 1.4; }
.side-footer button { width: 100%; border: 0; border-radius: 11px; padding: 9px 10px; background: var(--blue-weak); color: var(--blue); font-size: 12px; font-weight: 780; cursor: pointer; }

.main { min-width: 0; padding: 22px 26px max(76px, env(safe-area-inset-bottom)); }
.topbar { min-height: 58px; margin-bottom: 20px; display: flex; align-items: center; gap: 18px; }
.title-wrap { min-width: 265px; }
.date-kicker, .eyebrow { color: var(--muted); font-size: 12px; font-weight: 800; letter-spacing: .075em; text-transform: uppercase; }
h1 { margin: 3px 0 0; font-size: clamp(27px, 3vw, 40px); line-height: 1.05; letter-spacing: -1.6px; }
.top-actions { margin-left: auto; display: flex; gap: 8px; }
.icon-btn { position: relative; width: 43px; height: 43px; padding: 0; border: 1px solid var(--line); border-radius: 14px; background: var(--card); display: grid; place-items: center; cursor: pointer; transition: .18s ease; }
.icon-btn:hover { transform: translateY(-1px); border-color: #d4d7dd; box-shadow: 0 6px 16px rgba(20, 24, 32, .06); }
.icon-btn svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.85; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn.compact { width: 34px; height: 34px; border-radius: 11px; }
.icon-btn.compact svg { width: 17px; height: 17px; }
.profile-button.signed-in { border-color: rgba(29,84,242,.25); background: var(--blue-weak); color: var(--blue); }
.profile-button > span { font-size: 14px; font-weight: 850; }
.flip { transform: rotate(180deg); }
.status-dot { position: absolute; right: 8px; top: 8px; width: 7px; height: 7px; border: 2px solid #fff; border-radius: 50%; background: #c3c6cc; }
.notifications-on .status-dot { background: var(--green); }
.search-wrap { width: min(320px, 32vw); margin-left: auto; padding: 0 12px; border: 1px solid transparent; border-radius: 13px; background: #e9ebee; display: flex; align-items: center; gap: 9px; transition: .18s ease; }
.search-wrap:focus-within { border-color: rgba(29, 84, 242, .25); background: #fff; box-shadow: 0 0 0 3px rgba(29, 84, 242, .08); }
.search-wrap svg { width: 18px; height: 18px; fill: none; stroke: #747a84; stroke-width: 1.9; }
.search-wrap input { width: 100%; height: 42px; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 14px; }
.search-wrap kbd { padding: 3px 6px; border: 1px solid #d5d8de; border-radius: 6px; background: #f7f8f9; color: #81868e; font-family: inherit; font-size: 10px; white-space: nowrap; }
#searchToggle { display: none; }

.screen { display: none; }
.screen.active { display: block; animation: enter .22s ease; }
@keyframes enter { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
.workspace { display: grid; grid-template-columns: minmax(350px, .82fr) minmax(570px, 1.38fr); gap: 18px; align-items: start; }
.panel { min-width: 0; border: 1px solid rgba(22, 25, 32, .065); border-radius: var(--radius-lg); background: var(--card); box-shadow: var(--shadow); overflow: hidden; }
.panel-head { min-height: 72px; padding: 18px 19px 11px; display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.panel-title { font-size: 18px; font-weight: 830; letter-spacing: -.4px; }
.panel-sub { margin-top: 3px; color: var(--muted); font-size: 12px; line-height: 1.35; }
.progress-ring { --progress: 0deg; width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--blue) var(--progress), #edf0f3 0); position: relative; }
.progress-ring:after { content: ""; position: absolute; inset: 4px; border-radius: 50%; background: #fff; }
.progress-ring span { position: relative; z-index: 1; font-size: 9px; font-weight: 850; }

.quick-add { margin: 2px 15px 0; padding: 6px 6px 6px 13px; border: 1px solid transparent; border-radius: 15px; background: #f3f4f6; display: flex; align-items: center; gap: 5px; transition: .18s ease; }
.quick-add:focus-within { border-color: rgba(29, 84, 242, .22); background: #fff; box-shadow: 0 0 0 3px rgba(29, 84, 242, .07); }
.quick-add input { flex: 1; min-width: 0; height: 35px; padding: 0; border: 0; outline: 0; background: transparent; font-size: 14px; }
.capture-btn { width: 33px; height: 33px; padding: 0; border: 0; border-radius: 10px; background: transparent; color: #777d87; display: grid; place-items: center; cursor: pointer; }
.capture-btn:hover { background: #e7e9ed; color: var(--ink); }
.capture-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.capture-btn.listening { color: #fff; background: var(--red); animation: pulse 1.1s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px rgba(229, 97, 88, .12); } }
.add-btn { min-width: 76px; height: 35px; padding: 0 13px; border: 0; border-radius: 11px; background: var(--blue); color: #fff; display: grid; place-items: center; font-size: 12px; font-weight: 800; cursor: pointer; box-shadow: 0 6px 14px rgba(29, 84, 242, .22); }
.add-btn:hover { background: var(--blue-dark); }
.parser-hint { min-height: 30px; margin: 5px 20px 8px; color: #8f949d; display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 10px; }
.parser-hint .recognized { color: var(--blue); font-weight: 800; }
.parser-hint button { flex: 0 0 auto; min-height: 28px; padding: 0 8px; border: 0; border-radius: 8px; background: transparent; color: var(--blue); font-size: 10px; font-weight: 800; cursor: pointer; }
.parser-hint button:hover { background: var(--blue-weak); }
.recovery-card { margin: 9px 15px 11px; border: 1px solid #f0dfc3; border-radius: 16px; background: #fff9ef; overflow: hidden; }
.recovery-toggle { width: 100%; min-height: 54px; padding: 11px 13px; border: 0; background: transparent; display: flex; align-items: center; justify-content: space-between; gap: 12px; text-align: left; cursor: pointer; }
.recovery-toggle > span { min-width: 0; display: grid; gap: 3px; }
.recovery-toggle strong { font-size: 12px; }
.recovery-toggle small { overflow: hidden; color: #7c6d55; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.recovery-toggle svg { flex: 0 0 auto; width: 18px; height: 18px; fill: none; stroke: #7c6d55; stroke-width: 2; transition: transform .18s ease; }
.recovery-toggle[aria-expanded="true"] svg { transform: rotate(90deg); }
.recovery-details { padding: 0 10px 10px; }
.recovery-list { display: grid; gap: 7px; }
.recovery-item { min-width: 0; padding: 9px 10px; border: 1px solid #f1e3cc; border-radius: 12px; background: rgba(255,255,255,.76); display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 8px 10px; align-items: center; }
.recovery-copy { min-width: 0; }
.recovery-copy strong, .recovery-copy span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recovery-copy strong { color: var(--ink); font-size: 11px; }
.recovery-copy span { margin-top: 3px; color: #87765c; font-size: 9px; }
.recovery-item-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px; }
.recovery-item-actions button { min-height: 27px; padding: 0 7px; border: 1px solid #ead6b7; border-radius: 8px; background: #fff; color: #6d5b3e; font-size: 9px; font-weight: 780; cursor: pointer; }
.recovery-item-actions button.primary { border-color: var(--ink); background: var(--ink); color: #fff; }
.recovery-actions { margin-top: 8px; display: flex; justify-content: flex-end; gap: 5px; }
.recovery-actions button { min-height: 30px; padding: 0 9px; border: 1px solid #ead6b7; border-radius: 9px; background: #fff; color: #6d5b3e; font-size: 10px; font-weight: 780; cursor: pointer; }
.recovery-actions button:last-child { border-color: var(--ink); background: var(--ink); color: #fff; }

.agenda-list { min-height: 120px; }
.section-label { padding: 10px 18px 7px; display: flex; align-items: center; gap: 8px; color: #7e838c; font-size: 10px; font-weight: 850; letter-spacing: .085em; text-transform: uppercase; }
.section-label:after { content: ""; height: 1px; flex: 1; background: var(--line-soft); }
.task-row { --actions-width: min(430px, 88vw); position: relative; border-top: 1px solid var(--line-soft); overflow: hidden; cursor: pointer; }
.task-surface { position: relative; z-index: 2; min-height: 61px; padding: 11px 11px 11px 12px; background: #fff; display: grid; grid-template-columns: 18px 22px minmax(0, 1fr) auto 30px; align-items: start; gap: 8px; transition: transform .22s cubic-bezier(.2,.7,.2,1), background .16s ease; touch-action: pan-y; }
.task-row:hover .task-surface { background: #fafbfc; }
.task-row.actions-open .task-surface { transform: translateX(calc(-1 * var(--actions-width))); }
.task-row.actions-open .checklist-panel { display: none; }
.task-actions { position: absolute; z-index: 1; inset: 0 0 0 auto; width: var(--actions-width); padding: 7px; background: #eef0f4; display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; align-items: stretch; }
.task-actions button { min-width: 0; padding: 4px; border: 0; border-radius: 9px; background: #fff; color: #444b56; font-size: 9px; font-weight: 780; cursor: pointer; }
.task-actions button.danger { background: #fff0ef; color: #af4841; }
.task-row.dragging { opacity: .34; }
.task-row.drop-before:before { content: ""; position: absolute; left: 14px; right: 14px; top: -1px; height: 2px; border-radius: 99px; background: var(--blue); }
.drag-handle { width: 18px; height: 26px; padding: 2px 0 0; border: 0; background: transparent; color: #c0c4ca; cursor: grab; }
.drag-handle svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-linecap: round; }
.task-check { width: 21px; height: 21px; padding: 0; border: 2px solid #c7cbd2; border-radius: 50%; background: #fff; display: grid; place-items: center; cursor: pointer; }
.task-check svg { width: 13px; height: 13px; fill: none; stroke: transparent; stroke-width: 2.7; stroke-linecap: round; stroke-linejoin: round; }
.task-row.completed { opacity: .58; }
.task-row.completed .task-title { text-decoration: line-through; }
.task-row.completed .task-check { border-color: var(--green); background: var(--green); }
.task-row.completed .task-check svg { stroke: #fff; }
.task-body { min-width: 0; }
.task-title { overflow: hidden; color: var(--ink); font-size: 14px; font-weight: 740; line-height: 1.35; text-overflow: ellipsis; }
.task-meta { margin-top: 4px; display: flex; align-items: center; gap: 7px; flex-wrap: wrap; color: var(--muted); font-size: 11px; }
.task-meta > span { display: inline-flex; align-items: center; gap: 4px; }
.task-dot { width: 6px; height: 6px; border-radius: 50%; }
.task-dot.blue { background: var(--blue); }.task-dot.green { background: var(--green); }.task-dot.orange { background: var(--orange); }.task-dot.red { background: var(--red); }.task-dot.violet { background: var(--violet); }
.task-priority { padding: 2px 6px; border-radius: 6px; background: #fff0ee; color: #b34b44; font-weight: 720; }
.task-time { padding-top: 2px; color: #5e646d; font-size: 12px; font-weight: 800; white-space: nowrap; }
.task-more { width: 28px; height: 28px; margin-top: -3px; padding: 0; border: 0; border-radius: 9px; background: transparent; color: #858b95; display: grid; place-items: center; cursor: pointer; }
.task-more:hover { background: #eceef1; color: var(--ink); }
.task-more svg { width: 17px; height: 17px; fill: currentColor; stroke: currentColor; }
.checklist-toggle { width: max-content; max-width: 100%; min-height: 27px; margin-top: 7px; padding: 0 7px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: #59606a; display: flex; align-items: center; gap: 5px; font-size: 10px; font-weight: 740; cursor: pointer; }
.checklist-toggle svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2; transition: transform .18s ease; }
.task-row.expanded .checklist-toggle svg { transform: rotate(90deg); }
.checklist-panel { margin-top: 7px; padding: 7px; border-radius: 10px; background: #f6f7f9; display: grid; gap: 3px; }
.check-item { min-height: 28px; padding: 3px 4px; border: 0; background: transparent; display: flex; align-items: center; gap: 7px; color: #343941; text-align: left; font-size: 11px; cursor: pointer; }
.check-item i { width: 17px; height: 17px; border: 1.5px solid #bbc0c8; border-radius: 6px; display: grid; place-items: center; }
.check-item svg { width: 11px; height: 11px; fill: none; stroke: transparent; stroke-width: 2.5; }
.check-item.completed span { color: #8a8f97; text-decoration: line-through; }
.check-item.completed i { border-color: var(--green); background: var(--green); }
.check-item.completed svg { stroke: #fff; }
.empty-state { min-height: 180px; padding: 35px 24px; display: grid; place-items: center; align-content: center; text-align: center; color: var(--muted); }
.empty-state .empty-mark { width: 48px; height: 48px; margin-bottom: 12px; border-radius: 16px; background: var(--blue-weak); color: var(--blue); display: grid; place-items: center; font-size: 22px; }
.empty-state strong { margin-bottom: 3px; color: var(--ink); font-size: 15px; }
.empty-state span { max-width: 260px; font-size: 12px; line-height: 1.45; }

.focus-teaser { position: relative; min-height: 106px; margin: 15px; padding: 16px 14px 16px 17px; border-radius: 18px; background: var(--ink); color: #fff; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; overflow: hidden; }
.focus-teaser:after { content: ""; position: absolute; width: 110px; height: 110px; right: -51px; top: -55px; border: 22px solid rgba(255,255,255,.045); border-radius: 50%; }
.focus-orbit { position: relative; width: 36px; height: 36px; border: 1px solid rgba(255,255,255,.24); border-radius: 50%; display: grid; place-items: center; }
.focus-orbit:before { content: ""; position: absolute; inset: 6px; border: 1px solid rgba(255,255,255,.45); border-radius: 50%; }
.focus-orbit i { width: 5px; height: 5px; border-radius: 50%; background: #fff; }
.focus-teaser small, .focus-teaser span { display: block; color: #afb4bd; font-size: 10px; }
.focus-teaser strong { display: block; margin: 5px 0 4px; overflow: hidden; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.focus-teaser button { position: relative; z-index: 1; min-width: 42px; height: 38px; padding: 0 10px; border: 0; border-radius: 11px; background: #fff; color: var(--ink); display: flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 820; cursor: pointer; }
.focus-teaser button svg { width: 14px; height: 14px; fill: currentColor; stroke: currentColor; }

.calendar-head { padding-bottom: 12px; }
.calendar-actions { display: flex; align-items: center; gap: 5px; }
.quiet-btn { min-height: 34px; padding: 0 11px; border: 1px solid var(--line); border-radius: 11px; background: #fff; font-size: 11px; font-weight: 760; cursor: pointer; }
.view-tabs { margin: 0 15px 11px; padding: 3px; border-radius: 12px; background: #f2f3f5; display: grid; grid-template-columns: repeat(4, 1fr); gap: 2px; }
.view-tabs button { min-height: 32px; padding: 5px 10px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font-size: 11px; font-weight: 760; cursor: pointer; }
.view-tabs button.active { background: #fff; color: var(--ink); box-shadow: 0 2px 9px rgba(25, 29, 37, .08); }
.view-tabs.standalone { grid-template-columns: repeat(4, minmax(74px, 120px)) 1fr auto; margin: 0 20px 15px; }
.view-tabs .print-inline { grid-column: 6; padding-inline: 12px; display: flex; align-items: center; gap: 6px; justify-content: center; color: var(--ink); }
.print-inline svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.calendar-canvas { min-height: 505px; overflow: auto; scrollbar-color: #d7dae0 transparent; scrollbar-width: thin; }
.calendar-canvas.full { min-height: 670px; }

.week-view, .day-view { min-width: 620px; padding: 0 14px 15px; }
.week-head { position: sticky; top: 0; z-index: 4; min-width: inherit; display: grid; grid-template-columns: 48px repeat(7, minmax(76px, 1fr)); background: #fff; }
.week-day { min-width: 0; padding: 7px 2px 10px; border: 0; background: transparent; color: var(--muted); text-align: center; font-size: 10px; font-weight: 820; text-transform: uppercase; cursor: pointer; }
.week-day b { width: 29px; height: 29px; margin: 4px auto 0; border-radius: 10px; display: grid; place-items: center; color: var(--ink); font-size: 13px; }
.week-day.today b { background: var(--blue); color: #fff; box-shadow: 0 5px 12px rgba(29, 84, 242, .22); }
.week-body { position: relative; display: grid; grid-template-columns: 48px repeat(7, minmax(76px, 1fr)); grid-template-rows: repeat(var(--calendar-rows), var(--slot-height)); border-top: 1px solid var(--line); }
.time-label { z-index: 1; padding: 3px 6px 0 0; color: #9499a2; font-size: 9px; text-align: right; }
.time-cell { position: relative; border-left: 1px solid var(--line); cursor: crosshair; }
.time-cell.major { border-bottom: 1px solid #f0f1f4; }
.time-cell.hour { border-bottom-color: #dfe2e7; }
.time-cell.major:after { content: "+"; position: absolute; z-index: 1; right: 0; top: 0; width: 10%; min-width: 12px; height: 18px; color: var(--blue); display: grid; place-items: center; font-size: 12px; font-weight: 850; opacity: 0; pointer-events: none; transition: opacity .12s ease, background .12s ease; }
.time-cell:hover:after, .time-cell.create-ready:after { opacity: .72; background: rgba(29,84,242,.08); }
.time-cell.drag-over { background-color: var(--blue-weak); }
.calendar-event { position: relative; z-index: 2; width: var(--event-width, 90%); max-width: 90%; min-width: 0; min-height: 6px; margin: 1px 0 1px var(--event-left, 0%); padding: 5px 6px; border: 0; border-left: 3px solid currentColor; border-radius: 7px; overflow: hidden; text-align: left; font-size: 9px; font-weight: 770; line-height: 1.25; cursor: grab; touch-action: none; }
.calendar-event.resizing { z-index: 8; outline: 2px solid var(--blue); opacity: .88; }
.event-resize { position: absolute; z-index: 4; left: 3px; right: 3px; height: 12px; cursor: ns-resize; touch-action: none; }
.event-resize.top { top: -3px; }.event-resize.bottom { bottom: -3px; }
.event-resize:after { content: ""; position: absolute; left: 50%; top: 3px; width: 20px; height: 2px; border-radius: 99px; background: currentColor; opacity: 0; transform: translateX(-50%); transition: opacity .15s ease; }
.calendar-event:hover .event-resize:after, .calendar-event.resizing .event-resize:after { opacity: .48; }
.calendar-event strong, .calendar-event span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.calendar-event span { margin-top: 2px; opacity: .74; font-size: 8px; font-weight: 650; }
.calendar-event.blue { background: #e4ebff; color: #244dbb; }.calendar-event.green { background: #e0f3e9; color: #317556; }.calendar-event.orange { background: #fff0dd; color: #945e20; }.calendar-event.red { background: #ffe4e1; color: #a5413b; }.calendar-event.violet { background: #eee8ff; color: #6448ad; }
.day-view { min-width: 460px; display: grid; grid-template-columns: 58px minmax(320px, 1fr); grid-template-rows: repeat(var(--calendar-rows), var(--slot-height)); position: relative; border-top: 1px solid var(--line); }
.day-view .time-cell { border-left: 1px solid var(--line); }
.day-view .calendar-event { font-size: 11px; }
.day-agenda-view { min-height: 430px; padding: 2px 14px 18px; }
.day-agenda-summary { margin: 2px 0 10px; padding: 13px 14px; border-radius: 15px; background: #f4f6fb; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.day-agenda-summary strong { display: block; font-size: 13px; }
.day-agenda-summary span { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; }
.day-agenda-add { min-height: 34px; padding: 0 11px; border: 0; border-radius: 10px; background: var(--blue); color: #fff; font-size: 10px; font-weight: 800; cursor: pointer; }
.day-agenda-list { overflow: hidden; border: 1px solid var(--line-soft); border-radius: 15px; background: #fff; }
.day-agenda-list .section-label:first-child { padding-top: 12px; }
.day-agenda-list .empty-state { min-height: 230px; }
.calendar-drag-ghost { position: fixed; z-index: 140; left: 0; top: 0; max-width: 220px; padding: 9px 11px; border-radius: 10px; background: var(--ink); color: #fff; box-shadow: 0 12px 30px rgba(0,0,0,.2); font-size: 11px; font-weight: 740; pointer-events: none; }

.month-view { min-width: 600px; padding: 0 14px 15px; }
.month-weekdays { display: grid; grid-template-columns: repeat(7, 1fr); }
.month-weekdays span { padding: 7px; color: var(--muted); font-size: 9px; font-weight: 820; text-align: center; text-transform: uppercase; }
.month-grid { border-top: 1px solid var(--line); border-left: 1px solid var(--line); display: grid; grid-template-columns: repeat(7, minmax(78px, 1fr)); grid-template-rows: repeat(6, minmax(82px, 1fr)); }
.month-day { min-height: 82px; padding: 6px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: #fff; overflow: hidden; }
.month-day.other { background: #fafbfc; color: #b5b9c0; }
.month-day.today { box-shadow: inset 0 0 0 2px var(--blue); }
.month-day.drag-over { background: var(--blue-weak); }
.month-number { width: 23px; height: 23px; margin-bottom: 4px; border-radius: 8px; display: grid; place-items: center; font-size: 10px; font-weight: 780; }
.month-day.today .month-number { background: var(--blue); color: #fff; }
.mini-event { width: 100%; margin: 2px 0; padding: 3px 5px; border: 0; border-radius: 5px; display: block; overflow: hidden; color: #313640; font-size: 8px; font-weight: 720; text-align: left; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.mini-event.blue { background: #e5ebff; }.mini-event.green { background: #e2f3e9; }.mini-event.orange { background: #fff0df; }.mini-event.red { background: #ffe4e2; }.mini-event.violet { background: #eee9ff; }
.more-events { color: var(--muted); font-size: 8px; font-weight: 700; }

.year-view { min-width: 620px; padding: 4px 18px 20px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px 14px; }
.mini-month { min-width: 0; }
.mini-month h3 { margin: 0 0 7px; font-size: 12px; letter-spacing: -.1px; }
.mini-month-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; }
.mini-month-grid span { aspect-ratio: 1; border-radius: 4px; display: grid; place-items: center; color: #70757e; font-size: 7px; }
.mini-month-grid span.heading { aspect-ratio: auto; padding-bottom: 2px; color: #a3a7ae; font-size: 6px; font-weight: 820; }
.mini-month-grid span.blank { color: transparent; }
.mini-month-grid span.has-tasks { background: var(--blue-weak); color: var(--blue-dark); font-weight: 800; }
.mini-month-grid span.is-today { background: var(--blue); color: #fff; }

.full-calendar-panel { min-height: calc(100vh - 120px); }
.primary-btn, .secondary-btn, .danger-btn, .timer-main { min-height: 41px; padding: 0 15px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; font-size: 13px; font-weight: 790; cursor: pointer; }
.primary-btn { border: 0; background: var(--blue); color: #fff; box-shadow: 0 7px 17px rgba(29, 84, 242, .2); }
.primary-btn:hover { background: var(--blue-dark); }
.primary-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.secondary-btn { border: 1px solid var(--line); background: #fff; color: var(--ink); }
.danger-btn { border: 1px solid #f0d0cd; background: #fff6f5; color: #b64c45; }

.focus-stage { min-height: calc(100vh - 130px); padding: 56px 24px; border-radius: 30px; background: radial-gradient(circle at 50% 32%, #2d3139 0, #1a1c20 46%, #111215 100%); color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; box-shadow: 0 18px 50px rgba(16, 18, 22, .19); }
.focus-copy { max-width: 520px; text-align: center; }
.focus-copy .eyebrow { color: #969ca6; }
.focus-copy h2 { margin: 8px 0 7px; font-size: clamp(28px, 4vw, 48px); letter-spacing: -1.7px; }
.focus-copy p { margin: 0; color: #aeb3bb; font-size: 14px; }
.timer-dial { position: relative; width: 250px; height: 250px; margin: 30px 0 22px; display: grid; place-items: center; }
.timer-dial svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.timer-track, .timer-progress { fill: none; stroke-width: 5; }
.timer-track { stroke: rgba(255,255,255,.09); }
.timer-progress { stroke: #5f88ff; stroke-linecap: round; stroke-dasharray: 603.19; stroke-dashoffset: 0; transition: stroke-dashoffset .4s linear; }
.timer-time { font-size: 48px; font-weight: 780; letter-spacing: -2px; font-variant-numeric: tabular-nums; }
.timer-actions { display: flex; align-items: center; gap: 10px; }
.timer-actions .secondary-btn { border-color: rgba(255,255,255,.14); background: rgba(255,255,255,.06); color: #fff; }
.timer-main { min-width: 170px; border: 0; background: #fff; color: var(--ink); }
.timer-main svg { width: 16px; height: 16px; fill: currentColor; stroke: currentColor; }
.focus-picker { width: min(590px, calc(100% - 44px)); margin: 29px auto 0; padding: 18px; border: 1px solid rgba(255,255,255,.1); border-radius: 18px; display: grid; grid-template-columns: auto minmax(160px,1fr) auto minmax(125px,150px); align-items: center; gap: 12px; color: #acb1ba; font-size: 11px; }
.focus-picker select { min-width: 0; height: 40px; padding: 0 32px 0 13px; border: 1px solid rgba(255,255,255,.12); border-radius: 11px; background: #26292f; color: #fff; outline: 0; text-overflow: ellipsis; }
.inbox-panel { min-height: calc(100vh - 130px); }

.bottom-nav, .mobile-fab { display: none; }

dialog { padding: 0; border: 0; color: var(--ink); }
dialog::backdrop { background: rgba(15, 17, 21, .46); backdrop-filter: blur(4px); }
dialog.fallback-open { position: fixed; z-index: 90; display: block; }
.sheet-dialog { width: min(590px, calc(100vw - 24px)); max-height: min(820px, calc(100vh - 24px)); margin: auto 0 auto auto; background: transparent; }
.sheet-dialog.fallback-open { inset: 0 0 0 auto; margin: 0; max-height: 100vh; }
.sheet-dialog[open] { animation: sheet-in .22s ease; }
@keyframes sheet-in { from { opacity: 0; transform: translateX(20px); } }
.sheet { max-height: calc(100vh - 24px); margin: 12px; border-radius: 25px; background: #fff; display: flex; flex-direction: column; box-shadow: 0 24px 75px rgba(12, 15, 21, .2); overflow: hidden; }
.sheet-head { padding: 21px 22px 16px; border-bottom: 1px solid var(--line-soft); display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; }
.sheet-head h2, .modal-card h2 { margin: 5px 0 0; font-size: 23px; letter-spacing: -.65px; }
.sheet-body { padding: 18px 22px 8px; overflow: auto; }
.field { display: grid; gap: 6px; color: #555b65; font-size: 11px; font-weight: 760; }
.field > span, .color-field legend { padding-left: 2px; }
.field input, .field select, .field textarea { width: 100%; min-width: 0; border: 1px solid var(--line); border-radius: 11px; outline: 0; background: #f9fafb; color: var(--ink); font-size: 13px; font-weight: 520; transition: .16s ease; }
.field input, .field select { height: 42px; padding: 0 11px; }
.field textarea { padding: 10px 11px; line-height: 1.45; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: rgba(29,84,242,.45); background: #fff; box-shadow: 0 0 0 3px rgba(29,84,242,.08); }
.field.wide { margin-bottom: 15px; }
.field.wide > input { height: 48px; font-size: 15px; font-weight: 650; }
.form-grid { margin-bottom: 16px; display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.color-field { margin: 0 0 16px; padding: 0; border: 0; color: #555b65; font-size: 11px; font-weight: 760; }
.color-options { margin-top: 7px; display: flex; gap: 8px; }
.color-options label { cursor: pointer; }
.color-options input { position: absolute; opacity: 0; }
.color-options i { width: 28px; height: 28px; border: 4px solid #fff; border-radius: 50%; display: block; box-shadow: 0 0 0 1px var(--line); }
.color-options input:checked + i { box-shadow: 0 0 0 2px var(--ink); }
.color-options i.blue { background: var(--blue); }.color-options i.green { background: var(--green); }.color-options i.orange { background: var(--orange); }.color-options i.red { background: var(--red); }.color-options i.violet { background: var(--violet); }
.switch-row { min-height: 65px; margin: 7px 0 12px; padding: 12px 13px; border: 1px solid var(--line); border-radius: 13px; display: flex; align-items: center; justify-content: space-between; gap: 16px; cursor: pointer; }
.switch-row span { display: grid; gap: 3px; }
.switch-row strong { font-size: 13px; }
.switch-row small { color: var(--muted); font-size: 10px; line-height: 1.35; }
.switch-row input { position: absolute; opacity: 0; }
.switch-row i { position: relative; flex: 0 0 auto; width: 40px; height: 23px; border-radius: 99px; background: #d7d9de; transition: .18s ease; }
.switch-row i:after { content: ""; position: absolute; width: 17px; height: 17px; left: 3px; top: 3px; border-radius: 50%; background: #fff; box-shadow: 0 2px 5px rgba(0,0,0,.18); transition: .18s ease; }
.switch-row input:checked + i { background: var(--blue); }
.switch-row input:checked + i:after { transform: translateX(17px); }
.sheet-footer { padding: 13px 22px 17px; border-top: 1px solid var(--line-soft); display: flex; justify-content: flex-end; gap: 8px; }
.sheet-footer .danger-btn { margin-right: auto; }
.share-task-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.proof-panel { margin: -4px 0 12px; padding: 10px; border: 1px solid #f1cf8f; border-radius: 12px; background: #fffaf0; color: #55472e; }
.quick-add + .proof-panel { margin: 7px 15px 3px; }
.proof-head { margin-bottom: 7px; display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 10px; }
.proof-head strong { color: #695325; }
.proof-head span { color: #9a7d43; }
.proof-preview { max-height: 74px; padding: 8px 9px; border-radius: 8px; background: #fff; overflow: auto; font-size: 11px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.proof-preview u { text-decoration-line: underline; text-decoration-style: wavy; text-decoration-color: #d55a4e; text-decoration-thickness: 1.5px; text-underline-offset: 2px; }
.proof-suggestions { margin-top: 7px; display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; }
.proof-suggestions button { min-height: 32px; padding: 5px 8px; border: 1px solid #ead8ae; border-radius: 9px; background: #fff; color: #4d4538; display: flex; align-items: center; gap: 6px; font-size: 10px; white-space: nowrap; cursor: pointer; }
.proof-suggestions button:hover { border-color: #d6b665; background: #fffdf7; }
.proof-suggestions s { color: #a45d56; }.proof-suggestions b { color: #27704e; }
.settings-sheet .sheet-body { padding-bottom: 18px; }
.range-field { margin: 2px 0 13px; display: grid; gap: 8px; font-size: 12px; font-weight: 720; }
.range-field span { display: flex; justify-content: space-between; }
.range-field input { accent-color: var(--blue); }
.platform-note { margin-top: 16px; padding: 13px; border-radius: 13px; background: var(--blue-weak); color: #294ba2; display: flex; gap: 11px; }
.platform-note svg { flex: 0 0 auto; width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.platform-note p { margin: 0; display: grid; gap: 3px; }
.platform-note strong { font-size: 12px; }
.platform-note span { font-size: 10px; line-height: 1.4; }
.custom-sound-row { min-height: 64px; margin: 2px 0 13px; padding: 10px 11px 10px 13px; border: 1px solid var(--line); border-radius: 13px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.custom-sound-row > div { min-width: 0; display: grid; gap: 3px; }
.custom-sound-row strong { font-size: 12px; }
.custom-sound-row span { overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.file-pick { min-height: 36px; padding: 0 12px; border: 1px solid #ccd1da; border-radius: 10px; background: #fff; color: #3d4550; display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 780; cursor: pointer; white-space: nowrap; }
.file-pick:hover { border-color: #aab1bd; background: #f8f9fb; }
.attachment-picker { padding: 11px; border: 1px dashed #ccd1d9; border-radius: 12px; background: #fafbfc; display: flex; align-items: center; gap: 10px; }
.attachment-picker small { color: var(--muted); font-size: 9px; line-height: 1.35; }
.attachment-list { display: grid; gap: 6px; margin-top: 7px; }
.attachment-chip { min-height: 36px; padding: 4px 5px 4px 9px; border: 1px solid var(--line); border-radius: 10px; background: #fff; display: flex; align-items: center; gap: 7px; }
.attachment-chip > button:first-child { min-width: 0; padding: 0; border: 0; background: transparent; display: flex; align-items: center; gap: 5px; cursor: pointer; }
.attachment-chip span { overflow: hidden; color: #313740; font-size: 11px; font-weight: 680; text-overflow: ellipsis; white-space: nowrap; }
.attachment-chip small { margin-left: auto; color: var(--muted); font-size: 9px; white-space: nowrap; }
.attachment-chip > button:last-child { width: 26px; height: 26px; padding: 0; border: 0; border-radius: 8px; background: #f3f4f6; color: #7a8089; font-size: 16px; cursor: pointer; }
.settings-section { margin-top: 17px; padding-top: 16px; border-top: 1px solid var(--line-soft); }
.settings-section h3 { margin: 0 0 4px; font-size: 13px; }
.settings-section p { margin: 0 0 10px; color: var(--muted); font-size: 10px; line-height: 1.45; }
.settings-actions { display: flex; gap: 7px; flex-wrap: wrap; }
.file-btn { cursor: pointer; }
.privacy-note { margin: 0 0 15px; padding: 11px 12px; border-radius: 11px; background: #f2f5fb; color: #53627c; font-size: 10px; line-height: 1.5; }
.report-log { margin-top: 17px; border-top: 1px solid var(--line-soft); padding-top: 14px; }
.report-log-head { margin-bottom: 7px; display: flex; justify-content: space-between; font-size: 12px; }
.report-log-head span { min-width: 24px; padding: 2px 7px; border-radius: 99px; background: #eef0f3; text-align: center; }
.report-item { padding: 9px 0; border-bottom: 1px solid var(--line-soft); display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.report-item > div { min-width: 0; display: grid; gap: 3px; }
.report-item strong { overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.report-item span { color: var(--muted); font-size: 9px; }
.report-item b { padding: 3px 7px; border-radius: 7px; background: #eef0f3; color: #606771; font-size: 8px; white-space: nowrap; }
.report-item b.status-fixed { background: #e4f3ea; color: #347252; }.report-item b.status-planned { background: #e6edff; color: #3759b7; }
.empty-log { color: var(--muted); font-size: 11px; }
.history-list { max-height: 56vh; margin-top: 18px; overflow: auto; }
.history-item { padding: 10px 5px; border-bottom: 1px solid var(--line-soft); display: flex; align-items: flex-start; gap: 9px; }
.history-item .task-dot { margin-top: 5px; flex: 0 0 auto; }
.history-item div { display: grid; gap: 3px; }.history-item strong { font-size: 12px; }.history-item span { color: var(--muted); font-size: 10px; }

.account-dialog { width: min(500px, calc(100vw - 24px)); }
.account-card { min-height: 420px; }
.account-loading { min-height: 280px; display: grid; place-items: center; color: var(--muted); font-size: 13px; }
.account-lead, .download-lead { margin: 18px 0 14px; color: var(--muted); font-size: 12px; line-height: 1.55; }
.account-tabs { margin-bottom: 15px; padding: 4px; border-radius: 12px; background: #f0f1f3; display: grid; grid-template-columns: 1fr 1fr; }
.account-tabs button { min-height: 37px; border: 0; border-radius: 9px; background: transparent; color: #6a7079; font-size: 12px; font-weight: 760; cursor: pointer; }
.account-tabs button.active { background: #fff; color: var(--ink); box-shadow: 0 4px 13px rgba(20,24,31,.08); }
.account-form { display: grid; gap: 3px; }
.account-submit { width: 100%; margin-top: 5px; }
.account-error { min-height: 18px; margin: 0; color: #b8423c; font-size: 10px; line-height: 1.4; }
.account-production-link { display: inline-flex; width: max-content; margin-top: -2px; text-decoration: none; }
.account-production-link[hidden] { display: none; }
.account-note { margin: 4px 0 10px; color: var(--muted); font-size: 10px; line-height: 1.5; }
.profile-summary { margin: 20px 0; padding: 15px; border-radius: 16px; background: var(--blue-weak); display: flex; align-items: center; gap: 12px; }
.profile-avatar { width: 46px; height: 46px; border-radius: 15px; background: var(--blue); color: #fff; display: grid; place-items: center; font-size: 18px; font-weight: 850; }
.profile-summary div { min-width: 0; display: grid; gap: 3px; }
.profile-summary strong { font-size: 14px; }
.profile-summary div span { overflow: hidden; color: #526382; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.account-actions { display: flex; justify-content: space-between; gap: 9px; }
.download-dialog { width: min(860px, calc(100vw - 24px)); }
.download-primary { margin-bottom: 16px; display: flex; gap: 9px; flex-wrap: wrap; }
.download-primary button { min-height: 44px; }
.download-primary svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; }
.platform-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.platform-grid article { min-width: 0; padding: 14px; border: 1px solid var(--line); border-radius: 15px; display: grid; gap: 5px; }
.platform-grid article.recommended { border-color: rgba(29,84,242,.38); background: var(--blue-weak); box-shadow: inset 0 0 0 1px rgba(29,84,242,.09); }
.platform-grid article > span { color: var(--blue); font-size: 9px; font-weight: 850; letter-spacing: .07em; text-transform: uppercase; }
.platform-grid article strong { font-size: 13px; }
.platform-grid article small { min-height: 29px; color: var(--muted); font-size: 10px; line-height: 1.4; }
.platform-grid article a { width: max-content; margin-top: 4px; padding: 7px 9px; border-radius: 9px; background: #f0f2f5; color: var(--ink); font-size: 10px; font-weight: 780; text-decoration: none; }
.platform-grid article a:hover { background: var(--blue); color: #fff; }

.modal-dialog { width: min(760px, calc(100vw - 24px)); background: transparent; }
.modal-dialog.fallback-open { inset: 50% auto auto 50%; margin: 0; transform: translate(-50%, -50%); }
.modal-card { padding: 22px; border-radius: 24px; background: #fff; box-shadow: 0 24px 75px rgba(12,15,21,.2); }
.modal-card > header, .modal-card > footer { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.modal-card > footer { margin-top: 18px; justify-content: flex-end; align-items: center; }
.ocr-layout { margin-top: 18px; display: grid; grid-template-columns: .8fr 1.2fr; gap: 16px; }
.photo-preview { min-height: 260px; border-radius: 16px; background: #eef0f3; display: grid; place-items: center; overflow: hidden; }
.photo-preview img { width: 100%; height: 100%; max-height: 360px; object-fit: contain; }
.helper { margin: -7px 2px 0; color: var(--muted); font-size: 10px; line-height: 1.45; }
.bulk-dialog { width: min(780px, calc(100vw - 24px)); }
.bulk-layout { margin-top: 18px; display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(230px, .75fr); gap: 16px; }
.bulk-layout > .field { grid-row: span 2; margin: 0; }
.bulk-layout textarea { min-height: 290px; }
.bulk-modes { margin: 0; padding: 0; border: 0; display: grid; align-content: start; gap: 7px; }
.bulk-modes legend { margin-bottom: 7px; color: #555b65; font-size: 11px; font-weight: 760; }
.bulk-modes label { min-height: 61px; padding: 10px; border: 1px solid var(--line); border-radius: 12px; display: flex; align-items: flex-start; gap: 9px; cursor: pointer; }
.bulk-modes label:has(input:checked) { border-color: rgba(29,84,242,.45); background: var(--blue-weak); box-shadow: inset 0 0 0 1px rgba(29,84,242,.12); }
.bulk-modes input { margin-top: 2px; accent-color: var(--blue); }
.bulk-modes span { display: grid; gap: 3px; }
.bulk-modes strong { font-size: 12px; }
.bulk-modes small { color: var(--muted); font-size: 10px; line-height: 1.35; }
.bulk-preview { min-height: 66px; padding: 10px 11px; border-radius: 12px; background: #f5f6f8; color: #5e6570; font-size: 10px; line-height: 1.45; }
.check-index { flex: 0 0 18px; color: #7c828c; font-size: 10px; font-weight: 760; text-align: right; }

.toast { position: fixed; left: 50%; bottom: 24px; z-index: 100; min-width: 230px; max-width: calc(100vw - 32px); padding: 10px 13px; border-radius: 14px; background: var(--ink); color: #fff; display: flex; align-items: center; gap: 9px; box-shadow: 0 14px 35px rgba(10,12,16,.22); opacity: 0; pointer-events: none; transform: translate(-50%, 14px); transition: .22s ease; }
.toast.show { opacity: 1; pointer-events: auto; transform: translate(-50%, 0); }
.toast-icon { width: 24px; height: 24px; border-radius: 8px; background: #fff; color: var(--ink); display: grid; place-items: center; }
.toast-icon svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.5; }
.toast > span:nth-child(2) { flex: 1; font-size: 12px; font-weight: 670; }
.toast button { border: 0; background: transparent; color: #90abff; font-size: 11px; font-weight: 780; cursor: pointer; }
.drag-ghost { position: fixed; z-index: 120; padding: 9px 12px; border: 1px solid rgba(29,84,242,.25); border-radius: 13px; background: rgba(255,255,255,.96); box-shadow: 0 14px 38px rgba(20,24,32,.18); pointer-events: none; opacity: .92; }

@media (max-width: 1180px) {
  :root { --sidebar: 210px; }
  .main { padding-inline: 18px; }
  .workspace { grid-template-columns: minmax(330px, .78fr) minmax(500px, 1.22fr); }
  .search-wrap { width: 240px; }
}

@media (max-width: 980px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .main { padding: 18px 15px calc(126px + env(safe-area-inset-bottom)); }
  .topbar { margin-bottom: 16px; }
  .title-wrap { min-width: 0; }
  .workspace { grid-template-columns: 1fr; }
  .calendar-panel { min-height: 590px; }
  .bottom-nav { position: fixed; left: 10px; right: 10px; bottom: max(12px, env(safe-area-inset-bottom)); z-index: 50; min-height: 66px; padding: 7px; border: 1px solid rgba(20,24,31,.08); border-radius: 21px; background: rgba(255,255,255,.96); backdrop-filter: blur(18px); box-shadow: 0 10px 32px rgba(20,24,31,.14); display: grid; grid-template-columns: repeat(4, 1fr); }
  .bottom-nav button { min-width: 0; padding: 5px 2px; border: 0; border-radius: 15px; background: transparent; color: #7d838d; display: grid; place-items: center; gap: 2px; font-size: 9px; font-weight: 720; cursor: pointer; }
  .bottom-nav button.active { background: var(--blue-weak); color: var(--blue); }
  .bottom-nav svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; }
  .mobile-fab { position: fixed; right: 19px; bottom: calc(104px + env(safe-area-inset-bottom)); z-index: 52; width: 54px; height: 54px; padding: 0; border: 0; border-radius: 18px; background: var(--blue); color: #fff; box-shadow: 0 12px 26px rgba(29,84,242,.35); display: grid; place-items: center; }
  .mobile-fab svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
  body[data-screen="calendar"] .mobile-fab { display: none; }
  .toast { bottom: 86px; }
  .full-calendar-panel { min-height: calc(100vh - 156px); }
}

@media (max-width: 700px) {
  .main { padding: max(18px, env(safe-area-inset-top)) 11px calc(126px + env(safe-area-inset-bottom)); }
  .topbar { align-items: flex-start; }
  h1 { font-size: 27px; letter-spacing: -1px; }
  .date-kicker { font-size: 10px; }
  .search-wrap { position: absolute; left: 11px; right: 11px; top: 72px; z-index: 8; width: auto; display: none; box-shadow: 0 8px 28px rgba(20,24,31,.14); }
  .search-wrap.open { display: flex; }
  #searchToggle { display: grid; }
  .top-actions { gap: 5px; }
  .icon-btn { width: 39px; height: 39px; border-radius: 13px; }
  .panel { border-radius: 20px; }
  .panel-head { min-height: 66px; padding: 15px 15px 10px; }
  .panel-title { font-size: 17px; }
  .quick-add { margin-inline: 11px; }
  .parser-hint { margin-inline: 15px; }
  .task-surface { padding-inline: 8px 8px; grid-template-columns: 15px 22px minmax(0,1fr) auto 28px; gap: 7px; }
  .drag-handle { width: 15px; }
  .focus-teaser { margin: 12px; grid-template-columns: auto minmax(0,1fr) 39px; }
  .focus-teaser button { width: 39px; min-width: 39px; padding: 0; }
  .focus-teaser button span { display: none; }
  .calendar-head { align-items: flex-start; flex-wrap: wrap; }
  .calendar-head > div:first-child { min-width: 0; }
  .calendar-head .panel-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .calendar-actions { margin-left: auto; }
  .calendar-actions .quiet-btn { display: none; }
  .calendar-canvas { min-height: 480px; overflow-x: hidden; }
  .week-view { min-width: 0; padding-inline: 4px; }
  .week-head, .week-body { grid-template-columns: 34px repeat(7, minmax(0, 1fr)); }
  .week-day { padding-inline: 0; font-size: 8px; }
  .week-day b { width: 27px; height: 27px; font-size: 12px; }
  .week-body .time-label { padding-right: 3px; font-size: 8px; }
  .week-body .calendar-event { padding: 4px 2px; border-left-width: 2px; border-radius: 5px; font-size: 7px; }
  .week-body .calendar-event span { display: none; }
  .day-view { min-width: 100%; grid-template-columns: 48px minmax(0, 1fr); }
  .day-agenda-view { min-height: 390px; padding-inline: 8px; }
  .day-agenda-summary { align-items: flex-start; }
  .month-view { min-width: 0; padding-inline: 4px; }
  .month-grid { grid-template-columns: repeat(7, minmax(0, 1fr)); grid-template-rows: repeat(6, minmax(68px, 1fr)); }
  .month-weekdays span { padding-inline: 1px; }
  .month-day { min-height: 68px; padding: 3px 2px; }
  .month-number { width: 21px; height: 21px; margin-bottom: 2px; }
  .mini-event { padding: 2px; font-size: 6.5px; }
  .more-events { font-size: 6.5px; }
  .view-tabs { margin-inline: 11px; }
  .view-tabs.standalone { grid-template-columns: repeat(4, 1fr); margin-inline: 12px; }
  .view-tabs.standalone .print-inline { display: none; }
  .full-calendar-panel .primary-btn { width: 39px; padding: 0; font-size: 0; box-shadow: none; }
  .full-calendar-panel .calendar-head > .primary-btn { margin-left: auto; }
  .full-calendar-panel .primary-btn svg { width: 19px; height: 19px; }
  .focus-stage { min-height: calc(100vh - 140px); padding: 36px 15px; border-radius: 23px; }
  .timer-dial { width: 220px; height: 220px; }
  .timer-time { font-size: 43px; }
  .timer-actions { width: 100%; display: grid; grid-template-columns: 1fr 1.6fr 1fr; }
  .timer-actions button { min-width: 0; padding-inline: 8px; font-size: 11px; }
  .focus-picker { width: calc(100% - 28px); padding: 14px; grid-template-columns: minmax(0,1fr) minmax(118px,.55fr); gap: 10px; }
  .focus-picker label { display: none; }
  .focus-picker select { width: 100%; padding-left: 11px; }
  .sheet-dialog { width: 100%; max-height: calc(100vh - 10px); margin: auto 0 0; }
  .sheet-dialog.fallback-open { inset: auto 0 0; margin: 0; }
  .sheet { max-height: calc(100vh - 10px); margin: 10px 0 0; border-radius: 23px 23px 0 0; }
  .sheet-head { padding: 17px 16px 13px; }
  .sheet-body { padding: 15px 16px 5px; }
  .form-grid { grid-template-columns: 1fr 1fr; gap: 11px 9px; }
  .sheet-footer { padding: 11px 16px max(13px, env(safe-area-inset-bottom)); flex-wrap: wrap; }
  .sheet-footer .danger-btn { order: 3; width: 100%; margin: 0; }
  .sheet-footer .primary-btn { flex: 1; }
  .modal-card { padding: 17px; border-radius: 20px; }
  .modal-dialog { max-height: calc(100dvh - 12px); overflow: auto; }
  .ocr-layout { grid-template-columns: 1fr; }
  .photo-preview { min-height: 160px; max-height: 210px; }
  .attachment-picker { align-items: flex-start; flex-direction: column; }
  .custom-sound-row { align-items: flex-start; flex-direction: column; }
  .bulk-layout { grid-template-columns: 1fr; }
  .bulk-layout > .field { grid-row: auto; }
  .platform-grid { grid-template-columns: 1fr; }
  .download-primary { display: grid; }
  .account-actions { display: grid; grid-template-columns: 1fr 1fr; }

  .recovery-card { margin-inline: 11px; }
  .recovery-item { grid-template-columns: 1fr; }
  .recovery-item-actions { justify-content: flex-start; }
  .recovery-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .bulk-layout textarea { min-height: 190px; }
}

@media (max-width: 800px) and (max-height: 760px) {
  .focus-stage { padding-block: 20px 82px; }
  .focus-stage h2 { font-size: clamp(21px, 6vw, 30px); margin-top: 6px; }
  .focus-stage > p { margin-top: 4px; }
  .timer-dial { width: 165px; height: 165px; margin: 14px 0 12px; }
  .timer-time { font-size: 36px; }
  .focus-picker { margin-top: 14px; }
}

@media (max-width: 430px) {
  .main { padding-inline: 8px; }
  .topbar { padding-inline: 5px; }
  .top-actions .icon-btn:nth-child(2) { display: none; }
  h1 { font-size: 25px; }
  .quick-add input { font-size: 13px; }
  .add-btn { min-width: 66px; padding-inline: 10px; font-size: 11px; }
  .parser-hint { align-items: flex-start; font-size: 9px; line-height: 1.35; }
  .parser-hint span { display: block; min-width: 0; }
  .capture-btn { width: 30px; }
  .task-title { font-size: 13px; }
  .calendar-panel { min-height: 560px; }
  .form-grid { grid-template-columns: 1fr; }
  .sheet-footer .secondary-btn { display: none; }
  .sheet-footer .share-task-btn { display: inline-flex; flex: 0 0 auto; }
}

@media print {
  @page { size: A4 landscape; margin: 12mm; }
  html, body { background: #fff; }
  .sidebar, .topbar, .bottom-nav, .mobile-fab, .quick-add, .parser-hint, .focus-teaser, .calendar-actions, .view-tabs, .progress-ring { display: none !important; }
  .app-shell, .workspace { display: block; }
  .main { padding: 0; }
  .screen { display: none !important; }
  .screen.active { display: block !important; }
  .panel { margin-bottom: 10mm; border: 1px solid #bbb; box-shadow: none; break-inside: avoid; }
  .agenda-panel, .calendar-panel { display: block; }
  .calendar-canvas { min-height: 0; overflow: visible; }
  .week-view, .month-view, .year-view, .day-view { min-width: 0 !important; }
  .week-body, .day-view { --slot-height: 11px !important; }
  .month-grid { grid-template-rows: repeat(6, 55px); }
  .calendar-event, .mini-event { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
