/* ROUTE: blue glass on a near-black backdrop. Animations use transform and opacity only.
   Glass surfaces (.panel, .w, the menu buttons) blur what is behind them, so none of their
   ancestors may carry opacity, filter or mask: that would cut the blur off. */

@font-face { font-family: 'Outfit'; src: url('/fonts/outfit.woff2') format('woff2'); font-weight: 100 900; font-display: swap; }
@font-face { font-family: 'Orbitron'; src: url('/fonts/orbitron.woff2') format('woff2'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Figtree'; src: url('/fonts/figtree.woff2') format('woff2'); font-weight: 300 900; font-display: swap; }
/* Arabic letters only; Latin text and digits stay in the fonts above. */
@font-face { font-family: 'Readex Pro'; src: url('/fonts/readex-arabic.woff2') format('woff2'); font-weight: 160 700; font-display: swap; unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }

:root {
  --font-d: 'Outfit', 'Readex Pro', ui-sans-serif, system-ui, sans-serif;
  --font-b: 'Figtree', 'Readex Pro', ui-sans-serif, system-ui, sans-serif;
  --font-n: 'Orbitron', 'Outfit', ui-sans-serif, system-ui, sans-serif; /* calendar numbers */
  --ease: cubic-bezier(.22, 1, .36, 1);
  --spring: cubic-bezier(.34, 1.56, .64, 1);
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px;
  --r-sm: 10px; --r-md: 14px; --r-lg: 22px; --r-xl: 30px;
  --danger: #FF5D6C;
  --ok: #5BE49B;
}

[data-theme='dark'] {
  color-scheme: dark;
  --bg-a: #01030A; --bg-b: #051129;
  --panel: rgba(150, 180, 240, .05);
  --sheen: linear-gradient(140deg, rgba(255, 255, 255, .085), rgba(255, 255, 255, .02) 34%, rgba(255, 255, 255, 0) 60%, rgba(96, 150, 255, .055));
  --rim: linear-gradient(150deg, rgba(255, 255, 255, .46), rgba(255, 255, 255, .07) 30%, rgba(255, 255, 255, .03) 66%, rgba(120, 175, 255, .34));
  --blur: blur(26px) saturate(165%);
  --cell: rgba(255, 255, 255, .05);
  --cell-h: rgba(255, 255, 255, .11);
  --card: rgba(255, 255, 255, .045);
  --field: rgba(0, 4, 14, .40);
  --sheet: rgba(9, 15, 30, .80);
  --pill: rgba(0, 3, 12, .46);
  --txt: #F5F8FD; --txt-2: #A9B7CF; --txt-3: #7888A5;
  --line: rgba(255, 255, 255, .09); --line-2: rgba(255, 255, 255, .18);
  --edge: rgba(255, 255, 255, .09); --edge-2: rgba(255, 255, 255, .18); --well: none;
  --hi: rgba(255, 255, 255, .16);
  --accent: #2D8CFF; --accent-2: #5FB0FF; --link: #5FB0FF;
  --shadow: 0, 0, 0; --glow: 45, 140, 255;
  --on-accent: #06101F;
  --loop-ink: linear-gradient(90deg, #B4DAFF, #3D96FF);
  --mark: url('/brand/mark.png');
}

/* Light theme: clear glass over a soft sea of blue. A pane is almost the colour
   of what is behind it; its bright rim, the glow just inside the rim and the
   shadow under it are what make it read as glass. Nothing here is white, so the
   text is dark and the accents are a shade deeper than in the dark theme. */
[data-theme='light'] {
  color-scheme: light;
  --bg-a: #A9C7F2; --bg-b: #7BA4E8;
  --panel: rgba(255, 255, 255, .07);
  --sheen: linear-gradient(140deg, rgba(255, 255, 255, .34), rgba(255, 255, 255, .05) 30%, rgba(255, 255, 255, 0) 58%, rgba(255, 255, 255, .14));
  --rim: linear-gradient(150deg, #fff, rgba(255, 255, 255, .45) 28%, rgba(255, 255, 255, .16) 62%, rgba(255, 255, 255, .92));
  --blur: blur(14px) saturate(150%);
  --cell: rgba(255, 255, 255, .07);
  --cell-h: rgba(255, 255, 255, .30);
  --card: rgba(255, 255, 255, .12);
  --field: rgba(255, 255, 255, .12);
  --sheet: rgba(208, 226, 250, .56);
  --pill: rgba(255, 255, 255, .10);
  --txt: #07142B; --txt-2: #1E3054; --txt-3: #2F4066;
  --line: rgba(8, 36, 96, .13); --line-2: rgba(8, 36, 96, .26);
  --edge: rgba(255, 255, 255, .52); --edge-2: rgba(255, 255, 255, .72);
  --well: inset 0 1px 3px rgba(14, 44, 110, .24), inset 0 -1px 0 rgba(255, 255, 255, .45);
  --hi: rgba(255, 255, 255, .85);
  --accent: #1668E3; --accent-2: #1F7AF0; --link: #0A46B4;
  --shadow: 14, 44, 110; --glow: 40, 130, 250;
  --on-accent: #FFFFFF;
  --loop-ink: linear-gradient(90deg, #0E58D6, #06308C);
  --mark: url('/brand/mark-light.png');
  --ok: #14995A; --danger: #C9213E;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
/* The colour behind everything is the bottom of the backdrop, so an edge the
   layers do not reach never shows as a black strip. */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; background: var(--bg-b); }
/* The frame of the app stays put (no pull-down, no sideways drag). What is inside
   it scrolls, with the phone's usual soft bounce at the ends. */
html.app, html.app body { overscroll-behavior: none; }
/* Phones and tablets: no pinch or double-tap zoom, and fields keep their text at
   16px so focusing one never zooms the page (iOS does that below 16px). */
@media (pointer: coarse) {
  html.app { touch-action: pan-x pan-y; }
  html.app :is(input, select, textarea) { font-size: 16px !important; }
}
/* On a touch screen every page can be dragged, even one that fits: it gives a
   little and springs back, which is how a phone says "this is the end". */
@media (pointer: coarse) and (max-width: 1099px) {
  .stage { -webkit-overflow-scrolling: touch; overscroll-behavior-y: contain; }
  .slot:not([hidden]) { min-height: calc(100% + 1px); }
}
body {
  margin: 0; overflow: hidden;
  font-family: var(--font-b); font-size: 15px; line-height: 1.5; color: var(--txt);
  background: var(--bg-a);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  -webkit-tap-highlight-color: transparent;
}
h1, h2, h3, h4, p, ul { margin: 0; }
ul { padding: 0; list-style: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
.hide { display: none !important; }
:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }
::selection { background: rgba(var(--glow), .4); }

/* ---- backdrop ------------------------------------------------------------ */

.backdrop {
  position: fixed; inset: 0; z-index: -2;
  background:
    radial-gradient(90% 70% at 92% 110%, rgba(var(--glow), .30), transparent 62%),
    radial-gradient(60% 50% at 4% 112%, rgba(30, 90, 200, .22), transparent 64%),
    radial-gradient(50% 40% at 80% -10%, rgba(40, 110, 230, .12), transparent 70%),
    linear-gradient(165deg, var(--bg-a) 42%, var(--bg-b));
}
#bg { position: fixed; inset: 0; width: 100%; height: 100%; z-index: -1; display: block; pointer-events: none; }
/* The glyph field floats over the glass, faint enough to read through, so the
   trail behind the pointer shows on the panels as well as between them. */
#wake { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 58; display: block; pointer-events: none; opacity: .7; }
.grain {
  position: fixed; inset: 0; z-index: 60; pointer-events: none; opacity: .05; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---- shell --------------------------------------------------------------- */

/* The app fills the whole window, edge to edge. */
.shell { position: fixed; inset: 0; display: grid; grid-template-columns: 84px minmax(0, 1fr); }

.panel, .w, .wheel-hub, .wheel-item, .tdock-tab {
  background: var(--sheen), var(--panel);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
}
/* The bright-to-blue edge that makes a surface read as glass. */
.panel::before, .w::before {
  content: ''; position: absolute; inset: 0; padding: 1px; border-radius: inherit; pointer-events: none;
  background: var(--rim);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
}

.topbar { display: none; }

/* The left gutter holds the logo and the menu button, nothing else. */
.rail {
  position: relative; z-index: 70; display: flex; flex-direction: column; align-items: center; min-height: 0;
  padding: 20px 0 18px env(safe-area-inset-left);
}
.brand { display: grid; justify-items: center; padding: 0; flex: none; background: none; border: 0; border-radius: 14px; transition: transform .35s var(--spring); }
.brand:hover { transform: translateY(-2px) scale(1.05); }
.brand:active { transform: scale(.94); }
/* The logo is drawn as a background so each theme can bring its own: --mark. */
.brand-mark { display: block; width: 46px; height: 46px; flex: none; background: var(--mark) center / contain no-repeat; filter: drop-shadow(0 6px 14px rgba(var(--glow), .5)); }
.brand-word {
  display: block; width: 56px; aspect-ratio: 615 / 62; background: var(--txt);
  -webkit-mask: url('/brand/wordmark.png') center / contain no-repeat; mask: url('/brand/wordmark.png') center / contain no-repeat;
}
.ic { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ---- circular menu ---------------------------------------------------------
   One round button. Hovering it (or tapping it on a phone) rolls the pages out
   around it on a circle; picking one rolls them back in.
   --base is the direction the arc opens in (0deg = to the right), --o is each
   item's place on the arc, counted from the middle. */
.wheel { position: relative; width: 60px; height: 60px; margin-block: auto; flex: none; --base: 0deg; --step: 32deg; --r: 150px; --r2: 82px; --ustep: 36deg; }
.wheel-hub {
  position: relative; z-index: 2; width: 100%; height: 100%; display: grid; place-items: center; border-radius: 50%; padding: 0;
  border: 1px solid var(--edge-2); color: var(--txt);
  box-shadow: inset 0 1px 0 var(--hi), 0 14px 30px -12px rgba(var(--shadow), .9), 0 0 0 0 rgba(var(--glow), .5);
  transition: transform .4s var(--spring), opacity .2s;
}
.wheel-hub .ic { width: 23px; height: 23px; transition: transform .55s var(--spring); }
.wheel-hub:hover { transform: scale(1.06); }
.wheel-hub:active { transform: scale(.92); }
.wheel-hub::after {
  content: ''; position: absolute; inset: -7px; border-radius: 50%; border: 1px solid rgba(var(--glow), .55); pointer-events: none;
  opacity: 0; transform: scale(.8); transition: transform .5s var(--spring), opacity .3s;
}
.wheel[data-open='true'] .wheel-hub { background: var(--accent); border-color: transparent; color: #fff; box-shadow: 0 10px 28px -6px rgba(var(--glow), .85), inset 0 1px 0 rgba(255, 255, 255, .35); }
.wheel[data-open='true'] .wheel-hub .ic { transform: rotate(135deg); }
.wheel[data-open='true'] .wheel-hub::after { opacity: 1; transform: none; }
.wheel-hub .sync-dot { position: absolute; top: 3px; inset-inline-end: 3px; width: 10px; height: 10px; box-shadow: 0 0 0 2px var(--bg-a); }

.wheel-ring {
  position: absolute; left: 50%; top: 50%; width: calc(var(--r) * 2); height: calc(var(--r) * 2); margin: calc(var(--r) * -1) 0 0 calc(var(--r) * -1);
  border-radius: 50%; border: 1px dashed rgba(var(--glow), .45); pointer-events: none;
  background: radial-gradient(closest-side, transparent 52%, rgba(var(--glow), .12) 82%, transparent);
  opacity: 0; transform: scale(.25) rotate(-120deg); transition: transform .7s var(--ease), opacity .3s;
}
.wheel[data-open='true'] .wheel-ring { opacity: 1; transform: none; }

.wheel-items { position: absolute; left: 50%; top: 50%; width: 0; height: 0; }
.wheel-item {
  --a: calc(var(--base) + var(--o) * var(--step)); --rr: var(--r);
  position: absolute; left: -27px; top: -27px; width: 54px; height: 54px; display: grid; place-items: center; padding: 0; border-radius: 50%;
  border: 1px solid var(--edge-2); color: var(--txt);
  box-shadow: inset 0 1px 0 var(--hi), 0 14px 26px -12px rgba(var(--shadow), .9);
  transform: rotate(calc(var(--a) - 120deg)) translateX(calc(var(--rr) * .28)) rotate(calc(120deg - var(--a))) scale(.35);
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: transform .4s var(--ease), opacity .22s, visibility 0s linear .4s, scale .3s var(--spring);
}
.wheel[data-open='true'] .wheel-item {
  transform: rotate(var(--a)) translateX(var(--rr)) rotate(calc(-1 * var(--a))) scale(1);
  opacity: 1; visibility: visible; pointer-events: auto;
  transition: transform .62s var(--spring), opacity .3s, visibility 0s, scale .3s var(--spring);
  transition-delay: calc((var(--o) + 2) * 45ms), calc((var(--o) + 2) * 45ms), 0s, 0s;
}
.wheel-item:hover, .wheel-item:focus-visible { scale: 1.14; }
.wheel-item:active { scale: .92; }
.wheel-item.on { background: var(--accent); border-color: transparent; color: #fff; box-shadow: 0 10px 24px -6px rgba(var(--glow), .85), inset 0 1px 0 rgba(255, 255, 255, .3); }
.wheel-item.util { --rr: var(--r2); --a: calc(var(--base) + var(--o) * var(--ustep)); left: -21px; top: -21px; width: 42px; height: 42px; color: var(--txt-2); }
.wheel[data-open='true'] .wheel-item.util { transition-delay: .24s, .24s, 0s, 0s; }
.wheel-item.util .ic { width: 18px; height: 18px; }
.wheel-label {
  position: absolute; inset-inline-start: calc(100% + 10px); top: 50%; translate: 0 -50%; padding: 4px 11px; border-radius: 999px; white-space: nowrap; pointer-events: none;
  font-size: 13px; font-weight: 600; color: var(--txt); background: var(--sheet); border: 1px solid var(--edge);
}

.scrim {
  position: fixed; inset: 0; z-index: 65; background: rgba(1, 3, 10, .5);
  -webkit-backdrop-filter: blur(7px); backdrop-filter: blur(7px);
  opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .3s, visibility 0s linear .3s;
}
.scrim.on { opacity: 1; visibility: visible; pointer-events: auto; transition: opacity .3s, visibility 0s; }

.sync-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--txt-3); display: block; flex: none; }
[data-status='synced'] .sync-dot { background: var(--ok); box-shadow: 0 0 10px rgba(91, 228, 155, .7); }
[data-status='syncing'] .sync-dot { background: var(--accent-2); animation: blink 1s ease-in-out infinite; }
[data-status='offline'] .sync-dot { background: #FFB454; }
[data-status='locked'] .sync-dot, [data-status='error'] .sync-dot { background: var(--danger); }

.stage {
  overflow-y: auto; overflow-x: hidden; scrollbar-width: thin; scrollbar-color: var(--line-2) transparent;
  padding: 26px max(clamp(18px, 2vw, 40px), env(safe-area-inset-right)) 26px clamp(18px, 2vw, 40px);
}
.slot { min-height: 100%; }

/* ---- shared pieces -------------------------------------------------------- */

.panel {
  position: relative; border-radius: var(--r-lg); padding: var(--s5);
  box-shadow: inset 0 1px 0 var(--hi), inset 0 -24px 40px -34px rgba(var(--glow), .35), 0 30px 60px -30px rgba(var(--shadow), .75);
}
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .22em; text-transform: uppercase; color: var(--txt-3); }
.sub { color: var(--txt-2); margin-top: 4px; }
.hint { font-size: 12.5px; color: var(--txt-3); line-height: 1.5; }
.muted { color: var(--txt-2); }
.row { display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; }
.stack { display: grid; gap: var(--s4); }

.view-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s4); flex-wrap: wrap; margin-bottom: var(--s5); }
.view-head h1 { font-family: var(--font-d); font-weight: 600; font-size: 31px; letter-spacing: -.03em; line-height: 1.15; }

.round {
  width: 36px; height: 36px; display: grid; place-items: center; flex: none; border-radius: 50%;
  background: transparent; border: 1px solid var(--edge-2); color: var(--txt-2);
  transition: transform .3s var(--spring), opacity .2s;
}
.round:hover { transform: translateY(-1px); color: var(--txt); background: var(--cell-h); }
.round:active { transform: scale(.9); }
.round.sm { width: 32px; height: 32px; }
.round.sm .ic, .round .ic { width: 16px; height: 16px; stroke-width: 2.2; }
.round.accent { background: var(--accent); color: #fff; border-color: transparent; box-shadow: 0 6px 16px -6px rgba(var(--glow), .8); }

.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 999px; white-space: nowrap;
  background: var(--card); border: 1px solid var(--edge); color: var(--txt); font-size: 13px; font-weight: 600;
  transition: transform .3s var(--spring), opacity .2s;
}
.chip:hover { transform: translateY(-1px); background: var(--cell-h); }
.chip:active { transform: scale(.95); }
.chip.on { background: var(--accent); border-color: transparent; color: #fff; box-shadow: 0 6px 16px -8px rgba(var(--glow), .9); }
.chip.danger { color: var(--danger); }
.chip .ic { width: 14px; height: 14px; stroke-width: 2.4; }
.chip.file { position: relative; overflow: hidden; cursor: pointer; }
.chip.file input { position: absolute; inset: 0; opacity: 0; cursor: pointer; font-size: 0; }
.chip.file:focus-within { outline: 2px solid var(--accent-2); outline-offset: 2px; }

.btn {
  padding: 10px 18px; border-radius: 12px; border: 1px solid var(--edge-2); background: var(--card); color: var(--txt);
  font-size: 14px; font-weight: 600; transition: transform .3s var(--spring), opacity .2s;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: scale(.97); }
.btn.accent { background: var(--accent); border-color: transparent; color: #fff; box-shadow: 0 10px 22px -10px rgba(var(--glow), .9), inset 0 1px 0 rgba(255, 255, 255, .25); }
.btn.wide { width: 100%; }
.btn:disabled { opacity: .45; cursor: default; transform: none; }
.btn.danger { background: rgba(255, 93, 108, .16); border-color: rgba(255, 93, 108, .5); color: var(--danger); }
a.btn, a.chip { text-decoration: none; }
.row.end { justify-content: flex-end; }
.link { padding: 2px 0; background: none; border: 0; border-radius: 4px; color: var(--link); font-size: 13.5px; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; transition: opacity .2s; }
.link:hover { opacity: .8; }
.link:active { opacity: .6; }
.hint a, .gate-foot a { color: var(--link); text-underline-offset: 3px; }

.icon-btn {
  width: 34px; height: 34px; display: grid; place-items: center; flex: none; border-radius: 10px;
  background: transparent; border: 0; color: var(--txt-2); transition: transform .3s var(--spring), opacity .2s;
}
.icon-btn:hover { background: var(--cell-h); color: var(--txt); }
.icon-btn:active { transform: scale(.88); }
.icon-btn.sm { width: 30px; height: 30px; }
.icon-btn.sm .ic { width: 15px; height: 15px; }

.field { display: grid; gap: 6px; }
.field > span { font-size: 12.5px; font-weight: 600; color: var(--txt-2); }
input[type='text'], input[type='search'], input[type='email'], input[type='password'], input[type='number'], input[type='time'], input[type='date'], select, textarea {
  width: 100%; min-width: 0; background: var(--field); border: 1px solid var(--edge-2); border-radius: 12px; padding: 10px 12px; color: var(--txt); font-size: 15px;
  box-shadow: var(--well);
}
input::placeholder, textarea::placeholder { color: var(--txt-3); }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 1px; }
textarea { resize: vertical; min-height: 72px; line-height: 1.5; }
select option { background: #0B1426; color: #F5F8FD; }
input[type='range'] { width: 100%; accent-color: var(--accent); }

.seg { display: inline-flex; padding: 3px; gap: 2px; background: var(--field); border: 1px solid var(--edge); border-radius: 12px; box-shadow: var(--well); }
.seg-btn { padding: 7px 14px; border-radius: 9px; border: 0; background: transparent; color: var(--txt-2); font-size: 13px; font-weight: 600; transition: transform .25s var(--spring); }
.seg-btn:hover { color: var(--txt); }
.seg-btn:active { transform: scale(.95); }
.seg-btn.on { background: var(--accent); color: #fff; box-shadow: 0 6px 14px -8px rgba(var(--glow), .9); }

.switch { display: flex; align-items: center; gap: 12px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch-track { position: relative; width: 42px; height: 24px; flex: none; border-radius: 12px; background: var(--line-2); }
.switch-track::after { content: ''; position: absolute; top: 3px; inset-inline-start: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 2px 5px rgba(0, 0, 0, .3); transition: transform .3s var(--spring); }
.switch input:checked + .switch-track { background: var(--accent); }
.switch input:checked + .switch-track::after { transform: translateX(18px); }
.switch input:focus-visible + .switch-track { outline: 2px solid var(--accent-2); outline-offset: 2px; }

.tickbox {
  width: 24px; height: 24px; display: grid; place-items: center; flex: none; border-radius: 50%; padding: 0;
  background: transparent; border: 1.8px solid var(--line-2); color: var(--on-accent);
  transition: transform .3s var(--spring);
}
.tickbox .ic { width: 14px; height: 14px; stroke-width: 3; opacity: 0; transform: scale(.3); transition: transform .3s var(--spring), opacity .15s; }
button.tickbox:hover { transform: scale(1.12); border-color: var(--c, var(--accent-2)); }
button.tickbox:active { transform: scale(.88); }
.tickbox[aria-pressed='true'], .done > .tcard-in .tickbox, li.done .tickbox { background: var(--c, var(--accent-2)); border-color: var(--c, var(--accent-2)); }
.tickbox[aria-pressed='true'] .ic, .done > .tcard-in .tickbox .ic, li.done .tickbox .ic { opacity: 1; transform: none; }

/* ---- home ------------------------------------------------------------------ */

.hello { margin-bottom: var(--s5); display: grid; gap: 6px; justify-items: start; }
.brand-loop { font-family: var(--font-d); font-weight: 500; font-size: 40px; letter-spacing: -.035em; line-height: 1.12; }
.hello-line { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; max-width: 100%; min-width: 0; }
.hello-hi { font-family: var(--font-d); font-weight: 600; font-size: 19px; letter-spacing: -.01em; white-space: nowrap; }
.quote {
  max-width: 100%; padding: 0; background: none; border: 0; border-radius: 6px; text-align: start;
  font-family: var(--font-d); font-size: 18px; font-weight: 500; letter-spacing: -.01em; line-height: 1.3;
  transition: transform .3s var(--spring), opacity .2s;
}
.quote:hover { transform: translateX(3px); }
.quote:active { opacity: .6; transform: scale(.985); }

/* Looping text: a fixed word, then a word that wipes in behind a blinking cursor. */
.tloop { display: inline-flex; align-items: center; max-width: 100%; min-width: 0; }
.tloop-fixed { margin-inline-end: .26em; white-space: nowrap; }
.tloop-box {
  min-width: 0; max-width: 100%; white-space: nowrap; border-radius: .14em;
  background: linear-gradient(90deg, transparent, rgba(var(--glow), .10) 45%, rgba(var(--glow), .30));
}
.tloop-word {
  display: inline-block; padding: .03em 0 .07em; padding-inline: .1em .2em;
  background: var(--loop-ink); -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-fill-color: transparent;
}
.tloop-cursor {
  flex: none; width: max(2px, .075em); height: 1.02em; border-radius: 1px; background: var(--accent);
  box-shadow: 0 0 12px rgba(var(--glow), .9); animation: cursor .8s ease-in-out infinite alternate;
}

.home-grid { display: grid; grid-template-columns: minmax(0, 1fr) clamp(330px, 26vw, 500px); gap: var(--s5); align-items: start; }

.cal-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); margin-bottom: 18px; flex-wrap: wrap; }
.cal-pick { display: flex; align-items: center; gap: 18px; }
.pick { position: relative; display: inline-flex; align-items: center; }
.pick select { appearance: none; -webkit-appearance: none; width: auto; background: transparent; border: 0; box-shadow: none; border-radius: 8px; padding: 2px; padding-inline-end: 24px; font-family: var(--font-d); font-size: 23px; font-weight: 500; letter-spacing: -.01em; cursor: pointer; }
.pick .ic { position: absolute; inset-inline-end: 2px; width: 15px; height: 15px; pointer-events: none; color: var(--txt-2); stroke-width: 2.2; }
.cal-nav { display: flex; align-items: center; gap: 8px; }

.cal-dows { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; padding: 0 4px 10px; font-size: 13px; color: var(--txt-3); }
.cal-dows b { font-weight: 500; }
.cal-dows .short { display: none; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; }

.cell {
  position: relative; aspect-ratio: 1 / .92; padding: 0; overflow: hidden; text-align: start;
  border-radius: var(--r-md); background: var(--cell); border: 1px solid var(--edge); color: var(--txt);
  box-shadow: inset 0 1px 0 var(--hi);
  transition: transform .35s var(--spring), opacity .2s;
}
.cell-num { position: absolute; top: 10px; inset-inline-start: 12px; font-family: var(--font-n); font-size: 15.5px; font-weight: 700; letter-spacing: .03em; line-height: 1.2; }
.cell:hover, .cell:focus-visible { transform: translateY(-3px); background: rgba(var(--glow), .20); outline: 1.5px dashed var(--accent-2); outline-offset: -1.5px; }
.cell:active { transform: scale(.95); }
.cell.out { opacity: .42; }
.cell.today {
  color: #fff; border-color: rgba(140, 195, 255, .65);
  background: linear-gradient(180deg, #2F8FFF 0%, rgba(47, 143, 255, .62) 42%, rgba(47, 143, 255, .14) 100%);
  box-shadow: 0 14px 30px -10px rgba(var(--glow), .8), inset 0 1px 0 rgba(255, 255, 255, .38);
}
.cell-bar { position: absolute; left: 11px; right: 11px; bottom: 9px; height: 3px; border-radius: 3px; overflow: hidden; background: var(--line-2); }
.cell-bar i { display: block; height: 100%; border-radius: 3px; background: linear-gradient(90deg, var(--accent-2), #9AD4FF); transform-origin: left; transform: scaleX(var(--p)); }
.cell.today .cell-bar { background: rgba(255, 255, 255, .28); }
.cell.today .cell-bar i { background: #fff; }
.cell.full .cell-bar i { background: var(--ok); }

/* ---- widgets --------------------------------------------------------------- */

.widgets { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.w {
  position: relative; display: flex; flex-direction: column; gap: 6px; min-height: 134px; padding: 16px; overflow: hidden;
  border-radius: 24px;
  box-shadow: inset 0 1px 0 var(--hi), inset 0 -20px 34px -30px rgba(var(--glow), .4), 0 22px 40px -24px rgba(var(--shadow), .8);
  transition: transform .4s var(--spring);
}
.w:hover { transform: translateY(-3px); }
.w-label { font-size: 11px; font-weight: 700; letter-spacing: .13em; text-transform: uppercase; color: var(--txt-3); }
.w-big { font-family: var(--font-d); font-size: 36px; font-weight: 600; letter-spacing: -.03em; line-height: 1.1; font-variant-numeric: tabular-nums; display: flex; align-items: baseline; gap: 6px; }
.w-big small { font-size: 14px; font-weight: 500; letter-spacing: 0; color: var(--txt-2); }
.w-big b { font-weight: 600; }
.w-sub { margin-top: auto; font-size: 12.5px; color: var(--txt-2); }
.w-sub b { color: var(--txt); font-weight: 700; }
.w-empty { font-size: 13px; color: var(--txt-2); }
.w .chip { align-self: flex-start; margin-top: auto; }
.credit { font-size: 10.5px; color: var(--txt-3); text-decoration: none; }
.w-place {
  display: flex; align-items: center; gap: 5px; max-width: 100%; padding: 0; background: none; border: 0; text-align: start;
  font-size: 12.5px; color: var(--txt-2); transition: transform .3s var(--spring), opacity .2s;
}
.w-place .ic { width: 13px; height: 13px; flex: none; color: var(--link); }
.w-place span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.w-place:hover { color: var(--txt); transform: translateX(2px); }
.w-place:active { transform: scale(.96); }
.w-weather .w-sub + .w-place, .w-weather .w-empty + .w-place { margin-top: 2px; }
.w-weather .w-empty + .w-place { margin-top: auto; }
.credit:hover { color: var(--txt-2); text-decoration: underline; }

.w-today { grid-column: span 2; display: grid; grid-template-columns: 136px minmax(0, 1fr); gap: 16px; padding: 12px; cursor: pointer; }
.w-date {
  display: flex; flex-direction: column; justify-content: space-between; min-height: 138px; padding: 14px; border-radius: 16px; color: #fff;
  background: linear-gradient(180deg, #04070D 0%, #08142B 48%, #2A6FE0 86%, #9CCBFF 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08), 0 14px 28px -14px rgba(var(--glow), .9);
}
.w-date-big { font-family: var(--font-d); font-size: 29px; font-weight: 600; letter-spacing: -.02em; }
.w-date-sub { font-size: 13.5px; font-weight: 600; line-height: 1.35; }
.w-up { padding: 6px 0; padding-inline-end: 44px; min-width: 0; }
.w-up h3 { font-size: 11.5px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--txt-2); margin-bottom: 8px; }
.w-up li { border-inline-start: 3px solid var(--c); padding-inline-start: 10px; margin-bottom: 8px; }
.w-up li b, .w-up li span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.w-up li b { font-size: 14.5px; font-weight: 500; }
.w-up li span { font-size: 12px; color: var(--txt-3); }
.w-add {
  position: absolute; inset-inline-end: 12px; bottom: 12px; width: 42px; height: 42px; display: grid; place-items: center; border-radius: 50%; color: #fff;
  border: 2px solid transparent;
  background: linear-gradient(#0D1525, #0D1525) padding-box, conic-gradient(from 210deg, #5BE49B, #2D8CFF, #A08BFF, #5BE49B) border-box;
  box-shadow: 0 8px 18px -6px rgba(0, 0, 0, .6);
  transition: transform .35s var(--spring);
}
.w-add:hover { transform: scale(1.1) rotate(90deg); }
.w-add:active { transform: scale(.9); }

.w-wx { display: flex; align-items: center; gap: 10px; }
.w-wx-icon .ic { width: 34px; height: 34px; color: var(--link); stroke-width: 1.6; }

.ring { position: relative; width: 78px; height: 78px; margin: 2px 0; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-track { fill: none; stroke: var(--line-2); stroke-width: 6; }
.ring-fill { fill: none; stroke: var(--accent-2); stroke-width: 6; stroke-linecap: round; filter: drop-shadow(0 0 5px rgba(var(--glow), .7)); }
.ring-num { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--font-d); font-size: 18px; }
.ring-num b { font-weight: 600; }

.w-streak-row { display: flex; align-items: center; gap: 8px; }
.flame .ic { width: 28px; height: 28px; color: var(--txt-3); }
.flame.lit .ic { color: #FFB454; fill: rgba(255, 180, 84, .28); filter: drop-shadow(0 0 8px rgba(255, 180, 84, .6)); }

.w-timer, .w-week, .w-notes { grid-column: span 2; min-height: 0; }
.w-timer { gap: 10px; }
.prio { display: grid; gap: 6px; margin: 4px 0; }
.prio li { display: flex; align-items: center; gap: 10px; }
.prio li span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.prio li.done span { color: var(--txt-3); text-decoration: line-through; }
.prio .icon-btn { opacity: .5; }
.prio li:hover .icon-btn, .prio .icon-btn:focus-visible { opacity: 1; }
.w-week .row { flex-wrap: nowrap; margin-bottom: 8px; }
.w-week .row input { flex: 1; padding: 8px 12px; font-size: 14px; }

/* The notes: a glass notepad. Punched holes along the top, ruled lines edge to
   edge, a margin line, one bullet per note. The writing line stays in view. */
.w.w-notes { --lh: 36px; --gutter: 46px; padding: 42px 0 0; gap: 10px; }
.w-notes::after {
  content: ''; position: absolute; inset: 0 0 auto 0; height: 30px; pointer-events: none;
  background:
    radial-gradient(circle at 50% 50%, rgba(var(--shadow), .9) 0 3.6px, rgba(255, 255, 255, .55) 3.8px 4.8px, transparent 5px) center / 30px 30px repeat-x,
    linear-gradient(180deg, rgba(255, 255, 255, .1), rgba(255, 255, 255, .02));
  border-bottom: 1px solid var(--line);
}
.w-notes .w-label { padding-inline: 16px; }
.pad {
  --rule: repeating-linear-gradient(180deg, transparent 0, transparent calc(var(--lh) - 1px), rgba(var(--glow), .2) calc(var(--lh) - 1px), rgba(var(--glow), .2) var(--lh));
  flex: 1; min-height: calc(var(--lh) * 3); display: flex; flex-direction: column; border-top: 1px solid rgba(var(--glow), .34);
  background: linear-gradient(rgba(255, 122, 150, .42), rgba(255, 122, 150, .42)) 34px 0 / 1.5px 100% no-repeat;
}
/* The notes scroll on their own; the writing line stays right under them and the
   rest of the page is empty ruled lines. */
.pad-list { flex: 0 1 auto; min-height: 0; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; background: var(--rule); background-attachment: local; }
.pad::after { content: ''; flex: 1; background: var(--rule); }
.pad-list li, .pad-add { position: relative; display: flex; align-items: flex-start; gap: 2px; min-height: var(--lh); padding-inline: var(--gutter) 10px; }
.pad-list li::before, .pad-add::before {
  content: ''; position: absolute; inset-inline-start: 14px; top: calc(var(--lh) / 2 - 4px); width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent-2); box-shadow: 0 0 10px rgba(var(--glow), .8);
}
.pad-list li.done::before { background: var(--txt-3); box-shadow: none; }
.pad-text { flex: 1; min-width: 0; overflow-wrap: anywhere; font-size: 14.5px; line-height: var(--lh); transition: opacity .25s; }
.pad-list li.done .pad-text { color: var(--txt-3); text-decoration: line-through; text-decoration-thickness: 1.5px; opacity: .8; }
.pad-btn { margin-top: calc((var(--lh) - 30px) / 2); flex: none; opacity: .6; }
.pad-list li:hover .pad-btn, .pad-btn:focus-visible, .pad-btn.add { opacity: 1; }
.pad-btn[aria-pressed='true'] { color: var(--ok); opacity: 1; }
.pad-btn.del:hover { color: var(--danger); }
.pad-add { flex: none; box-shadow: inset 0 -1px 0 rgba(var(--glow), .2); }
.pad-add::before { background: none; box-shadow: none; border: 1.5px dashed var(--txt-3); width: 9px; height: 9px; }
.pad-add:focus-within::before { border-color: var(--accent-2); border-style: solid; }
.pad-add input {
  flex: 1; min-width: 0; height: var(--lh); padding: 0; font-size: 14.5px;
  background: none; border: 0; border-radius: 0; box-shadow: none;
}
.pad-add input:focus-visible { outline: none; }
.pad-add:focus-within { box-shadow: inset 0 -2px 0 var(--accent-2); }
@media (hover: none) { .pad-btn { opacity: .85; } }
[dir='rtl'] .pad { background-position: right 34px top 0; }
.w-quote p { font-family: var(--font-d); font-size: 19px; font-weight: 500; line-height: 1.35; letter-spacing: -.01em; }

/* ---- timer pill ------------------------------------------------------------- */

.tpill {
  position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px;
  min-height: 132px; padding: 18px 26px; border-radius: 50px; background: var(--pill);
  box-shadow: inset 0 1px 0 var(--hi), 0 24px 46px -24px rgba(var(--shadow), .9);
}
.tpill-edge { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.edge-track { fill: none; stroke: var(--line-2); stroke-width: 5; }
.edge-fill { fill: none; stroke: var(--accent-2); stroke-width: 5; stroke-linecap: round; filter: drop-shadow(0 0 7px rgba(var(--glow), .85)); }
.tpill[data-status='paused'] .edge-fill { stroke: var(--txt-2); filter: none; }
.tpill[data-status='done'] .edge-track { stroke: var(--ok); }
.tbtn {
  position: relative; z-index: 1; width: 68px; height: 68px; display: grid; place-items: center; border-radius: 50%; border: 0;
  background: var(--cell-h); color: var(--txt); box-shadow: inset 0 1px 0 var(--hi);
  transition: transform .35s var(--spring), opacity .2s;
}
.tbtn .ic { width: 28px; height: 28px; }
.tbtn:hover { transform: scale(1.07); }
.tbtn:active { transform: scale(.9); }
.tbtn-x { background: rgba(255, 93, 108, .2); color: var(--danger); }
.tbtn:disabled { opacity: .3; cursor: default; transform: none; }
.tpill-mid { display: flex; flex-direction: column; align-items: center; min-width: 0; }
.tpill-top { display: inline-flex; align-items: center; gap: 5px; font-size: 14px; font-weight: 600; color: var(--txt-2); }
.tpill-top .ic { width: 14px; height: 14px; fill: currentColor; stroke: none; }
.tpill-time { font-family: var(--font-d); font-size: 66px; font-weight: 600; letter-spacing: -.02em; line-height: 1.05; font-variant-numeric: tabular-nums; }
.tpill-label { font-size: 15px; color: var(--txt-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }

.tpill.compact { min-height: 84px; padding: 10px 14px; border-radius: 42px; gap: 8px; }
.tpill.compact .tbtn { width: 46px; height: 46px; }
.tpill.compact .tbtn .ic { width: 20px; height: 20px; }
.tpill.compact .tpill-time { font-size: 34px; }
.tpill.compact .tpill-top { font-size: 11.5px; }
.tpill.compact .tpill-label { font-size: 11.5px; }
.tpill.compact .edge-track, .tpill.compact .edge-fill { stroke-width: 4; }

.timer-stage { max-width: 600px; margin: 40px auto 0; display: grid; gap: var(--s5); }
.presets { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; align-items: center; }
.chip-form { display: inline-flex; gap: 6px; }
.chip-form { align-items: center; }
.chip-form input { width: 52px; padding: 7px 6px; border-radius: 999px; font-size: 13px; text-align: center; -moz-appearance: textfield; appearance: textfield; }
.chip-form input::-webkit-outer-spin-button, .chip-form input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.hms { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; font-weight: 600; color: var(--txt-3); }
/* Settings: the preset times, each with a small cross, and the boxes that add one. */
.preset-field { gap: 10px; }
.preset-edit { justify-content: flex-start; }
.preset-add { flex-wrap: wrap; }
.preset-x .ic { opacity: .55; }
.preset-x:hover .ic, .preset-x:focus-visible .ic { opacity: 1; }
.timer-stage .hint { text-align: center; }

/* Quick timer: a small tab on the right edge of the home screen. */
.tdock { position: fixed; top: 24px; inset-inline-end: 0; z-index: 50; }
.tdock-tab {
  display: inline-flex; align-items: center; gap: 8px; height: 42px; padding: 0; padding-inline: 14px 22px; border-radius: 0; border-start-start-radius: 999px; border-end-start-radius: 999px;
  border: 1px solid var(--edge-2); border-inline-end: 0; color: var(--txt); font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap;
  box-shadow: inset 0 1px 0 var(--hi), 0 14px 30px -14px rgba(var(--shadow), .9);
  transform: translateX(8px); transition: transform .4s var(--spring), opacity .2s;
}
.tdock-tab .ic { width: 18px; height: 18px; color: var(--link); }
.tdock-tab:hover { transform: none; }
.tdock-tab:active { transform: translateX(4px) scale(.97); }
.tdock[data-status='running'] .tdock-tab { border-color: rgba(var(--glow), .7); box-shadow: inset 0 1px 0 var(--hi), 0 0 22px -4px rgba(var(--glow), .8); }
.tdock[data-status='running'] .tdock-tab .ic { animation: blink 1.6s ease-in-out infinite; }
.tdock[data-open='true'] .tdock-tab { transform: none; background: var(--accent); border-color: transparent; color: #fff; }
.tdock[data-open='true'] .tdock-tab .ic { color: #fff; }
.tdock-panel {
  position: absolute; top: calc(100% + 10px); inset-inline-end: 12px; width: min(340px, calc(100vw - 24px)); display: grid; gap: 12px; padding: 14px; border-radius: 24px;
  background: var(--sheen), var(--sheet); border: 1px solid var(--edge-2);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  box-shadow: inset 0 1px 0 var(--hi), 0 30px 60px -24px rgba(var(--shadow), .9);
  transform-origin: 100% 0; transform: translateX(18px) scale(.92); opacity: 0; visibility: hidden;
  transition: transform .25s var(--ease), opacity .2s, visibility 0s linear .25s;
}
.tdock[data-open='true'] .tdock-panel { transform: none; opacity: 1; visibility: visible; transition: transform .5s var(--spring), opacity .2s, visibility 0s; }
.tdock-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tdock-panel .presets { justify-content: flex-start; }
.tdock-panel > .chip { justify-self: start; }

/* ---- day view --------------------------------------------------------------- */

.view.day { display: grid; grid-template-columns: minmax(0, 1fr) clamp(290px, 24vw, 460px); gap: var(--s5); align-items: start; }
.day-panel { will-change: transform; }
.day-head { display: flex; align-items: center; gap: var(--s4); }
.day-title h1 { font-family: var(--font-d); font-size: 30px; font-weight: 600; letter-spacing: -.03em; line-height: 1.15; }
.day-today { margin-inline-start: auto; flex: none; }
.day-today + .day-wx { margin-inline-start: 0; }
.day-wx { margin-inline-start: auto; display: flex; align-items: center; gap: 8px; font-family: var(--font-d); font-size: 19px; font-weight: 500; }
.day-wx .ic { width: 28px; height: 28px; color: var(--link); stroke-width: 1.6; }
.day-wx small { margin-inline-start: 6px; font-size: 14px; color: var(--txt-3); }

.strip { display: flex; align-items: center; gap: 10px; margin: 20px 0 6px; padding: 8px 10px; border-radius: 20px; background: var(--field); border: 1px solid var(--edge); }
.strip-days { flex: 1; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.strip-day {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 7px 0 11px; border-radius: 14px;
  background: transparent; border: 0; color: var(--txt-2); font-family: var(--font-d); font-size: 16px; font-weight: 500;
  transition: transform .3s var(--spring);
}
.strip-day small { font-family: var(--font-b); font-size: 11px; color: var(--txt-3); }
.strip-day:hover { background: var(--cell); color: var(--txt); }
.strip-day:active { transform: scale(.92); }
.strip-day.is-today span { color: var(--link); }
.strip-day.sel { color: var(--txt); background: rgba(var(--glow), .2); box-shadow: inset 0 0 0 2px var(--accent-2), 0 8px 18px -10px rgba(var(--glow), .9); }
.strip-day.sel small { color: var(--txt-2); }
.strip-bar { position: absolute; left: 28%; right: 28%; bottom: 5px; height: 2px; border-radius: 2px; background: var(--accent-2); transform-origin: left; transform: scaleX(var(--p)); }

.day-body { display: grid; grid-template-columns: minmax(0, 1fr) 72px; gap: var(--s4); }
.timeline { position: relative; padding-inline-start: 30px; }
.timeline::before { content: ''; position: absolute; inset-inline-start: 9px; top: 10px; bottom: 26px; width: 2px; border-radius: 2px; background: linear-gradient(180deg, var(--line-2), var(--line)); }
.timeline > .eyebrow { margin: 20px 0 10px; }
.timeline > .eyebrow:first-child { margin-top: 12px; }

.tcard { position: relative; margin-bottom: 12px; }
.tdot { position: absolute; inset-inline-start: -29px; top: 50%; width: 16px; height: 16px; margin-top: -8px; border-radius: 50%; background: var(--c); box-shadow: 0 0 14px -1px var(--c); }
.tcard-in {
  display: block; width: 100%; text-align: start; padding: 12px 16px; border-radius: 18px; color: var(--txt);
  background: var(--card); border: 1.5px solid color-mix(in srgb, var(--c) 72%, transparent);
  box-shadow: inset 0 1px 0 var(--hi), 0 14px 26px -20px rgba(var(--shadow), .9);
  transition: transform .35s var(--spring), opacity .25s;
}
button.tcard-in:hover, .tcard:hover > div.tcard-in { transform: translateX(3px); }
button.tcard-in:active { transform: scale(.985); }
.tcard-row { display: flex; align-items: center; gap: 10px; }
.tcard-row.sub { margin-top: 8px; justify-content: space-between; min-height: 30px; font-size: 13.5px; color: var(--txt-2); }
.tcard-title { flex: 1; min-width: 0; font-family: var(--font-d); font-size: 17.5px; font-weight: 600; letter-spacing: -.01em; overflow-wrap: anywhere; }
.tcard-right { font-family: var(--font-d); font-size: 16.5px; font-weight: 600; white-space: nowrap; }
.tcard-tag { display: inline-flex; align-items: center; gap: 6px; }
.tcard-tag .ic { width: 15px; height: 15px; }
.tcard.done > .tcard-in { opacity: .52; border-color: var(--line-2); }
.tcard.done .tcard-title { text-decoration: line-through; text-decoration-thickness: 1.5px; }
.tcard.done .tdot { background: var(--txt-3); box-shadow: none; }

.plats { display: inline-flex; gap: 8px; flex-wrap: wrap; }
.plat {
  display: inline-flex; align-items: center; gap: 4px; padding: 5px 12px; padding-inline-start: 8px; border-radius: 999px;
  background: transparent; border: 1.5px solid var(--line-2); color: var(--txt-2); font-size: 12.5px; font-weight: 700; letter-spacing: .05em;
  transition: transform .3s var(--spring);
}
.plat .ic { width: 14px; height: 14px; stroke-width: 3; opacity: .25; transform: scale(.7); transition: transform .3s var(--spring), opacity .15s; }
.plat:hover { transform: translateY(-2px); border-color: var(--c, var(--accent-2)); color: var(--txt); }
.plat:active { transform: scale(.9); }
.plat.on { background: var(--c, var(--accent-2)); border-color: var(--c, var(--accent-2)); color: #06101F; }
.plat.on .ic { opacity: 1; transform: none; }

.acts { display: inline-flex; gap: 2px; opacity: 0; transition: opacity .2s; }
.tcard:hover .acts, .tcard:focus-within .acts { opacity: 1; }
@media (hover: none) { .acts { opacity: .75; } }

.composer {
  position: relative; display: flex; align-items: center; gap: 8px; margin-top: 4px; padding: 7px 8px; padding-inline-start: 16px;
  border-radius: 18px; background: var(--field); border: 1.5px dashed var(--line-2);
}
.composer:focus-within { border-color: var(--accent-2); border-style: solid; }
.composer .tdot { opacity: .5; }
.composer input { background: transparent; border: 0; padding: 6px 0; border-radius: 6px; box-shadow: none; }
.composer input[type='text'] { flex: 1; }
.composer input[type='time'] { width: auto; flex: none; color: var(--txt-2); font-size: 14px; }
.composer input:focus-visible { outline: none; }

.tracker { position: sticky; top: 0; display: flex; flex-direction: column; align-items: center; gap: 10px; padding-top: 36px; }
.tracker-bar { position: relative; width: 10px; height: 230px; border-radius: 10px; overflow: hidden; background: var(--line-2); }
.tracker-bar i { position: absolute; inset: 0; border-radius: 10px; background: linear-gradient(0deg, var(--accent), #9AD4FF); transform-origin: bottom; transform: scaleY(var(--p)); transition: transform .7s var(--ease); }
.tracker-num { text-align: center; }
.tracker-num b { display: block; font-family: var(--font-d); font-size: 21px; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.tracker-num span { font-size: 10px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--txt-3); }
.tracker-sub { font-size: 12px; color: var(--txt-3); }

.day-side { display: grid; gap: 14px; }
.day-side .w { min-height: 0; grid-column: auto; }

/* ---- stats ------------------------------------------------------------------ */

.stat-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: var(--s5); }
.stat .flame .ic { width: 26px; height: 26px; }
.stats .panel + .panel { margin-top: var(--s5); }
.bars { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; height: 210px; margin-top: 18px; }
.bar { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 0; background: transparent; border: 0; color: var(--txt-2); font-size: 13px; transition: transform .3s var(--spring); }
.bar:hover { transform: translateY(-3px); }
.bar:active { transform: scale(.96); }
.bar b { font-family: var(--font-d); font-weight: 500; }
.bar small { font-size: 11px; color: var(--txt-3); min-height: 16px; }
.bar.is-today b { color: var(--link); }
.bar-col { flex: 1; width: 100%; max-width: var(--bar-w, 46px); border-radius: 12px; overflow: hidden; background: var(--cell); display: flex; align-items: flex-end; }
.bar-col i { display: block; width: 100%; height: 100%; border-radius: 12px; background: linear-gradient(0deg, var(--accent), #9AD4FF); transform-origin: bottom; transform: scaleY(var(--p)); }
.bar.future .bar-col { opacity: .45; }

.heat-scroll { overflow-x: auto; margin-top: 16px; padding-bottom: 6px; scrollbar-width: thin; }
.heat-wrap { width: max-content; }
.heat-months { position: relative; height: 18px; font-size: 11px; color: var(--txt-3); }
.heat-wrap { --hs: 14px; }
.heat-months span { position: absolute; inset-inline-start: calc(var(--col) * (var(--hs) + 3px)); }
.heat { display: grid; grid-auto-flow: column; grid-template-rows: repeat(7, var(--hs)); grid-auto-columns: var(--hs); gap: 3px; }
.heat-cell { display: block; width: var(--hs); height: var(--hs); padding: 0; border: 0; border-radius: 4px; background: var(--cell); }
button.heat-cell { transition: transform .25s var(--spring); }
button.heat-cell:hover { transform: scale(1.35); }
.heat-cell.blank { background: transparent; }
.heat-cell.future { opacity: .4; }
.heat-cell.l1 { background: rgba(var(--glow), .30); }
.heat-cell.l2 { background: rgba(var(--glow), .52); }
.heat-cell.l3 { background: rgba(var(--glow), .78); }
.heat-cell.l4 { background: var(--accent-2); box-shadow: 0 0 8px rgba(var(--glow), .6); }
.heat-cell.is-today { outline: 1.5px solid var(--txt); outline-offset: 1px; }
.heat-legend { display: flex; align-items: center; justify-content: flex-end; gap: 4px; margin-top: 12px; font-size: 11px; color: var(--txt-3); }
.heat-legend span { margin: 0 4px; }

/* ---- settings --------------------------------------------------------------- */

.set-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s4); }
.set { display: grid; gap: 14px; align-content: start; }
.set.wide { grid-column: span 2; }
.set h4 { font-size: 13px; font-weight: 700; color: var(--txt-2); margin-top: 6px; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.set .chip { justify-self: start; }
.brand-row { display: flex; align-items: center; gap: 14px; }
.brand-row .brand-word { width: 104px; }
.tpl { display: grid; gap: 8px; }
.tpl li { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.tpl li input { flex: 1 1 180px; }
.tpl li input.tpl-post { flex-basis: 110px; }
/* The day of the month a monthly task falls on: a row of its own under the task. */
.mday { flex: 1 0 100%; display: flex; align-items: center; gap: 10px; padding-bottom: 6px; font-size: 13px; color: var(--txt-2); }
.mday select { flex: 0 0 auto; width: 84px; padding: 7px 10px; }
/* The weekdays a daily task is on: a row of its own under the task. */
.days { flex: 1 0 100%; display: flex; flex-wrap: wrap; gap: 6px; padding-bottom: 6px; }
.dayb {
  width: 34px; height: 34px; display: grid; place-items: center; flex: none; border-radius: 50%;
  background: transparent; border: 1.5px solid var(--line-2); color: var(--txt-3); font-size: 12.5px; font-weight: 700;
  transition: transform .3s var(--spring);
}
/* Only with a mouse: on a touch screen "hover" sticks after a tap and would leave the button raised. */
@media (hover: hover) { .dayb:hover { transform: translateY(-2px); border-color: var(--accent-2); color: var(--txt); } }
.dayb:active { transform: scale(.9); }
.dayb.on { background: var(--accent-2); border-color: var(--accent-2); color: #06101F; }
@media (pointer: coarse) { .dayb { width: 38px; height: 38px; font-size: 13.5px; } }
.ring-row { flex-wrap: nowrap; }
.ring-row select { flex: 1; min-width: 0; }
@media (pointer: coarse) { .tpl li input.tpl-time { width: 144px; } }
.tpl li input.tpl-time { flex: 0 0 auto; width: 132px; color: var(--txt-2); }
.clash-msg { font-size: 15px; line-height: 1.6; overflow-wrap: anywhere; }
.track-name { font-size: 13.5px; color: var(--txt-2); overflow-wrap: anywhere; min-width: 0; flex: 1; }
.sync-line, .on-line { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.acct { display: grid; gap: 2px; }
.acct b { font-family: var(--font-d); font-size: 17px; font-weight: 600; }
.acct bdi { font-size: 13.5px; color: var(--txt-2); overflow-wrap: anywhere; }
.set .btn { justify-self: start; }

/* ---- dialogs, toasts ---------------------------------------------------------- */

.overlay {
  position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 16px;
  background: rgba(1, 3, 10, .5); -webkit-backdrop-filter: blur(14px) saturate(150%); backdrop-filter: blur(14px) saturate(150%);
  animation: fade .2s ease both;
}
.overlay.out { opacity: 0; transition: opacity .2s; }
.sheet {
  width: min(430px, 100%); max-height: calc(100dvh - 32px); overflow-y: auto; padding: 20px; border-radius: 24px;
  background: var(--sheen), var(--sheet); border: 1px solid var(--edge-2);
  box-shadow: inset 0 1px 0 var(--hi), 0 40px 80px -30px rgba(0, 0, 0, .7);
  animation: sheet .45s var(--spring) both;
}
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 14px; margin-bottom: 16px; border-bottom: 1px dashed var(--line-2); }
.sheet-head h2 { font-family: var(--font-d); font-size: 19px; font-weight: 600; }
.sheet-head .ic { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.sheet-body { display: grid; gap: 14px; }
.sheet-body .row { flex-wrap: nowrap; }
.sheet-body .row input { flex: 1; }
.or { text-align: center; font-size: 12.5px; color: var(--txt-3); }
.results { display: grid; gap: 4px; }
.results .muted { font-size: 13.5px; padding: 6px 2px; }
.result { width: 100%; text-align: start; padding: 10px 12px; border-radius: 12px; background: transparent; border: 0; transition: transform .25s var(--spring); }
.result:hover { background: var(--cell-h); transform: translateX(3px); }
.result:active { transform: scale(.98); }

.toasts { position: fixed; left: 50%; bottom: 32px; z-index: 90; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; width: max-content; max-width: calc(100vw - 32px); }
.toast {
  padding: 10px 18px; border-radius: 999px; font-size: 13.5px; font-weight: 600; text-align: center;
  background: var(--sheet); border: 1px solid var(--edge-2); box-shadow: inset 0 1px 0 var(--hi), 0 16px 34px -14px rgba(0, 0, 0, .6);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  animation: toast .45s var(--spring) both; transition: opacity .3s, transform .3s;
}
.toast.out { opacity: 0; transform: translateY(8px); }
.spark { position: fixed; z-index: 95; width: 7px; height: 7px; border-radius: 50%; pointer-events: none; }

/* ---- loading screen ------------------------------------------------------------ */

.splash {
  position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; align-content: center; gap: 22px;
  background:
    radial-gradient(46% 38% at 50% 44%, rgba(var(--glow), .26), transparent 72%),
    radial-gradient(90% 70% at 92% 110%, rgba(var(--glow), .22), transparent 62%),
    linear-gradient(165deg, var(--bg-a) 42%, var(--bg-b));
  transition: opacity .5s ease;
}
.splash.out { opacity: 0; pointer-events: none; }
.splash-logo { position: relative; width: 128px; height: 128px; display: grid; place-items: center; }
.splash-logo .brand-mark { width: 86px; height: 86px; filter: drop-shadow(0 14px 30px rgba(var(--glow), .65)); animation: splashIn .9s var(--spring) both, breathe 2.6s ease-in-out .9s infinite; }
/* A bright arc that runs round the logo, and a soft ring that pulses outward. */
.splash-ring {
  position: absolute; inset: 0; border-radius: 50%;
  background: conic-gradient(from 0deg, transparent 0 58%, rgba(var(--glow), .9) 90%, #fff 100%);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 2px)); mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 2px));
  animation: spin 1.15s linear infinite, fade .5s ease both;
}
.splash-pulse { position: absolute; inset: 10px; border-radius: 50%; border: 1px solid rgba(var(--glow), .6); animation: ripple 1.8s var(--ease) infinite; }
.splash .brand-word { width: 118px; animation: fu .7s var(--ease) .3s both; }
.splash-bar { width: 118px; height: 3px; border-radius: 3px; overflow: hidden; background: var(--line-2); animation: fade .6s ease .4s both; }
.splash-bar i { display: block; width: 42%; height: 100%; border-radius: 3px; background: linear-gradient(90deg, transparent, var(--accent-2), transparent); animation: sweep 1.25s var(--ease) infinite; }

/* ---- sign-in screen and the questions after it ----------------------------------- */

.gated .shell { visibility: hidden; }
.gate {
  position: fixed; inset: 0; z-index: 75; display: grid; overflow-y: auto;
  padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  transition: opacity .3s ease;
}
.gate.out { opacity: 0; pointer-events: none; }
.gate-in { width: min(440px, 100%); margin: auto; display: grid; gap: 18px; padding-block: 8px; }
.gate-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.gate-brand { display: inline-flex; align-items: center; gap: 12px; }
.gate-brand .brand-mark { width: 44px; height: 44px; }
.gate-brand .brand-word { width: 92px; }
.gate-card {
  position: relative; display: grid; gap: 14px; padding: 26px; border-radius: 28px;
  background: var(--sheen), var(--sheet); border: 1px solid var(--edge-2);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  box-shadow: inset 0 1px 0 var(--hi), inset 0 -24px 40px -34px rgba(var(--glow), .4), 0 40px 80px -30px rgba(var(--shadow), .8);
  animation: sheet .5s var(--spring) both;
}
.gate-card h1 { font-family: var(--font-d); font-size: 27px; font-weight: 600; letter-spacing: -.03em; line-height: 1.15; }
.gate-card .sub { margin-top: -6px; line-height: 1.55; }
.gate-note { padding: 10px 12px; border-radius: 12px; font-size: 13.5px; background: rgba(var(--glow), .14); border: 1px solid rgba(var(--glow), .35); }
.gate-err { font-size: 13.5px; font-weight: 600; color: var(--danger); }
.gbtn { display: flex; align-items: center; justify-content: center; gap: 10px; padding-block: 11px; background: #fff; color: #1F1F1F; border-color: transparent; box-shadow: 0 10px 22px -14px rgba(var(--shadow), .9); }
.gate-card .or { display: flex; align-items: center; gap: 12px; }
.gate-card .or::before, .gate-card .or::after { content: ''; flex: 1; height: 1px; background: var(--line-2); }
.gate-links { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 16px; }
.gate-foot { text-align: center; font-size: 12.5px; }
.code {
  display: block; padding: 16px 10px; border-radius: 14px; text-align: center; overflow-wrap: anywhere; user-select: all; -webkit-user-select: all;
  font-family: var(--font-n); font-size: 18px; font-weight: 700; letter-spacing: .08em;
  background: var(--field); border: 1px dashed var(--line-2);
}
.gate-card > .chip { justify-self: center; }
.gate-wait { display: grid; justify-items: center; gap: 14px; padding: 30px 0; color: var(--txt-2); }
.spinner {
  width: 34px; height: 34px; border-radius: 50%;
  background: conic-gradient(from 0deg, transparent 0 40%, var(--accent-2));
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 calc(100% - 3px)); mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 calc(100% - 3px));
  animation: spin .9s linear infinite;
}
.steps { display: flex; gap: 6px; }
.steps i { flex: 1; height: 4px; border-radius: 4px; background: var(--line-2); }
.steps i.on { background: var(--accent-2); box-shadow: 0 0 10px rgba(var(--glow), .7); }
.opts { display: grid; gap: 8px; }
.opt {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; border-radius: 16px; text-align: start;
  background: var(--card); border: 1.5px solid var(--edge); color: var(--txt);
  transition: transform .3s var(--spring), opacity .2s;
}
.opt:hover { transform: translateY(-1px); background: var(--cell-h); }
.opt:active { transform: scale(.98); }
.opt.on { border-color: var(--accent-2); background: rgba(var(--glow), .18); box-shadow: 0 10px 22px -16px rgba(var(--glow), .9); }
/* a tick box at the end of each row: several can be picked */
.opt::after {
  content: '✓'; flex: none; margin-inline-start: auto; width: 22px; height: 22px; border-radius: 50%;
  display: grid; place-items: center; font-size: 13px; font-weight: 700; line-height: 1; color: transparent;
  border: 1.5px solid var(--line-2);
}
.opt.on::after { color: #fff; background: var(--accent-2); border-color: var(--accent-2); }
.opt .ic { width: 24px; height: 24px; color: var(--link); }
.opt b { display: block; font-size: 15px; font-weight: 600; }
.opt small { display: block; font-size: 12.5px; color: var(--txt-2); }
.goal-row .chip { padding: 9px 16px; font-size: 14px; }
.q-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.q-skip { justify-self: center; color: var(--txt-3); }
.starter { display: grid; gap: 8px; }
.starter li { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); }
.starter .ic { width: 18px; height: 18px; margin-top: 2px; color: var(--ok); stroke-width: 2.6; }
.starter small { margin-inline-start: 6px; font-size: 11.5px; color: var(--txt-3); }
.kv { display: grid; gap: 6px; }
.kv li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 12px; border-radius: 10px; background: var(--card); }
.fb { display: grid; gap: 8px; max-height: 240px; overflow-y: auto; }
.fb li { padding: 10px 12px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); overflow-wrap: anywhere; }
.fb small { font-size: 11.5px; color: var(--txt-3); }
.sheet-body h4 { font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--txt-3); }

/* ---- light theme: the pieces that are not just a variable ---------------------- */

/* Shown when the animated backdrop is off or cannot run: the same blues, still. */
[data-theme='light'] .backdrop {
  background:
    radial-gradient(70% 55% at 90% 106%, rgba(70, 214, 236, .50), transparent 64%),
    radial-gradient(60% 50% at 0% 110%, rgba(98, 108, 232, .40), transparent 66%),
    radial-gradient(55% 45% at 76% -10%, rgba(255, 255, 255, .42), transparent 70%),
    linear-gradient(165deg, var(--bg-a) 30%, var(--bg-b));
}
/* The page's own flat colour would sit in front of the backdrop and hide it;
   the glass needs the backdrop's colours behind it to look like glass. */
[data-theme='light'] body { background: transparent; }
[data-theme='light'] #wake { opacity: .5; }
[data-theme='light'] .scrim { background: rgba(104, 146, 220, .44); }
[data-theme='light'] .overlay { background: rgba(38, 78, 160, .36); }
[data-theme='light'] .sheet { box-shadow: inset 0 1px 0 var(--hi), inset 0 0 26px rgba(255, 255, 255, .22), 0 40px 80px -30px rgba(var(--shadow), .85); }
[data-theme='light'] .toast { box-shadow: inset 0 1px 0 var(--hi), 0 16px 34px -14px rgba(var(--shadow), .75); }
[data-theme='light'] select option { background: #DCE9FB; color: #07142B; }
/* The word that types itself sits on a strip of frosted glass, so its blue reads on the blue behind. */
[data-theme='light'] .tloop-box { background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .20) 45%, rgba(255, 255, 255, .46)); }
[data-theme='light'][dir='rtl'] .tloop-box { background: linear-gradient(270deg, transparent, rgba(255, 255, 255, .20) 45%, rgba(255, 255, 255, .46)); }
/* The edge of a pane: a rim that is bright all the way round, a glow just inside
   it, and a soft shadow underneath. :where() keeps these as weak as the plain
   rules, so the "on" and "today" looks further up still win. */
[data-theme='light'] :where(.panel, .w) {
  box-shadow: inset 0 1px 0 var(--hi), inset 0 0 0 1px rgba(255, 255, 255, .16), inset 0 0 26px rgba(255, 255, 255, .20),
    inset 0 -22px 34px -30px rgba(var(--shadow), .30), 0 26px 50px -30px rgba(var(--shadow), .62);
}
[data-theme='light'] :is(.panel, .w)::before { padding: 1.5px; }
[data-theme='light'] :where(.cell) { box-shadow: inset 0 1px 0 var(--hi), inset 0 0 14px rgba(255, 255, 255, .14), 0 8px 16px -12px rgba(var(--shadow), .55); }
[data-theme='light'] :where(.tpill) { box-shadow: inset 0 1px 0 var(--hi), inset 0 0 20px rgba(255, 255, 255, .16), 0 24px 46px -24px rgba(var(--shadow), .7); }
[data-theme='light'] :where(.chip, .btn, .round, .opt) { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .7), 0 8px 16px -10px rgba(var(--shadow), .5); }
[data-theme='light'] .btn.danger { border-color: rgba(201, 33, 62, .5); }
/* Whatever is switched on or is the main button: blue glass that glows. */
[data-theme='light'] :is(.btn.accent, .chip.on, .seg-btn.on, .round.accent, .wheel-item.on, .wheel[data-open='true'] .wheel-hub, .tdock[data-open='true'] .tdock-tab, .switch input:checked + .switch-track) {
  background: linear-gradient(180deg, rgba(40, 120, 245, .92), rgba(16, 88, 216, .92));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .55), inset 0 0 0 1px rgba(255, 255, 255, .22), inset 0 -8px 14px -8px rgba(150, 215, 255, .55), 0 10px 24px -10px rgba(var(--glow), .9);
}
[data-theme='light'] .switch-track { background: rgba(8, 36, 96, .16); box-shadow: inset 0 1px 2px rgba(var(--shadow), .3), inset 0 0 0 1px rgba(255, 255, 255, .5); }
/* What opens on top of the page blurs more, so the words under it do not show through. */
[data-theme='light'] :is(.tdock-panel, .gate-card, .toast) { -webkit-backdrop-filter: blur(24px) saturate(160%); backdrop-filter: blur(24px) saturate(160%); }
/* The calendar is the clearest pane on the page: next to no fill and only a light
   blur, so the backdrop shows straight through it and through its day boxes. */
[data-theme='light'] .cal {
  background: linear-gradient(140deg, rgba(255, 255, 255, .14), rgba(255, 255, 255, .02) 28%, rgba(255, 255, 255, 0) 58%, rgba(255, 255, 255, .05)), rgba(255, 255, 255, .02);
  -webkit-backdrop-filter: blur(5px) saturate(120%); backdrop-filter: blur(5px) saturate(120%);
  box-shadow: inset 0 1px 0 var(--hi), inset 0 0 0 1px rgba(255, 255, 255, .14), inset 0 0 20px rgba(255, 255, 255, .09), 0 26px 50px -30px rgba(var(--shadow), .62);
}
[data-theme='light'] :where(.cal .cell) { background: rgba(255, 255, 255, .03); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .7), inset 0 0 12px rgba(255, 255, 255, .08), 0 8px 16px -12px rgba(var(--shadow), .5); }
[data-theme='light'] .cell.today {
  border-color: rgba(190, 228, 255, .85);
  background: linear-gradient(180deg, #1668E3 0%, rgba(31, 122, 240, .74) 46%, rgba(70, 160, 255, .30) 100%);
}
/* The date card and the round add button: deep blue glass in place of black. */
[data-theme='light'] .w-date {
  background: linear-gradient(180deg, rgba(8, 44, 130, .88) 0%, rgba(20, 96, 224, .82) 54%, rgba(96, 186, 255, .72) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5), inset 0 0 0 1px rgba(255, 255, 255, .24), 0 14px 28px -14px rgba(var(--glow), .9);
}
[data-theme='light'] .w-add {
  background: linear-gradient(#0C2F7A, #0C2F7A) padding-box, conic-gradient(from 210deg, #6FF0B0, #6CC4FF, #C0B2FF, #6FF0B0) border-box;
  box-shadow: 0 8px 18px -6px rgba(var(--shadow), .75);
}
[data-theme='light'] .pad { --rule: repeating-linear-gradient(180deg, transparent 0, transparent calc(var(--lh) - 1px), rgba(8, 36, 96, .16) calc(var(--lh) - 1px), rgba(8, 36, 96, .16) var(--lh)); border-top-color: rgba(8, 36, 96, .22); }
[data-theme='light'] .pad-add { box-shadow: inset 0 -1px 0 rgba(8, 36, 96, .16); }
[data-theme='light'] .pad-add:focus-within { box-shadow: inset 0 -2px 0 var(--accent-2); }
[data-theme='light'] .gbtn { background: rgba(255, 255, 255, .86); }

/* ---- the privacy page -------------------------------------------------------------- */

body.doc { overflow: auto; }
.doc-in { width: min(720px, 100%); margin: 0 auto; padding: 32px 20px 64px; display: grid; gap: 18px; }
.doc-in h1 { font-family: var(--font-d); font-size: 31px; font-weight: 600; letter-spacing: -.03em; line-height: 1.2; }
.doc-in h2 { font-family: var(--font-d); font-size: 19px; font-weight: 600; margin-top: 10px; }
.doc-in p, .doc-in li { color: var(--txt-2); line-height: 1.7; }
.doc-in ul { list-style: disc; padding-inline-start: 22px; display: grid; gap: 6px; }
.doc-in a { color: var(--link); }
html:not([lang='ar']) .only-ar, html[lang='ar'] .only-en { display: none; }

/* ---- motion ------------------------------------------------------------------- */

@keyframes fu { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes sheet { from { opacity: 0; transform: translateY(18px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes toast { from { opacity: 0; transform: translateY(14px) scale(.94); } to { opacity: 1; transform: none; } }
@keyframes pop { 0% { transform: scale(1); } 40% { transform: scale(1.28); } 100% { transform: scale(1); } }
@keyframes swap { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes drop { from { opacity: 0; transform: translateY(-12px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes cellIn { from { opacity: 0; transform: translateY(10px) scale(.94); } }
@keyframes growX { from { transform: scaleX(0); } }
@keyframes growY { from { transform: scaleY(0); } }
@keyframes slideNext { from { opacity: 0; transform: translateX(28px); } to { opacity: 1; transform: none; } }
@keyframes slidePrev { from { opacity: 0; transform: translateX(-28px); } to { opacity: 1; transform: none; } }
@keyframes blink { 50% { opacity: .35; } }
@keyframes cursor { to { opacity: .35; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes sweep { from { transform: translateX(-110%); } to { transform: translateX(250%); } }
@keyframes splashIn { from { opacity: 0; transform: scale(.5) rotate(-12deg); } to { opacity: 1; transform: none; } }
@keyframes breathe { 50% { transform: scale(1.05); } }
@keyframes ripple { from { opacity: .8; transform: scale(.8); } to { opacity: 0; transform: scale(1.45); } }

.pop { animation: pop .42s var(--spring); }
.swap { animation: swap .38s var(--ease); }
.drop { animation: drop .45s var(--spring); }
.cal-grid.slide-next { animation: slideNext .4s var(--ease) both; }
.cal-grid.slide-prev { animation: slidePrev .4s var(--ease) both; }

.enter .hello > *, .enter .view-head, .enter > .panel, .enter .home-grid > .panel, .enter .set-grid > .panel, .enter .w, .enter .timer-stage > * { animation: fu .65s var(--ease) both; }
.enter .hello > :nth-child(2) { animation-delay: .06s; }
.enter .home-grid > .panel, .enter > .panel { animation-delay: .1s; }
.enter .w:nth-child(1) { animation-delay: .16s; } .enter .w:nth-child(2) { animation-delay: .21s; }
.enter .w:nth-child(3) { animation-delay: .26s; } .enter .w:nth-child(4) { animation-delay: .31s; }
.enter .w:nth-child(5) { animation-delay: .36s; } .enter .w:nth-child(6) { animation-delay: .41s; }
.enter .w:nth-child(7) { animation-delay: .46s; }
.enter .set-grid > .panel:nth-child(n) { animation-delay: calc(.05s * var(--n, 1)); }
.enter .timer-stage > :nth-child(2) { animation-delay: .1s; } .enter .timer-stage > :nth-child(3) { animation-delay: .16s; }
.enter .timer-stage > :nth-child(4) { animation-delay: .22s; }
.enter .cell { animation: cellIn .55s var(--ease) both; animation-delay: calc(var(--i) * 11ms + 120ms); }
.enter .cell-bar i { animation: growX .8s var(--ease) both; animation-delay: calc(var(--i) * 11ms + 380ms); }
.enter .timeline > * { animation: fu .55s var(--ease) both; animation-delay: calc(var(--i) * 45ms + 220ms); }
.enter .tracker-bar i { animation: growY 1s var(--ease) both; animation-delay: .35s; }
.enter .bar-col i { animation: growY .9s var(--ease) both; animation-delay: calc(var(--i) * 60ms + 200ms); }
.enter .strip-day { animation: fu .5s var(--ease) both; }

.calm *, .calm *::before, .calm *::after { animation-duration: .001ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

/* ---- responsive --------------------------------------------------------------- */

/* Laptop and desktop: two columns that fill the window height. The calendar
   stretches to the bottom edge; the widget column and the day list scroll on
   their own if they are taller than the screen. */
@media (min-width: 1100px) and (min-height: 640px) {
  .slot[data-view='home'], .slot[data-view='day'] { height: 100%; }
  .view.home { height: 100%; display: grid; grid-template-rows: auto minmax(0, 1fr); }
  /* One line: the name, then the greeting and the line of the moment. It wraps
     before it can run under the timer tab in the corner. */
  .hello { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 30px; padding-inline-end: 150px; }
  .home-grid { align-items: stretch; min-height: 0; }
  .cal { display: flex; flex-direction: column; min-height: 0; }
  .cal-grid { flex: 1; min-height: 0; grid-auto-rows: minmax(0, 1fr); }
  .cell { aspect-ratio: auto; min-height: 0; }
  .widgets {
    min-height: 0; overflow-y: auto; align-content: start; grid-template-rows: repeat(5, max-content) minmax(224px, 1fr);
    padding: 4px 0 8px; padding-inline-end: 8px; margin: -4px 0 0; margin-inline-end: -8px; scrollbar-width: thin; scrollbar-color: var(--line-2) transparent;
  }

  .view.day { height: 100%; align-items: stretch; }
  .day-panel { display: flex; flex-direction: column; min-height: 0; }
  .day-body { flex: 1; min-height: 0; overflow-y: auto; margin-inline-end: -8px; padding-inline-end: 8px; scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
  .day-side { align-content: start; grid-auto-rows: max-content; min-height: 0; overflow-y: auto; scrollbar-width: none; padding-top: 4px; margin-top: -4px; }
}

/* Wide screens: the widgets sit three across, so the whole column fits the
   height and the calendar boxes stay close to square. */
@media (min-width: 1400px) and (min-height: 640px) {
  .home-grid { grid-template-columns: minmax(0, 1fr) clamp(500px, 36vw, 860px); }
  .widgets { grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: repeat(4, max-content) minmax(224px, 1fr); }
  .w-timer, .w-week, .w-notes { grid-column: span 3; }
}

/* Big screens: the priorities and the notepad share the last row, so the whole
   column still fits the height. Long lists scroll inside their own card. */
@media (min-width: 1700px) and (min-height: 640px) {
  .widgets { grid-template-columns: repeat(6, minmax(0, 1fr)); grid-template-rows: repeat(3, max-content) minmax(224px, 1fr); }
  .widgets > .w { grid-column: span 2; }
  .widgets > .w-today { grid-column: span 4; }
  .widgets > .w-timer { grid-column: span 6; }
  .widgets > .w-week, .widgets > .w-notes { grid-column: span 3; }
  .w-week .prio { min-height: 0; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
}

/* Wide but short windows keep two columns and scroll the page instead. */
@media (min-width: 1100px) and (max-height: 639px) {
  .cell { aspect-ratio: 1 / .58; }
}

/* Short desktop windows: tighten the header so the calendar keeps its height. */
@media (min-width: 1100px) and (max-height: 760px) {
  .stage { padding-top: 18px; padding-bottom: 18px; }
  .hello { margin-bottom: var(--s4); }
  .hello { gap: 4px; }
  .brand-loop { font-size: 32px; }
  .tdock { top: 16px; }
  .cal-head { margin-bottom: 12px; }
  .panel { padding: 18px; }
}

/* Big monitors: more room, so bigger type and controls. */
@media (min-width: 1700px) and (min-height: 960px) {
  body { font-size: 16px; }
  .shell { grid-template-columns: 104px minmax(0, 1fr); }
  .rail { padding-top: 26px; }
  .rail .brand-mark { width: 54px; height: 54px; }
  .wheel { width: 68px; height: 68px; --r: 172px; --r2: 92px; }
  .wheel-hub .ic { width: 26px; height: 26px; }
  .wheel-item { left: -30px; top: -30px; width: 60px; height: 60px; }
  .wheel-item .ic { width: 22px; height: 22px; }
  .wheel-item.util { left: -23px; top: -23px; width: 46px; height: 46px; }
  .wheel-label { font-size: 14.5px; }
  .tdock { top: 32px; }
  .tdock-tab { height: 46px; font-size: 14.5px; }
  .stage { padding-top: 32px; padding-bottom: 32px; }
  .view-head h1 { font-size: 38px; }
  .brand-loop { font-size: 52px; }
  .hello-hi { font-size: 22px; }
  .quote { font-size: 21px; }
  .panel { padding: 28px; border-radius: 26px; }
  .pick select { font-size: 28px; padding-inline-end: 28px; }
  .cal-dows { font-size: 14.5px; gap: 12px; }
  .cal-grid { gap: 12px; }
  .cell { border-radius: 18px; }
  .cell-num { top: 14px; inset-inline-start: 17px; font-size: 19px; }
  .cell-bar { left: 16px; right: 16px; bottom: 14px; height: 4px; }
  .widgets { gap: 16px; }
  .w { padding: 20px; border-radius: 28px; min-height: 148px; }
  .w-label { font-size: 12px; }
  .w-big { font-size: 44px; }
  .w-sub, .w-empty { font-size: 14px; }
  .w-today { grid-template-columns: 164px minmax(0, 1fr); padding: 14px; }
  .w-date { min-height: 152px; padding: 16px; border-radius: 18px; }
  .w-date-big { font-size: 35px; }
  .w-date-sub { font-size: 15px; }
  .w-up h3 { font-size: 12.5px; }
  .w-up li b { font-size: 16.5px; }
  .w-up li span { font-size: 13px; }
  .w-add { width: 48px; height: 48px; }
  .ring { width: 88px; height: 88px; }
  .ring-num { font-size: 21px; }
  .tpill.compact { min-height: 96px; }
  .tpill.compact .tpill-time { font-size: 42px; }
  .tpill.compact .tbtn { width: 56px; height: 56px; }
  .tpill.compact .tpill-top, .tpill.compact .tpill-label { font-size: 13px; }
  .day-title h1 { font-size: 38px; }
  .strip-day { font-size: 18.5px; padding: 10px 0 14px; }
  .strip-day small { font-size: 12.5px; }
  .tcard { margin-bottom: 14px; }
  .tcard-in { padding: 16px 22px; border-radius: 20px; }
  .tcard-title { font-size: 20px; }
  .tcard-right { font-size: 18.5px; }
  .tcard-row.sub { font-size: 15px; }
  .plat { font-size: 13.5px; padding: 7px 15px; padding-inline-start: 10px; }
  .tracker-bar { height: 280px; width: 12px; }
  .tracker-num b { font-size: 25px; }
  .w-quote p { font-size: 22px; }
  .stat-cards { gap: 18px; }
  .bars { height: 280px; --bar-w: 84px; }
  .heat-wrap { --hs: 24px; }
  .heat-cell { border-radius: 6px; }
  .set-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s5); }
  .set.wide { grid-column: 1 / -1; }
}

@media (min-width: 1400px) and (max-width: 1699px) {
  .heat-wrap { --hs: 18px; }
  .bars { --bar-w: 64px; }
}

/* Tablets and narrow windows: one column, the page scrolls. */
@media (max-width: 1099px) {
  .home-grid { grid-template-columns: minmax(0, 1fr); }
  .widgets { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .w-week, .w-notes { grid-column: span 2; }
  .view.day { grid-template-columns: minmax(0, 1fr); }
  .day-side { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .stat-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cell { aspect-ratio: 1 / .74; }
}

/* Phones on their side and other short windows: a slimmer gutter and a tighter menu. */
@media (min-width: 761px) and (max-height: 600px) {
  .shell { grid-template-columns: 70px minmax(0, 1fr); }
  .rail { padding-top: 10px; padding-bottom: 8px; }
  .rail .brand-mark { width: 34px; height: 34px; }
  .wheel { width: 52px; height: 52px; --r: 128px; --r2: 72px; --step: 34deg; --ustep: 42deg; }
  .brand-loop { font-size: 28px; }
  .tdock { top: 10px; }
  .tdock-tab { height: 36px; }
}

@media (max-width: 760px) {
  .shell { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
  .topbar { display: flex; align-items: center; gap: 10px; min-height: 50px; padding: calc(8px + var(--top-extra, 0px) + env(safe-area-inset-top)) 124px 4px max(16px, env(safe-area-inset-left)); }
  [dir='rtl'] .topbar { padding-left: 124px; padding-right: max(16px, env(safe-area-inset-right)); }
  .topbar .brand-mark { width: 30px; height: 30px; flex: none; }
  .topbar .brand-loop { font-size: 22px; }

  /* The menu button sits at the top right. On the home screen it drops to just
     under the Set timer tab; on the other pages it takes the tab's place in the
     top bar. The pages fan out from it down and to the left, Calendar first. */
  .rail { position: fixed; top: calc(4px + var(--top-extra, 0px) + env(safe-area-inset-top)); right: max(10px, env(safe-area-inset-right)); left: auto; bottom: auto; padding: 0; pointer-events: none; transition: transform .45s var(--spring), opacity .2s; }
  [dir='rtl'] .rail { right: auto; left: max(10px, env(safe-area-inset-left)); }
  .shell[data-dock='on'] .rail { transform: translateY(52px); }
  /* The quick timer opens over the menu button: the button steps aside so the panel's X can be tapped. */
  .shell[data-timer-open='true'] .rail { opacity: 0; }
  .shell[data-timer-open='true'] .wheel { pointer-events: none; }
  .rail .brand { display: none; }
  .wheel { width: 52px; height: 52px; margin: 0; pointer-events: auto; --base: 134deg; --step: -22deg; --r: 176px; --r2: 96px; --ustep: 40deg; }
  .wheel-hub .ic { width: 21px; height: 21px; }
  .wheel-hub { box-shadow: inset 0 1px 0 var(--hi), 0 16px 34px -10px rgba(var(--shadow), 1), 0 0 0 1px rgba(var(--glow), .25); }
  .wheel-item { left: -30px; top: -30px; width: 60px; height: 60px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }
  .wheel-item .ic { width: 19px; height: 19px; }
  .wheel-item.util { left: -21px; top: -21px; width: 42px; height: 42px; }
  .wheel-label { position: static; translate: none; padding: 0; border: 0; background: none; font-size: 9.5px; font-weight: 700; letter-spacing: .01em; color: inherit; }
  .scrim { background: rgba(1, 3, 10, .64); }
  [data-theme='light'] .scrim { background: rgba(104, 146, 220, .56); }

  .stage { padding: 10px max(14px, env(safe-area-inset-right)) calc(24px + env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left)); }
  .view-head h1 { font-size: 25px; }
  .hello { gap: 4px; }
  .hello .brand-loop { display: none; }
  .hello-line { display: grid; gap: 6px; justify-items: start; }
  .hello-hi { font-size: 25px; letter-spacing: -.03em; padding-inline-end: 60px; }
  .quote { font-size: 15px; }
  .quote .tloop-box, .quote .tloop-word { white-space: normal; }
  .tdock { top: calc(8px + var(--top-extra, 0px) + env(safe-area-inset-top)); }
  .tdock-tab { height: 38px; }
  .panel { padding: 14px; border-radius: 20px; }

  .cal-pick { gap: 10px; }
  .pick select { font-size: 19px; }
  .cal-dows, .cal-grid { gap: 5px; }
  .cal-dows { text-align: center; padding: 0 0 8px; font-size: 11.5px; }
  .cal-dows .full { display: none; }
  .cal-dows .short { display: inline; }
  .cell { aspect-ratio: 1 / 1.08; border-radius: 12px; }
  .cell-num { top: 7px; inset-inline-start: 7px; font-size: 11.5px; letter-spacing: 0; }
  .cell-bar { left: 7px; right: 7px; bottom: 7px; }

  .widgets { display: flex; overflow-x: auto; gap: 12px; margin: 0 -14px; padding: 4px 14px 14px; scroll-snap-type: x proximity; scrollbar-width: none; }
  .widgets::-webkit-scrollbar { display: none; }
  .w { flex: 0 0 164px; scroll-snap-align: start; }
  .w-today { flex-basis: 316px; }
  .w-timer { flex-basis: 290px; }
  .w-week, .w-notes { flex-basis: 300px; }
  .pad { max-height: calc(var(--lh) * 6); }

  .day-head { gap: 12px; }
  .day-title h1 { font-size: 24px; }
  .strip { padding: 6px; gap: 4px; margin-top: 14px; }
  .strip .round { display: none; }
  .day-body { grid-template-columns: minmax(0, 1fr) 46px; gap: 8px; }
  .timeline { padding-inline-start: 26px; }
  .tdot { inset-inline-start: -25px; width: 14px; height: 14px; margin-top: -7px; }
  .timeline::before { inset-inline-start: 7px; }
  .tcard-in { padding: 11px 12px; }
  .tcard-title { font-size: 16px; }
  .tcard-row.sub { flex-wrap: wrap; gap: 8px; }
  .plat { padding: 5px 10px; padding-inline-start: 7px; }
  .composer input[type='time'] { max-width: 96px; }
  .tracker-bar { height: 170px; width: 8px; }
  .tracker-num b { font-size: 16px; }
  .tracker-num span { font-size: 8px; letter-spacing: .04em; }
  .day-side { grid-template-columns: minmax(0, 1fr); }

  .tpill { min-height: 108px; padding: 14px 18px; }
  .tbtn { width: 56px; height: 56px; }
  .tpill-time { font-size: 50px; }
  .timer-stage { margin-top: 16px; }

  .stat-cards { gap: 10px; }
  .bars { gap: 6px; height: 180px; }
  .set-grid { grid-template-columns: minmax(0, 1fr); }
  .set.wide { grid-column: auto; }
  .toasts { bottom: calc(24px + env(safe-area-inset-bottom)); }
}

/* ---- Arabic: right to left -------------------------------------------------------
   Layout mirrors itself through flex, grid and the logical properties above.
   What is left here are the things that point in a direction. */

html[lang='ar'] * { letter-spacing: normal !important; }
html[lang='ar'] body { line-height: 1.65; }
html[lang='ar'] :is(h1, .brand-loop, .hello-hi, .quote, .w-big, .w-date-big, .tcard-title, .w-quote p) { line-height: 1.45; }
html[lang='ar'] :is(.eyebrow, .w-label, .w-up h3, .tracker-num span, .sheet-body h4) { font-size: 12.5px; }
html[lang='ar'] .cell-num, html[lang='ar'] .code { letter-spacing: .03em !important; }

[dir='rtl'] .flip .ic { transform: scaleX(-1); }
/* Text people typed may be English inside an Arabic page: cut it at its own end, not its start. */
[dir='rtl'] :is(.w-up li b, .w-up li span, .tpill-label, .track-name, .tcard-title, .prio li span, .pad-text, .w-place span) { unicode-bidi: plaintext; }
[dir='rtl'] :is(.w-up li b, .w-up li span, .tcard-title, .prio li span, .pad-text) { text-align: right; }
[dir='rtl'] input[dir='ltr'] { text-align: right; }
[dir='rtl'] .rail { padding-left: 0; padding-right: env(safe-area-inset-right); }
/* The menu opens toward the middle of the screen: mirror every angle. */
[dir='rtl'] .wheel-item { --a: calc(180deg - var(--base) - var(--o) * var(--step)); }
[dir='rtl'] .wheel-item.util { --a: calc(180deg - var(--base) - var(--o) * var(--ustep)); }
[dir='rtl'] .switch input:checked + .switch-track::after { transform: translateX(-18px); }
[dir='rtl'] .quote:hover, [dir='rtl'] .result:hover, [dir='rtl'] button.tcard-in:hover, [dir='rtl'] .tcard:hover > div.tcard-in { transform: translateX(-3px); }
[dir='rtl'] .tloop-box { background: linear-gradient(270deg, transparent, rgba(var(--glow), .10) 45%, rgba(var(--glow), .30)); }
[dir='rtl'] .cell-bar i, [dir='rtl'] .strip-bar { transform-origin: right; }
[dir='rtl'] .tdock-tab { transform: translateX(-8px); }
[dir='rtl'] .tdock-tab:hover, [dir='rtl'] .tdock[data-open='true'] .tdock-tab { transform: none; }
[dir='rtl'] .tdock-tab:active { transform: translateX(-4px) scale(.97); }
[dir='rtl'] .tdock-panel { transform-origin: 0 0; transform: translateX(-18px) scale(.92); }
[dir='rtl'] .tdock[data-open='true'] .tdock-panel { transform: none; }
[dir='rtl'] .cal-grid.slide-next { animation-name: slidePrev; }
[dir='rtl'] .cal-grid.slide-prev { animation-name: slideNext; }
[dir='rtl'] .splash-bar i { animation-direction: reverse; }
@media (max-width: 760px) {
  [dir='rtl'] .rail { padding-right: 0; }
}

/* Installed on a phone's Home Screen the app runs under the clock and the
   battery: the top row sits a little lower so it is clear of them. */
@media (max-width: 760px) and (display-mode: standalone) {
  :root { --top-extra: 12px; }
}

/* iPhone Home Screen apps can lay the page out short of the bottom of the screen
   (an iOS 26 bug), which leaves an empty strip there. boot.js measures the
   missing strip into --vp-gap and every full-screen layer reaches down over it.
   Everywhere else the strip is 0 and these rules change nothing. */
.backdrop, .grain, .shell, .scrim, .overlay, .splash, .gate { bottom: calc(0px - var(--vp-gap, 0px)); }
/* Stretching the layers is not enough on its own: iOS does not draw them below the
   short edge. It only lays the app out short while the page itself is shorter than
   the screen (WebKit bug 301108), so the page is made at least as tall as the screen
   and iOS then gives it the whole screen (--vp-gap goes back to 0 by itself). The
   min() keeps the page from scrolling on phones where the top inset is 0. */
@media (display-mode: standalone) {
  html.app { min-height: min(100lvh, calc(100% + env(safe-area-inset-top, 0px))); }
}
#bg, #wake { height: calc(100% + var(--vp-gap, 0px)); }
.toasts { margin-bottom: calc(0px - var(--vp-gap, 0px)); }

/* On a touch screen "hover" sticks after a tap, which left the line of the day
   nudged sideways until the next tap somewhere else. */
@media (hover: none) {
  .quote:hover, [dir='rtl'] .quote:hover { transform: none; }
}

/* ---- the boards under the calendar on phones and tablets: two layouts ----------
   "carousel": one row that slides sideways.
   "stack": big boards one under the other, arranged as on a computer.
   A phone starts with the carousel and a tablet with the stack; the choice is in
   Settings > Appearance and is kept per device. */
@media (min-width: 1100px) {
  .only-small { display: none; }
}
@media (max-width: 760px) {
  html[data-boards='stack'] .widgets { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; overflow: visible; margin: 0; padding: 0 0 14px; scroll-snap-type: none; }
  html[data-boards='stack'] .w { min-height: 150px; }
  html[data-boards='stack'] :is(.w-today, .w-timer, .w-week, .w-notes) { grid-column: span 2; }
  html[data-boards='stack'] :is(.w-week, .w-notes) { min-height: 400px; }
  html[data-boards='stack'] .pad { max-height: none; }
}
@media (min-width: 761px) and (max-width: 1099px) {
  html:not([data-boards='carousel']) .widgets { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 16px; }
  html:not([data-boards='carousel']) .widgets > .w { grid-column: span 2; min-height: 176px; }
  html:not([data-boards='carousel']) .widgets > .w-today { grid-column: span 4; }
  html:not([data-boards='carousel']) .widgets > .w-timer { grid-column: span 6; min-height: 0; }
  html:not([data-boards='carousel']) .widgets > :is(.w-week, .w-notes) { grid-column: span 3; min-height: 560px; }

  html[data-boards='carousel'] .widgets { display: flex; overflow-x: auto; gap: 14px; padding: 4px 2px 16px; scroll-snap-type: x proximity; scrollbar-width: none; overscroll-behavior-x: contain; }
  html[data-boards='carousel'] .widgets::-webkit-scrollbar { display: none; }
  html[data-boards='carousel'] .w { flex: 0 0 220px; scroll-snap-align: start; }
  html[data-boards='carousel'] .w-today { flex-basis: 420px; }
  html[data-boards='carousel'] .w-timer { flex-basis: 380px; }
  html[data-boards='carousel'] :is(.w-week, .w-notes) { flex-basis: 380px; }
  html[data-boards='carousel'] .pad { max-height: calc(var(--lh) * 7); }
}

/* ---- the day view: this day's own priorities and notes ------------------------
   The same two boards as on the home screen, in the column beside the day (under
   it on tablets and phones). A long list scrolls inside its own card. The rules
   for the home boards above reach these two as well, so their place in the
   column is set here last. */
/* (The home screen's "Big" layout makes boards two columns wide; in this one-column
   stack that used to push a board into a column of its own.) */
html .day-side > .w.w { grid-column: auto; }
html .day-side > .w.w:is(.w-week, .w-notes) { min-height: 0; }
.day-side .w-week .prio { max-height: 216px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
html .day-side .pad { max-height: calc(var(--lh) * 7); }
@media (min-width: 761px) and (max-width: 1099px) {
  /* Tablets: the timer across the top, then priorities beside notes, then the two small boards. */
  .day-side { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  html .day-side > .w.w { grid-column: span 3; }
  html .day-side > .w.w.w-timer { grid-column: span 6; }
  html .day-side > .w.w:is(.w-week, .w-notes) { min-height: 300px; }
}

/* ---- assistant ---------------------------------------------------------------
   A small round face in a corner of the app; press it and a chat opens beside
   it. On a computer or tablet it sits at the foot of the left gutter, which is
   otherwise empty; on a phone it sits beside the menu button, at the top. */
.shell { --rail-w: 84px; }
@media (min-width: 1700px) and (min-height: 960px) { .shell { --rail-w: 104px; } }
@media (min-width: 761px) and (max-height: 600px) { .shell { --rail-w: 70px; } }

.buddy {
  position: fixed; z-index: 71; bottom: calc(18px - var(--vp-gap, 0px)); padding: 0; border: 0; border-radius: 50%; background: none;
  inset-inline-start: calc(env(safe-area-inset-left) + (var(--rail-w) - env(safe-area-inset-left) - 46px) / 2);
  font-size: 46px; line-height: 0; transition: transform .4s var(--spring), opacity .25s;
}
[dir='rtl'] .buddy { inset-inline-start: calc(env(safe-area-inset-right) + (var(--rail-w) - env(safe-area-inset-right) - 46px) / 2); }
.buddy:hover { transform: translateY(-3px) scale(1.08); }
.buddy:active { transform: scale(.9); }
.buddy:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 4px; }

/* The ball itself. Sized in em, so the big one in an empty chat is the same drawing. */
.buddy-orb {
  position: relative; display: grid; place-items: center; flex: none; width: 1em; height: 1em; border-radius: 50%;
  background: radial-gradient(circle at 36% 26%, #E4F1FF 0%, #A5CFFF 24%, #62A8FA 56%, #3A82EC 82%, #2C6BD8 100%);
  box-shadow: 0 0 .42em rgba(var(--glow), .7), 0 .14em .3em -.08em rgba(var(--shadow), .7), inset 0 -.14em .2em rgba(24, 76, 190, .5), inset 0 .05em .07em rgba(255, 255, 255, .75);
}
.buddy-orb.big { font-size: 76px; }
.ask-head .buddy-orb { font-size: 30px; }
.buddy-eyes { display: flex; gap: .2em; transition: transform .36s var(--ease); }
.buddy-eyes i { display: block; width: .1em; height: .23em; border-radius: .06em; background: #fff; box-shadow: 0 0 .12em rgba(255, 255, 255, .95); transition: transform .12s ease; }
.buddy-eyes[data-look='l'] { transform: translateX(-.13em); }
.buddy-eyes[data-look='r'] { transform: translateX(.13em); }
.buddy-eyes.blink i { transform: scaleY(.12); }
/* A ring lights up around the face while its chat is open. */
.buddy::after {
  content: ''; position: absolute; inset: -6px; border-radius: 50%; border: 1px solid rgba(var(--glow), .6); pointer-events: none;
  opacity: 0; transform: scale(.8); transition: transform .5s var(--spring), opacity .3s;
}
.buddy[aria-expanded='true']::after { opacity: 1; transform: none; }

/* The chat: one pane of glass that pops out beside the face. */
.ask-panel {
  position: fixed; z-index: 64; inset-inline-start: calc(var(--rail-w) + 6px); bottom: calc(16px - var(--vp-gap, 0px));
  width: min(400px, calc(100vw - var(--rail-w) - 22px)); height: min(640px, calc(100dvh - 32px));
  display: grid; grid-template-rows: auto minmax(0, 1fr) auto auto; gap: var(--s3); padding: 14px; border-radius: 24px;
  background: var(--sheen), var(--sheet); border: 1px solid var(--edge-2);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  box-shadow: inset 0 1px 0 var(--hi), 0 40px 80px -30px rgba(var(--shadow), .9), 0 0 0 1px rgba(var(--glow), .12);
  transform-origin: 0 100%; transition: transform .5s var(--spring), opacity .22s, visibility 0s;
}
[dir='rtl'] .ask-panel { transform-origin: 100% 100%; }
.ask-panel[data-open='false'] {
  opacity: 0; visibility: hidden; pointer-events: none; transform: translateX(-22px) scale(.92);
  transition: transform .26s var(--ease), opacity .2s, visibility 0s linear .26s;
}
[dir='rtl'] .ask-panel[data-open='false'] { transform: translateX(22px) scale(.92); }

.ask-head { display: flex; align-items: center; gap: 10px; padding: 2px 2px 12px; border-bottom: 1px dashed var(--line-2); }
.ask-head h2 { flex: 1; min-width: 0; font-family: var(--font-d); font-size: 18px; font-weight: 600; letter-spacing: -.01em; }
.ask-head .icon-btn .ic { width: 17px; height: 17px; }

.ask-log {
  min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--line-2) transparent;
  display: flex; flex-direction: column; gap: 10px; padding: 4px 2px 6px; border-radius: var(--r-md);
}
.ask-log:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }
/* Pushes a short conversation down to sit just above the box. */
.ask-log > :first-child { margin-top: auto; }

.ask-msg { display: flex; max-width: 86%; }
.ask-msg.me { align-self: flex-end; }
.ask-msg.bot { align-self: flex-start; }
.ask-msg.wide { width: 100%; max-width: none; }
.ask-msg.new { animation: fu .45s var(--ease) both; }
.ask-msg p {
  margin: 0; padding: 10px 14px; border-radius: 18px; font-size: 15px; line-height: 1.5; overflow-wrap: anywhere; white-space: pre-wrap;
  background: var(--card); border: 1px solid var(--edge); color: var(--txt);
}
.ask-msg.bot p { border-end-start-radius: 6px; }
.ask-msg.me p { border-end-end-radius: 6px; background: var(--accent); border-color: transparent; color: #fff; box-shadow: 0 10px 22px -12px rgba(var(--glow), .9), inset 0 1px 0 rgba(255, 255, 255, .25); }
[data-theme='light'] .ask-msg.me p { background: linear-gradient(180deg, rgba(40, 120, 245, .92), rgba(16, 88, 216, .92)); }

/* Three dots while the AI reads a message. They only exist during the wait. */
.ask-wait { display: flex; align-items: center; gap: 5px; min-height: 23px; }
.ask-wait i { width: 7px; height: 7px; border-radius: 50%; background: var(--txt-2); animation: ask-dot 1.1s ease-in-out infinite; }
.ask-wait i:nth-child(2) { animation-delay: .16s; }
.ask-wait i:nth-child(3) { animation-delay: .32s; }
@keyframes ask-dot { 0%, 60%, 100% { opacity: .3; transform: none; } 30% { opacity: 1; transform: translateY(-3px); } }
.ask-empty .hint { max-width: 34ch; }

.ask-empty { margin: auto; display: grid; justify-items: center; gap: var(--s4); padding: var(--s4); text-align: center; }
.ask-empty h3 { font-family: var(--font-d); font-size: 20px; font-weight: 600; letter-spacing: -.02em; line-height: 1.3; max-width: 20ch; }

/* What the assistant is about to add, and what it found. */
.ask-card {
  width: 100%; display: grid; gap: var(--s3); padding: var(--s4); border-radius: 18px; border-end-start-radius: 6px;
  background: var(--card); border: 1px solid var(--edge-2); box-shadow: inset 0 1px 0 var(--hi);
}
.ask-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: var(--s3); }
/* All seven weekdays stay on one line, however narrow the card. */
.ask-days { display: grid; grid-template-columns: repeat(7, minmax(0, 38px)); gap: 6px; }
.ask-days .dayb { width: 100%; height: auto; aspect-ratio: 1; }
.ask-card.is-added { border-color: color-mix(in srgb, var(--ok) 55%, transparent); gap: 4px; }
.ask-card.is-cancelled, .ask-card.is-undone { gap: 4px; opacity: .62; }
.ask-state { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700; letter-spacing: .04em; color: var(--txt-2); }
.is-added .ask-state { color: var(--ok); }
.ask-state .ic { width: 15px; height: 15px; stroke-width: 2.6; }
.ask-item { font-family: var(--font-d); font-size: 17px; font-weight: 600; letter-spacing: -.01em; overflow-wrap: anywhere; }
.is-cancelled .ask-item, .is-undone .ask-item { text-decoration: line-through; text-decoration-thickness: 1.5px; }
.ask-meta { font-size: 13.5px; color: var(--txt-2); }
.ask-acts { margin-top: 8px; }
/* A changed thing that was put back is still there: it is not struck through. */
.ask-card.keep .ask-item { text-decoration: none; }
/* Cards for a tick, a delete, the timer and a setting. */
.ask-targets li { display: flex; align-items: baseline; gap: 9px; padding: 5px 0; font-size: 15px; line-height: 1.4; }
.ask-targets.gone li > span { color: var(--txt-3); text-decoration: line-through; }
.ask-set { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.ask-set span { font-size: 14px; font-weight: 500; color: var(--txt-2); }
.ask-set i { font-style: normal; color: var(--txt-3); }
[dir='rtl'] .ask-set i { transform: scaleX(-1); }
.ask-clock { font-family: var(--font-n, var(--font-d)); font-size: 26px; letter-spacing: .02em; font-variant-numeric: tabular-nums; }
.is-cancelled .ask-targets, .is-undone .ask-targets { opacity: .9; }
/* Several things share the name: tap the one that was meant. */
.ask-options { display: grid; gap: 6px; }
.ask-option {
  width: 100%; display: flex; align-items: baseline; gap: 9px; padding: 10px 12px; border-radius: 12px; text-align: start; font-size: 15px; color: inherit;
  background: var(--cell); border: 1px solid var(--line-2); transition: transform .3s var(--spring), opacity .2s;
}
.ask-option > span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.ask-option small { flex: none; font-size: 12.5px; font-weight: 600; color: var(--txt-2); white-space: nowrap; }
.ask-option:hover { transform: translateY(-1px); border-color: var(--accent-2); }
.ask-option:active { transform: scale(.98); opacity: .8; }
.ask-option:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }

.ask-card h3 { font-size: 11.5px; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; color: var(--txt-3); margin-top: 2px; }
.ask-card ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.ask-day li, .ask-week > ul:not(.ask-week-list) li { display: flex; align-items: baseline; gap: 9px; padding: 5px 0; font-size: 14.5px; line-height: 1.4; }
.ask-card li > span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.ask-card li.done > span { color: var(--txt-3); text-decoration: line-through; }
.ask-card li small, .ask-at { flex: none; font-size: 12.5px; font-weight: 600; color: var(--txt-2); white-space: nowrap; }
.ask-tick { align-self: center; flex: none; width: 16px; height: 16px; display: grid; place-items: center; border-radius: 50%; border: 1.5px solid var(--line-2); color: var(--on-accent); }
.done > .ask-tick { background: var(--ok); border-color: var(--ok); }
.ask-tick .ic { width: 10px; height: 10px; stroke-width: 3.4; }

.ask-day-head, .ask-week-row {
  width: 100%; display: grid; gap: 4px; padding: 0; background: none; border: 0; border-radius: 10px; color: inherit; text-align: start;
  transition: transform .3s var(--spring), opacity .2s;
}
.ask-day-head b { font-family: var(--font-d); font-size: 18px; font-weight: 600; letter-spacing: -.01em; }
.ask-day-head span { font-size: 13px; color: var(--txt-2); }
.ask-day-head:hover, .ask-week-row:hover { transform: translateX(3px); }
[dir='rtl'] .ask-day-head:hover, [dir='rtl'] .ask-week-row:hover { transform: translateX(-3px); }
.ask-day-head:active, .ask-week-row:active { opacity: .7; }
.ask-bar { display: block; height: 5px; margin-top: 4px; border-radius: 99px; background: var(--cell-h); overflow: hidden; }
.ask-bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transform: scaleX(var(--p, 0)); transform-origin: left; }
[dir='rtl'] .ask-bar i { transform-origin: right; }
.ask-week-list { gap: 0 !important; }
.ask-week-list li + li { border-top: 1px solid var(--line); }
.ask-week-row { grid-template-columns: 104px minmax(0, 1fr); align-items: baseline; gap: 10px; padding: 9px 2px; font-size: 14px; }
.ask-week-row b { font-weight: 600; color: var(--txt-2); white-space: nowrap; }
.ask-week-row span { color: var(--txt); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ask-week-row.is-today b { color: var(--accent-2); }

.ask-chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px; margin: -2px; }
.ask-chips::-webkit-scrollbar { display: none; }
.ask-form { display: flex; align-items: center; gap: 10px; }
.ask-form input { border-radius: 999px; padding: 12px 18px; font-size: 16px; }
.ask-form .round { width: 46px; height: 46px; }
.ask-form .round .ic { width: 19px; height: 19px; }

@media (max-width: 760px) {
  /* Phones: the face sits beside the menu button and moves with it (under the
     Set timer tab on the home screen, in the top bar on the other pages). The
     chat opens from there and fills the screen, shrinking to stay above the keyboard. */
  .buddy {
    z-index: 60; bottom: auto; font-size: 42px;
    top: calc(9px + var(--top-extra, 0px) + env(safe-area-inset-top));
    inset-inline-start: auto; inset-inline-end: calc(max(10px, env(safe-area-inset-right)) + 60px);
    transition: transform .4s var(--spring), translate .45s var(--spring), opacity .25s;
  }
  [dir='rtl'] .buddy { inset-inline-start: auto; inset-inline-end: calc(max(10px, env(safe-area-inset-left)) + 60px); }
  .buddy:hover { transform: scale(1.08); }
  .shell[data-dock='on'] .buddy { translate: 0 52px; }
  /* The greeting stops short of the face and the menu button; a long name is cut with dots. */
  .hello-hi { padding-inline-end: 0; max-width: calc(100% - 112px); overflow: hidden; text-overflow: ellipsis; }
  /* It steps aside for its own chat, the quick timer and the open menu. */
  .shell[data-chat='open'] .buddy, .shell[data-timer-open='true'] .buddy, .shell:has(.wheel[data-open='true']) .buddy { opacity: 0; pointer-events: none; transform: scale(.6); }
  /* The chat fills the screen: the menu button steps aside, as it does for the quick timer. */
  .shell[data-chat='open'] .rail { opacity: 0; }
  .shell[data-chat='open'] .wheel { pointer-events: none; }
  .ask-panel {
    --top: calc(8px + var(--top-extra, 0px) + env(safe-area-inset-top));
    inset-inline: 8px; width: auto; bottom: auto; top: calc(var(--vv-top, 0px) + var(--top));
    height: calc(var(--vv-h, 100dvh) - var(--top) - 8px - env(safe-area-inset-bottom));
    padding: 12px; gap: 10px; border-radius: 22px; transform-origin: calc(100% - 80px) 40px;
  }
  [dir='rtl'] .ask-panel { transform-origin: 80px 40px; }
  .ask-panel[data-open='false'] { transform: translateX(28px) scale(.94); }
  [dir='rtl'] .ask-panel[data-open='false'] { transform: translateX(-28px) scale(.94); }
  .ask-card { padding: 14px; }
  .ask-week-row { grid-template-columns: 92px minmax(0, 1fr); }
}
/* A light page behind it: the ball keeps a soft white rim so it reads against blue. */
[data-theme='light'] .buddy-orb { box-shadow: 0 0 0 1px rgba(255, 255, 255, .7), 0 0 .4em rgba(var(--glow), .75), 0 .16em .34em -.08em rgba(var(--shadow), .8), inset 0 -.14em .2em rgba(24, 76, 190, .5), inset 0 .05em .07em rgba(255, 255, 255, .8); }

/* ---- templates (Study, Business, Creator) -------------------------------------
   A row of templates sits under the greeting and above the calendar, on the home
   screen and on each template's page. A template's page is laid out like the home
   screen (it carries the same classes), so the calendar, the boards and their
   layouts on phones, tablets and computers are the home screen's own rules. What
   is here is only what the templates add. */

/* the row of templates */
.spaces { display: flex; flex-wrap: wrap; gap: 8px; margin: -8px 0 16px; }
.space-tab { position: relative; padding: 8px 16px; font-size: 13.5px; }
.space-tab .ic { width: 16px; height: 16px; stroke-width: 2; flex: none; }
.space-tab.on { cursor: default; }
.space-tab.on:hover { transform: none; background: var(--accent); }
.space-tab:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }
.space-dot { position: absolute; top: -3px; inset-inline-end: -3px; width: 10px; height: 10px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 8px rgba(91, 228, 155, .8); }
.enter .spaces { animation: fu .65s var(--ease) both; animation-delay: .08s; }
@media (pointer: coarse) { .space-tab { min-height: 44px; } }

/* a template's page: its name, one line about what is next, and a pencil for the answers */
.space .hello { display: flex; flex-wrap: nowrap; align-items: flex-start; justify-content: space-between; gap: 12px; padding-inline-end: 0; }
.space .hello-line { flex: 1; min-width: 0; }
.sp-headline { min-width: 0; font-family: var(--font-d); font-size: 18px; font-weight: 500; letter-spacing: -.01em; line-height: 1.3; color: var(--txt-2); overflow-wrap: anywhere; unicode-bidi: plaintext; }
.sp-edit { flex: none; margin-top: -5px; }

/* the questions asked once, and the small notes shown in place of the calendar */
.sp-setup, .sp-note { display: grid; gap: 14px; width: 100%; max-width: 560px; align-self: start; }
.sp-setup h2, .sp-note h2 { font-family: var(--font-d); font-size: 25px; font-weight: 600; letter-spacing: -.03em; line-height: 1.2; outline: none; }
.sp-setup .sub { margin-top: -6px; line-height: 1.55; }
.sp-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.sp-chips .chip { padding-inline-end: 5px; cursor: default; }
.sp-chips .chip:hover { transform: none; background: var(--card); }
.sp-chip-x { width: 22px; height: 22px; display: grid; place-items: center; flex: none; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--txt-2); transition: transform .3s var(--spring), opacity .2s; }
.sp-chip-x:hover { background: var(--cell-h); color: var(--txt); }
.sp-chip-x:active { transform: scale(.85); }
.sp-chips .sp-chip-x .ic { width: 11px; height: 11px; }
.sp-list-add { flex-wrap: nowrap; }
.sp-list-add input { flex: 1; }
.sp-custom input { max-width: 170px; }
.sp-fields, .sp-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.sp-fields > *, .sp-form > * { grid-column: 1 / -1; min-width: 0; }
.sp-fields > .half, .sp-form > .half { grid-column: span 1; }
@media (pointer: coarse) { .sp-chip-x { width: 30px; height: 30px; } }

/* what a date shows in a template's calendar: one short line and up to four dots */
.cell-dots { position: absolute; inset-inline: 11px; bottom: 9px; display: flex; gap: 4px; }
.cell-dots i { width: 7px; height: 7px; flex: none; border-radius: 50%; background: var(--c); box-shadow: 0 0 6px -1px var(--c); }
.cell-dots i.off { background: transparent; box-shadow: inset 0 0 0 1.5px var(--c); opacity: .75; }
.cell-note { display: none; position: absolute; inset-inline: 10px; bottom: 23px; padding-inline-start: 6px; border-inline-start: 2px solid var(--c); font-size: 11.5px; font-weight: 600; line-height: 1.3; text-align: start; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; unicode-bidi: plaintext; }
.cell.has-exam:not(.today) { border-color: rgba(255, 126, 182, .5); }
.enter .cell-dots, .enter .cell-note { animation: fu .5s var(--ease) both; animation-delay: calc(var(--i) * 11ms + 360ms); }

/* boards */
.sp-hero:not([data-open-day]) { cursor: default; }
.sp-hero .w-date-big .ic { width: 30px; height: 30px; stroke-width: 1.7; }
.w .sp-subs .chip { align-self: auto; margin-top: 0; flex: none; padding: 6px 12px; font-size: 12.5px; }
.sp-subs { display: flex; gap: 6px; margin: 0 -2px; padding: 2px; overflow-x: auto; scrollbar-width: none; }
.sp-subs::-webkit-scrollbar { display: none; }
.sp-meta { display: inline-block; width: 100%; font-size: 12px; line-height: 1.35; color: var(--txt-3); }
.sp-late, .w-sub.sp-late { color: var(--danger); }
.sp-tasks .prio { max-height: 252px; overflow-y: auto; padding-inline-end: 2px; scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
.sp-add { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1fr) auto; align-items: center; gap: 8px; margin-top: auto; padding-top: 4px; }
.sp-add input[type='text'] { grid-column: span 2; }
.sp-date { grid-column: span 2; display: flex; align-items: center; gap: 8px; min-width: 0; }
.sp-date span { flex: none; font-size: 12px; font-weight: 600; color: var(--txt-3); }
.sp-date input { flex: 1; }
.sp-subjects .sp-rows { min-height: 0; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
.sp-add :is(input, select) { min-width: 0; padding: 8px 10px; font-size: 14px; }
.sp-rows { display: grid; gap: 8px; margin: 4px 0 8px; }
.sp-rows li { display: grid; grid-template-columns: minmax(0, 1fr) minmax(36px, 1.1fr) auto auto; align-items: center; gap: 10px; font-size: 14px; }
.sp-row-name { padding-inline-start: 9px; border-inline-start: 3px solid var(--c); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; unicode-bidi: plaintext; }
.sp-row-bar { height: 6px; border-radius: 6px; overflow: hidden; background: var(--line-2); }
.sp-row-bar i { display: block; height: 100%; border-radius: 6px; background: var(--c); transform-origin: left; transform: scaleX(var(--p)); }
[dir='rtl'] .sp-row-bar i { transform-origin: right; }
.sp-row-val { font-size: 12.5px; color: var(--txt-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.sp-rows .icon-btn { opacity: .5; }
.sp-rows li:hover .icon-btn, .sp-rows .icon-btn:focus-visible { opacity: 1; }
.enter .sp-row-bar i { animation: growX .8s var(--ease) both; animation-delay: .4s; }
@media (hover: none) { .sp-rows .icon-btn, .sp-tasks .prio .icon-btn, .sp-list .icon-btn { opacity: .8; } }

/* the sheet of one date */
.sp-sheet { display: grid; gap: 16px; }
.sp-sheet section { display: grid; gap: 8px; }
.sp-list { margin: 0; }
.sp-list .sp-move { padding-inline-start: 34px; }
.sp-dot { width: 10px; height: 10px; margin: 0 7px; flex: none; border-radius: 50%; background: var(--c); }
.sheet-body .sp-actions { flex-wrap: wrap; gap: 8px; }
.sp-actions .chip { padding: 9px 14px; }

@media (min-width: 1100px) and (min-height: 640px) {
  /* one more row than before: greeting, the templates, then the calendar and boards */
  .view.home { grid-template-rows: auto auto minmax(0, 1fr); }
  .slot:is([data-view='study'], [data-view='business'], [data-view='creator']) { height: 100%; }
  /* a template's last boards hold a list and a form: never shorter than what is in them */
  .space .widgets { grid-template-rows: repeat(5, max-content) minmax(max-content, 1fr); }
}
@media (min-width: 1100px) and (min-height: 821px) {
  .cell-note { display: block; }
}
@media (min-width: 1100px) and (max-height: 820px) {
  .spaces { margin: -10px 0 12px; }
}
@media (min-width: 1400px) and (min-height: 640px) {
  .space .widgets { grid-template-rows: repeat(4, max-content) minmax(max-content, 1fr); }
}
@media (min-width: 1700px) and (min-height: 640px) {
  .space .widgets { grid-template-rows: repeat(3, max-content) minmax(max-content, 1fr); }
}
@media (max-width: 1099px) {
  /* boards that slide sideways are tall and narrow: names may take two lines */
  html:not([data-boards='stack']) .sp-hero .w-up li :is(b, span) { white-space: normal; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow-wrap: anywhere; }
  html:not([data-boards='stack']) .sp-hero .w-up li span { -webkit-line-clamp: 3; }
}
@media (min-width: 761px) and (max-width: 1099px) {
  html:not([data-boards='carousel']) .space .widgets > .w-week { min-height: 340px; }
}
@media (min-width: 1700px) and (min-height: 960px) {
  .space-tab { padding: 10px 20px; font-size: 15px; }
  .sp-headline { font-size: 21px; }
  .cell-dots { inset-inline: 16px; bottom: 14px; gap: 5px; }
  .cell-dots i { width: 9px; height: 9px; }
  .cell-note { inset-inline: 15px; bottom: 32px; font-size: 13.5px; }
}
@media (max-width: 760px) {
  /* four equal buttons across the phone, icon over name, big enough for a thumb */
  .spaces { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); grid-template-columns: none; gap: 5px; margin: -4px 0 12px; }
  .space-tab { flex-direction: column; justify-content: center; gap: 3px; min-height: 52px; padding: 7px 1px; border-radius: 16px; font-size: 11px; letter-spacing: -.01em; }
  .space-tab span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
  .space-tab .ic { width: 18px; height: 18px; }
  .space .hello-hi { padding-inline-end: 0; }
  .sp-headline { font-size: 15px; }
  .sp-setup h2, .sp-note h2 { font-size: 22px; }
  html[data-boards='stack'] .space .w-week { min-height: 280px; }
  .cell-dots { inset-inline: 6px; bottom: 6px; gap: 3px; }
  .cell-dots i { width: 6px; height: 6px; }
}
html[lang='ar'] :is(.sp-headline, .sp-setup h2, .sp-note h2) { line-height: 1.5; }

/* ---- each template's own look ------------------------------------------------------
   While a template is on screen the page's root carries data-space (app.js sets it,
   and turns the moving backdrop to the same colour). The planner itself has no
   data-space: it stays blue and nothing below touches it.
     Study     violet, a desk late at night; the page behind is dotted like graph paper
     Business  gold on black; crisp corners, plain numerals, the page ruled like a ledger
     Creator   rose with a warm second light; soft round shapes, bold numerals
   Colours first (dark, then light), then what every template shares, then shapes. */

html[data-space='study'][data-theme='dark'] {
  --bg-a: #03020B; --bg-b: #130A33; --sheet: rgba(13, 10, 32, .84);
  --panel: rgba(170, 160, 240, .05);
  --sheen: linear-gradient(140deg, rgba(255, 255, 255, .085), rgba(255, 255, 255, .02) 34%, rgba(255, 255, 255, 0) 60%, rgba(150, 120, 255, .06));
  --rim: linear-gradient(150deg, rgba(255, 255, 255, .46), rgba(255, 255, 255, .07) 30%, rgba(255, 255, 255, .03) 66%, rgba(170, 150, 255, .36));
  --txt-2: #B5B1D6; --txt-3: #8784AD;
  --accent: #7C68F5; --accent-2: #A99BFF; --link: #B3A6FF;
  --glow: 124, 104, 245;
  --loop-ink: linear-gradient(90deg, #D9D2FF, #8B78FF);
  --tile-mid: #120B33; --tile-top: #C9BFFF;
}
html[data-space='business'][data-theme='dark'] {
  --bg-a: #050403; --bg-b: #1C1404; --sheet: rgba(14, 11, 5, .86);
  --panel: rgba(240, 210, 150, .045);
  --sheen: linear-gradient(140deg, rgba(255, 255, 255, .085), rgba(255, 255, 255, .02) 34%, rgba(255, 255, 255, 0) 60%, rgba(230, 180, 80, .05));
  --rim: linear-gradient(150deg, rgba(255, 255, 255, .46), rgba(255, 255, 255, .07) 30%, rgba(255, 255, 255, .03) 66%, rgba(240, 200, 110, .38));
  --txt-2: #C9BFA8; --txt-3: #958B73;
  --accent: #D4A82E; --accent-2: #F0CC6A; --link: #F3D37C;
  --glow: 214, 170, 50;
  --loop-ink: linear-gradient(90deg, #FFF0C2, #D9A92B);
  --tile-mid: #1E1505; --tile-top: #FFE7A0;
}
html[data-space='creator'][data-theme='dark'] {
  --bg-a: #090206; --bg-b: #2B0A1C; --sheet: rgba(24, 8, 17, .84);
  --panel: rgba(240, 160, 190, .05);
  --sheen: linear-gradient(140deg, rgba(255, 255, 255, .085), rgba(255, 255, 255, .02) 34%, rgba(255, 255, 255, 0) 60%, rgba(255, 110, 160, .06));
  --rim: linear-gradient(150deg, rgba(255, 255, 255, .46), rgba(255, 255, 255, .07) 30%, rgba(255, 255, 255, .03) 66%, rgba(255, 150, 120, .36));
  --txt-2: #D6B5C3; --txt-3: #A9879A;
  --accent: #EE3F7A; --accent-2: #FF86AC; --link: #FF9DBD;
  --glow: 240, 70, 125;
  --loop-ink: linear-gradient(90deg, #FFD3B5, #FF5C93);
  --tile-mid: #300B20; --tile-top: #FFC19A;
}

html[data-space='study'][data-theme='light'] {
  --bg-a: #C6BDF6; --bg-b: #9E8FEA;
  --sheet: rgba(224, 218, 250, .56);
  --txt: #0E0A2B; --txt-2: #2A2356; --txt-3: #3C3470;
  --line: rgba(40, 24, 110, .13); --line-2: rgba(40, 24, 110, .26);
  --accent: #5A43DE; --accent-2: #6B56EE; --link: #3A25B0;
  --shadow: 44, 30, 120; --glow: 110, 90, 240;
  --loop-ink: linear-gradient(90deg, #4B33D6, #28138C);
  --tile-a: rgba(34, 16, 120, .88); --tile-b: rgba(92, 68, 224, .82); --tile-c: rgba(170, 150, 255, .72); --tile-d: #24107A;
}
html[data-space='business'][data-theme='light'] {
  --bg-a: #EBD9A8; --bg-b: #D6B865;
  --sheet: rgba(250, 240, 214, .6);
  --txt: #171104; --txt-2: #3D3110; --txt-3: #57471C;
  --line: rgba(60, 42, 0, .15); --line-2: rgba(60, 42, 0, .3);
  --accent: #8F6400; --accent-2: #A87800; --link: #6B4A00;
  --shadow: 70, 50, 0; --glow: 190, 140, 20;
  --loop-ink: linear-gradient(90deg, #8F6400, #3D2A00);
  --tile-a: rgba(18, 13, 4, .92); --tile-b: rgba(70, 50, 8, .86); --tile-c: rgba(214, 170, 50, .8); --tile-d: #17120A;
}
html[data-space='creator'][data-theme='light'] {
  --bg-a: #F6BFD0; --bg-b: #EE93B2;
  --sheet: rgba(252, 226, 235, .56);
  --txt: #2B0716; --txt-2: #541E34; --txt-3: #6A2F45;
  --line: rgba(110, 16, 50, .13); --line-2: rgba(110, 16, 50, .26);
  --accent: #D61F5E; --accent-2: #E83A76; --link: #A01245;
  --shadow: 120, 24, 60; --glow: 235, 70, 125;
  --loop-ink: linear-gradient(90deg, #D21C5B, #8C0E3C);
  --tile-a: rgba(120, 10, 50, .88); --tile-b: rgba(226, 50, 110, .82); --tile-c: rgba(255, 170, 130, .72); --tile-d: #7A0E38;
}

/* the still backdrop (shown when the moving one is off), in the template's colour */
html[data-space] .backdrop {
  background:
    radial-gradient(90% 70% at 92% 110%, rgba(var(--glow), .30), transparent 62%),
    radial-gradient(60% 50% at 4% 112%, rgba(var(--glow), .18), transparent 64%),
    radial-gradient(50% 40% at 80% -10%, rgba(var(--glow), .10), transparent 70%),
    linear-gradient(165deg, var(--bg-a) 42%, var(--bg-b));
}
html[data-space][data-theme='light'] .backdrop {
  background:
    radial-gradient(70% 55% at 90% 106%, rgba(255, 255, 255, .36), transparent 64%),
    radial-gradient(60% 50% at 0% 110%, rgba(var(--glow), .40), transparent 66%),
    radial-gradient(55% 45% at 76% -10%, rgba(255, 255, 255, .42), transparent 70%),
    linear-gradient(165deg, var(--bg-a) 30%, var(--bg-b));
}

/* the few places where the planner's blue is written out: today, the date tile, lit buttons */
html[data-space] .cell.today {
  border-color: var(--accent-2);
  background: linear-gradient(180deg, var(--accent) 0%, rgba(var(--glow), .62) 42%, rgba(var(--glow), .14) 100%);
}
html[data-space][data-theme='light'] .cell.today {
  border-color: rgba(255, 255, 255, .85);
  background: linear-gradient(180deg, var(--accent) 0%, rgba(var(--glow), .74) 46%, rgba(var(--glow), .30) 100%);
}
html[data-space] .w-date { background: linear-gradient(180deg, #04070D 0%, var(--tile-mid) 48%, var(--accent) 86%, var(--tile-top) 100%); }
html[data-space][data-theme='light'] .w-date { background: linear-gradient(180deg, var(--tile-a) 0%, var(--tile-b) 54%, var(--tile-c) 100%); }
html[data-space][data-theme='light'] .w-add { background: linear-gradient(var(--tile-d), var(--tile-d)) padding-box, conic-gradient(from 210deg, #6FF0B0, #6CC4FF, #C0B2FF, #6FF0B0) border-box; }
html[data-space][data-theme='light'] :is(.btn.accent, .chip.on, .seg-btn.on, .round.accent, .wheel-item.on, .wheel[data-open='true'] .wheel-hub, .tdock[data-open='true'] .tdock-tab, .switch input:checked + .switch-track) {
  background: linear-gradient(180deg, var(--accent-2), var(--accent));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .55), inset 0 0 0 1px rgba(255, 255, 255, .22), inset 0 -8px 14px -8px rgba(255, 255, 255, .42), 0 10px 24px -10px rgba(var(--glow), .9);
}

/* Business is gold and black: what is lit is gold with black lettering in the dark
   theme, and black with gold lettering in the light one (white would not read on gold) */
html[data-space='business'][data-theme='dark'] :is(.btn.accent, .chip.on, .seg-btn.on, .round.accent, .wheel-item.on, .wheel[data-open='true'] .wheel-hub, .tdock[data-open='true'] .tdock-tab) {
  background: linear-gradient(180deg, #F3D37C, #C9992A); color: #1A1203;
  box-shadow: 0 8px 20px -10px rgba(var(--glow), .9), inset 0 1px 0 rgba(255, 255, 255, .5);
}
html[data-space='business'][data-theme='dark'] .cell.today .cell-num { color: #1A1203; }
html[data-space='business'][data-theme='dark'] .cell.today { background: linear-gradient(180deg, #F0CC6A 0%, rgba(214, 170, 50, .72) 44%, rgba(214, 170, 50, .16) 100%); }
html[data-space='business'][data-theme='dark'] .w-date { background: linear-gradient(180deg, #050403 0%, #1E1505 44%, #C9992A 84%, #FFE7A0 100%); }
html[data-space='business'][data-theme='dark'] .w-date-sub { color: #1A1203; }
html:root[data-space='business'][data-theme='light'] :is(.btn.accent, .chip.on, .seg-btn.on, .round.accent, .wheel-item.on, .wheel[data-open='true'] .wheel-hub, .tdock[data-open='true'] .tdock-tab) {
  background: linear-gradient(180deg, #2B2210, #120D04); color: #F3D37C;
  box-shadow: inset 0 1px 0 rgba(255, 231, 160, .35), inset 0 0 0 1px rgba(240, 204, 106, .28), 0 10px 24px -10px rgba(var(--shadow), .9);
}
html:root[data-space='business'][data-theme='light'] .switch input:checked + .switch-track { background: linear-gradient(180deg, #2B2210, #120D04); }
html[data-space='business'][data-theme='light'] .cell.today { color: #F3D37C; border-color: rgba(240, 204, 106, .7); background: linear-gradient(180deg, #17120A 0%, rgba(40, 30, 8, .84) 46%, rgba(150, 110, 10, .5) 100%); }

/* the template's name at the top is written in its own light */
.space .hello-hi { background: var(--loop-ink); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* in the row of templates each button's icon carries its template's colour, lit or not */
.space-tab[data-space='daily'] { --sp-c: #5FB0FF; }
.space-tab[data-space='study'] { --sp-c: #A99BFF; }
.space-tab[data-space='business'] { --sp-c: #F0CC6A; }
.space-tab[data-space='creator'] { --sp-c: #FF86AC; }
[data-theme='light'] .space-tab[data-space='daily'] { --sp-c: #0A46B4; }
[data-theme='light'] .space-tab[data-space='study'] { --sp-c: #4530C4; }
[data-theme='light'] .space-tab[data-space='business'] { --sp-c: #6B4A00; }
[data-theme='light'] .space-tab[data-space='creator'] { --sp-c: #B0144C; }
.space-tab .ic { color: var(--sp-c); }
.space-tab.on .ic { color: inherit; }
.space-tab:not(.on):hover, .space-tab:not(.on):focus-visible { border-color: var(--sp-c); }

/* something on the page itself, behind the glass: it shows in the gaps between panels */
html[data-space] .shell::before { content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none; }
html[data-space='study'] .shell::before { background: radial-gradient(circle, rgba(var(--glow), .30) 1px, transparent 1.7px) 0 0 / 24px 24px; }
html[data-space='business'] .shell::before {
  background:
    linear-gradient(rgba(var(--glow), .11) 1px, transparent 1px) 0 0 / 100% 46px,
    linear-gradient(90deg, rgba(var(--glow), .07) 1px, transparent 1px) 0 0 / 92px 100%;
}
html[data-space='creator'] .shell::before {
  background:
    radial-gradient(42% 36% at 88% 8%, rgba(255, 150, 80, .22), transparent 70%),
    radial-gradient(48% 42% at 6% 92%, rgba(255, 70, 150, .18), transparent 70%),
    radial-gradient(30% 26% at 30% 22%, rgba(190, 90, 255, .10), transparent 70%);
}
html[data-space='study'][data-theme='light'] .shell::before { background: radial-gradient(circle, rgba(255, 255, 255, .62) 1px, transparent 1.7px) 0 0 / 24px 24px; }
html[data-space='business'][data-theme='light'] .shell::before {
  background:
    linear-gradient(rgba(255, 255, 255, .34) 1px, transparent 1px) 0 0 / 100% 46px,
    linear-gradient(90deg, rgba(255, 255, 255, .22) 1px, transparent 1px) 0 0 / 92px 100%;
}
html[data-space='creator'][data-theme='light'] .shell::before {
  background:
    radial-gradient(42% 36% at 88% 8%, rgba(255, 196, 120, .50), transparent 70%),
    radial-gradient(48% 42% at 6% 92%, rgba(255, 255, 255, .30), transparent 70%),
    radial-gradient(30% 26% at 30% 22%, rgba(200, 120, 255, .22), transparent 70%);
}

/* shapes and numerals: Study keeps the planner's; Business is crisp, Creator is soft */
html[data-space='business'] .space :is(.panel, .w) { border-radius: 14px; }
html[data-space='business'] .space .cell { border-radius: 6px; }
html[data-space='business'] .space .w-date { border-radius: 9px; }
html[data-space='business'] .space-tab { border-radius: 10px; }
html[data-space='business'] .space .cell-num { font-family: var(--font-d); font-weight: 600; letter-spacing: 0; font-variant-numeric: tabular-nums; }
html[data-space='creator'] .space .panel { border-radius: 34px; }
html[data-space='creator'] .space .w { border-radius: 32px; }
html[data-space='creator'] .space .cell { border-radius: 22px; }
html[data-space='creator'] .space .w-date { border-radius: 24px; }
html[data-space='creator'] .space .cell-num { font-family: var(--font-d); font-weight: 800; letter-spacing: -.01em; }
@media (max-width: 760px) {
  html[data-space='business'] .space :is(.panel, .w) { border-radius: 12px; }
  html[data-space='business'] .space .cell { border-radius: 5px; }
  html[data-space='business'] .space-tab { border-radius: 9px; }
  html[data-space='creator'] .space .panel { border-radius: 28px; }
  html[data-space='creator'] .space .w { border-radius: 28px; }
  html[data-space='creator'] .space .cell { border-radius: 15px; }
}

/* the logo and Routely's face take the template's colour too. The logos are the
   owner's own artworks (brand/logo-study.png and so on), one drawing in three colours. */
html[data-space='study'] { --mark: url('/brand/mark-study.png'); --orb-1: #F1EDFF; --orb-2: #CBC2FF; --orb-3: #9A88FA; --orb-4: #7460EC; --orb-5: #5B45D8; --orb-in: rgba(60, 36, 170, .5); }
html[data-space='business'] { --mark: url('/brand/mark-business.png'); --orb-1: #FFF8DC; --orb-2: #FFE596; --orb-3: #EDBE45; --orb-4: #CB9A2C; --orb-5: #A87614; --orb-in: rgba(120, 76, 0, .55); }
html[data-space='creator'] { --mark: url('/brand/mark-creator.png'); --orb-1: #FFE9F0; --orb-2: #FFB8CE; --orb-3: #FA6F9D; --orb-4: #EC417B; --orb-5: #D62660; --orb-in: rgba(170, 20, 70, .5); }
html[data-space] .buddy-orb {
  background: radial-gradient(circle at 36% 26%, var(--orb-1) 0%, var(--orb-2) 24%, var(--orb-3) 56%, var(--orb-4) 82%, var(--orb-5) 100%);
  box-shadow: 0 0 .42em rgba(var(--glow), .7), 0 .14em .3em -.08em rgba(var(--shadow), .7), inset 0 -.14em .2em var(--orb-in), inset 0 .05em .07em rgba(255, 255, 255, .75);
}
html[data-space][data-theme='light'] .buddy-orb { box-shadow: 0 0 0 1px rgba(255, 255, 255, .7), 0 0 .4em rgba(var(--glow), .75), 0 .16em .34em -.08em rgba(var(--shadow), .8), inset 0 -.14em .2em var(--orb-in), inset 0 .05em .07em rgba(255, 255, 255, .8); }
/* on gold, white eyes would not show: Routely's eyes are black there */
html[data-space='business'] .buddy-eyes i { background: #1A1203; box-shadow: 0 0 .1em rgba(255, 240, 190, .6); }
/* what the person says in the chat is written on the template's colour */
html[data-space][data-theme='light'] .ask-msg.me p { background: linear-gradient(180deg, var(--accent-2), var(--accent)); }
html[data-space='business'][data-theme='dark'] .ask-msg.me p { background: linear-gradient(180deg, #F3D37C, #C9992A); color: #1A1203; }
html[data-space='business'][data-theme='light'] .ask-msg.me p { background: linear-gradient(180deg, #2B2210, #120D04); color: #F3D37C; }

/* ---- boards the Business and Creator templates add ---------------------------------
   (their colours come from the block above; this is layout only) */

/* a date with something still to come is outlined in the template's colour */
.cell.has-mark:not(.today) { border-color: rgba(var(--glow), .6); }

/* a board that opens something when pressed */
.w.sp-tap { cursor: pointer; transition: transform .3s var(--spring); }
.w.sp-tap:hover { transform: translateY(-3px); }
.w.sp-tap:active { transform: scale(.97); }
.w.sp-tap:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }

/* an amount of money as a board's big number: smaller than a count, and it may wrap */
.w-big.sp-amt { font-size: 19px; line-height: 1.25; letter-spacing: -.02em; flex-wrap: wrap; unicode-bidi: plaintext; }
.w-big.sp-amt b { white-space: nowrap; }
.sp-amt-s { flex: none; font-size: 13.5px; font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; unicode-bidi: plaintext; }
.sp-amt-s.in { color: var(--ok); }
.sp-meta .sp-amt-s { font-size: inherit; color: var(--txt); }
.sp-meta > span { display: inline; }
/* a time of day in the big tile is longer than a count of days */
.w-date-big.sp-clock { font-size: 23px; white-space: nowrap; }
@media (min-width: 1700px) and (min-height: 960px) { .w-date-big.sp-clock { font-size: 28px; } }
.sp-amt-s.out { color: var(--danger); }

/* the money board: three figures, the goal, six months of bars, and a line to add */
.sp-figs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.sp-figs small { display: block; font-size: 11.5px; color: var(--txt-3); }
.sp-figs b { display: block; font-family: var(--font-d); font-size: 20px; font-weight: 600; letter-spacing: -.02em; line-height: 1.25; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; unicode-bidi: plaintext; }
.sp-figs .in { color: var(--ok); }
.sp-figs .out { color: var(--danger); }
.sp-goal { display: grid; gap: 5px; }
.sp-goal .sp-row-bar { --c: var(--accent-2); }
.sp-goal small { font-size: 12px; color: var(--txt-2); }
.sp-months { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; align-items: end; }
.sp-month { display: grid; gap: 4px; justify-items: center; min-width: 0; font-size: 11px; color: var(--txt-3); }
.sp-month.now { color: var(--txt); font-weight: 700; }
.sp-bars { display: flex; align-items: flex-end; justify-content: center; gap: 3px; width: 100%; height: 52px; border-bottom: 1px solid var(--line-2); }
.sp-bars i { display: block; width: min(14px, 34%); height: 100%; border-radius: 4px 4px 0 0; background: var(--c); transform-origin: bottom; transform: scaleY(var(--p)); }
.enter .sp-bars i { animation: growY .8s var(--ease) both; animation-delay: .4s; }
.sp-quick { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, .9fr) minmax(0, 1.5fr) auto; align-items: center; gap: 8px; margin-top: auto; padding-top: 2px; }
.sp-quick :is(input, select) { min-width: 0; padding: 8px 10px; font-size: 14px; }
.sp-quick.sp-quick-2 { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) auto; }
/* with several businesses the line also asks which one: amount, kind, business; then what for and the button */
.sp-quick.sp-quick-b { grid-template-columns: minmax(0, .8fr) minmax(0, .9fr) minmax(0, 1fr) auto; }
.sp-quick.sp-quick-b input[name='text'] { grid-column: 1 / span 3; }
.sp-money .sp-subs .chip { max-width: 180px; overflow: hidden; text-overflow: ellipsis; }
.sp-pipe .sp-subs .chip b { margin-inline-start: 2px; opacity: .75; }
.sp-pipe .sp-scroll { max-height: 190px; }
.sp-plats .w-sub { margin-top: auto; }

/* lists inside a board scroll in their own space; the line to add stays at the foot */
.sp-scroll { max-height: 252px; overflow-y: auto; padding-inline-end: 2px; scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
.w-week .sp-foot { margin: auto 0 0; padding-top: 4px; }
.sp-tally { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12px; color: var(--txt-2); }
.sp-tally span { display: inline-flex; align-items: center; white-space: nowrap; }
.sp-tally .sp-dot { width: 8px; height: 8px; margin: 0; margin-inline-end: 5px; }
.sp-tally b { margin-inline-start: 4px; color: var(--txt); }
.w .chip.sp-stage, .sp-sheet .chip.sp-paid { flex: none; align-self: center; margin: 0; padding: 4px 10px; font-size: 12px; }
.chip.sp-stage { border-color: var(--c); }
.sp-sheet .chip.sp-paid { border-color: var(--ok); }

@media (max-width: 1099px) {
  /* boards that slide sideways are narrow: the figures go one under the other, the line to add on two rows */
  html:not([data-boards='stack']) .sp-figs { grid-template-columns: 1fr; gap: 4px; }
  html:not([data-boards='stack']) .sp-figs > div { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
  html:not([data-boards='stack']) .sp-figs b { font-size: 17px; }
  html:not([data-boards='stack']) .sp-quick { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; }
  html:not([data-boards='stack']) .sp-quick.sp-quick-b select[name='b'] { grid-column: span 2; order: 2; }
  html:not([data-boards='stack']) .sp-quick:not(.sp-quick-2) input[name='text'] { grid-column: span 2; order: 3; }
  html:not([data-boards='stack']) .sp-quick:not(.sp-quick-2) button { order: 4; }
  html:not([data-boards='stack']) .sp-quick.sp-quick-2 { grid-template-columns: minmax(0, 1fr) auto; }
  html:not([data-boards='stack']) .sp-quick.sp-quick-2 input { grid-column: 1 / -1; }
  html:not([data-boards='stack']) .sp-bars { height: 44px; }
}
@media (max-width: 760px) {
  html[data-boards='stack'] .sp-quick { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; }
  html[data-boards='stack'] .sp-quick.sp-quick-b select[name='b'] { grid-column: span 2; order: 2; }
  html[data-boards='stack'] .sp-quick:not(.sp-quick-2) input[name='text'] { grid-column: span 2; order: 3; }
  html[data-boards='stack'] .sp-quick:not(.sp-quick-2) button { order: 4; }
}

/* ---- the Money template (emerald) and the Tasks board ------------------------------ */
html[data-space='money'][data-theme='dark'] {
  --bg-a: #010705; --bg-b: #04231A; --sheet: rgba(4, 16, 12, .86);
  --panel: rgba(150, 230, 200, .045);
  --sheen: linear-gradient(140deg, rgba(255, 255, 255, .085), rgba(255, 255, 255, .02) 34%, rgba(255, 255, 255, 0) 60%, rgba(70, 220, 170, .05));
  --rim: linear-gradient(150deg, rgba(255, 255, 255, .46), rgba(255, 255, 255, .07) 30%, rgba(255, 255, 255, .03) 66%, rgba(90, 230, 180, .32));
  --txt-2: #A8C6BC; --txt-3: #76968A;
  --accent: #12A67E; --accent-2: #45E0B0; --link: #5BE6BA;
  --glow: 24, 190, 140;
  --loop-ink: linear-gradient(90deg, #C8F8E8, #2FCB9C);
  --tile-mid: #05261C; --tile-top: #A8F5DA;
}
html[data-space='money'][data-theme='light'] {
  --bg-a: #B4E0D2; --bg-b: #7CC4AC;
  --sheet: rgba(216, 244, 235, .56);
  --txt: #04201A; --txt-2: #17423A; --txt-3: #285549;
  --line: rgba(6, 70, 50, .14); --line-2: rgba(6, 70, 50, .28);
  --accent: #0A8A65; --accent-2: #0E9C73; --link: #06644A;
  --shadow: 10, 80, 60; --glow: 20, 170, 125;
  --loop-ink: linear-gradient(90deg, #08845F, #04503A);
  --tile-a: rgba(4, 70, 52, .88); --tile-b: rgba(14, 150, 110, .82); --tile-c: rgba(120, 230, 190, .72); --tile-d: #06503A;
}
html[data-space='money'] { --mark: url('/brand/mark-money.png'); --orb-1: #E9FFF6; --orb-2: #A9F3D7; --orb-3: #4FD9A9; --orb-4: #1FB888; --orb-5: #0E946B; --orb-in: rgba(4, 96, 66, .5); }
.space-tab[data-space='money'] { --sp-c: #45E0B0; }
[data-theme='light'] .space-tab[data-space='money'] { --sp-c: #06644A; }
/* the page behind Money: the faint lines of a receipt */
html[data-space='money'] .shell::before { background: repeating-linear-gradient(0deg, rgba(var(--glow), .09) 0 1px, transparent 1px 30px); }
html[data-space='money'][data-theme='light'] .shell::before { background: repeating-linear-gradient(0deg, rgba(255, 255, 255, .34) 0 1px, transparent 1px 30px); }
@media (min-width: 1100px) and (min-height: 640px) { .slot[data-view='money'] { height: 100%; } }

/* a fee in the list is one button: its name, when it repeats, its price */
.sp-fees .prio li { display: block; }
.sp-fee { display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 8px; border: 0; border-radius: 12px; background: transparent; color: inherit; font: inherit; text-align: start; cursor: pointer; transition: transform .3s var(--spring), opacity .2s; }
.sp-fee:hover { background: var(--cell-h); }
.sp-fee:active { transform: scale(.98); }
.sp-fee:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 1px; }
.sp-fee .sp-dot { margin: 0; }
.sp-fees .prio li.sp-off { opacity: .55; }
.sp-fees .sp-scroll { max-height: 300px; }
.sp-top .w-sub { margin-top: auto; }
.sp-row-bar.over { --c: var(--danger); }
.chip.sp-danger { border-color: var(--danger); color: var(--danger); }
.sp-sheet .sub { line-height: 1.5; }
/* the weekdays a daily fee is on: seven small round buttons */
.sp-wds { display: flex; flex-wrap: wrap; gap: 6px; }
.sp-wd { position: relative; cursor: pointer; }
.sp-wd input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.sp-wd span { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--edge-2); color: var(--txt-2); font-size: 13px; font-weight: 700; transition: transform .3s var(--spring), opacity .2s; }
.sp-wd:hover span { transform: translateY(-2px); }
.sp-wd:active span { transform: scale(.9); }
.sp-wd input:checked + span { background: var(--accent-2); border-color: var(--accent-2); color: #06101F; }
.sp-wd input:focus-visible + span { outline: 2px solid var(--link); outline-offset: 2px; }

/* the Tasks board is the size of the priorities board beside it: same width, and no shorter */
/* a ninth board lands in a row the column did not plan for: that row is as tall as the board */
@media (min-width: 1100px) { .space .widgets { grid-auto-rows: max-content; } }
@media (min-width: 1100px) { .space .widgets > .sp-todo { min-height: 224px; } }

/* ---- Customize widgets: the button after the last board, the screen it opens, and
   the boards a person makes themselves ------------------------------------------------ */
.wz-open { flex: none; align-self: center; justify-self: start; grid-column: 1 / -1; margin: 2px 0; color: var(--txt-2); }
.wz-open .ic { width: 15px; height: 15px; }
.wz-open:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }
@media (max-width: 1099px) { html:not([data-boards='stack']) .wz-open { margin-inline: 6px 10px; } }
@media (min-width: 761px) and (max-width: 1099px) { html:not([data-boards='carousel']) .wz-open { margin: 2px 0; } }

/* a page somebody customized lays its boards out row by row, each as tall as it needs */
@media (min-width: 1100px) { .widgets.sp-free { grid-template-rows: none; grid-auto-rows: max-content; } }
@media (min-width: 1100px) { .widgets.sp-free > :is(.w-week, .w-notes) { min-height: 224px; } }

/* the list of a page's widgets: a handle to drag, the name, a switch */
.wz-list { display: grid; gap: 6px; margin: 0; }
.wz-row { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 14px; border: 1px solid var(--edge); background: var(--card); }
.wz-row.off .wz-name { color: var(--txt-3); }
.wz-row.drag { position: relative; z-index: 2; border-color: var(--accent-2); box-shadow: 0 14px 30px -14px rgba(var(--shadow), .9); }
.wz-name { flex: 1; min-width: 0; font-weight: 600; font-size: 14px; overflow-wrap: anywhere; unicode-bidi: plaintext; }
.wz-name small { margin-inline-start: 8px; font-size: 11px; font-weight: 600; color: var(--accent-2); }
.wz-grip { flex: none; display: grid; place-items: center; width: 34px; height: 38px; padding: 0; border: 0; border-radius: 10px; background: transparent; color: var(--txt-3); cursor: grab; touch-action: none; transition: transform .3s var(--spring), opacity .2s; }
.wz-grip:hover { color: var(--txt); background: var(--cell-h); }
.wz-grip:active { cursor: grabbing; transform: scale(.92); }
.wz-grip:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 1px; }
.wz-grip .ic { width: 18px; height: 18px; }
.wz-row .switch { flex: none; gap: 0; }
.wz-reset { justify-self: start; }

/* boards of one's own */
.wz-note { flex: 1; width: 100%; min-height: 120px; resize: none; padding: 10px 12px; font-size: 14px; line-height: 1.55; }
.wz-steps { display: flex; gap: 8px; }
.wz-steps .round:disabled { opacity: .35; cursor: default; }
.sp-count .w-big small { font-size: 13px; }

/* ---- the Today page: what each template holds for today, in that template's own colours ---- */
.tday { --c: var(--accent-2); --tint: var(--glow); }
.tday[data-tday='study'] { --c: #A99BFF; --tint: 124, 104, 245; }
.tday[data-tday='business'] { --c: #F0CC6A; --tint: 214, 170, 50; }
.tday[data-tday='creator'] { --c: #FF86AC; --tint: 240, 70, 125; }
html[data-theme='light'] .tday[data-tday='study'] { --c: #5A43DE; }
html[data-theme='light'] .tday[data-tday='business'] { --c: #8F6400; }
html[data-theme='light'] .tday[data-tday='creator'] { --c: #D61F5E; }
.tday > .tcard-in { background: linear-gradient(135deg, rgba(var(--tint), .2), rgba(var(--tint), .06) 55%, rgba(var(--tint), 0)), var(--card); }
.tday .tcard-title { color: var(--c); }
.tday-ic { display: grid; place-items: center; flex: none; width: 30px; height: 30px; border-radius: 10px; color: var(--c); background: rgba(var(--tint), .2); }
.tday-ic .ic { width: 16px; height: 16px; }
.tday .tcard-right { color: var(--txt-2); font-size: 14px; }
.tday-list { margin: 12px 0 4px; gap: 8px; }
.tday-list .tickbox { flex: none; }
.tday .tcard-row.sub { margin-top: 10px; }
.tday-open { padding: 6px 14px; font-size: 13px; border-color: color-mix(in srgb, var(--c) 45%, transparent); }
.tday-open:hover { border-color: var(--c); }
.tday-open:focus-visible { outline: 2px solid var(--c); outline-offset: 2px; }
.tday-open:active { transform: scale(.96); }
