/* Shared surfaces and navigation */
:root {
  --ease-out: cubic-bezier(.2,.75,.2,1);
  --card-shadow: 0 1px 2px #3635220a, 0 5px 20px #36352205;
  --raised-shadow: 0 1px 0 #fff8 inset, 0 17px 32px -21px #4a402c66;
  --display-font: Outfit, Inter, system-ui, sans-serif;
  --edge-padding: clamp(20px,3vw,52px);
}
:root[data-mode="dark"] {
  --card-shadow: 0 1px 2px #10120d22, 0 5px 20px #10120d12;
  --raised-shadow: 0 1px 0 #ffffff12 inset, 0 17px 34px -21px #070905bd;
}
h1, h2, h3, .brand, .score-dial strong, .activity-info strong, .big-stat,
.metric-tiles strong, .detail-stats strong, .review-numbers strong, .count-dark, .priority-count {
  font-family: var(--display-font);
}
.page-title h1, .chapter-copy h2 { font-weight: 300; letter-spacing: -.025em; }
h2, h3, .dialog header h2, .review-content h2, .archive-card h2 { font-weight: 400; letter-spacing: -.01em; }
.score-dial strong, .activity-info p strong, .big-stat, .metric-tiles strong,
.review-numbers strong, .detail-stats strong { font-weight: 300; letter-spacing: -.02em; }
.top-nav :is(button,.nav-label) { font-weight: 500; letter-spacing: normal; }
.title-word { display: inline-block; max-width: 100%; overflow-wrap: anywhere; }
[data-roll] { font-variant-numeric: tabular-nums; }
[data-roll].counting { position: relative; display: inline-block; }
[data-roll].counting > :is(.count-reserve,.count-ink) {
  display: block; font: inherit; color: inherit; letter-spacing: inherit; line-height: inherit;
  text-align: inherit; margin: 0; padding: 0; white-space: nowrap;
}
.count-reserve { opacity: 0; }
.count-ink { position: absolute; inset: 0; pointer-events: none; user-select: none; }
.chapter-progress .day-left { font-weight: inherit; }
#main:focus { outline: none; }
.dash-grid > article, .collection-cards > article, .workspace-panel, .archive-card,
.review-summary, .saved-reviews { box-shadow: var(--card-shadow); }
.collection-cards { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 12px; }
.collection-cards > article { flex: 1 1 calc((100% - 24px)/3); }
.top-nav { position: relative; isolation: isolate; }
.top-nav > button { position: relative; z-index: 1; }
/* The clipped layer and the controls share label geometry at every breakpoint. */
.nav-glide {
  position: absolute; inset: 0; z-index: 2; display: flex; align-items: center; gap: inherit; padding: inherit;
  pointer-events: none; user-select: none; color: var(--surface); background: var(--ink); clip-path: inset(50% round 99px);
}
@property --nav-left { syntax: '<length>'; inherits: false; initial-value: 0px; }
@property --nav-right { syntax: '<length>'; inherits: false; initial-value: 0px; }
.nav-caption { display: inline-flex; position: relative; align-items: center; }
.nav-caption .icon { position: absolute; right: calc(100% + 3px); opacity: 0; transform: scale(.75); }
.top-nav .selected > .nav-caption { transform: translateX(8px); }
.top-nav .selected > .nav-caption .icon { opacity: 1; transform: scale(1); }
@media (prefers-reduced-motion: no-preference) {
  /* Advance the leading edge first, then draw the trailing edge in behind it. */
  .nav-glide[data-travel] {
    --lead: 350ms cubic-bezier(.18,.82,.22,1);
    --trail: 425ms cubic-bezier(.38,0,.18,1) 55ms;
  }
  .nav-glide[data-travel="right"] { transition: --nav-right var(--lead), --nav-left var(--trail); }
  .nav-glide[data-travel="left"] { transition: --nav-left var(--lead), --nav-right var(--trail); }
  .nav-caption { transition: transform 310ms cubic-bezier(.22,.76,.22,1); }
  .nav-caption .icon { transition: opacity 170ms ease, transform 260ms ease; }
}
.top-nav > button:not(:disabled):active { transform: none; }
.top-actions .settings-short.selected { background: var(--ink); color: var(--surface); }
.top-actions .avatar.selected { box-shadow: 0 0 0 2px var(--frame), 0 0 0 4px var(--gold); }
@media (forced-colors: active) {
  .nav-glide { display: none; }
  .top-nav button.selected, .top-actions .selected { outline: 2px solid Highlight; outline-offset: -3px; }
}
.settings-short { width: auto; gap: 6px; padding-inline: 13px; border-radius: 99px; font-size: .83rem; }
:is(.dash-grid > article, .collection-cards > article, .archive-card, .metric-tiles > div, .workspace-panel, .comparison-panel, .review-layout > section) {
  transition: translate .27s var(--ease-out), box-shadow .27s var(--ease-out);
}
.chapter-photo { transition: transform .34s var(--ease-out); }
.calendar-art { transition: rotate .3s var(--ease-out); }
.priority-tools { display: flex; align-items: center; gap: 7px; }
.priority-count, .count-dark { display: inline-flex; align-items: baseline; gap: .22em; font-size: 1rem; line-height: 1.15; font-variant-numeric: tabular-nums; }
.priority-count { padding: 4px 9px; color: var(--muted); background: var(--subtle); border-radius: 99px; }
.priority-count em, .count-dark em { font: inherit; }
.priority-count b, .count-dark b { font-weight: 450; }
.habit-row, .priority-row { position: relative; isolation: isolate; }
.habit-row::before, .priority-row::before {
  content: ""; position: absolute; z-index: -1; inset: 3px -6px; border-radius: 10px;
  pointer-events: none; opacity: 0; background: var(--subtle); transition: opacity .18s;
}
.habit-row::before { background: #ffffff0e; }
.habit-row:has(:focus-visible)::before, .priority-row:has(:focus-visible)::before { opacity: 1; }
.workspace-row:not(.headers) { padding-inline: 9px; border-radius: 12px; }
.workspace-row, .drawer-link, .notice-row, .theme-tile, .widget-option {
  transition: background-color .18s, border-color .18s, box-shadow .18s;
}
.list-check:not(.on) .icon { opacity: .43; }
.task-box.checked { background: var(--yellow); border-color: var(--yellow); color: var(--on-yellow); }
.habit-row:has(.is-checked) .habit-name strong { color: var(--dark-muted); text-decoration: line-through; }
.chart-readout {
  bottom: auto; transform: none; max-width: calc(100% - 16px); white-space: normal;
  color: var(--on-yellow); background: var(--yellow); box-shadow: 0 3px 12px #25261c24;
  transition: left .15s var(--ease-out), top .15s var(--ease-out);
}
.chart-readout:not(:empty) { animation: hint-in .15s var(--ease-out); }
.chart-zone { fill: transparent; pointer-events: all; }
.chart-hotspot { outline: none; }
.chart-hotspot:focus-visible { outline: none; }
.chart-halo, .chart-guide { opacity: 0; pointer-events: none; transition: opacity .15s; }
.chart-halo { fill: var(--yellow); stroke: var(--ink); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.chart-guide { stroke: var(--muted); stroke-dasharray: 2 4; vector-effect: non-scaling-stroke; }
.chart-hotspot.active .chart-halo { opacity: 1; }
.chart-hotspot.active .chart-guide { opacity: .52; }
.chart-dates { pointer-events: none; }
@keyframes hint-in { from { opacity: 0; translate: 0 3px; } to { opacity: 1; translate: 0 0; } }
.date-choices { border: 1px solid var(--line); }
.date-choice[aria-pressed="true"] { box-shadow: 0 1px 4px #26271e18; }
.score-dial strong, .activity-info strong, .habit-count, .bell-count { font-variant-numeric: tabular-nums; }

/* Dialogs and the full-height workspace drawer */
.overlay { background: rgb(30 32 27 / 32%); }
.overlay.leaving { pointer-events: none; }
.dialog { box-shadow: 0 22px 70px #14160e35, 0 2px 10px #14160e12; }
.dialog > header { flex-shrink: 0; }
.dialog > header .icon-button { width: 36px; height: 36px; }
.dialog.drawer > header {
  background: linear-gradient(112deg,var(--surface) 34%,color-mix(in srgb,var(--accent-pale) 52%,var(--surface)));
  align-items: center;
}
.drawer .dialog-content { padding: 4px 16px 20px; }
.drawer-section { padding-block: 9px; }
.drawer-section + .drawer-section { border-top: 1px solid var(--line); }
.drawer-group { margin: 6px 10px 5px; }
.drawer-link { min-height: 42px; border-radius: 12px; }
.drawer-link.active, .drawer-link[aria-current="page"]:hover { background: var(--accent-pale); }
.drawer-link.active > .icon:last-child { color: var(--ink); }

/* Current chapter reminders */
.bell-toggle { position: relative; }
.bell-count {
  position: absolute; right: -3px; top: -3px; min-width: 17px; height: 17px; padding-inline: 3px;
  display: grid; place-items: center; border-radius: 99px; background: var(--yellow); color: var(--on-yellow);
  font-size: .64rem; line-height: 1; font-weight: 660; box-shadow: 0 0 0 2px var(--frame);
  animation: badge-in .22s var(--ease-out);
}
.bell-count[hidden] { display: none; }
.bell-toggle[aria-expanded="true"] > .icon { animation: ring-bell .4s var(--ease-out); transform-origin: 50% 10%; }
@keyframes badge-in { from { transform: scale(.55); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes ring-bell { 24% { rotate: 12deg; } 56% { rotate: -8deg; } 78% { rotate: 4deg; } }
.notice-overlay {
  justify-content: flex-end; align-items: flex-start; backdrop-filter: none;
  padding: 80px max(var(--edge-padding),calc((100vw - 1740px)/2 + var(--edge-padding))) 16px;
  background: rgb(24 26 22 / 7%);
}
.dialog[data-screen="notifications"] {
  width: min(100%,370px); max-height: min(calc(100dvh - 96px),605px); border-radius: 23px;
  background: #292c27; color: #fffcf3; border: 1px solid #55584a; transform-origin: 90% 0;
}
.dialog[data-screen="notifications"] > header { padding: 19px 19px 14px; border-color: #474a40; align-items: center; }
.dialog[data-screen="notifications"] .eyebrow { color: #e7d278; }
.dialog[data-screen="notifications"] h2 { font-size: 1.42rem; }
.dialog[data-screen="notifications"] header .icon-button { background: #42453d; color: #fffced; }
.dialog[data-screen="notifications"] .dialog-content { padding: 6px 13px 13px; }
.notice-group { margin: 5px 0; }
.notice-group + .notice-group { border-top: 1px solid #44473d; padding-top: 5px; }
.notice-group h3 { display: flex; align-items: center; gap: 7px; margin: 9px 7px 3px; font-size: .75rem; font-weight: 550; color: #d5d7c8; letter-spacing: .015em; }
.notice-group h3 span { background: #45483d; color: #eeeccd; border-radius: 10px; padding: 2px 6px; font-size: .66rem; }
.notice-row { display: flex; align-items: center; gap: 5px; border-radius: 13px; padding: 2px 3px; }
.notice-link { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; min-height: 47px; padding: 4px; text-align: left; }
.notice-link > span:last-child { min-width: 0; }
.notice-link strong, .notice-link small { display: block; overflow-wrap: anywhere; }
.notice-link strong { font-size: .91rem; font-weight: 520; line-height: 1.32; }
.notice-link small { margin-top: 2px; font-size: .75rem; color: #c6c9ba; }
.notice-kind, .notice-check, .notice-empty > span { display: inline-grid; place-items: center; border-radius: 50%; flex-shrink: 0; }
.notice-kind { width: 33px; height: 33px; background: #41453b; color: #f8f6e4; }
.notice-check { width: 35px; height: 35px; border: 1px solid #6c7162; color: #e5e6d8; }
.notice-empty { padding: 24px 10px; text-align: center; }
.notice-empty > span { width: 50px; height: 50px; background: #484a38; color: var(--yellow); }
.notice-empty h3 { margin: 12px 0 5px; }
.notice-empty p { color: #c6c9ba; font-size: .82rem; line-height: 1.5; }

/* Settings and profile */
.theme-picker { min-width: 0; margin: 19px 0 0; padding: 0; border: 0; }
.theme-picker legend { margin-bottom: 7px; }
.theme-choices, .settings-widgets { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
.theme-choice, .widget-option { position: relative; cursor: pointer; }
.theme-choice input, .widget-option input {
  position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}
.theme-tile { display: block; padding: 6px; border: 1px solid var(--line); border-radius: 15px; }
.theme-sample {
  height: 68px; display: grid; grid-template-columns: 1.3fr .7fr; grid-template-rows: 1fr 1fr; gap: 3px;
  position: relative; overflow: hidden; padding: 22px 9px 7px; border-radius: 10px;
}
.theme-sample::before { content: ""; position: absolute; top: 8px; right: 9px; width: 42%; height: 6px; border-radius: 99px; }
.theme-sample i { border-radius: 5px; }
.theme-sample i:first-child { grid-row: span 2; }
.theme-sample.light { background: linear-gradient(115deg,#dcdfdc,#fff0ae); }
.theme-sample.light::before, .theme-sample.light i { background: #fffdf3; }
.theme-sample.light i:first-child { background: linear-gradient(140deg,#f4cd69,#a97930); }
.theme-sample.light i:last-child { background: #36382f; }
.theme-sample.dark { background: linear-gradient(115deg,#292e29,#4c4831); }
.theme-sample.dark::before, .theme-sample.dark i { background: #6b6c54; }
.theme-sample.dark i:first-child { background: linear-gradient(140deg,#968448,#4c4934); }
.theme-sample.dark i:last-child { background: #242821; }
.theme-caption { display: flex; align-items: center; gap: 6px; padding: 7px 4px 2px; font-size: .82rem; }
.theme-check { display: grid; place-items: center; width: 16px; height: 16px; margin-left: auto; border-radius: 50%; opacity: 0; }
.theme-choice input:checked + .theme-tile { border-color: var(--gold); box-shadow: inset 0 0 0 1px var(--gold); }
.theme-choice input:checked + .theme-tile .theme-check { opacity: 1; background: var(--yellow); color: var(--on-yellow); }
.theme-choice input:focus-visible + .theme-tile, .widget-option input:focus-visible + .setting-switch { outline: 2px solid var(--focus); outline-offset: 2px; }
.settings-widgets { margin-top: 12px; }
.widget-option { display: flex; align-items: center; gap: 8px; padding: 10px; border: 1px solid var(--line); border-radius: 13px; font-size: .82rem; }
.setting-icon { display: inline-grid; place-items: center; flex-shrink: 0; border-radius: 50%; background: var(--subtle); }
.setting-icon { width: 28px; height: 28px; }
.setting-switch { flex-shrink: 0; position: relative; margin-left: auto; width: 32px; height: 19px; border-radius: 99px; background: var(--track); transition: background .2s; }
.setting-switch::after { content: ""; display: block; position: absolute; width: 13px; height: 13px; inset: 3px auto auto 3px; border-radius: 50%; background: var(--soft); transition: transform .2s var(--ease-out); }
.widget-option input:checked + .setting-switch { background: var(--yellow); }
.widget-option input:checked + .setting-switch::after { transform: translateX(13px); background: var(--on-yellow); }

.account-page { max-width: 1220px; margin-inline: auto; }
.account-layout {
  display: grid; grid-template-columns: minmax(215px,.8fr) minmax(0,2.1fr); gap: 16px;
  align-items: start; padding-bottom: 14px;
}
.settings-layout { grid-template-areas: "tabs content" "identity content"; grid-template-rows: auto 1fr; }
.profile-layout { grid-template-areas: "identity content" "identity chapter"; }
.account-tabs, .account-content, .identity-card, .profile-chapter { box-shadow: var(--card-shadow); }
.account-tabs { grid-area: tabs; display: grid; gap: 4px; background: var(--panel); padding: 8px; border-radius: 22px; }
.account-tabs button {
  display: flex; align-items: center; gap: 12px; min-height: 47px; padding: 10px 15px;
  border-radius: 15px; text-align: start; font-size: .93rem; color: var(--muted);
}
.account-tabs button[aria-selected="true"] { background: var(--accent-pale); color: var(--ink); font-weight: 550; }
.account-tabs button:hover:not([aria-selected="true"]) { background: var(--subtle); }
.account-content { grid-area: content; padding: clamp(20px,2.6vw,38px); }
.account-content h2 { font-size: clamp(1.5rem,2.1vw,2.1rem); }
.account-intro, .backup-options p { color: var(--muted); font-size: .91rem; line-height: 1.55; margin: 7px 0 17px; }
.account-content [role="tabpanel"]:focus-visible { outline: 2px solid var(--focus); outline-offset: 6px; border-radius: 6px; }
.account-content .theme-picker { margin-top: 22px; }
.account-content .theme-picker legend { margin-bottom: 9px; }
.account-content .theme-choices { gap: 12px; }
.account-content .theme-tile { padding: 8px; border-radius: 18px; background: var(--control); }
.account-content .theme-sample { height: clamp(82px,8vw,115px); padding: 28px 12px 10px; gap: 5px; border-radius: 11px; }
.account-content .theme-sample::before { top: 11px; right: 12px; height: 8px; }
.account-content .theme-caption { min-height: 34px; font-size: .9rem; }
.account-content .theme-check { width: 19px; height: 19px; }
.currency-setting, .switch-space { border-top: 1px solid var(--line); padding-top: 19px; margin-top: 22px; }
.currency-setting .field { max-width: 340px; }
.currency-setting p, .profile-name p, .switch-space p { margin-top: 7px; }
.account-content .field input, .account-content .field select { width: 100%; min-height: 44px; }
.account-content .widget-option { min-height: 52px; padding: 10px 12px; font-size: .9rem; }
.account-content .interface-sound { margin-top: 17px; gap: 12px; padding: 13px 15px; background: var(--subtle); }
.interface-sound .setting-icon { background: var(--control); width: 34px; height: 34px; }
.interface-sound strong, .interface-sound small { display: block; }
.interface-sound strong { font-weight: 550; }
.interface-sound small { margin-top: 2px; color: var(--muted); font-size: .8rem; line-height: 1.4; }
.backup-options { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.backup-options > div { display: flex; flex-direction: column; align-items: start; padding: 16px; border-radius: 17px; background: var(--subtle); }
.backup-options .setting-icon { background: var(--control); width: 34px; height: 34px; margin-bottom: 12px; }
.backup-options p { font-size: .84rem; margin: 5px 0 16px; }
.backup-options .btn { margin-top: auto; }
.switch-space { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.account-save { display: flex; gap: 8px; align-items: center; justify-content: flex-end; flex-wrap: wrap; padding-top: 18px; margin-top: 22px; border-top: 1px solid var(--line); }
.account-save [data-draft-status] { margin-inline-end: auto; color: var(--muted); font-size: .8rem; }
.account-save .btn:disabled { opacity: .52; }
.account-save .btn:disabled:hover { background: var(--control); }
.account-save .btn, .switch-space .btn, .backup-options .btn { min-height: 42px; }
.identity-card {
  grid-area: identity; position: relative; isolation: isolate; overflow: hidden; display: flex; align-items: start;
  flex-direction: column; min-width: 0; padding: clamp(21px,2.2vw,32px); border-radius: 25px; background: #282a24; color: #fffdf3;
}
.identity-card::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(ellipse at 104% -4%,#8e792c60,transparent 61%),
    repeating-radial-gradient(circle at 104% -16%,transparent 0 25px,#e8ca6528 26px,transparent 27px 41px);
  mask-image: linear-gradient(150deg,#000 28%,transparent 90%);
}
.identity-monogram { display: grid; place-items: center; height: 51px; min-width: 51px; border-radius: 50%; background: var(--yellow); color: var(--on-yellow); font: 450 1.32rem/1 var(--display-font); }
.identity-card strong { margin-top: 18px; max-width: 100%; overflow-wrap: anywhere; font: 400 clamp(1.55rem,2.25vw,2.1rem)/1.12 var(--display-font); }
.identity-workspace { margin-top: 6px; font-size: .83rem; color: #d1d1c3; }
.identity-card .btn { background: #3b3e34; border-color: #555849; color: #fbf9ec; margin-top: 20px; }
.identity-card .btn:not(.filled):not(.yellow):not(.review-button):hover { background: #4c5043; }
.profile-name { margin-top: 20px; max-width: 480px; }
.profile-chapter { grid-area: chapter; display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
.profile-chapter > div { flex: 1; min-width: min(100%,145px); }
.profile-chapter h2 { overflow-wrap: anywhere; margin: 3px 0; }
.chapter-stamp { width: 47px; height: 47px; display: grid; place-items: center; background: var(--accent-pale); border-radius: 15px; }
@media (max-width: 740px) {
  .account-layout { grid-template-columns: minmax(0,1fr); gap: 12px; }
  .settings-layout { grid-template-areas: "tabs" "content" "identity"; }
  .profile-layout { grid-template-areas: "identity" "content" "chapter"; }
  .account-tabs { display: flex; padding: 4px; gap: 2px; border-radius: 18px; }
  .account-tabs button { flex: 1; min-width: 0; min-height: 44px; justify-content: center; gap: 6px; padding: 7px 5px; text-align: center; font-size: .8rem; border-radius: 14px; }
  .identity-card { display: grid; grid-template-columns: auto minmax(0,1fr) auto; column-gap: 12px; align-items: center; padding: 17px; border-radius: 21px; }
  .identity-monogram { grid-column: 1; grid-row: 1/3; }
  .identity-card strong { grid-column: 2; align-self: end; margin: 0; font-size: 1.4rem; }
  .identity-workspace { grid-column: 2; align-self: start; margin: 2px 0 0; font-size: .75rem; }
  .identity-card .btn { grid-column: 3; grid-row: 1/3; margin: 0; font-size: .8rem; }
}
@media (max-width: 460px) {
  .account-content .theme-choices { gap: 7px; }
  .account-content .theme-sample { padding: 22px 7px 7px; gap: 3px; }
  .account-content .theme-tile { padding: 5px; }
  .backup-options { grid-template-columns: 1fr; }
  .identity-card { grid-template-columns: auto minmax(0,1fr); }
  .identity-card .btn { grid-column: 1/-1; grid-row: auto; margin-top: 12px; }
  .account-save [data-draft-status]:not(:empty) { flex-basis: 100%; }
}
@media (max-width: 365px) {
  .account-tabs button .icon { display: none; }
}
/* Feedback and input */
.toast { display: inline-flex; align-items: center; gap: 7px; border-radius: 99px; animation: toast-in .21s var(--ease-out); }
.toast .icon { color: var(--gold); }
.toast.leaving { animation: toast-out .18s ease-in forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateY(5px); } }
.check-burst { position: fixed; inset: 0; overflow: hidden; contain: strict; pointer-events: none; z-index: 45; }
.check-burst i {
  position: absolute; left: calc(var(--origin-x) - var(--size)/2); top: calc(var(--origin-y) - var(--size)/2);
  width: var(--size); height: var(--size); border-radius: 50%; background: var(--color);
  box-shadow: 0 0 0 .55px #95702540;
  animation: bead-out var(--duration) var(--delay) linear both;
}
@keyframes bead-out {
  0% { opacity: 0; transform: translate3d(0,0,0) scale(.28); animation-timing-function: cubic-bezier(.17,.55,.38,1); }
  15% { opacity: 1; transform: translate3d(calc(var(--dx)*.48),calc(var(--dy)*.48),0) scale(1.05); animation-timing-function: cubic-bezier(.19,.63,.37,1); }
  48% { opacity: 1; transform: translate3d(calc(var(--dx)*.9),calc(var(--dy)*.9),0) scale(1); }
  62% { opacity: .94; transform: translate3d(calc(var(--dx)*.95),calc(var(--dy)*.95 + var(--fall)*.18),0) scale(.96); animation-timing-function: ease-in-out; }
  100% { opacity: 0; transform: translate3d(var(--dx),calc(var(--dy) + var(--fall)),0) scale(.22); }
}
button:not(:disabled):active { transform: scale(.97); }
@media (hover: hover) and (pointer: fine) {
  :is(.dash-grid > article, .collection-cards > article, .archive-card, .metric-tiles > div, .workspace-panel, .comparison-panel, .review-layout > section):hover {
    translate: 0 -3px; box-shadow: var(--raised-shadow), var(--card-shadow);
  }
  .chapter-card:hover .chapter-photo { transform: translate3d(var(--photo-x,0px),var(--photo-y,0px),0) scale(1.08); }
  .review-card:hover .calendar-art { rotate: -3deg; }
  .habit-row:hover::before, .priority-row:hover::before { opacity: 1; }
  .workspace-row:not(.headers):hover { background: color-mix(in srgb,var(--accent-pale) 42%,transparent); }
  .widget-option:hover { background: var(--subtle); }
  .theme-choice:hover .theme-tile { border-color: var(--gold); }
  .notice-row:hover { background: #33372f; }
  .notice-check:hover { color: #28291f; background: var(--yellow); border-color: var(--yellow); }
  .habit-toggle:not(.is-checked):hover { background: #ffffff18; border-color: var(--yellow); }
  .task-box:not(.checked):hover, .list-check:not(.on):hover { border-color: var(--gold); background: var(--accent-pale); }
}
@media (hover: none) and (pointer: coarse) {
  .drawer-link:active, .account-tabs button:active { background: var(--accent-pale); }
  .habit-row:has(button:active)::before, .priority-row:has(button:active)::before { opacity: 1; }
}

@media (max-width: 1100px) {
  .topbar { grid-template-columns: auto 1fr auto; }
  .top-nav { justify-self: center; }
  .settings-short { width: 40px; padding: 0; }
  .settings-short span { display: none; }
}
@media (max-width: 1050px) {
  :root { --edge-padding: 20px; }
  .notice-overlay { padding-top: 68px; }
  .collection-cards { gap: 9px; margin-top: 9px; }
  .collection-cards > article { flex-basis: calc((100% - 18px)/3); }
}
@media (max-width: 835px) {
  .topbar { grid-template-columns: 1fr auto; }
  .collection-cards { gap: 10px; margin-top: 10px; }
  .collection-cards > article { flex-basis: calc((100% - 10px)/2); }
}
@media (max-width: 590px) {
  .inner { padding-inline: max(14px,env(safe-area-inset-left)) max(14px,env(safe-area-inset-right)); }
  .topbar { padding-block: max(13px,env(safe-area-inset-top)) 13px; gap: 5px; }
  .top-actions { gap: 5px; }
  .top-actions .icon-button, .top-actions .avatar { width: 41px; height: 41px; }
  .top-actions .settings-short { display: none; }
  .collection-cards > article { flex-basis: 100%; }
  .workspace-row:not(.headers) { padding-inline: 3px; }
  .dialog.drawer { width: 100%; height: 100%; max-width: none; max-height: 100%; box-shadow: none; }
  .dialog.drawer > header { padding: max(17px,env(safe-area-inset-top)) max(16px,env(safe-area-inset-right)) 13px max(16px,env(safe-area-inset-left)); }
  .drawer .dialog-content { padding: 3px max(14px,env(safe-area-inset-right)) max(20px,env(safe-area-inset-bottom)) max(14px,env(safe-area-inset-left)); }
  .drawer-link { min-height: 44px; }
  .dialog > header .icon-button { width: 40px; height: 40px; }
  .notice-overlay { padding: max(68px,calc(env(safe-area-inset-top) + 53px)) max(10px,env(safe-area-inset-right)) max(10px,env(safe-area-inset-bottom)) max(10px,env(safe-area-inset-left)); }
  .dialog[data-screen="notifications"] { width: min(100%,370px); max-height: min(70dvh,calc(100dvh - 82px)); border-radius: 20px; }
  .notice-check { width: 42px; height: 42px; }
  .settings-widgets { grid-template-columns: 1fr; }
  #toasts { bottom: max(21px,env(safe-area-inset-bottom)); }
}
@media (max-width: 365px) {
  .inner { padding-inline: max(10px,env(safe-area-inset-left)) max(10px,env(safe-area-inset-right)); }
  .top-actions { gap: 3px; }
}
@media (prefers-reduced-motion: reduce) {
  .check-burst { display: none; }
  :is(.dash-grid > article, .collection-cards > article, .archive-card, .metric-tiles > div, .workspace-panel, .comparison-panel, .review-layout > section):hover { translate: none; }
  .chapter-card:hover .chapter-photo, button:not(:disabled):active { transform: none; }
  .review-card:hover .calendar-art { rotate: none; }
}
