/* =========================================================
   Dashboard — white & accent (sky-blue by default) theme
   --acc / --acc2 / --acc-deep are set from the chosen accent in dash.js;
   everything else (tints, lines, glows) is mixed from them.
   ========================================================= */
:root {
  --acc: #0ea5e9;
  --acc2: #38bdf8;
  --acc-deep: #0284c7;
  --bg: color-mix(in srgb, var(--acc) 4%, #fbfdff);
  --bg-grad: radial-gradient(1200px 600px at 85% -10%, color-mix(in srgb, var(--acc) 16%, transparent) 0%, transparent 60%), radial-gradient(900px 500px at -10% 20%, color-mix(in srgb, var(--acc2) 10%, transparent) 0%, transparent 55%), var(--bg);
  --card: rgba(255, 255, 255, .86);
  --card-solid: #ffffff;
  --card-2: color-mix(in srgb, var(--acc) 5%, #fbfcfe);
  --ink: #0d1b2e;
  --ink2: #44566e;
  --ink3: #8798b0;
  --line: color-mix(in srgb, var(--acc) 10%, #e9eef4);
  --line2: color-mix(in srgb, var(--acc) 16%, #dde5ee);
  --acc-soft: color-mix(in srgb, var(--acc) 13%, transparent);
  --acc-softer: color-mix(in srgb, var(--acc) 6%, transparent);
  --acc-ink: var(--acc-deep);
  --grad: linear-gradient(135deg, var(--acc2) 0%, var(--acc) 45%, var(--acc-deep) 100%);
  --p: var(--acc);
  --c: #6380f5;
  --f: #14b8a6;
  --ok: #10b981;
  --warn: #f59e0b;
  --danger: #ef4444;
  --danger-soft: #fdecec;
  --shadow: 0 1px 2px color-mix(in srgb, var(--acc-deep) 5%, transparent), 0 8px 28px color-mix(in srgb, var(--acc-deep) 7%, transparent);
  --shadow-hi: 0 2px 6px color-mix(in srgb, var(--acc-deep) 6%, transparent), 0 18px 44px color-mix(in srgb, var(--acc-deep) 14%, transparent);
  --glass: color-mix(in srgb, var(--bg) 72%, transparent);
  --r: 20px;
  --r-sm: 12px;
  --pad: 22px;
  --gap: 20px;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --spring: cubic-bezier(.34, 1.56, .64, 1);
  --font: 'DM Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --hdr: 64px;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --acc: #38bdf8;
  --acc2: #7dd3fc;
  --acc-deep: #0ea5e9;
  --bg: color-mix(in srgb, var(--acc) 5%, #060a12);
  --bg-grad: radial-gradient(1100px 600px at 85% -10%, color-mix(in srgb, var(--acc) 15%, transparent) 0%, transparent 60%), radial-gradient(900px 500px at -10% 25%, color-mix(in srgb, var(--acc2) 7%, transparent) 0%, transparent 55%), var(--bg);
  --card: color-mix(in srgb, color-mix(in srgb, var(--acc) 7%, #0c121d) 84%, transparent);
  --card-solid: color-mix(in srgb, var(--acc) 7%, #0c121d);
  --card-2: color-mix(in srgb, var(--acc) 9%, #101724);
  --ink: #e9f0fa;
  --ink2: #a8b6c9;
  --ink3: #6d7d94;
  --line: color-mix(in srgb, var(--acc) 12%, #18202d);
  --line2: color-mix(in srgb, var(--acc) 18%, #1f2938);
  --acc-soft: color-mix(in srgb, var(--acc) 15%, transparent);
  --acc-softer: color-mix(in srgb, var(--acc) 7%, transparent);
  --acc-ink: var(--acc2);
  --c: #8b9dff;
  --f: #2dd4bf;
  --danger-soft: rgba(239, 68, 68, .14);
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 28px rgba(0, 0, 0, .28);
  --shadow-hi: 0 2px 6px rgba(0, 0, 0, .3), 0 18px 44px rgba(0, 0, 0, .45);
  color-scheme: dark;
}
:root[data-density="compact"] { --pad: 16px; --gap: 14px; --r: 16px; }

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; }
body {
  background: var(--bg-grad);
  background-attachment: fixed;
  color: var(--ink);
  font: 15.5px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  overflow-x: hidden;
  transition: background-color .4s var(--ease), color .4s var(--ease);
}
body.route-polish { overflow: hidden; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
::selection { background: var(--acc-soft); }
:focus-visible { outline: 2.5px solid var(--acc); outline-offset: 2px; border-radius: 8px; }
kbd { font: 600 11.5px/1 var(--font); padding: 3px 6px; border-radius: 6px; background: var(--card-2); border: 1px solid var(--line2); border-bottom-width: 2px; color: var(--ink2); }

/* floating background orbs */
.bg-orbs { position: fixed; inset: 0; pointer-events: none; z-index: -1; overflow: hidden; }
.bg-orbs i { position: absolute; border-radius: 50%; filter: blur(60px); opacity: .5; will-change: transform; }
.bg-orbs i:nth-child(1) { width: 380px; height: 380px; background: color-mix(in srgb, var(--acc2) 45%, transparent); top: 8%; right: -80px; animation: drift 22s ease-in-out infinite; }
.bg-orbs i:nth-child(2) { width: 300px; height: 300px; background: color-mix(in srgb, var(--acc) 22%, transparent); bottom: 5%; left: -60px; animation: drift 26s ease-in-out infinite reverse; }
.bg-orbs i:nth-child(3) { width: 220px; height: 220px; background: color-mix(in srgb, var(--acc2) 25%, transparent); top: 45%; left: 45%; animation: drift 30s ease-in-out infinite; }
[data-theme="dark"] .bg-orbs i { opacity: .3; }
@keyframes drift { 0%, 100% { transform: translate(0, 0) scale(1); } 33% { transform: translate(-40px, 30px) scale(1.06); } 66% { transform: translate(30px, -20px) scale(.96); } }

/* ---------- header ---------- */
.hdr {
  position: sticky; top: 0; z-index: 30;
  height: var(--hdr); padding: 0 24px; padding-top: env(safe-area-inset-top);
  box-sizing: content-box;
  display: flex; align-items: center; gap: 16px;
  background: var(--glass);
  backdrop-filter: saturate(1.6) blur(18px); -webkit-backdrop-filter: saturate(1.6) blur(18px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s, box-shadow .3s, background .4s;
}
.hdr.scrolled, body.route-polish .hdr { border-bottom-color: var(--line); box-shadow: 0 4px 24px color-mix(in srgb, var(--acc-deep) 5%, transparent); }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; letter-spacing: -.01em; }
.brand-mark { width: 32px; height: 32px; border-radius: 10px; background: var(--grad); display: grid; place-items: center; box-shadow: 0 4px 14px color-mix(in srgb, var(--acc) 35%, transparent); transition: transform .5s var(--spring); }
.brand-mark svg { color: #fff; stroke-width: 3; width: 18px; height: 18px; }
.brand:hover .brand-mark { transform: rotate(-8deg) scale(1.06); }

.tabs { position: relative; display: flex; gap: 2px; padding: 4px; margin: 0 auto; background: var(--acc-softer); border: 1px solid var(--line); border-radius: 999px; }
.tabs a { position: relative; z-index: 1; display: flex; align-items: center; gap: 7px; padding: 7px 16px; border-radius: 999px; font-weight: 600; font-size: 14px; color: var(--ink2); transition: color .25s; }
.tabs a:hover { color: var(--ink); }
.tabs a.active { color: var(--acc-deep); }
[data-theme="dark"] .tabs a.active { color: var(--acc2); }
.tabs a svg { width: 16px; height: 16px; }
.tab-ink { position: absolute; top: 4px; bottom: 4px; left: 0; width: 0; border-radius: 999px; background: var(--card-solid); box-shadow: 0 1px 3px color-mix(in srgb, var(--acc-deep) 10%, transparent), 0 4px 12px color-mix(in srgb, var(--acc-deep) 10%, transparent); transition: transform .45s var(--spring), width .45s var(--spring); }
.mini-flag { width: 16px; height: 11px; border-radius: 2.5px; background: linear-gradient(#fff 50%, #d4213d 50%); box-shadow: 0 0 0 1px rgba(0, 0, 0, .12); }

.hdr-right { display: flex; align-items: center; gap: 6px; }
.clock { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--ink2); font-size: 14px; margin-right: 6px; }
.icon-btn { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; color: var(--ink2); transition: background .2s, color .2s, transform .2s var(--spring); }
.icon-btn:hover { background: var(--acc-soft); color: var(--acc-deep); }
.icon-btn:active { transform: scale(.9); }
.icon-btn.sm { width: 30px; height: 30px; border-radius: 9px; }
.icon-btn.sm svg { width: 16px; height: 16px; }
.theme-btn { position: relative; overflow: hidden; }
.theme-btn svg { position: absolute; transition: transform .55s var(--spring), opacity .3s; }
.theme-btn .moon { transform: translateY(26px) rotate(-60deg); opacity: 0; }
[data-theme="dark"] .theme-btn .sun { transform: translateY(-26px) rotate(90deg); opacity: 0; }
[data-theme="dark"] .theme-btn .moon { transform: none; opacity: 1; }

.menu-wrap { position: relative; }
.menu { position: absolute; right: 0; top: calc(100% + 8px); min-width: 230px; padding: 6px; background: var(--card-solid); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-hi); transform-origin: top right; animation: pop .22s var(--ease); }
.menu button { display: flex; width: 100%; gap: 10px; align-items: center; padding: 9px 10px; border-radius: 9px; font-size: 14px; color: var(--ink2); text-align: left; }
.menu button:hover { background: var(--acc-soft); color: var(--ink); }
@keyframes pop { from { opacity: 0; transform: scale(.94) translateY(-4px); } }

/* ---------- views ---------- */
.view { animation: viewIn .5s var(--ease); }
.view[hidden] { display: none; }
@keyframes viewIn { from { opacity: 0; transform: translateY(10px); } }
.wrap { max-width: 1180px; margin: 0 auto; padding: 28px 24px 40px; }

.hero { padding: 18px 4px 26px; }
.eyebrow { margin: 0 0 6px; color: var(--acc-deep); font-weight: 600; font-size: 13.5px; letter-spacing: .04em; text-transform: uppercase; }
[data-theme="dark"] .eyebrow { color: var(--acc2); }
.hero h1 { margin: 0 0 18px; font-size: clamp(30px, 5vw, 46px); line-height: 1.08; letter-spacing: -.03em; font-weight: 700; }
.hero h1 em { font-style: normal; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip { display: inline-flex; align-items: center; gap: 9px; padding: 8px 14px 8px 10px; background: var(--card); border: 1px solid var(--line); border-radius: 999px; font-size: 14px; color: var(--ink2); box-shadow: var(--shadow); transition: transform .3s var(--spring), box-shadow .3s, border-color .3s; }
a.chip:hover, button.chip:hover { transform: translateY(-2px); box-shadow: var(--shadow-hi); border-color: var(--line2); }
.chip b { color: var(--ink); font-weight: 700; }
.chip .dot { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--acc-soft); color: var(--acc-deep); font-size: 13px; }
[data-theme="dark"] .chip .dot { color: var(--acc2); }
.chip .dot svg { width: 14px; height: 14px; }

/* ---------- grid & cards ---------- */
.grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: var(--gap); }
.grid > .card { grid-column: span var(--span, 6); }
.card {
  position: relative;
  background: var(--card);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: var(--pad);
  box-shadow: var(--shadow);
  transition: box-shadow .4s var(--ease), border-color .4s, background .4s;
  min-width: 0;
}
.card::before { content: ''; position: absolute; inset: 0 0 auto; height: 3px; border-radius: var(--r) var(--r) 0 0; background: var(--grad); opacity: 0; transition: opacity .4s; }
.card:hover { box-shadow: var(--shadow-hi); border-color: var(--line2); }
.card:hover::before { opacity: .9; }
.card-hd { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 16px; }
.card h2 { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 18px; letter-spacing: -.01em; }
.card h2 .ic { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--acc-soft); color: var(--acc-deep); }
[data-theme="dark"] .card h2 .ic { color: var(--acc2); }
.card h2 .ic svg { width: 17px; height: 17px; }
.sub { margin: 3px 0 0 42px; font-size: 13.5px; color: var(--ink3); }
.muted { color: var(--ink3); }
.small { font-size: 13px; }


/* ---------- buttons & inputs ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 38px; padding: 0 14px; border-radius: 11px; font-weight: 600; font-size: 14px; white-space: nowrap; transition: background .2s, color .2s, transform .2s var(--spring), box-shadow .25s, opacity .2s; }
.btn svg { width: 16px; height: 16px; }
.btn:active { transform: scale(.95); }
.btn.ghost { color: var(--ink2); }
.btn.ghost:hover { background: var(--acc-soft); color: var(--acc-deep); }
[data-theme="dark"] .btn.ghost:hover { color: var(--acc2); }
.btn.primary { background: var(--grad); color: #fff; box-shadow: 0 4px 14px color-mix(in srgb, var(--acc) 30%, transparent); }
.btn.primary:hover { box-shadow: 0 6px 20px color-mix(in srgb, var(--acc) 42%, transparent); transform: translateY(-1px); }
.btn.primary:active { transform: scale(.95); }
.btn.primary.soft { background: var(--acc-soft); color: var(--acc-deep); box-shadow: none; }
[data-theme="dark"] .btn.primary.soft { color: var(--acc2); }
.btn.primary.soft:hover { background: var(--acc); color: #fff; }
.btn:disabled { opacity: .45; pointer-events: none; }
.btn .count { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; background: var(--acc-soft); color: var(--acc-deep); font-size: 12px; display: inline-grid; place-items: center; }

input[type="text"], input[type="password"], input[type="number"], input[type="search"], input[type="datetime-local"], select {
  height: 42px; padding: 0 13px; border-radius: var(--r-sm);
  background: var(--card-solid); border: 1.5px solid var(--line2);
  outline: none; min-width: 0;
  transition: border-color .2s, box-shadow .2s, background .2s;
}
input:focus, select:focus { border-color: var(--acc); box-shadow: 0 0 0 4px var(--acc-soft); }
input::placeholder { color: var(--ink3); }
input[type="number"] { -moz-appearance: textfield; }
select { padding-right: 30px; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238798b0' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M7 10l5 5 5-5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 9px center; background-size: 16px; }

/* ---------- to-do ---------- */
.ring-sm { position: relative; width: 46px; height: 46px; flex: none; }
.ring-sm svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-sm circle { fill: none; stroke-linecap: round; }
.ring-sm .trk { stroke: var(--line); stroke-width: 3.5; }
.ring-sm .val { stroke: var(--acc); stroke-width: 3.5; stroke-dasharray: 0 100; transition: stroke-dasharray .8s var(--ease), stroke .3s; }
.ring-sm.full .val { stroke: var(--ok); }
.ring-sm b { position: absolute; inset: 0; display: grid; place-items: center; font-size: 11.5px; font-weight: 700; color: var(--ink2); font-variant-numeric: tabular-nums; }

.add-row { display: flex; gap: 8px; margin-bottom: 10px; }
.add-row input { flex: 1; height: 46px; border-radius: 14px; }
.btn-round { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: var(--grad); color: #fff; box-shadow: 0 4px 14px color-mix(in srgb, var(--acc) 30%, transparent); transition: transform .25s var(--spring), box-shadow .25s; }
.btn-round:hover { transform: rotate(90deg); box-shadow: 0 6px 20px color-mix(in srgb, var(--acc) 42%, transparent); }
.btn-round:active { transform: rotate(90deg) scale(.88); }
.btn-round svg { stroke-width: 2.6; }

.tasks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; max-height: 380px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.task { display: flex; align-items: center; gap: 12px; padding: 9px 8px 9px 6px; border-radius: 12px; transition: background .2s, opacity .35s, transform .35s var(--ease); }
.task.new { animation: slideIn .4s var(--ease) both; }
.task:hover { background: var(--acc-softer); }
.task.leaving { opacity: 0; transform: translateX(24px); }
@keyframes slideIn { from { opacity: 0; transform: translateY(-8px); } }
.check { position: relative; width: 24px; height: 24px; flex: none; border-radius: 8px; border: 2px solid var(--line2); display: grid; place-items: center; transition: background .25s, border-color .25s, transform .3s var(--spring); }
.check:hover { border-color: var(--acc); }
.check:active { transform: scale(.82); }
.check svg { width: 14px; height: 14px; stroke: #fff; stroke-width: 3.2; stroke-dasharray: 20; stroke-dashoffset: 20; transition: stroke-dashoffset .35s var(--ease) .05s; }
.task.done .check { background: var(--grad); border-color: transparent; }
.task.done .check svg { stroke-dashoffset: 0; }
.task.done:not(.quiet) .check { animation: bounce .45s var(--spring); }
@keyframes bounce { 40% { transform: scale(1.2); } }
.task .t { flex: 1; min-width: 0; overflow-wrap: anywhere; cursor: text; position: relative; transition: color .3s; }
.task .t::after { content: ''; position: absolute; left: 0; top: 52%; height: 1.5px; width: 0; background: var(--ink3); transition: width .35s var(--ease); }
.task.done .t { color: var(--ink3); }
.task.done .t::after { width: 100%; }
.task .tag { font-size: 11px; font-weight: 600; color: var(--warn); background: rgba(245, 158, 11, .12); padding: 2px 7px; border-radius: 99px; flex: none; }
.task .edit { flex: 1; height: 32px; padding: 0 8px; }
.x { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; color: var(--ink3); opacity: 0; transition: opacity .2s, background .2s, color .2s; flex: none; }
.x svg { width: 15px; height: 15px; }
.task:hover .x, .x:focus-visible, .row:hover .x { opacity: 1; }
.x:hover { background: var(--danger-soft); color: var(--danger); }
@media (hover: none) { .x { opacity: .7; } }
.card-ft { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line); font-size: 13px; color: var(--ink3); min-height: 40px; }
.card-ft:empty { display: none; }

.empty { text-align: center; padding: 26px 12px; color: var(--ink3); font-size: 14px; }
.empty .big { font-size: 30px; display: block; margin-bottom: 6px; animation: float 3.5s ease-in-out infinite; }
.empty b { color: var(--ink2); display: block; font-size: 15px; margin-bottom: 2px; }
@keyframes float { 50% { transform: translateY(-5px); } }

/* ---------- countdowns ---------- */
.cd-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.cd { position: relative; padding: 16px 16px 14px; border-radius: 16px; background: linear-gradient(160deg, var(--acc-softer), transparent 70%), var(--card-solid); border: 1px solid var(--line); animation: slideIn .45s var(--ease) both; transition: transform .35s var(--spring), box-shadow .35s, border-color .3s; overflow: hidden; }
.cd:hover { transform: translateY(-3px); box-shadow: var(--shadow-hi); border-color: var(--line2); }
.cd.soon { border-color: color-mix(in srgb, var(--acc) 45%, transparent); }
.cd.past { background: linear-gradient(160deg, rgba(16, 185, 129, .1), transparent 70%), var(--card-solid); }
.cd-top { display: flex; align-items: center; gap: 6px; }
.cd-title { flex: 1; min-width: 0; font-weight: 700; font-size: 15.5px; height: 32px; padding: 0 8px; margin-left: -8px; border: 1.5px solid transparent !important; background: transparent !important; border-radius: 9px; box-shadow: none !important; text-overflow: ellipsis; }
.cd-title:hover { background: var(--acc-softer) !important; }
.cd-title:focus { border-color: var(--acc) !important; background: var(--card-solid) !important; }
.cd-nums { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 12px 0 10px; }
.cd-nums div { text-align: center; padding: 8px 0 6px; border-radius: 11px; background: var(--acc-softer); border: 1px solid var(--line); }
.cd-nums b { display: block; font-size: 22px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1.15; }
.cd-nums div:first-child b { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.cd-nums span { font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--ink3); }
.cd-nums b.tick { animation: tick .35s var(--ease); }
@keyframes tick { from { transform: translateY(-4px); opacity: .4; } }
.cd-done { margin: 14px 0 12px; font-weight: 700; font-size: 20px; color: var(--ok); }
.cd-done small { display: block; font-weight: 500; font-size: 13px; color: var(--ink3); }
.cd-bar { height: 5px; border-radius: 99px; background: var(--line); overflow: hidden; }
.cd-bar i { display: block; height: 100%; border-radius: inherit; background: var(--grad); transition: width 1s var(--ease); }
.cd.past .cd-bar i { background: var(--ok); }
.cd-meta { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 10px; }
.cd-date { height: 32px !important; font-size: 12.5px; padding: 0 8px !important; border-radius: 9px !important; color: var(--ink2); max-width: 100%; }
.cd-pct { font-size: 12px; font-weight: 600; color: var(--ink3); font-variant-numeric: tabular-nums; }
.cd .x { opacity: .0; }
.cd:hover .x { opacity: 1; }

.foot-note { text-align: center; color: var(--ink3); font-size: 13px; margin: 30px 0 0; }

/* ---------- Polski frame ---------- */
#view-polish { animation: none; }
.frame-wrap { position: relative; height: calc(100dvh - var(--hdr) - env(safe-area-inset-top)); }
.frame-wrap iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block; background: transparent; opacity: 0; transition: opacity .45s var(--ease); }
.frame-wrap iframe.ready { opacity: 1; }
.frame-loading { position: absolute; inset: 0; display: grid; place-items: center; transition: opacity .3s; }
.frame-loading span { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--acc); animation: spin .8s linear infinite; }
.frame-loading.gone { opacity: 0; pointer-events: none; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- dialogs ---------- */
.dlg { width: min(460px, calc(100vw - 32px)); padding: 0; border: 1px solid var(--line); border-radius: 22px; background: var(--card-solid); color: var(--ink); box-shadow: var(--shadow-hi); }
.dlg[open] { animation: dlgIn .35s var(--spring); }
.dlg::backdrop { background: rgba(8, 25, 45, .35); backdrop-filter: blur(4px); animation: fade .3s; }
@keyframes dlgIn { from { opacity: 0; transform: translateY(16px) scale(.96); } }
@keyframes fade { from { opacity: 0; } }
.dlg form { padding: 22px; display: grid; gap: 12px; }
.dlg h3 { margin: 0 0 4px; font-size: 19px; letter-spacing: -.01em; }
.fld { display: grid; gap: 5px; min-width: 0; }
.fld span { font-size: 12.5px; font-weight: 600; color: var(--ink2); }
.fld input { width: 100%; }
.fld small { font-size: 12px; color: var(--ink3); }
.fld-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.dlg-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }
.dlg .sub0 { margin: -4px 0 2px; }
.gate-err { margin: 0; color: #e5384f; font-size: 13.5px; font-weight: 600; }
.tgl.busy { opacity: .6; pointer-events: none; }
.gate-note { margin: 10px 2px 0; font-size: 12.5px; color: var(--ink3); }
.gate-btns { margin-top: 12px; }
.gate-link { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; margin-top: 12px; padding: 12px; border-radius: 14px; background: var(--acc-softer); border: 1.5px solid color-mix(in srgb, var(--acc) 30%, var(--line)); }
.gate-link input { width: 100%; font-size: 13px; }
.gate-link small { grid-column: 1 / -1; color: var(--ink2); font-size: 12px; }
.dlg select { width: 100%; }
.ds-bad { color: var(--danger); font-weight: 600; }
.chip.chip-warn { border-color: color-mix(in srgb, #f59e0b 55%, var(--line)); background: color-mix(in srgb, #f59e0b 10%, var(--card)); }
.keys { display: grid; grid-template-columns: auto 1fr; gap: 10px 16px; margin: 4px 0; align-items: center; }
.keys dt { text-align: right; }
.keys dd { margin: 0; color: var(--ink2); font-size: 14px; }

/* ---------- toasts ---------- */
.toasts { position: fixed; left: 50%; bottom: calc(22px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 60; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; width: max-content; max-width: calc(100vw - 32px); }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 14px; padding: 11px 12px 11px 16px; border-radius: 14px; background: #0d1b2e; color: #eef6ff; font-size: 14px; box-shadow: 0 10px 30px rgba(0, 0, 0, .25); animation: toastIn .4s var(--spring); }
[data-theme="dark"] .toast { background: #e8f2fd; color: #0d1b2e; }
.toast button { font-weight: 700; color: var(--acc2); padding: 4px 8px; border-radius: 8px; }
[data-theme="dark"] .toast button { color: var(--acc-deep); }
.toast button:hover { background: color-mix(in srgb, var(--acc2) 15%, transparent); }
.toast.out { animation: toastOut .3s var(--ease) forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateY(14px) scale(.95); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(10px) scale(.96); } }

/* theme switch: circular reveal (View Transitions) */
::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }

/* ---------- responsive ---------- */
@media (max-width: 980px) {
  .grid > .card { grid-column: span 12; }
}
@media (max-width: 720px) {
  :root { --hdr: 58px; }
  .hdr { padding: 0 16px; padding-top: env(safe-area-inset-top); gap: 10px; }
  .brand-name, .clock { display: none; }
  .tabs a { padding: 7px 13px; }
  .wrap { padding: 16px 16px 32px; }
  .hero { padding: 10px 0 20px; }
  .grid { gap: 14px; }
  .card { padding: 18px 16px; }
  .sub { margin-left: 0; }
  .card-hd { flex-wrap: wrap; }
  .cd-list { grid-template-columns: 1fr; }
}
@media (max-width: 420px) {
  .chip { font-size: 13px; }
}

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

/* =========================================================
   SCROLL-LINKED MOTION ("scrollmations")
   Modern browsers scrub these with the scroll position; others get a fade-in.
   ========================================================= */
.wrap, .ob-card { zoom: var(--zoom, 1); }
.hero-sub { margin: -8px 0 0; color: var(--ink3); }
.scroll-prog { position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--grad); transform-origin: 0 50%; transform: scaleX(0); pointer-events: none; }
body.route-polish .scroll-prog { display: none; }

@supports (animation-timeline: view()) {
  html:not(.reduce-motion) .sr {
    animation: sr-in linear both;
    animation-timeline: view();
    animation-range: entry 0% entry 80%;
  }
  html:not(.reduce-motion) .chip.sr { animation-range: entry 0% entry 100%; }
  html:not(.reduce-motion) #view-home .hero, html:not(.reduce-motion) #view-settings .hero {
    animation: hero-out linear both;
    animation-timeline: scroll(root);
    animation-range: 0 380px;
  }
  html:not(.reduce-motion) .bg-orbs { animation: orbs-par linear both; animation-timeline: scroll(root); }
  .scroll-prog { animation: prog linear both; animation-timeline: scroll(root); }
  html:not(.reduce-motion) .card h2 .ic { animation: ic-spin linear both; animation-timeline: view(); animation-range: entry 0% cover 40%; }
}
@supports not (animation-timeline: view()) {
  .sr { opacity: 0; transform: translateY(30px) scale(.98); transition: opacity .8s var(--ease), transform .8s var(--ease); }
  .sr.in { opacity: 1; transform: none; }
}
@keyframes sr-in { from { opacity: 0; transform: translateY(56px) scale(.955); } 60% { opacity: 1; } }
@keyframes hero-out { to { opacity: .15; transform: translateY(-46px) scale(.96); } }
@keyframes orbs-par { to { transform: translateY(-160px); } }
@keyframes prog { to { transform: scaleX(1); } }
@keyframes ic-spin { from { transform: rotate(-90deg) scale(.4); opacity: 0; } }
.reduce-motion *, .reduce-motion *::before, .reduce-motion *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
.reduce-motion .sr { opacity: 1 !important; transform: none !important; }

/* ---------- shared form controls ---------- */
.frow { display: grid; grid-template-columns: 170px 1fr; gap: 14px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); }
.frow:first-child { border-top: 0; }
.flbl b { display: block; font-size: 14.5px; }
.flbl small { color: var(--ink3); font-size: 12.5px; }
.seg { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; background: var(--acc-softer); border: 1px solid var(--line); border-radius: 14px; max-width: 100%; }
.seg button { padding: 8px 14px; border-radius: 10px; font-weight: 600; font-size: 14px; color: var(--ink2); display: flex; flex-direction: column; align-items: center; line-height: 1.25; transition: background .25s var(--ease), color .2s, box-shadow .25s, transform .25s var(--spring); }
.seg button small { font-weight: 500; font-size: 11.5px; color: var(--ink3); }
.seg button:hover { color: var(--ink); }
.seg button:active { transform: scale(.94); }
.seg button.on { background: var(--card-solid); color: var(--acc-ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .08), 0 4px 12px color-mix(in srgb, var(--acc) 14%, transparent); }

/* appearance: mode previews + swatches */
.modes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.mode-card { display: grid; gap: 10px; padding: 10px; border-radius: 18px; border: 2px solid var(--line); background: var(--card-solid); transition: border-color .25s, transform .3s var(--spring), box-shadow .3s; text-align: center; }
.mode-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-hi); }
.mode-card.on { border-color: var(--acc); box-shadow: 0 0 0 4px var(--acc-soft); }
.mode-t { font-weight: 700; font-size: 14px; }
.pv { position: relative; display: block; aspect-ratio: 16 / 10; border-radius: 11px; overflow: hidden; --pb: #f6f9fc; --pc: #fff; --pl: #e3eaf2; background: var(--pb); border: 1px solid var(--pl); }
.pv-dark { --pb: #0a0f18; --pc: #131b28; --pl: #1f2938; }
.pv-system { background: linear-gradient(115deg, #f6f9fc 50%, #0a0f18 50%); }
.pv i { position: absolute; border-radius: 4px; }
.pv-top { left: 0; right: 0; top: 0; height: 15%; background: var(--pc); border-bottom: 1px solid var(--pl); border-radius: 0 !important; }
.pv-hero { left: 8%; top: 24%; width: 44%; height: 9%; background: var(--acc); }
.pv-a { left: 8%; top: 42%; width: 38%; height: 46%; background: var(--pc); border: 1px solid var(--pl); }
.pv-b { left: 50%; top: 42%; width: 42%; height: 46%; background: var(--pc); border: 1px solid var(--pl); }
.pv-c { left: 54%; top: 52%; width: 22%; height: 6%; background: var(--acc2); }
.pv-system .pv-top { background: linear-gradient(115deg, #fff 50%, #131b28 50%); }
.pv-system .pv-a { background: #fff; border-color: #e3eaf2; }
.pv-system .pv-b { background: #131b28; border-color: #1f2938; }
.sw-label { margin: 20px 0 10px; font-weight: 700; font-size: 14.5px; }
.swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 10px; }
.sw { display: grid; justify-items: center; gap: 6px; padding: 10px 6px; border-radius: 14px; border: 1.5px solid transparent; font-size: 12.5px; font-weight: 600; color: var(--ink2); transition: background .2s, border-color .2s, transform .3s var(--spring); }
.sw:hover { background: var(--acc-softer); transform: translateY(-2px); }
.sw.on { border-color: var(--line2); background: var(--acc-softer); color: var(--ink); }
.sw i { width: 40px; height: 40px; border-radius: 50%; background: linear-gradient(135deg, var(--sw2), var(--sw)); display: grid; place-items: center; box-shadow: 0 4px 14px color-mix(in srgb, var(--sw) 40%, transparent); transition: transform .35s var(--spring); }
.sw.on i { transform: scale(1.1); box-shadow: 0 0 0 3px var(--card-solid), 0 0 0 5px var(--sw); }
.sw svg { color: #fff; stroke-width: 3; opacity: 0; transform: scale(.4); transition: opacity .2s, transform .35s var(--spring); }
.sw.on svg { opacity: 1; transform: none; }

/* toggles */
.tgls { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.tgl { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--card-solid); text-align: left; transition: border-color .25s, background .25s; }
.tgl.on { border-color: color-mix(in srgb, var(--acc) 40%, var(--line)); background: var(--acc-softer); }
.tgl-t b { display: block; font-size: 14.5px; }
.tgl-t small { color: var(--ink3); font-size: 12.5px; }
.tgl i { position: relative; width: 42px; height: 24px; flex: none; border-radius: 99px; background: var(--line2); transition: background .25s; }
.tgl i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); transition: transform .35s var(--spring); }
.tgl.on i { background: var(--acc); }
.tgl.on i::after { transform: translateX(18px); }

/* ---------- settings page ---------- */
.wrap.narrow { max-width: 860px; }
.set-body { display: grid; gap: var(--gap); }
.set-card .card-hd { margin-bottom: 10px; }
.sub0 { margin: 4px 0 0; font-size: 13.5px; color: var(--ink3); }
.set-card.flash { animation: flash 1.6s var(--ease) !important; }
@keyframes flash { 0%, 40% { box-shadow: 0 0 0 4px var(--acc-soft), var(--shadow-hi); border-color: var(--acc); } }
.data-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.btn.danger { color: var(--danger); }
.btn.danger:hover { background: var(--danger-soft); color: var(--danger); }

/* ---------- first-run setup ---------- */
html.onboarding body { overflow: hidden; }
html.onboarding .hdr, html.onboarding #views { visibility: hidden; }
.ob { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 24px 16px; overflow-y: auto; background: var(--bg-grad); animation: fade .5s var(--ease); }
.ob[hidden] { display: none; }
.ob.leaving { animation: obOut .5s var(--ease) forwards; }
@keyframes obOut { to { opacity: 0; transform: scale(1.03); } }
.ob-card { position: relative; width: min(680px, 100%); max-height: calc(100dvh - 48px); display: flex; flex-direction: column; background: var(--card); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border: 1px solid var(--line); border-radius: 28px; box-shadow: var(--shadow-hi); animation: dlgIn .6s var(--spring); }
.ob-top { display: flex; align-items: center; gap: 14px; padding: 20px 24px 0; }
.ob-steps { flex: 1; display: flex; gap: 6px; }
.ob-steps i { flex: 1; height: 5px; border-radius: 99px; background: var(--line); overflow: hidden; position: relative; }
.ob-steps i::after { content: ""; position: absolute; inset: 0; background: var(--grad); transform: scaleX(0); transform-origin: 0 50%; transition: transform .6s var(--ease); }
.ob-steps i.done::after, .ob-steps i.on::after { transform: scaleX(1); }
.ob-steps i.on::after { opacity: .55; }
.ob-count { font-size: 12.5px; font-weight: 600; color: var(--ink3); font-variant-numeric: tabular-nums; }
.ob-body { padding: 22px 24px 8px; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; }
.ob-step { animation: stepIn .5s var(--ease); }
.ob-step.back { animation-name: stepBack; }
@keyframes stepIn { from { opacity: 0; transform: translateX(34px); } }
@keyframes stepBack { from { opacity: 0; transform: translateX(-34px); } }
.ob-step h2 { margin: 0 0 6px; font-size: clamp(24px, 4vw, 32px); letter-spacing: -.025em; }
.ob-sub { margin: 0 0 22px; color: var(--ink2); }
.ob-body.nudge { animation: shake .4s; }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
.ob-nav { display: flex; align-items: center; gap: 10px; padding: 14px 24px 20px; border-top: 1px solid var(--line); }
.ob-err { flex: 1; font-size: 13px; color: var(--danger); font-weight: 600; text-align: right; }
.ob-nav .btn.primary { min-width: 130px; height: 44px; border-radius: 13px; }

@media (max-width: 720px) {
  .frow { grid-template-columns: 1fr; gap: 8px; }
  .modes { gap: 8px; }
  .mode-card { padding: 7px; border-radius: 14px; }
  .mode-t { font-size: 12.5px; }
  .ob { padding: 0; place-items: stretch; }
  .ob-card { max-height: none; min-height: 100dvh; border-radius: 0; border: 0; }
  .ob-top { padding: calc(16px + env(safe-area-inset-top)) 16px 0; }
  .ob-body { padding: 18px 16px 8px; flex: 1; }
  .ob-nav { padding: 12px 16px calc(14px + env(safe-area-inset-bottom)); flex-wrap: wrap; }
  .ob-err { order: -1; flex-basis: 100%; text-align: left; }
  .ob-nav .btn.primary { flex: 1; }
}

/* ---------- moving data from the old address ---------- */
.xfer-offer { display: flex; align-items: center; gap: 14px; margin: -6px 0 20px; padding: 14px 14px 14px 16px; border-radius: 18px; background: linear-gradient(120deg, var(--acc-soft), transparent 85%), var(--card); border: 1px solid var(--line2); box-shadow: var(--shadow); }
.xfer-offer .xo-ic { width: 40px; height: 40px; flex: none; border-radius: 12px; display: grid; place-items: center; background: var(--grad); color: #fff; font-size: 20px; font-weight: 700; }
.xfer-offer div { flex: 1; min-width: 0; }
.xfer-offer b { display: block; }
.xfer-offer small { color: var(--ink2); }
.xfer { position: fixed; inset: 0; z-index: 120; display: grid; place-items: center; padding: 16px; background: var(--bg-grad); }
.xfer-card { width: min(380px, 100%); text-align: center; padding: 30px 24px; border-radius: 24px; background: var(--card-solid); border: 1px solid var(--line); box-shadow: var(--shadow-hi); animation: dlgIn .5s var(--spring); }
.xfer-card h2 { margin: 14px 0 6px; font-size: 22px; letter-spacing: -.02em; }
.xfer-card p { margin: 0; color: var(--ink2); }
.xfer-ic { width: 54px; height: 54px; margin: 0 auto; border-radius: 16px; display: grid; place-items: center; font-size: 24px; color: #fff; background: var(--grad); animation: spin 1.6s linear infinite; }
.xfer-ic.ok { animation: dlgIn .5s var(--spring); background: var(--ok); }
html.transfer-mode .hdr, html.transfer-mode #views { visibility: hidden; }
@media (max-width: 720px) { .xfer-offer { flex-wrap: wrap; } .xfer-offer .btn.primary { flex: 1 0 100%; order: 3; } }

/* =========================================================
   APP SHELL ON PHONES — bottom tab bar, compact top bar, full-height Polski
   ========================================================= */
.btabs { display: none; }
@media (max-width: 720px) {
  :root { --btabs: calc(64px + env(safe-area-inset-bottom)); }
  .tabs, #setBtn, .clock { display: none; }
  .brand-name { display: inline; font-size: 18px; }
  .hdr { gap: 6px; }
  .hdr-right { margin-left: auto; }
  body.route-polish .hdr { display: none; }
  .frame-wrap { height: calc(100dvh - var(--btabs)); }
  .wrap { padding-bottom: calc(var(--btabs) + 28px); }
  .toasts { bottom: calc(var(--btabs) + 14px); }
  body.polish-focus .toasts { bottom: calc(22px + env(safe-area-inset-bottom)); }

  .btabs {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    display: flex; justify-content: space-around; align-items: stretch;
    height: var(--btabs); padding: 8px 8px env(safe-area-inset-bottom);
    background: color-mix(in srgb, var(--card-solid) 88%, transparent);
    backdrop-filter: saturate(1.6) blur(20px); -webkit-backdrop-filter: saturate(1.6) blur(20px);
    border-top: 1px solid var(--line);
    transition: transform .35s var(--ease);
  }
  body.polish-focus .btabs { transform: translateY(110%); }
  body.polish-focus .frame-wrap { height: 100dvh; }
  .btabs a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; color: var(--ink3); font-size: 12px; font-weight: 600; -webkit-user-select: none; user-select: none; }
  .bt-ic { position: relative; width: 60px; height: 32px; border-radius: 999px; display: grid; place-items: center; transition: background .3s var(--ease), color .2s; }
  .bt-ic svg { width: 22px; height: 22px; transition: transform .35s var(--spring); }
  .btabs a:active .bt-ic svg { transform: scale(.86); }
  .btabs a.active { color: var(--acc-ink); }
  .btabs a.active .bt-ic { background: var(--acc-soft); color: var(--acc-ink); }
  .btabs a.active .bt-ic svg { stroke-width: 2.4; }

  .hero h1 { font-size: 34px; }
  .card-hd h2 { font-size: 17px; }
}
@media (pointer: coarse) { .kb-hint, .kb-only { display: none !important; } }

/* ---------- the Android app: behave like an app, not a web page ---------- */
html.native, html.native body { overscroll-behavior: none; }
html.native body { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
html.native input, html.native textarea, html.native [contenteditable] { -webkit-user-select: text; user-select: text; }
html.native .hdr { padding-top: 0; }
html.native .bg-orbs { display: none; }

/* =========================================================
   FOCUS TIMER (focus.js)
   Each phase has its own colour: focus = accent, breaks = teal / green, custom = indigo.
   ========================================================= */
.focus { --ph: var(--acc); --ph2: var(--acc2); display: flex; flex-direction: column; }
.focus[data-phase="short"] { --ph: var(--f); --ph2: color-mix(in srgb, var(--f) 60%, #fff); }
.focus[data-phase="long"] { --ph: var(--ok); --ph2: color-mix(in srgb, var(--ok) 60%, #fff); }
.focus[data-phase="custom"] { --ph: var(--c); --ph2: color-mix(in srgb, var(--c) 60%, #fff); }
.fm-modes { display: flex; width: 100%; }
.fm-modes button { flex: 1; padding: 7px 6px; }
.fm-modes button.on { color: var(--ph); }
.fm-dial { position: relative; width: min(232px, 72%); aspect-ratio: 1; margin: 18px auto 10px; }
.fm-svg { width: 100%; height: 100%; transform: rotate(-90deg); overflow: visible; }
.fm-svg circle { fill: none; stroke-linecap: round; }
.fm-svg .trk { stroke: var(--line); stroke-width: 7; }
.fm-svg .val { stroke: var(--ph); stroke-width: 7; stroke-dasharray: 100 100; transition: stroke-dasharray .35s linear, stroke .4s; filter: drop-shadow(0 0 6px color-mix(in srgb, var(--ph) 45%, transparent)); }
.focus:not(.running) .fm-svg .val { filter: none; }
.fm-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; }
.fm-time { font-size: clamp(38px, 4.4vw, 50px); font-weight: 700; letter-spacing: -.035em; line-height: 1; font-variant-numeric: tabular-nums; padding: 4px 10px; border-radius: 14px; transition: transform .25s var(--spring), color .3s; }
.fm-time:hover { background: var(--acc-softer); }
.fm-time:active { transform: scale(.96); }
.focus.running .fm-time { color: var(--ph); }
.fm-label { font-size: 13px; font-weight: 600; color: var(--ink3); max-width: 80%; text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fm-dots { display: flex; gap: 6px; min-height: 8px; margin-top: 4px; }
.fm-dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--line2); transition: background .3s, transform .3s var(--spring); }
.fm-dots i.on { background: var(--ph); transform: scale(1.1); }
.fm-dots i.now { background: color-mix(in srgb, var(--ph) 45%, transparent); animation: breathe 1.6s ease-in-out infinite; }
@keyframes breathe { 50% { transform: scale(1.35); } }
.focus.rang .fm-dial { animation: ring .9s var(--spring); }
@keyframes ring { 20% { transform: scale(1.06) rotate(-3deg); } 40% { transform: scale(1.06) rotate(3deg); } 60% { transform: scale(1.03) rotate(-2deg); } }

.fm-custom { display: grid; gap: 10px; margin: 2px 0 6px; animation: slideIn .35s var(--ease); }
.fm-presets { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.fm-pre { padding: 6px 11px; border-radius: 99px; font-size: 13px; font-weight: 600; color: var(--ink2); border: 1.5px solid var(--line2); transition: background .2s, color .2s, border-color .2s, transform .2s var(--spring); }
.fm-pre:hover { border-color: var(--ph); color: var(--ink); }
.fm-pre:active { transform: scale(.92); }
.fm-pre.on { background: var(--ph); border-color: var(--ph); color: #fff; }
.fm-crow { display: flex; gap: 8px; }
.fm-crow > input { flex: 1; height: 40px; }
.fm-min, .num-in { position: relative; display: inline-flex; align-items: center; }
.fm-min input, .num-in input { width: 92px; height: 40px; padding-right: 38px; text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.fm-min span, .num-in span { position: absolute; right: 11px; font-size: 12.5px; color: var(--ink3); pointer-events: none; }
.num-in input { width: 84px; height: 38px; }
.fm-task { display: flex; align-items: center; gap: 10px; margin: 2px 0 6px; font-size: 13px; font-weight: 600; color: var(--ink3); }
.fm-task select { flex: 1; height: 38px; font-size: 14px; font-weight: 500; color: var(--ink); }
.fm-ctl { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 8px; }
.btn.primary.fm-go { min-width: 132px; height: 48px; border-radius: 15px; font-size: 15.5px; background: linear-gradient(135deg, var(--ph2), var(--ph)); box-shadow: 0 6px 18px color-mix(in srgb, var(--ph) 32%, transparent); }
.btn.primary.fm-go:hover { box-shadow: 0 8px 24px color-mix(in srgb, var(--ph) 45%, transparent); }
.fm-go svg { width: 17px; height: 17px; fill: currentColor; stroke-width: 1.5; }
.fm-ctl .icon-btn { width: 44px; height: 44px; border-radius: 14px; border: 1.5px solid var(--line); }
.fm-plus { font-weight: 700; font-size: 14px; }
.fm-week { margin-top: auto; padding-top: 16px; }
.fm-week:not(:empty) { border-top: 1px dashed var(--line); }
.fm-ctl + .fm-week { margin-top: 18px; }
.fw-hd { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--ink3); font-weight: 600; margin-bottom: 8px; }
.fw-hd b { color: var(--ink2); }
.fw-bars { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }
.fw-col { display: grid; justify-items: center; gap: 4px; }
.fw-bar { position: relative; width: 100%; max-width: 26px; height: 46px; border-radius: 7px; background: var(--acc-softer); overflow: hidden; }
.fw-bar i { position: absolute; left: 0; right: 0; bottom: 0; border-radius: 7px; background: color-mix(in srgb, var(--acc) 55%, transparent); transition: height .8s var(--ease); }
.fw-col.today .fw-bar i { background: var(--grad); }
.fw-col small { font-size: 11px; font-weight: 600; color: var(--ink3); }
.fw-col.today small { color: var(--acc-ink); }

/* timer pill in the header + live state elsewhere */
.tpill { display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 12px 0 10px; margin-right: 4px; border-radius: 99px; background: var(--acc-soft); color: var(--acc-ink); font-weight: 700; font-size: 13.5px; font-variant-numeric: tabular-nums; animation: pop .3s var(--spring); transition: background .2s; }
.tpill:hover { background: color-mix(in srgb, var(--acc) 22%, transparent); }
.tpill i { width: 8px; height: 8px; border-radius: 50%; background: currentColor; animation: breathe 1.6s ease-in-out infinite; }
.tpill.paused i { animation: none; opacity: .45; }
.tpill[data-phase="short"], .tpill[data-phase="long"] { background: color-mix(in srgb, var(--ok) 15%, transparent); color: var(--ok); }
.tpill[data-phase="custom"] { background: color-mix(in srgb, var(--c) 15%, transparent); color: var(--c); }
.chip-live b { font-variant-numeric: tabular-nums; color: var(--acc-ink); }
.btabs a.timing .bt-l { font-variant-numeric: tabular-nums; color: var(--acc-ink); }

/* tasks: focus button + tomato count */
.task .poms { font-size: 12px; font-weight: 700; color: var(--ink3); flex: none; white-space: nowrap; }
.task .fx:hover { background: var(--acc-soft); color: var(--acc-ink); }
.task .fx svg { fill: currentColor; stroke-width: 1.5; width: 13px; height: 13px; }
.task.focusing { background: var(--acc-softer); box-shadow: inset 3px 0 0 var(--acc); }
.task.focusing .fx { opacity: 1; color: var(--acc-ink); }

/* settings: preset lengths + an "any length" box */
.seg-num { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.tgls-gap { margin-top: 16px; }

/* =========================================================
   HABITS (habits.js)
   ========================================================= */
.habit-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; max-height: 420px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.habit, .hb-head { display: grid; grid-template-columns: 24px minmax(0, 1fr) auto 28px; align-items: center; gap: 10px; padding: 8px 4px 8px 6px; border-radius: 12px; }
.habit { transition: background .2s, opacity .35s, transform .35s var(--ease); }
.habit.new { animation: slideIn .4s var(--ease) both; }
.habit:hover { background: var(--acc-softer); }
.habit.leaving { opacity: 0; transform: translateX(24px); }
.hb-head { padding-top: 0; padding-bottom: 0; }
.habit.done .check { background: var(--grad); border-color: transparent; }
.habit.done:not(.quiet) .check { animation: bounce .45s var(--spring); }
.habit.done .check svg { stroke-dashoffset: 0; }
.hb-main { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; min-width: 0; }
.hb-name { min-width: 0; overflow-wrap: anywhere; line-height: 1.3; font-weight: 500; cursor: text; }
.habit .edit { height: 32px; padding: 0 8px; width: 100%; }
.hb-streak { flex: none; font-size: 12px; font-weight: 700; color: var(--warn); background: rgba(245, 158, 11, .12); padding: 2px 7px; border-radius: 99px; }
.hb-streak.hot { color: #fff; background: linear-gradient(135deg, #fbbf24, #f97316); }
.hb-days { display: grid; grid-template-columns: repeat(7, 18px); gap: 5px; justify-items: center; }
.hb-days small { font-size: 10.5px; font-weight: 700; color: var(--ink3); }
.hb-days small.today { color: var(--acc-ink); }
.hb-d { width: 18px; height: 18px; border-radius: 6px; background: var(--acc-softer); border: 1.5px solid var(--line2); transition: background .2s, border-color .2s, transform .25s var(--spring); }
.hb-d:hover { border-color: var(--acc); }
.hb-d:active { transform: scale(.8); }
.hb-d.on { background: var(--acc); border-color: transparent; }
.hb-d.today { box-shadow: 0 0 0 2px var(--card-solid), 0 0 0 3.5px color-mix(in srgb, var(--acc) 40%, transparent); }
.habit .x { opacity: 0; }
.habit:hover .x { opacity: 1; }
@media (hover: none) { .habit .x { opacity: .6; } }
@media (max-width: 420px) {
  .habit { grid-template-columns: 24px minmax(0, 1fr) 28px; row-gap: 6px; }
  .habit .hb-days { grid-column: 2 / 3; grid-row: 2; justify-content: start; }
  .habit .x { grid-column: 3; grid-row: 1; }
  .hb-head { display: none; }
}
@media (max-width: 720px) {
  .fm-dial { width: min(220px, 66%); }
  .fm-ctl { gap: 8px; }
  .btn.primary.fm-go { flex: 1; max-width: 200px; }
}

/* ---------- command palette (Ctrl+K) ---------- */
.menu button kbd { margin-left: auto; }
.cmd-dlg { width: min(600px, calc(100vw - 24px)); margin-top: min(12vh, 110px); overflow: hidden; }
.cmd-box { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.cmd-box svg { width: 20px; height: 20px; flex: none; fill: none; stroke: var(--ink3); stroke-width: 2.2; stroke-linecap: round; }
.cmd-box input { flex: 1; min-width: 0; height: 40px; border: 0; background: transparent; padding: 0; font-size: 16.5px; box-shadow: none; }
.cmd-box input:focus { box-shadow: none; }
.cmd-list { list-style: none; margin: 0; padding: 6px; max-height: min(56vh, 440px); overflow-y: auto; overscroll-behavior: contain; }
.cmd-g { padding: 10px 10px 4px; font-size: 11.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--ink3); }
.cmd-i { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border-radius: 11px; cursor: pointer; font-size: 14.5px; color: var(--ink); }
.cmd-i small { color: var(--ink3); font-size: 12px; white-space: nowrap; }
.cmd-i.on { background: var(--acc-soft); }
.cmd-i.on span { color: var(--acc-ink); font-weight: 600; }
.cmd-none { padding: 22px; text-align: center; color: var(--ink3); font-size: 14px; }

/* ---------- weekly review ---------- */
.wk-dlg { width: min(680px, calc(100vw - 24px)); max-height: calc(100dvh - 32px); overflow-y: auto; }
.wk-hd { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.wk-hd .eyebrow { margin: 0 0 2px; }
.wk-line { margin: 0; color: var(--ink2); font-size: 14.5px; }
.wk-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.wk-tile { display: grid; gap: 1px; padding: 12px 14px; border-radius: 14px; background: var(--acc-softer); border: 1px solid var(--line); }
.wk-tile > span { font-size: 18px; }
.wk-tile small { font-size: 12.5px; color: var(--ink3); font-weight: 600; }
.wk-tile b { font-size: 24px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.wk-tile .wk-d { font-size: 11.5px; font-weight: 600; color: var(--ink3); }
.wk-d.up { color: #059669; }
.wk-d.down { color: var(--danger); }
.wk-chart { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; height: 120px; align-items: end; padding-top: 6px; }
.wk-col { display: grid; grid-template-rows: 1fr auto; gap: 4px; height: 100%; text-align: center; }
.wk-col small { font-size: 11.5px; color: var(--ink3); }
.wk-col.today small { color: var(--acc-ink); font-weight: 700; }
.wk-bars { display: flex; align-items: flex-end; justify-content: center; gap: 3px; height: 100%; }
.wk-bars i { width: 38%; max-width: 16px; min-height: 2px; border-radius: 5px 5px 2px 2px; transition: height .5s var(--spring); }
.wk-bars i.f, .wk-leg i.f { background: var(--acc); }
.wk-bars i.t, .wk-leg i.t { background: #10b981; }
.wk-leg { margin-top: -4px; }
.wk-two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.wk-two h4 { margin: 0 0 6px; font-size: 14px; }
.wk-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.wk-list li { display: flex; justify-content: space-between; gap: 10px; font-size: 13.5px; padding: 6px 10px; border-radius: 9px; background: var(--acc-softer); }
.wk-list li span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.wk-list li b { white-space: nowrap; font-variant-numeric: tabular-nums; }
.wk-mute { margin: 0; color: var(--ink3); font-size: 13px; }
.chip.chip-week { border-color: color-mix(in srgb, var(--acc) 45%, var(--line)); }
@media (max-width: 560px) {
  .wk-tiles { grid-template-columns: repeat(2, 1fr); }
  .wk-two { grid-template-columns: 1fr; }
  .cmd-dlg { margin-top: 12px; }
}
/* dialogs never wider than the screen, even if something else overflows */
.dlg { max-width: calc(100vw - 24px); }
.tgl-t small strong { font-weight: 700; color: var(--ink2); }

/* visible to screen readers and search engines, not on screen */
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; }
