@font-face {
    font-family: "Noto Sans Bengali";
    src: local("Noto Sans Bengali");
    font-display: swap;
}

:root {
    color-scheme: dark;
    --night-sky: #090d12;
    --desk-felt: #111821;
    --raised-tray: #17212b;
    --capture-well: #0c1219;
    --paper: #f2f3ed;
    --pencil: #b7c0c6;
    --smoke: #85919a;
    --lamp: #d6aa61;
    --lamp-ink: #17120b;
    --dawn: #86afcb;
    --done: #70b68e;
    --missed: #d47e75;
    --focus: #9ac9e6;
    --lamp-hover: #e0b66f;
    --smoke-deep: #73808a;
    --tray-hover: #141d26;
    --error-text: #efb3ad;
    --hairline: rgba(242, 243, 237, 0.1);
    --soft-line: rgba(242, 243, 237, 0.065);
    --inset-line: rgba(0, 0, 0, 0.42);
    --control: #1b2631;
    --radius-control: 6px;
    --radius-tray: 10px;
    --radius-dialog: 14px;
    --edge-width: 184px;
}

* { box-sizing: border-box; }

html { background: var(--night-sky); -webkit-font-smoothing: antialiased; }

body {
    margin: 0;
    min-width: 320px;
    min-height: 100vh;
    min-height: 100dvh;
    background: var(--night-sky);
    color: var(--paper);
    font-family: "Noto Sans Bengali", "Noto Sans", ui-sans-serif, system-ui, -apple-system, sans-serif;
    font-size: 16px;
    line-height: 1.5;
}

.skip-link { position: fixed; z-index: 200; top: 8px; left: 8px; translate: 0 -160%; border-radius: var(--radius-control); background: var(--paper); padding: 9px 12px; color: var(--night-sky); font-size: 13px; }
.skip-link:focus { translate: 0; }

button, input, select, textarea { font: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { text-wrap: balance; }
p { text-wrap: pretty; }

:focus-visible {
    outline: 2px solid var(--focus);
    outline-offset: 2px;
}

::selection { background: rgba(214, 170, 97, 0.32); color: var(--paper); }

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.os-shell { min-height: 100vh; }

.edge-index {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 20;
    display: flex;
    width: var(--edge-width);
    flex-direction: column;
    border-right: 1px solid var(--hairline);
    background: var(--night-sky);
    padding: 24px 16px 16px;
}

.os-wordmark {
    display: flex;
    min-height: 44px;
    align-items: center;
    gap: 10px;
    font-size: 15px;
    font-weight: 600;
}

.os-wordmark b { color: var(--lamp); font-weight: 700; }
.wordmark-lamp { width: 8px; height: 8px; border-radius: 50%; background: var(--lamp); box-shadow: 0 0 0 4px rgba(214, 170, 97, 0.1); }

.edge-nav { display: grid; gap: 4px; margin-top: 32px; }
.nav-item {
    display: grid;
    min-height: 44px;
    grid-template-columns: 24px 1fr;
    align-items: center;
    gap: 8px;
    border: 0;
    border-radius: var(--radius-control);
    background: transparent;
    padding: 8px 10px;
    color: var(--pencil);
    text-align: left;
    cursor: pointer;
    transition: background-color 160ms cubic-bezier(0.23, 1, 0.32, 1), color 160ms cubic-bezier(0.23, 1, 0.32, 1);
}
.nav-item span { color: var(--smoke); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; font-variant-numeric: tabular-nums; }
.nav-item:hover { background: rgba(242, 243, 237, 0.045); color: var(--paper); }
.nav-item.is-active { background: var(--desk-felt); color: var(--paper); }
.nav-item.is-active span { color: var(--lamp); }

.brand-shelf { margin-top: 36px; min-height: 0; }
.section-label-row { display: flex; align-items: center; justify-content: space-between; }
.section-label-row h2 { margin: 0; color: var(--smoke); font-size: 11px; font-weight: 600; }
.brand-shelf-list { display: grid; gap: 2px; margin-top: 8px; max-height: 34vh; overflow: auto; scrollbar-width: thin; }
.brand-shelf-item { width: 100%; overflow: hidden; border: 0; border-radius: var(--radius-control); background: transparent; padding: 7px 4px; color: var(--pencil); font-size: 13px; text-align: left; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.brand-shelf-item:hover { background: var(--desk-felt); color: var(--paper); }
.brand-shelf-empty { padding: 8px 4px; color: var(--smoke); font-size: 12px; }
.shelf-link { width: 100%; min-height: 40px; margin-top: 8px; border: 0; border-top: 1px solid var(--soft-line); background: transparent; padding: 10px 4px 4px; color: var(--dawn); font-size: 11px; text-align: left; cursor: pointer; }
.shelf-link:hover { color: var(--paper); }

.edge-footer {
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    margin-top: auto;
    border-top: 1px solid var(--soft-line);
    padding-top: 16px;
}
.user-avatar { display: grid; width: 32px; height: 32px; place-items: center; border-radius: 50%; background: var(--raised-tray); color: var(--lamp); font-weight: 650; }
.edge-footer strong, .edge-footer small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.edge-footer strong { font-size: 12px; font-weight: 600; }
.edge-footer small { color: var(--smoke); font-size: 10px; }

.desk-canvas { min-height: 100vh; margin-left: var(--edge-width); padding: 28px clamp(24px, 4vw, 56px) 56px; }
.desk-header { display: flex; max-width: 1300px; align-items: flex-start; justify-content: space-between; gap: 24px; margin: 0 auto 24px; }
.desk-header h1 { margin: 2px 0 0; font-size: clamp(25px, 2.2vw, 32px); line-height: 1.18; letter-spacing: -0.025em; }
.eyebrow, .section-kicker { margin-bottom: 4px; color: var(--smoke); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 10px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; }
.header-actions { display: flex; gap: 8px; }

.button, .icon-button, .text-button, .mobile-nav button {
    border: 0;
    cursor: pointer;
    transition: background-color 140ms cubic-bezier(0.23, 1, 0.32, 1), color 140ms cubic-bezier(0.23, 1, 0.32, 1), transform 120ms cubic-bezier(0.23, 1, 0.32, 1);
}
.button:active, .icon-button:active, .text-button:active, .mobile-nav button:active { transform: scale(0.97); }
.button:disabled, .icon-button:disabled, .text-button:disabled, .small-action:disabled { opacity: 0.52; cursor: wait; transform: none; }
.button { display: inline-flex; min-height: 44px; align-items: center; justify-content: center; border-radius: var(--radius-control); padding: 10px 16px; font-size: 14px; font-weight: 600; }
.button-primary { background: var(--lamp); color: var(--lamp-ink); }
.button-primary:hover { background: var(--lamp-hover); }
.button-quiet { box-shadow: inset 0 0 0 1px var(--hairline); background: transparent; color: var(--paper); }
.button-quiet:hover { background: var(--raised-tray); }
.icon-button { display: grid; width: 44px; height: 44px; place-items: center; border-radius: var(--radius-control); background: transparent; color: var(--pencil); font-size: 20px; }
.icon-button:hover { background: var(--raised-tray); color: var(--paper); }
.text-button { min-height: 44px; background: transparent; padding: 8px 4px; color: var(--dawn); font-size: 12px; }
.text-button:hover { color: var(--paper); }

.night-ribbon {
    display: grid;
    max-width: 1300px;
    min-height: 76px;
    grid-template-columns: 150px minmax(260px, 1fr) 64px;
    align-items: center;
    gap: 20px;
    margin: 0 auto 32px;
    border-top: 1px solid var(--hairline);
    border-bottom: 1px solid var(--hairline);
    padding: 12px 0;
}
.ribbon-copy p { margin: 0; }
.ribbon-copy strong { display: block; color: var(--pencil); font-size: 13px; font-weight: 500; }
.ribbon-track { position: relative; padding: 9px 0 22px; }
.ribbon-track progress { display: block; width: 100%; height: 6px; appearance: none; border: 0; border-radius: 99px; overflow: hidden; background: var(--raised-tray); }
.ribbon-track progress::-webkit-progress-bar { background: var(--raised-tray); }
.ribbon-track progress::-webkit-progress-value { background: var(--lamp); }
.ribbon-track progress::-moz-progress-bar { background: var(--lamp); }
.ribbon-ticks { position: absolute; inset: 21px 0 auto; display: flex; justify-content: space-between; color: var(--smoke); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 10px; font-variant-numeric: tabular-nums; }
.ribbon-ticks .midnight { position: relative; color: var(--pencil); }
.ribbon-ticks .midnight::before { position: absolute; top: -20px; left: 50%; width: 8px; height: 8px; border-right: 1px solid var(--pencil); border-bottom: 1px solid var(--pencil); content: ""; transform: translateX(-50%) rotate(45deg); }
.ribbon-ticks small { position: absolute; top: 14px; left: 50%; color: var(--smoke); font-size: 8px; white-space: nowrap; transform: translateX(-50%); }
.ribbon-now { justify-self: end; color: var(--lamp); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; }

.view-panel { display: none; max-width: 1300px; margin: 0 auto; }
.view-panel.is-active { display: block; }
.desk-grid { display: grid; grid-template-columns: minmax(520px, 1fr) minmax(280px, 320px); gap: clamp(24px, 4vw, 48px); align-items: start; }
.focus-ledger { min-width: 0; }
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.section-heading h2, .section-heading h3 { margin: 0; }
.section-heading h2 { font-size: 23px; line-height: 1.3; letter-spacing: -0.02em; }
.section-heading h3 { font-size: 17px; }
.quiet-count { color: var(--smoke); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; font-variant-numeric: tabular-nums; }

.top3-ledger { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.ledger-row {
    display: grid;
    min-height: 104px;
    grid-template-columns: 42px minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    border-top: 1px solid var(--soft-line);
    padding: 16px 0;
}
.ledger-row:last-child { border-bottom: 1px solid var(--soft-line); }
.ledger-number { align-self: start; padding-top: 4px; color: var(--lamp); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; font-variant-numeric: tabular-nums; }
.ledger-content { min-width: 0; }
.ledger-title { margin: 0; color: var(--paper); font-size: 19px; font-weight: 620; line-height: 1.45; }
.plain-title-button { display: block; width: 100%; border: 0; background: transparent; padding: 0; text-align: left; cursor: pointer; }
.plain-title-button:hover { color: var(--lamp-hover); }
.ledger-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin-top: 5px; color: var(--smoke); font-size: 12px; }
.ledger-actions { display: flex; align-items: center; gap: 6px; }
.ledger-row.is-done .ledger-title { color: var(--smoke); text-decoration: line-through; text-decoration-color: rgba(112, 182, 142, 0.55); }
.ledger-row.is-done .ledger-number { color: var(--done); }
.ledger-empty .ledger-title { color: var(--smoke); font-weight: 500; }
.ledger-empty button { justify-self: start; }
.ledger-loading { border-top: 1px solid var(--soft-line); padding: 28px 0; color: var(--smoke); }
.brand-chip, .status-chip { display: inline-flex; min-height: 22px; align-items: center; border-radius: 4px; padding: 2px 7px; background: var(--raised-tray); color: var(--pencil); font-size: 11px; font-weight: 550; }
.status-chip.is-done { color: var(--done); }
.status-chip.is-waiting, .status-chip.is-approval { color: var(--dawn); }
.done-button { min-width: 66px; }

.capture-well { margin-top: 28px; border-radius: var(--radius-tray); box-shadow: inset 0 0 0 1px var(--inset-line); background: var(--capture-well); padding: 14px; }
.capture-well label { display: block; margin-bottom: 4px; color: var(--smoke); font-size: 11px; font-weight: 600; }
.capture-well textarea { display: block; width: 100%; min-height: 52px; max-height: 144px; resize: vertical; border: 0; outline: 0; background: transparent; color: var(--paper); font-size: 16px; line-height: 1.5; }
.capture-well textarea::placeholder { color: var(--smoke-deep); }
.capture-footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 8px; border-top: 1px solid var(--soft-line); padding-top: 10px; }
.capture-footer span { color: var(--smoke); font-size: 11px; }

.side-tray { border-radius: var(--radius-tray); background: var(--desk-felt); padding: 4px 16px; }
.tray-section { padding: 18px 0; }
.tray-section + .tray-section { border-top: 1px solid var(--soft-line); }
.tray-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.tray-heading h3 { margin: 0; font-size: 15px; font-weight: 600; }
.tray-list { margin-top: 8px; }
.tray-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; min-height: 44px; padding: 7px 0; }
.tray-row + .tray-row { border-top: 1px solid var(--soft-line); }
.tray-row strong { display: block; overflow: hidden; color: var(--pencil); font-size: 13px; font-weight: 520; text-overflow: ellipsis; white-space: nowrap; }
.tray-row small { display: block; color: var(--smoke); font-size: 10px; }
.tray-row-action { min-height: 44px; border: 0; border-radius: var(--radius-control); background: transparent; padding: 6px 8px; color: var(--dawn); font-size: 11px; cursor: pointer; }
.tray-row-action:hover { background: var(--raised-tray); color: var(--paper); }
.empty-copy { margin: 8px 0 0; color: var(--smoke); font-size: 12px; }

.page-intro { display: flex; align-items: flex-end; justify-content: space-between; gap: 32px; margin: 4px 0 32px; border-bottom: 1px solid var(--hairline); padding-bottom: 24px; }
.page-intro h2 { margin: 0 0 6px; font-size: 28px; line-height: 1.2; letter-spacing: -0.025em; }
.page-intro p:not(.section-kicker) { max-width: 650px; margin: 0; color: var(--pencil); }
.intro-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.split-ledger { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; }
.work-groups { display: grid; grid-template-columns: 1fr 1fr; gap: 36px 48px; }
.list-toolbar, .portfolio-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: -10px 0 28px; }
.search-control { min-width: min(420px, 100%); }
.portfolio-toolbar .search-control { flex: 1; }
.filter-control { min-width: 180px; }
.long-list { border-top: 1px solid var(--soft-line); }
.long-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; align-items: center; min-height: 78px; border-bottom: 1px solid var(--soft-line); padding: 14px 0; }
.long-row h4 { margin: 0; color: var(--paper); font-size: 15px; font-weight: 580; }
.long-row p { margin: 3px 0 0; color: var(--smoke); font-size: 12px; }
.row-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.small-action { min-height: 44px; border: 0; border-radius: var(--radius-control); box-shadow: inset 0 0 0 1px var(--hairline); background: transparent; padding: 8px 10px; color: var(--pencil); font-size: 12px; cursor: pointer; }
.small-action:hover { background: var(--raised-tray); color: var(--paper); }

.routine-board { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.routine-window { border-top: 1px solid var(--hairline); }
.routine-window h3 { margin: 14px 0 8px; font-size: 15px; }
.routine-row { min-height: 78px; border-bottom: 1px solid var(--soft-line); padding: 14px 0; }
.routine-row strong { display: block; font-size: 14px; }
.routine-row p { margin: 4px 0 0; color: var(--smoke); font-size: 11px; }
.routine-row.is-inactive { opacity: 0.56; }

.preset-status { display: flex; align-items: center; justify-content: space-between; gap: 32px; margin-bottom: 28px; border-top: 1px solid var(--hairline); border-bottom: 1px solid var(--hairline); padding: 20px 0; }
.preset-status h3 { margin: 0 0 4px; font-size: 17px; }
.preset-status p:not(.section-kicker) { max-width: 680px; margin: 0; color: var(--smoke); font-size: 13px; }
.preset-stats { display: grid; grid-template-columns: repeat(3, auto); gap: 22px; }
.preset-stats span { color: var(--smoke); font-size: 10px; text-align: right; text-transform: uppercase; }
.preset-stats strong { display: block; color: var(--paper); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 16px; font-weight: 600; text-transform: none; }
.portfolio-section { margin-top: 42px; }
.catalogue-groups, .preset-groups { display: grid; gap: 34px; }
.catalogue-group, .preset-group { min-width: 0; }
.catalogue-group-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 10px; border-bottom: 1px solid var(--hairline); padding-bottom: 8px; }
.catalogue-group-heading h4 { margin: 0; color: var(--paper); font-size: 14px; font-weight: 600; }
.catalogue-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px 20px; }
.catalogue-item { min-width: 0; min-height: 128px; border-bottom: 1px solid var(--soft-line); padding: 15px 0; }
.catalogue-title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.catalogue-title-row strong { min-width: 0; color: var(--paper); font-size: 14px; font-weight: 590; }
.catalogue-item > p { margin: 7px 0 12px; color: var(--smoke); font-size: 11px; }
.catalogue-meta { display: flex; flex-wrap: wrap; gap: 8px; color: var(--smoke); font-size: 10px; }
.installed-mark { color: var(--done); }
.missing-mark { color: var(--dawn); }
.state-badge { flex: none; border-radius: 99px; background: var(--raised-tray); padding: 3px 6px; color: var(--pencil); font-size: 9px; font-weight: 650; text-transform: uppercase; }
.state-badge.state-core, .state-badge.state-active { color: var(--done); }
.state-badge.state-temporary, .state-badge.state-on-demand { color: var(--dawn); }
.state-badge.state-blocked { color: var(--missed); }
.state-badge.state-parked, .state-badge.state-complete { color: var(--smoke); }
.preset-list { display: grid; grid-template-columns: 1fr 1fr; gap: 0 28px; }
.task-preset-row { display: grid; min-height: 78px; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px; border-bottom: 1px solid var(--soft-line); padding: 12px 0; }
.task-preset-copy { min-width: 0; }
.task-preset-copy strong { display: block; color: var(--paper); font-size: 13px; font-weight: 560; }
.task-preset-copy p { margin: 4px 0 0; color: var(--smoke); font-size: 10px; }
.review-section { margin-top: 32px; }
.review-clock { color: var(--lamp); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }
.connection-strip { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-top: 48px; border-top: 1px solid var(--hairline); border-bottom: 1px solid var(--hairline); padding: 24px 0; }
.connection-strip h3 { margin: 0 0 4px; }
.connection-strip p:not(.section-kicker) { margin: 0; color: var(--smoke); font-size: 13px; }

label { display: grid; gap: 6px; color: var(--pencil); font-size: 12px; font-weight: 550; }
input, select, textarea {
    width: 100%;
    min-height: 44px;
    border: 1px solid var(--hairline);
    border-radius: var(--radius-control);
    background: var(--capture-well);
    padding: 9px 11px;
    color: var(--paper);
    outline: 0;
}
textarea { resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { border-color: var(--focus); box-shadow: 0 0 0 2px rgba(154, 201, 230, 0.12); }
select { color-scheme: dark; }

.sheet-dialog { width: min(560px, calc(100vw - 32px)); max-height: min(82vh, 760px); border: 1px solid var(--hairline); border-radius: var(--radius-dialog); background: var(--raised-tray); color: var(--paper); padding: 0; box-shadow: 0 24px 80px rgba(0, 0, 0, 0.42); }
.sheet-dialog::backdrop { background: rgba(4, 7, 10, 0.78); backdrop-filter: blur(4px); }
.sheet-dialog[open] { animation: dialog-in 210ms cubic-bezier(0.23, 1, 0.32, 1); }
.dialog-frame { display: grid; gap: 18px; margin: 0; padding: 22px; }
.dialog-frame header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.dialog-frame header h2 { margin: 0; font-size: 22px; }
.dialog-frame footer { display: flex; justify-content: flex-end; gap: 8px; border-top: 1px solid var(--soft-line); padding-top: 18px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.conditional-field[hidden], [hidden] { display: none !important; }
.dialog-copy { margin: -6px 0 0; color: var(--pencil); font-size: 13px; }
.compact-dialog { gap: 16px; }
.resolve-task-title { margin: -4px 0 0; color: var(--paper); font-size: 18px; font-weight: 600; }
.resolution-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.resolution-action { min-height: 84px; border: 1px solid var(--hairline); border-radius: var(--radius-tray); background: var(--desk-felt); padding: 14px; color: var(--paper); text-align: left; cursor: pointer; }
.resolution-action:hover { border-color: rgba(214, 170, 97, 0.45); background: var(--tray-hover); }
.resolution-action strong, .resolution-action span { display: block; }
.resolution-action strong { font-size: 14px; }
.resolution-action span { margin-top: 4px; color: var(--smoke); font-size: 11px; }
.delegate-panel { display: grid; gap: 12px; border-top: 1px solid var(--soft-line); padding-top: 16px; }
.slot-choices { display: grid; gap: 8px; }
.slot-choice { display: grid; min-height: 62px; grid-template-columns: 36px minmax(0, 1fr); align-items: center; gap: 10px; border: 1px solid var(--hairline); border-radius: var(--radius-control); background: var(--desk-felt); padding: 10px 12px; color: var(--paper); text-align: left; cursor: pointer; }
.slot-choice span:first-child { color: var(--lamp); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
.slot-choice span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.weekday-picker { display: flex; flex-wrap: wrap; gap: 6px; }
.weekday-picker > span { width: 100%; color: var(--pencil); font-size: 12px; }
.weekday-picker label { display: inline-flex; min-height: 44px; align-items: center; gap: 5px; border: 1px solid var(--hairline); border-radius: var(--radius-control); padding: 7px 8px; }
.weekday-picker input { width: 16px; min-height: 16px; margin: 0; }
.token-result { display: grid; gap: 10px; }
.token-result code { display: block; overflow-wrap: anywhere; border: 1px solid var(--hairline); border-radius: var(--radius-control); background: var(--capture-well); padding: 12px; color: var(--lamp); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }

.toast-region { position: fixed; z-index: 100; right: 20px; bottom: 20px; display: grid; width: min(360px, calc(100vw - 40px)); gap: 8px; }
.toast { border: 1px solid var(--hairline); border-radius: var(--radius-tray); background: var(--raised-tray); padding: 12px 14px; color: var(--paper); font-size: 13px; box-shadow: 0 12px 36px rgba(0, 0, 0, 0.28); animation: toast-in 180ms cubic-bezier(0.23, 1, 0.32, 1); }
.toast.is-error { border-color: rgba(212, 126, 117, 0.48); }

.auth-body { display: grid; min-height: 100vh; place-items: center; padding: 24px; }
.auth-shell { width: min(440px, 100%); }
.auth-panel { border-top: 1px solid var(--hairline); border-bottom: 1px solid var(--hairline); padding: 36px 0; }
.auth-panel h1 { margin: 4px 0 10px; font-size: 28px; line-height: 1.25; }
.auth-copy { color: var(--pencil); }
.auth-form { display: grid; gap: 16px; margin-top: 28px; }
.auth-form .button { width: 100%; margin-top: 4px; }
.form-error { border-left: 2px solid var(--missed); background: rgba(212, 126, 117, 0.08); padding: 10px 12px; color: var(--error-text); font-size: 13px; }
.brand-mark { display: flex; width: 100%; align-items: center; gap: 8px; margin-bottom: 28px; color: var(--smoke); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 10px; }
.brand-mark i { height: 1px; flex: 1; background: var(--hairline); }
.brand-mark i::after { display: block; width: 8px; height: 8px; margin: -4px auto 0; border-radius: 50%; background: var(--lamp); content: ""; }

.mobile-nav { display: none; }

@keyframes dialog-in { from { opacity: 0; transform: translateY(12px) scale(0.98); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

@media (max-width: 1100px) {
    .desk-grid { grid-template-columns: minmax(0, 1fr) 280px; gap: 28px; }
    .routine-board { grid-template-columns: 1fr 1fr; }
    .catalogue-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 839px) {
    :root { --edge-width: 0px; }
    body { padding-bottom: calc(72px + env(safe-area-inset-bottom)); }
    .edge-index { display: none; }
    .desk-canvas { margin-left: 0; padding: 20px 16px 96px; }
    .desk-header { align-items: flex-start; flex-direction: column; gap: 12px; margin-bottom: 16px; }
    .desk-header h1 { font-size: 23px; }
    .header-actions { width: 100%; }
    .header-actions .button { flex: 1; padding-inline: 12px; }
    .night-ribbon { min-height: 64px; grid-template-columns: minmax(86px, auto) minmax(150px, 1fr) 50px; gap: 10px; margin-bottom: 24px; padding: 8px 0; }
    .ribbon-copy strong { font-size: 11px; }
    .ribbon-now { font-size: 15px; }
    .ribbon-ticks small { display: none; }
    .desk-grid { display: block; }
    .side-tray { margin-top: 28px; }
    .ledger-row { min-height: 112px; grid-template-columns: 32px minmax(0, 1fr); gap: 10px; }
    .ledger-actions { grid-column: 2; justify-content: flex-start; }
    .ledger-title { font-size: 18px; }
    .capture-well { position: static; margin-top: 24px; padding: 12px; box-shadow: inset 0 0 0 1px var(--inset-line); }
    .capture-well textarea { min-height: 48px; max-height: 120px; }
    .capture-footer { margin-top: 6px; padding-top: 8px; }
    .capture-footer span { display: none; }
    .capture-footer .button { min-height: 44px; }
    .page-intro { align-items: flex-start; flex-direction: column; gap: 18px; margin-top: 0; }
    .page-intro h2 { font-size: 24px; }
    .page-intro p:not(.section-kicker) { font-size: 14px; }
    .page-intro > .button, .intro-actions { width: 100%; }
    .intro-actions .button { flex: 1; }
    .split-ledger, .work-groups, .routine-board { grid-template-columns: 1fr; gap: 32px; }
    .list-toolbar, .portfolio-toolbar { align-items: stretch; flex-direction: column; gap: 10px; }
    .search-control, .filter-control { width: 100%; min-width: 0; }
    .preset-status { align-items: flex-start; flex-direction: column; gap: 18px; }
    .preset-stats { width: 100%; justify-content: space-between; }
    .preset-stats span { text-align: left; }
    .catalogue-grid, .preset-list { grid-template-columns: 1fr; }
    .connection-strip { align-items: flex-start; flex-direction: column; }
    .mobile-nav { position: fixed; z-index: 40; inset: auto 0 0; display: grid; min-height: calc(62px + env(safe-area-inset-bottom)); grid-template-columns: repeat(5, 1fr); border-top: 1px solid var(--hairline); background: rgba(9, 13, 18, 0.96); padding: 6px 4px env(safe-area-inset-bottom); backdrop-filter: blur(14px); }
    .mobile-nav button { min-width: 0; min-height: 50px; border-radius: var(--radius-control); background: transparent; padding-inline: 2px; color: var(--smoke); font-size: 10px; }
    .mobile-nav button.is-active { background: var(--desk-felt); color: var(--lamp); }
    .sheet-dialog { width: 100%; max-width: none; max-height: 88vh; margin: auto 0 0; overflow-y: auto; border-right: 0; border-bottom: 0; border-left: 0; border-radius: var(--radius-dialog) var(--radius-dialog) 0 0; }
    .sheet-dialog[open] { animation-name: sheet-in; }
    .dialog-frame { padding: 18px 16px calc(20px + env(safe-area-inset-bottom)); }
    .dialog-frame footer { position: sticky; z-index: 2; bottom: 0; background: var(--raised-tray); padding-bottom: max(12px, env(safe-area-inset-bottom)); }
    .resolution-grid, .form-grid { grid-template-columns: 1fr; }
    .resolution-action { min-height: 72px; }
    .toast-region { right: 12px; bottom: calc(74px + env(safe-area-inset-bottom)); left: 12px; width: auto; }
}

@keyframes sheet-in { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: translateY(0); } }

@media (max-width: 390px) {
    .desk-canvas { padding-inline: 12px; }
    .desk-header h1 { font-size: 21px; }
    .header-actions .button { font-size: 12px; }
    .preset-stats { gap: 12px; }
    .task-preset-row { align-items: flex-start; grid-template-columns: 1fr; }
    .task-preset-row .small-action { width: 100%; }
    .night-ribbon { grid-template-columns: 78px minmax(132px, 1fr) 42px; }
    .ribbon-copy .section-kicker { letter-spacing: 0.04em; }
    .ledger-row { grid-template-columns: 28px minmax(0, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; }
}
