/* Stilltab New Tab. Tokens: ../shared/tokens.css. Scene vars set by boot.js/newtab.js. */

:root {
  /* Default scene (Dusk) — replaced before first paint by boot.js */
  --s-base: #0D0F22;
  --s-c1: #2E3384;
  --s-c2: #4F4396;
  --s-c3: #D98D74;
  --s-c4: #1A2156;
  --photo-blur: 0px;
  --photo-dim: 0.25;
}

/* Scene colors are typed, so switching scenes (or "Day & night" moving on) cross-fades. */
@property --s-base { syntax: '<color>'; inherits: true; initial-value: #0D0F22; }
@property --s-c1 { syntax: '<color>'; inherits: true; initial-value: #2E3384; }
@property --s-c2 { syntax: '<color>'; inherits: true; initial-value: #4F4396; }
@property --s-c3 { syntax: '<color>'; inherits: true; initial-value: #D98D74; }
@property --s-c4 { syntax: '<color>'; inherits: true; initial-value: #1A2156; }
:root { transition: --s-base 1.4s ease, --s-c1 1.4s ease, --s-c2 1.4s ease, --s-c3 1.4s ease, --s-c4 1.4s ease; }

/* Glass + text colors for each tone */
:root[data-tone="dark"] {
  --g-bg: rgba(255, 255, 255, 0.09);
  --g-bg-hover: rgba(255, 255, 255, 0.14);
  --g-border: rgba(255, 255, 255, 0.16);
  --g-highlight: rgba(255, 255, 255, 0.22);
  --g-text: #FFFFFF;
  --g-text-2: rgba(255, 255, 255, 0.72);
  --g-text-3: rgba(255, 255, 255, 0.48);
  --g-fill: rgba(255, 255, 255, 0.1);
  --g-shadow: 0 24px 60px -24px rgba(0, 0, 0, 0.55);
  --hero-shadow: 0 2px 24px rgba(0, 0, 0, 0.25);
  --blend: screen;
  --pop-bg: rgba(22, 24, 32, 0.74);
  --pass: #4ADE80;
  --fail: #FF7A7A;
}
:root[data-tone="light"] {
  --g-bg: rgba(255, 255, 255, 0.5);
  --g-bg-hover: rgba(255, 255, 255, 0.66);
  --g-border: rgba(255, 255, 255, 0.75);
  --g-highlight: rgba(255, 255, 255, 0.9);
  --g-text: #16181D;
  --g-text-2: rgba(22, 24, 29, 0.66);
  --g-text-3: rgba(22, 24, 29, 0.45);
  --g-fill: rgba(22, 24, 29, 0.06);
  --g-shadow: 0 24px 60px -28px rgba(40, 30, 80, 0.28);
  --hero-shadow: none;
  --blend: normal;
  --pop-bg: rgba(255, 255, 255, 0.84);
  --pass: #18794E;
  --fail: #CD2B31;
}
:root[data-photo="on"] {
  --g-bg: rgba(20, 20, 24, 0.32);
  --g-bg-hover: rgba(20, 20, 24, 0.42);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  min-height: 100vh;
  background: var(--s-base);
  color: var(--g-text);
  font: 14px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }
svg { display: block; flex: none; }

/* ---------- Background ---------- */
.bg { position: fixed; inset: 0; z-index: 0; overflow: hidden; background: var(--s-base); }
.bg-scene {
  position: absolute;
  inset: -4vmax;
  /* Follows the cursor slightly (set by newtab.js) */
  transform: translate3d(calc(var(--px, 0) * -3vmax), calc(var(--py, 0) * -3vmax), 0);
  transition: transform 1.8s cubic-bezier(0.16, 1, 0.3, 1);
}
:root[data-motion="off"] .bg-scene { transform: none; }
.bg-scene i {
  position: absolute;
  width: 75vmax;
  height: 75vmax;
  border-radius: 50%;
  mix-blend-mode: var(--blend);
  opacity: 0.85;
  will-change: transform;
}
.bg-scene i:nth-child(1) { left: -20vmax; top: -25vmax; background: radial-gradient(closest-side, var(--s-c1), transparent); animation: drift-a 38s ease-in-out infinite alternate; }
.bg-scene i:nth-child(2) { right: -25vmax; top: -15vmax; background: radial-gradient(closest-side, var(--s-c2), transparent); animation: drift-b 46s ease-in-out infinite alternate; }
.bg-scene i:nth-child(3) { left: 10vmax; bottom: -35vmax; background: radial-gradient(closest-side, var(--s-c3), transparent); animation: drift-c 52s ease-in-out infinite alternate; opacity: 0.7; }
.bg-scene i:nth-child(4) { right: -10vmax; bottom: -30vmax; background: radial-gradient(closest-side, var(--s-c4), transparent); animation: drift-d 44s ease-in-out infinite alternate; }
@keyframes drift-a { to { transform: translate(18vmax, 14vmax) scale(1.15); } }
@keyframes drift-b { to { transform: translate(-16vmax, 18vmax) scale(0.9); } }
@keyframes drift-c { to { transform: translate(20vmax, -14vmax) scale(1.2); } }
@keyframes drift-d { to { transform: translate(-22vmax, -10vmax) scale(1.05); } }
:root[data-motion="off"] .bg-scene i { animation: none; }

.bg-photo {
  position: absolute;
  inset: calc(var(--photo-blur) * -2);
  background: center / cover no-repeat;
  filter: blur(var(--photo-blur)) brightness(calc(1 - var(--photo-dim)));
  opacity: 0;
  transition: opacity 0.6s ease;
}
:root[data-photo="on"] .bg-photo.is-ready { opacity: 1; }
/* Bundled photo wallpaper: visible from the first frame (boot.js sets --wall) */
:root[data-photo="on"][data-wall="on"] .bg-photo { opacity: 1; background-image: var(--wall); transition: none; }
:root[data-photo="on"] .bg-scene { display: none; }

.bg-grain {
  position: absolute;
  inset: 0;
  opacity: 0.09;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}
:root[data-grain="off"] .bg-grain { display: none; }
.bg-vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 35%, transparent 40%, rgba(0, 0, 0, 0.28));
}
:root[data-tone="light"]:not([data-photo="on"]) .bg-vignette { background: radial-gradient(ellipse at 50% 35%, transparent 50%, rgba(80, 60, 120, 0.08)); }

/* ---------- Glass primitives ---------- */
.glass {
  background: var(--g-bg);
  border: 1px solid var(--g-border);
  box-shadow: inset 0 1px 0 var(--g-highlight), var(--g-shadow);
  backdrop-filter: blur(28px) saturate(1.7);
  -webkit-backdrop-filter: blur(28px) saturate(1.7);
}

.glass-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 14px;
  border-radius: 13px;
  background: var(--g-bg);
  border: 1px solid var(--g-border);
  box-shadow: inset 0 1px 0 var(--g-highlight);
  backdrop-filter: blur(20px) saturate(1.6);
  color: var(--g-text);
  font-weight: 600;
  font-size: 13px;
  transition: background 0.2s, transform 0.2s var(--ease);
}
.glass-btn:hover { background: var(--g-bg-hover); }
.glass-btn:active { transform: scale(0.97); }
.glass-btn svg { width: 18px; height: 18px; }
.glass-btn.icon { width: 40px; padding: 0; justify-content: center; }

/* ---------- Layout ---------- */
.nt-top {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  pointer-events: none;
}
.nt-top > * { pointer-events: auto; }
.nt-top-right { display: flex; gap: 8px; margin-left: auto; }

.weather-mini {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px 6px 8px;
  border-radius: 12px;
  color: var(--g-text);
  text-shadow: var(--hero-shadow);
  transition: background 0.2s;
}
.weather-mini:hover { background: var(--g-fill); }
.weather-mini svg { width: 26px; height: 26px; }
.weather-mini b { font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; }
.weather-mini span { color: var(--g-text-2); font-size: 13px; }

.nt-main {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
  min-height: 100dvh;
  padding: var(--pad-top) 32px var(--pad-bottom);
  --pad-top: clamp(28px, 9vh, 88px);
  --pad-bottom: 40px;
}

/* ---------- Hero ---------- */
.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  text-align: center;
  /* No animation on .hero itself: a transform would trap the fixed dock inside it, and a fade
     would fade the dock too. Its children animate instead; the dock simply stays put. */
}
.hero > :not(.shortcuts) { animation: hero-in 0.7s var(--ease) backwards; }
:root[data-dock="off"] .hero > .shortcuts { animation: hero-in 0.7s var(--ease) backwards; }
@keyframes hero-in { from { opacity: 0; transform: translateY(12px); } }

.greeting {
  margin: 0 0 4px;
  color: var(--g-text-2);
  font: 500 clamp(16px, 1.5vw, 20px)/1.3 var(--font-display);
  letter-spacing: -0.01em;
  text-shadow: var(--hero-shadow);
}
.clock {
  margin: 0;
  font: 200 clamp(88px, 11vw, 156px)/0.95 var(--font-display);
  letter-spacing: -0.045em;
  font-variant-numeric: tabular-nums;
  text-shadow: var(--hero-shadow);
}
.clock .colon { display: inline-block; margin: 0 0.02em; opacity: 0.8; transform: translateY(-0.06em); }
.clock .ampm { margin-left: 0.18em; font-size: 0.24em; font-weight: 500; letter-spacing: 0; opacity: 0.7; }
.date {
  margin: 12px 0 0;
  color: var(--g-text-2);
  font: 500 clamp(14px, 1.2vw, 17px)/1.3 var(--font-display);
  text-shadow: var(--hero-shadow);
}

.search {
  display: flex;
  align-items: center;
  gap: 12px;
  width: min(640px, 100%);
  height: 56px;
  margin-top: 36px;
  padding: 0 14px 0 20px;
  border-radius: 18px;
  background: var(--g-bg);
  border: 1px solid var(--g-border);
  box-shadow: inset 0 1px 0 var(--g-highlight), var(--g-shadow);
  backdrop-filter: blur(28px) saturate(1.7);
  transition: background 0.2s, box-shadow 0.2s, transform 0.2s var(--ease);
}
.search:hover { background: var(--g-bg-hover); }
.search:focus-within {
  background: var(--g-bg-hover);
  box-shadow: inset 0 1px 0 var(--g-highlight), 0 0 0 3px color-mix(in srgb, var(--accent) 55%, transparent), var(--g-shadow);
  transform: translateY(-1px);
}
.search > svg { width: 20px; height: 20px; color: var(--g-text-2); }
.search input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 16px;
}
.search input::placeholder { color: var(--g-text-3); }

/* ---------- Shortcuts ---------- */
.shortcuts {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  max-width: 820px;
  margin-top: 28px;
}
.sc {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 88px;
  padding: 10px 4px 8px;
  border-radius: 16px;
  color: var(--g-text);
  text-decoration: none;
  transition: background 0.2s, transform 0.2s var(--ease);
}
.sc:hover { background: var(--g-fill); transform: translateY(-2px); }
.sc-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: var(--g-bg);
  border: 1px solid var(--g-border);
  box-shadow: inset 0 1px 0 var(--g-highlight), 0 8px 20px -10px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(20px);
  overflow: hidden;
}
.sc-icon img { width: 28px; height: 28px; border-radius: 6px; }
.sc-icon .letter {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--lc);
  color: #fff;
  font: 700 15px/1 var(--font-display);
}
.sc-label {
  max-width: 100%;
  overflow: hidden;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  text-overflow: ellipsis;
  text-shadow: var(--hero-shadow);
}
.sc-edit {
  position: absolute;
  top: 2px;
  right: 6px;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 7px;
  background: var(--g-bg-hover);
  color: var(--g-text);
  opacity: 0;
  transition: opacity 0.15s;
  backdrop-filter: blur(10px);
}
.sc-edit svg { width: 12px; height: 12px; }
.sc:hover .sc-edit, .sc-edit:focus-visible { opacity: 1; }
.sc.add .sc-icon { background: transparent; border-style: dashed; box-shadow: none; backdrop-filter: none; color: var(--g-text-2); }
.sc.add .sc-icon svg { width: 20px; height: 20px; }
.sc.add .sc-label { color: var(--g-text-2); }

/* ---------- Widgets ---------- */
.widgets {
  display: grid;
  grid-template-columns: repeat(var(--cols, 5), minmax(0, 1fr));
  /* Row height is set by fit() in newtab.js so every layout fits the window (min 150px, max --row-max). */
  grid-auto-rows: var(--row-h, 248px);
  --row-max: 248px;
  gap: 16px;
  width: min(1320px, calc(var(--cols, 5) * 264px), 100%);
  margin-top: auto;
  padding-top: clamp(14px, 5vh, 48px);
}
.widgets:empty { display: none; }
.w {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 18px 20px 20px;
  border-radius: 24px;
  background: var(--g-bg);
  border: 1px solid var(--g-border);
  box-shadow: inset 0 1px 0 var(--g-highlight), var(--g-shadow);
  backdrop-filter: blur(28px) saturate(1.7);
  -webkit-backdrop-filter: blur(28px) saturate(1.7);
  animation: w-in 0.6s var(--ease) both;
  overflow: hidden;
}
.w.span-2 { grid-column: span 2; }
.w:nth-child(2) { animation-delay: 0.05s; }
.w:nth-child(3) { animation-delay: 0.1s; }
.w:nth-child(4) { animation-delay: 0.15s; }
.w:nth-child(5) { animation-delay: 0.2s; }
.w:nth-child(6) { animation-delay: 0.25s; }
@keyframes w-in { from { opacity: 0; transform: translateY(16px) scale(0.98); } }

.w-head {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 28px;
  margin-bottom: 12px;
}
.w-title {
  flex: 1;
  color: var(--g-text-2);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.w-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  white-space: nowrap;
  height: 28px;
  min-width: 28px;
  padding: 0 8px;
  border-radius: 9px;
  color: var(--g-text-2);
  font-size: 12px;
  font-weight: 600;
  transition: background 0.15s, color 0.15s;
}
.w-btn:hover { background: var(--g-fill); color: var(--g-text); }
.w-btn svg { width: 16px; height: 16px; }
.w-empty { display: block; margin: auto 0; padding: 0 6px; color: var(--g-text-3); font-size: 12.5px; line-height: 1.45; text-align: center; list-style: none; }
.w-empty b { display: block; margin-bottom: 3px; color: var(--g-text); font-size: 14px; font-weight: 600; letter-spacing: -0.01em; }
.w-empty kbd { font: 600 11px var(--font-mono); padding: 1px 5px; border-radius: 5px; background: var(--g-fill); color: var(--g-text-2); }
.w-empty-ico { display: grid; place-items: center; width: 40px; height: 40px; margin: 0 auto 10px; border-radius: 13px; background: var(--g-fill); color: var(--g-text-2); box-shadow: inset 0 1px 0 var(--g-highlight); }
.w-empty-ico svg { width: 20px; height: 20px; }
@container (max-height: 168px) { .w-empty-ico { display: none; } }

/* Focus timer */
.focus-body { flex: 1; display: flex; align-items: center; gap: 16px; min-height: 0; }
.ring { position: relative; width: 112px; height: 112px; flex: none; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 7; }
.ring .track { stroke: var(--g-fill); }
.ring .bar { stroke: var(--accent); stroke-linecap: round; transition: stroke-dashoffset 0.9s linear; }
.ring-time {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font: 300 28px/1 var(--font-display);
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.focus-side { flex: 1; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.focus-side .pill { width: 100%; padding: 0 10px; }
.modes { display: flex; gap: 2px; padding: 3px; border-radius: 11px; background: var(--g-fill); }
.modes button { padding: 3px 8px; border-radius: 8px; color: var(--g-text-2); font-size: 12px; font-weight: 600; white-space: nowrap; }
.spacer { flex: 1; }
.modes button[aria-pressed="true"] { background: var(--g-bg-hover); color: var(--g-text); box-shadow: inset 0 1px 0 var(--g-highlight); }
.focus-actions { display: flex; gap: 6px; }
.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 34px;
  padding: 0 14px;
  border-radius: 11px;
  background: var(--g-fill);
  font-weight: 600;
  font-size: 13px;
  transition: background 0.15s, transform 0.15s var(--ease);
}
.pill:hover { background: var(--g-bg-hover); }
.pill:active { transform: scale(0.97); }
.pill.primary { background: var(--accent); color: #fff; box-shadow: 0 8px 20px -8px color-mix(in srgb, var(--accent) 80%, transparent); }
.pill.primary:hover { filter: brightness(1.08); }
.pill svg { width: 14px; height: 14px; }
.sessions { display: flex; gap: 5px; }
.sessions i { width: 7px; height: 7px; border-radius: 50%; background: var(--g-fill); }
.sessions i.on { background: var(--accent); }

/* To-do */
.todo-list { flex: 1; margin: 0 -8px; padding: 0; overflow-y: auto; list-style: none; scrollbar-width: thin; }
.todo {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 34px;
  padding: 4px 8px;
  border-radius: 10px;
  transition: background 0.15s;
}
.todo:hover { background: var(--g-fill); }
.todo .tick {
  display: grid;
  place-items: center;
  flex: none;
  width: 18px;
  height: 18px;
  border-radius: 6px;
  box-shadow: inset 0 0 0 1.5px var(--g-text-3);
  color: transparent;
  transition: background 0.15s, box-shadow 0.15s;
}
.todo .tick svg { width: 12px; height: 12px; }
.todo.done .tick { background: var(--accent); box-shadow: none; color: #fff; }
.todo span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.todo.done span { color: var(--g-text-3); text-decoration: line-through; }
.todo .x { opacity: 0; color: var(--g-text-3); }
.todo:hover .x { opacity: 1; }
.todo .x:hover { color: var(--g-text); }
.todo .x svg { width: 14px; height: 14px; }
.todo-add {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 38px;
  margin-top: 8px;
  padding: 0 12px;
  border-radius: 12px;
  background: var(--g-fill);
}
.todo-add svg { width: 16px; height: 16px; color: var(--g-text-3); }
.todo-add input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent; }
.todo-add input::placeholder { color: var(--g-text-3); }

/* Notes */
.notes {
  flex: 1;
  width: 100%;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 14px;
  line-height: 1.6;
  resize: none;
  scrollbar-width: thin;
}
.notes::placeholder { color: var(--g-text-3); }

/* Recent shots */
.shots-grid {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: 8px;
  min-height: 0;
}
.shot-tile {
  position: relative;
  min-height: 0;
  border-radius: 12px;
  overflow: hidden;
  background: var(--g-fill);
  box-shadow: inset 0 0 0 1px var(--g-border);
  transition: transform 0.2s var(--ease), box-shadow 0.2s;
}
.shot-tile:hover { transform: translateY(-2px) scale(1.02); box-shadow: inset 0 0 0 1px var(--g-highlight), 0 12px 24px -12px rgba(0, 0, 0, 0.5); z-index: 1; }
.shot-tile img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; }
.shot-tile span {
  position: absolute;
  left: 6px;
  right: 6px;
  bottom: 6px;
  padding: 2px 6px;
  overflow: hidden;
  border-radius: 6px;
  background: rgba(10, 12, 18, 0.55);
  color: #fff;
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
  text-overflow: ellipsis;
  backdrop-filter: blur(8px);
  opacity: 0;
  transition: opacity 0.15s;
}
.shot-tile:hover span { opacity: 1; }

/* Palette of the day */
.palette-strips { flex: 1; display: flex; gap: 6px; min-height: 0; }
.strip {
  position: relative;
  flex: 1;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 10px;
  border-radius: 14px;
  background: var(--c);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
  font: 600 10px/1 var(--font-mono);
  letter-spacing: 0.02em;
  transition: flex 0.35s var(--ease), transform 0.2s var(--ease);
  cursor: copy;
}
.strip span { writing-mode: vertical-rl; transform: rotate(180deg); opacity: 0; transition: opacity 0.2s; color: var(--ink); }
.strip:hover { flex: 1.8; }
.strip:hover span { opacity: 1; }
.palette-name { margin: 10px 0 0; color: var(--g-text-2); font-size: 12px; }

/* World clock */
.zones { display: flex; flex-direction: column; gap: 4px; margin: 0 -8px; overflow-y: auto; }
.zone {
  display: grid;
  grid-template-columns: 22px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  border-radius: 10px;
}
.zone:hover { background: var(--g-fill); }
.zone svg { width: 18px; height: 18px; color: var(--g-text-2); }
.zone b { display: block; font-weight: 600; font-size: 13px; }
.zone small { color: var(--g-text-3); font-size: 11px; }
.zone time { font: 300 24px/1 var(--font-display); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }

/* Weather */
.weather-body { flex: 1; display: flex; flex-direction: column; justify-content: space-between; }
.weather-now { display: flex; align-items: center; gap: 12px; }
.weather-now svg { width: 56px; height: 56px; }
.weather-temp { font: 200 56px/1 var(--font-display); letter-spacing: -0.04em; }
.weather-cond { color: var(--g-text-2); font-size: 13px; }
.weather-meta { display: flex; justify-content: space-between; color: var(--g-text-2); font-size: 12px; }
.weather-days { display: flex; justify-content: space-between; gap: 4px; }
.wday { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; color: var(--g-text-2); }
.wday svg { width: 20px; height: 20px; }
.wday b { color: var(--g-text); font-weight: 600; font-size: 12px; }

.lock-note { margin: auto 0; text-align: center; color: var(--g-text-2); font-size: 13px; }
.lock-note .pill { margin-top: 10px; }

/* ---------- Drawer ---------- */
.drawer {
  position: fixed;
  top: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 30;
  display: flex;
  flex-direction: column;
  width: min(400px, calc(100vw - 24px));
  border-radius: 22px;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-xl);
  transform: translateX(calc(100% + 24px));
  visibility: hidden;
  transition: transform 0.38s var(--ease), visibility 0s linear 0.38s;
}
.drawer.is-open { transform: none; visibility: visible; transition: transform 0.38s var(--ease); }
.drawer-scrim {
  position: fixed;
  inset: 0;
  z-index: 29;
  background: rgba(8, 9, 14, 0.25);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}
.drawer-scrim.is-open { opacity: 1; pointer-events: auto; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px 8px 24px; }
.drawer-head h2 { margin: 0 auto 0 0; font: 700 20px/1.2 var(--font-display); letter-spacing: -0.02em; }
.drawer-body { flex: 1; overflow-y: auto; padding: 0 24px 24px; scrollbar-width: thin; }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  color: var(--text-2);
}
.icon-btn:hover { background: var(--fill); color: var(--text); }
.icon-btn svg { width: 18px; height: 18px; }

.d-sec { padding: 20px 0; border-bottom: 1px solid var(--border); }
.d-sec:last-child { border-bottom: 0; }
.d-sec h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 14px;
  color: var(--text-3);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.scenes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.scene {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--text-2);
  font-size: 11px;
  font-weight: 500;
  text-align: center;
}
.scene-swatch {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: 12px;
  overflow: hidden;
  background: var(--sb);
  box-shadow: inset 0 0 0 1px var(--border);
  transition: transform 0.2s var(--ease), box-shadow 0.2s;
}
.scene-swatch::before, .scene-swatch::after {
  content: "";
  position: absolute;
  width: 90%;
  height: 120%;
  border-radius: 50%;
  filter: blur(8px);
}
.scene-swatch::before { left: -30%; top: -40%; background: var(--s1); opacity: 0.9; }
.scene-swatch::after { right: -35%; bottom: -45%; background: var(--s2); opacity: 0.85; }
.scene-swatch i { position: absolute; right: -10%; top: -30%; width: 60%; height: 80%; border-radius: 50%; background: var(--s3); filter: blur(10px); opacity: 0.7; z-index: 1; }
.scene:hover .scene-swatch { transform: translateY(-2px); }
.scene[aria-checked="true"] { color: var(--text); font-weight: 600; }
.scene[aria-checked="true"] .scene-swatch { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--accent); }
.scene.photo .scene-swatch { display: grid; place-items: center; background: var(--fill); color: var(--text-2); }
.scene.photo .scene-swatch::before, .scene.photo .scene-swatch::after { display: none; }
.scene.photo .scene-swatch svg { width: 22px; height: 22px; position: relative; z-index: 2; }
.scene.photo .scene-swatch img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.scene .pro-badge { position: absolute; top: 6px; right: 6px; z-index: 2; height: 16px; font-size: 9px; }

.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 40px;
}
.row + .row { margin-top: 4px; }
.row label, .row > span { display: flex; align-items: center; gap: 8px; }
.row small { color: var(--text-3); }
.switch {
  position: relative;
  flex: none;
  width: 40px;
  height: 24px;
  border-radius: 12px;
  background: var(--fill-strong);
  transition: background 0.2s;
}
.switch::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, 0.25);
  transition: transform 0.25s var(--ease-spring);
}
.switch[aria-checked="true"] { background: var(--accent); }
.switch[aria-checked="true"]::after { transform: translateX(16px); }

.field {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border: 0;
  border-radius: 10px;
  outline: 0;
  background: var(--fill);
  color: var(--text);
}
.field:focus { box-shadow: 0 0 0 2px var(--accent); }
.slider { width: 160px; accent-color: var(--accent); }
.seg { display: flex; padding: 3px; border-radius: 10px; background: var(--fill); }
.seg button { padding: 5px 12px; border-radius: 8px; color: var(--text-2); font-size: 12px; font-weight: 600; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(17, 19, 26, 0.08); }

.accents { display: flex; gap: 8px; flex-wrap: wrap; }
.accent-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--c);
  transition: transform 0.15s var(--ease-spring);
}
.accent-dot:hover { transform: scale(1.1); }
.accent-dot[aria-checked="true"] { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--c); }

.wlist { display: flex; flex-direction: column; gap: 2px; }
.wlist .row { padding: 0 4px; border-radius: 10px; }
.wlist .row:hover { background: var(--surface-2); }
.wicon { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: var(--fill); color: var(--text-2); }
.wicon svg { width: 16px; height: 16px; }

.city-results { display: flex; flex-direction: column; margin-top: 6px; }
.city-results button { padding: 8px 10px; border-radius: 8px; text-align: left; }
.city-results button:hover { background: var(--fill); }
.city-results small { color: var(--text-3); }
.zone-edit { display: flex; flex-direction: column; gap: 4px; margin-bottom: 8px; }
.zone-edit .row { padding: 0 4px; }
select.field { appearance: none; cursor: pointer; }
.d-note { margin: 8px 0 0; color: var(--text-3); font-size: 12px; }
.link-btn { color: var(--accent); font-weight: 600; font-size: 13px; }
.link-btn:hover { text-decoration: underline; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 36px;
  padding: 0 14px;
  border-radius: 10px;
  font-weight: 600;
  transition: background 0.15s;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { filter: brightness(1.08); }
.btn-ghost { color: var(--text-2); }
.btn-ghost:hover { background: var(--fill); color: var(--text); }
.btn-secondary { background: var(--fill); color: var(--text); }
.btn-secondary:hover { background: var(--fill-strong); }
.danger-text { color: var(--danger) !important; }
.pro-card {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px 16px;
  border-radius: 16px;
  background: var(--pro);
  color: #fff;
  text-align: left;
  box-shadow: 0 12px 28px -12px rgba(76, 91, 240, 0.7);
}
.pro-card b { display: block; font-size: 14px; }
.pro-card small { opacity: 0.85; }
.pro-card svg { width: 24px; height: 24px; }

/* ---------- Dialog ---------- */
.sheet {
  width: min(380px, calc(100vw - 32px));
  padding: 24px;
  border: 0;
  border-radius: 20px;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-xl);
}
.sheet::backdrop { background: rgba(8, 9, 14, 0.35); backdrop-filter: blur(4px); }
.sheet[open] { animation: pro-in 0.28s var(--ease); }
.sheet h2 { margin: 0 0 16px; font: 700 18px/1.2 var(--font-display); }
.sheet label { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; color: var(--text-2); font-size: 12px; font-weight: 600; }
.sheet input {
  height: 40px;
  padding: 0 12px;
  border: 0;
  border-radius: 10px;
  outline: 0;
  background: var(--fill);
  color: var(--text);
  font-size: 14px;
  font-weight: 400;
}
.sheet input:focus { box-shadow: 0 0 0 2px var(--accent); }
.sheet-actions { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.spacer { flex: 1; }

/* ---------- Toast ---------- */
.nt-toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 60;
  padding: 10px 16px;
  border-radius: 12px;
  background: rgba(16, 17, 22, 0.88);
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  backdrop-filter: blur(12px);
  box-shadow: 0 12px 32px -8px rgba(0, 0, 0, 0.45);
  opacity: 0;
  transform: translate(-50%, 8px);
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s var(--ease);
}
.nt-toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Focus sounds ---------- */
.eq { display: inline-flex; align-items: flex-end; gap: 2px; width: 13px; height: 12px; flex: none; }
.eq i { width: 3px; height: 6px; border-radius: 2px; background: currentColor; opacity: 0.85; transition: height 0.3s var(--ease); }
.eq i:nth-child(2) { height: 11px; }
.eq i:nth-child(3) { height: 8px; }
[data-playing="true"] .eq i { animation: eq 0.9s ease-in-out infinite alternate; }
[data-playing="true"] .eq i:nth-child(2) { animation-duration: 0.7s; animation-delay: -0.35s; }
[data-playing="true"] .eq i:nth-child(3) { animation-duration: 1.1s; animation-delay: -0.6s; }
@keyframes eq { from { height: 3px; } to { height: 12px; } }
.focus-side .sound-pill { gap: 5px; padding: 0 7px; }
.sound-pill .lbl, .sound-chip .lbl { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.sound-pill[data-playing="true"] {
  background: color-mix(in srgb, var(--accent) 22%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 55%, transparent);
}

.mixer {
  position: fixed;
  z-index: 40;
  width: 300px;
  padding: 14px;
  border-radius: 22px;
  background: var(--pop-bg);
  border: 1px solid var(--g-border);
  box-shadow: inset 0 1px 0 var(--g-highlight), 0 30px 70px -20px rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(36px) saturate(1.8);
  -webkit-backdrop-filter: blur(36px) saturate(1.8);
  color: var(--g-text);
  opacity: 0;
  transform: translateY(6px) scale(0.97);
  transform-origin: 50% 100%;
  transition: opacity 0.18s ease, transform 0.22s var(--ease);
}
.mixer.is-open { opacity: 1; transform: none; }
.mx-head { display: flex; align-items: center; justify-content: space-between; margin: 0 2px 12px 4px; }
.mx-head b { font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--g-text-2); }
.mx-play {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  box-shadow: 0 8px 18px -8px color-mix(in srgb, var(--accent) 90%, transparent);
  transition: transform 0.15s var(--ease-spring), filter 0.15s;
}
.mx-play:hover { filter: brightness(1.1); }
.mx-play:active { transform: scale(0.92); }
.mx-play svg { width: 14px; height: 14px; }
.mx-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.mx-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 76px;
  border-radius: 16px;
  background: var(--g-fill);
  color: var(--g-text-2);
  font-size: 12px;
  font-weight: 600;
  transition: background 0.2s, color 0.2s, box-shadow 0.2s, transform 0.15s var(--ease);
}
.mx-tile:hover { background: var(--g-bg-hover); color: var(--g-text); }
.mx-tile:active { transform: scale(0.96); }
.mx-tile svg { width: 24px; height: 24px; }
.mx-tile[aria-pressed="true"] {
  background: color-mix(in srgb, var(--accent) 24%, transparent);
  color: var(--g-text);
  box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--accent) 75%, transparent);
}
.mixer[data-on="true"] .mx-tile[aria-pressed="true"] svg { animation: breathe 2.6s ease-in-out infinite; }
@keyframes breathe { 50% { transform: scale(1.12); } }
.mx-tile .pro-badge { position: absolute; top: 6px; right: 6px; height: 16px; font-size: 9px; }
.mx-vol { display: flex; align-items: center; gap: 10px; margin: 14px 4px 4px; color: var(--g-text-2); }
.mx-vol svg { width: 18px; height: 18px; }
.mx-vol input {
  flex: 1;
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(to right, var(--accent) var(--v, 60%), var(--g-fill) var(--v, 60%));
  appearance: none;
  outline: 0;
  cursor: pointer;
}
.mx-vol input::-webkit-slider-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
  appearance: none;
}
.mx-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 8px 4px 0; font-size: 13px; color: var(--g-text-2); }
.mixer .switch { background: var(--g-fill); box-shadow: inset 0 0 0 1px var(--g-border); }
.mixer .switch[aria-checked="true"] { background: var(--accent); box-shadow: none; }

/* ---------- Colors (eyedropper + contrast) ---------- */
.cc-preview {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: none;
  height: 56px;
  padding: 0 16px;
  border-radius: 14px;
  background: var(--bg);
  color: var(--fg);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14), 0 6px 18px -10px rgba(0, 0, 0, 0.4);
  transition: background 0.3s, color 0.3s;
}
.cc-aa { font: 600 30px/1 var(--font-display); letter-spacing: -0.02em; }
.cc-sample { font-size: 13px; font-weight: 600; line-height: 1.25; }
.cc-sample small { font-size: 11px; font-weight: 400; }
.cc-score { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.cc-ratio { flex: none; font: 600 18px/1 var(--font-display); letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.cc-badges { display: flex; gap: 4px; min-width: 0; margin-left: auto; }
.cc-badge { display: inline-flex; align-items: center; height: 22px; padding: 0 6px; border-radius: 7px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.cc-badge.fail { text-decoration: line-through; text-decoration-thickness: 1.5px; }
.cc-badge.pass { background: color-mix(in srgb, var(--pass) 18%, transparent); color: var(--pass); }
.cc-badge.fail { background: color-mix(in srgb, var(--fail) 14%, transparent); color: var(--fail); }
.cc-pair { display: flex; align-items: center; gap: 4px; margin-top: 10px; }
.cc-chip { flex: 1; display: flex; align-items: center; gap: 6px; min-width: 0; height: 34px; padding: 0 4px 0 5px; border-radius: 10px; background: var(--g-fill); cursor: text; }
.cc-sw {
  flex: none;
  width: 22px;
  height: 22px;
  border-radius: 7px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.28), 0 0 0 1px rgba(0, 0, 0, 0.12);
  transition: transform 0.15s var(--ease-spring);
}
.cc-sw:hover { transform: scale(1.1); }
.cc-chip input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent; font: 500 11.5px/1 var(--font-mono); letter-spacing: -0.02em; text-transform: uppercase; }
.cc-chip:focus-within { box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 70%, transparent); }
.cc-chip input.bad { color: var(--fail); }
.cc-swap { flex: none; width: 26px; min-width: 26px; padding: 0; }
.cc-history { display: flex; align-items: center; gap: 6px; min-height: 18px; margin-top: auto; padding-top: 8px; overflow: hidden; }
.cc-dot {
  flex: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--c);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.22), 0 0 0 1px rgba(0, 0, 0, 0.12);
  cursor: copy;
  transition: transform 0.15s var(--ease-spring);
}
.cc-dot:hover { transform: scale(1.2); }
.cc-hint { color: var(--g-text-3); font-size: 12px; white-space: nowrap; }

/* "Day & night" scene swatch */
.scene.auto .scene-swatch { background: linear-gradient(135deg, #FFB089 0%, #FFD7A3 22%, #8FCBFF 45%, #FF3D77 68%, #2A1F6E 100%); }
.scene.auto .scene-swatch::before, .scene.auto .scene-swatch::after { display: none; }

/* ---------- Focusing: other widgets step back ---------- */
.w, .shortcuts { transition: opacity 0.6s var(--ease), filter 0.6s var(--ease); }
:root[data-focusing="on"] .w:not([data-widget="focus"]) { opacity: 0.38; filter: saturate(0.4); }
:root[data-focusing="on"] .shortcuts { opacity: 0.45; }
:root[data-focusing="on"] .w:hover, :root[data-focusing="on"] .w:focus-within, :root[data-focusing="on"] .shortcuts:hover { opacity: 1; filter: none; }

/* ---------- Zen mode: just the time, your timer and your sound ---------- */
.greeting { view-transition-name: greeting; }
.clock { view-transition-name: clock; }
.date { view-transition-name: date; }
::view-transition-group(*) { animation-duration: 0.6s; animation-timing-function: cubic-bezier(0.2, 0.8, 0.2, 1); }
:root[data-zen="on"] .search, :root[data-zen="on"] .shortcuts, :root[data-zen="on"] .widgets { display: none !important; }
:root[data-zen="on"] .nt-main { justify-content: center; padding-bottom: 12vh; }
:root[data-zen="on"] .clock { font-size: clamp(120px, 17vw, 240px); }
:root[data-zen="on"] #zenBtn { background: var(--g-bg-hover); box-shadow: inset 0 0 0 1px var(--g-highlight); }
.zen-status { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 28px; animation: hero-in 0.6s 0.2s var(--ease) both; }
.zen-status:empty { display: none; }
.zen-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 260px;
  height: 38px;
  padding: 0 16px;
  border-radius: 19px;
  background: var(--g-bg);
  border: 1px solid var(--g-border);
  box-shadow: inset 0 1px 0 var(--g-highlight);
  backdrop-filter: blur(20px) saturate(1.6);
  color: var(--g-text);
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
button.zen-chip:hover { background: var(--g-bg-hover); }
.zen-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); animation: zen-pulse 2s ease-in-out infinite; }
@keyframes zen-pulse { 50% { opacity: 0.35; transform: scale(0.8); } }

/* ---------- Widget grip + drag to reorder ---------- */
.w-body { display: contents; }
.w.is-in { animation: none; }
.w-grip {
  position: absolute;
  top: 3px;
  left: 50%;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 40px;
  height: 14px;
  margin-left: -20px;
  border-radius: 7px;
  color: var(--g-text-3);
  opacity: 0;
  cursor: grab;
  transition: opacity 0.2s, background 0.15s, color 0.15s;
  touch-action: none;
}
.w-grip svg { width: 18px; height: 6px; }
.w:hover .w-grip, .w-grip:focus-visible { opacity: 1; }
.w-grip:hover { background: var(--g-fill); color: var(--g-text); }
.w-title { cursor: grab; user-select: none; }
.widgets.is-sorting, .widgets.is-sorting * { cursor: grabbing !important; user-select: none; }
.w.is-dragging {
  z-index: 20;
  scale: 1.03;
  box-shadow: inset 0 1px 0 var(--g-highlight), 0 40px 80px -20px rgba(0, 0, 0, 0.6);
  transition: scale 0.2s var(--ease), box-shadow 0.2s !important;
  opacity: 1 !important;
  filter: none !important;
}
.w.is-dragging .w-grip { opacity: 1; color: var(--g-text); }

/* ---------- Layouts ---------- */
.layouts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.layout { display: flex; flex-direction: column; gap: 2px; text-align: left; color: var(--text-2); }
.layout b { margin-top: 6px; color: var(--text); font-size: 12px; font-weight: 600; }
.layout small { color: var(--text-3); font-size: 11px; }
.lay-mini {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  height: 70px;
  padding: 10px 8px 8px;
  border-radius: 12px;
  background: var(--fill);
  box-shadow: inset 0 0 0 1px var(--border);
  transition: transform 0.2s var(--ease), box-shadow 0.2s;
}
.lay-mini i { display: block; border-radius: 2px; background: var(--text-3); opacity: 0.55; }
.lay-mini .m-clock { width: 30%; height: 7px; border-radius: 3px; opacity: 0.8; }
.lay-mini .m-search { width: 56%; height: 5px; border-radius: 3px; }
.lay-mini .m-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 3px; width: 100%; margin-top: auto; }
.lay-mini .m-row i { height: 11px; }
.lay-mini .m-row i.w2 { grid-column: span 2; }
.lay-mini.lay-dashboard .m-row { margin-top: 0; }
.lay-mini.lay-dashboard .m-row:first-of-type { margin-top: auto; }
.lay-mini .m-dots { display: flex; gap: 4px; margin-top: 3px; }
.lay-mini .m-dots i { width: 7px; height: 7px; border-radius: 2px; }
.lay-mini.lay-minimal { justify-content: center; }
.layout:hover .lay-mini { transform: translateY(-2px); }
.layout[aria-checked="true"] .lay-mini { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--accent); }
.layout[aria-checked="true"] .lay-mini i { background: var(--accent); opacity: 0.7; }

:root[data-layout="minimal"] .nt-main { justify-content: center; padding-bottom: 14vh; }
:root[data-layout="minimal"] .clock { font-size: clamp(100px, 13vw, 184px); }
:root[data-layout="dashboard"]:not([data-zen="on"]) .nt-main { --pad-top: clamp(20px, 5vh, 48px); }
:root[data-layout="dashboard"]:not([data-zen="on"]) .clock { font-size: clamp(64px, 6.5vw, 88px); }
:root[data-layout="dashboard"]:not([data-zen="on"]) .search { height: 50px; margin-top: 20px; }
:root[data-layout="dashboard"]:not([data-zen="on"]) .shortcuts { margin-top: 14px; }
:root[data-layout="dashboard"] .widgets { --row-max: 240px; padding-top: clamp(12px, 3vh, 24px); }
/* Notes takes the free cell, so the second row is full too */
:root[data-layout="dashboard"] .w[data-widget="notes"] { grid-column: span 2; }

/* ---------- ⌘K command menu ---------- */
.cmdk-btn { display: inline-flex; gap: 3px; padding: 2px; border-radius: 9px; transition: background 0.15s; }
.cmdk-btn:hover { background: var(--g-fill); }
.cmdk-btn kbd, .search kbd {
  display: grid;
  place-items: center;
  min-width: 24px;
  height: 24px;
  padding: 0 6px;
  border-radius: 7px;
  background: var(--g-fill);
  color: var(--g-text-2);
  font: 600 12px/1 var(--font);
}
.search:focus-within .cmdk-btn { opacity: 0.5; }

.cmdk {
  width: min(640px, calc(100vw - 32px));
  max-height: min(560px, calc(100vh - 120px));
  margin: 12vh auto auto;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--g-border);
  border-radius: 22px;
  background: var(--pop-bg);
  color: var(--g-text);
  box-shadow: inset 0 1px 0 var(--g-highlight), 0 40px 100px -20px rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(40px) saturate(1.8);
  -webkit-backdrop-filter: blur(40px) saturate(1.8);
}
.cmdk[open] { display: flex; flex-direction: column; animation: cmdk-in 0.22s var(--ease); }
@keyframes cmdk-in { from { opacity: 0; transform: translateY(-8px) scale(0.98); } }
.cmdk::backdrop { background: rgba(6, 7, 12, 0.32); backdrop-filter: blur(3px); }
.cmdk-input { display: flex; align-items: center; gap: 12px; height: 60px; padding: 0 16px 0 20px; border-bottom: 1px solid var(--g-border); }
.cmdk-input > svg { width: 20px; height: 20px; color: var(--g-text-2); }
.cmdk-input input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent; font-size: 17px; }
.cmdk-input input::placeholder { color: var(--g-text-3); }
.cmdk kbd {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 6px;
  background: var(--g-fill);
  color: var(--g-text-2);
  font: 600 11px/1 var(--font);
}
.cmdk-list { flex: 1; overflow-y: auto; padding: 6px 8px 8px; scrollbar-width: thin; overscroll-behavior: contain; }
.cmdk-sec { padding: 10px 12px 4px; color: var(--g-text-3); font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; }
.cmdk-item {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 42px;
  padding: 5px 12px;
  border-radius: 12px;
  cursor: pointer;
}
.cmdk-item[aria-selected="true"] { background: color-mix(in srgb, var(--accent) 22%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 40%, transparent); }
.cmdk-icon { display: grid; place-items: center; flex: none; width: 30px; height: 30px; border-radius: 9px; background: var(--g-fill); color: var(--g-text-2); }
.cmdk-icon svg { width: 16px; height: 16px; }
.cmdk-item[aria-selected="true"] .cmdk-icon { color: var(--g-text); }
.cmdk-thumb { flex: none; width: 44px; height: 30px; border-radius: 7px; object-fit: cover; object-position: top; box-shadow: inset 0 0 0 1px var(--g-border); background: var(--g-fill); }
.cmdk-swatch { flex: none; width: 30px; height: 30px; border-radius: 9px; background: var(--c); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2); }
.cmdk-title { flex: 1; min-width: 0; overflow: hidden; font-size: 14px; font-weight: 500; white-space: nowrap; text-overflow: ellipsis; }
.cmdk-hint { flex: none; color: var(--g-text-3); font-size: 12px; }
.cmdk-empty { margin: 28px 0; color: var(--g-text-3); text-align: center; }
.cmdk-foot { display: flex; gap: 16px; padding: 10px 20px; border-top: 1px solid var(--g-border); color: var(--g-text-3); font-size: 12px; }
.cmdk-foot span { display: inline-flex; align-items: center; gap: 4px; }

/* ---------- Focus stats ---------- */
.st-streak {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 24px;
  padding: 0 9px 0 7px;
  border-radius: 12px;
  background: color-mix(in srgb, #FF8A3D 20%, transparent);
  color: #FFB27A;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}
:root[data-tone="light"] .st-streak { color: #C2510C; }
.st-streak svg { width: 12px; height: 12px; }
.st-total { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.st-total b { font: 300 38px/1 var(--font-display); letter-spacing: -0.03em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.st-total small { overflow: hidden; color: var(--g-text-2); font-size: 12px; white-space: nowrap; text-overflow: ellipsis; }
.st-bars { flex: 1; display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; min-height: 0; margin-top: 14px; }
.st-day { display: flex; flex-direction: column; align-items: center; gap: 6px; min-height: 0; }
.st-bar { position: relative; flex: 1; width: 100%; max-width: 22px; border-radius: 7px; background: var(--g-fill); overflow: hidden; }
.st-bar i {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: 7px;
  background: color-mix(in srgb, var(--accent) 60%, transparent);
  transition: height 0.6s var(--ease);
}
.st-day.today .st-bar i { background: var(--accent); box-shadow: 0 0 16px -2px color-mix(in srgb, var(--accent) 80%, transparent); }
.st-day small { color: var(--g-text-3); font-size: 11px; font-weight: 600; }
.st-day.today small { color: var(--g-text); }
.st-day.future .st-bar { opacity: 0.45; }

/* ---------- Tab sessions ---------- */
.ss-list { flex: 1; margin: 0 -8px; padding: 0; overflow-y: auto; list-style: none; scrollbar-width: thin; }
.ss-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 6px 8px;
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.15s;
}
.ss-row:hover { background: var(--g-fill); }
.ss-icons { display: flex; flex: none; width: 46px; }
.ss-ic {
  position: relative;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  margin-right: -10px;
  overflow: hidden;
  border-radius: 7px;
  background: var(--g-bg-hover);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--s-base) 70%, transparent);
}
.ss-ic img { position: absolute; inset: 3px; width: 16px; height: 16px; border-radius: 3px; background: #fff; }
.ss-letter { display: grid; place-items: center; width: 100%; height: 100%; background: var(--lc); color: #fff; font: 700 11px/1 var(--font-display); }
.ss-text { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.ss-text b { overflow: hidden; font-size: 13px; font-weight: 600; white-space: nowrap; text-overflow: ellipsis; outline: 0; border-radius: 4px; }
.ss-text b[contenteditable="plaintext-only"] { padding: 0 4px; margin: 0 -4px; background: var(--g-fill); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 70%, transparent); text-overflow: clip; cursor: text; }
.ss-text small { overflow: hidden; color: var(--g-text-3); font-size: 11px; white-space: nowrap; text-overflow: ellipsis; }
.ss-btn { display: grid; place-items: center; flex: none; width: 26px; height: 26px; border-radius: 8px; color: var(--g-text-3); opacity: 0; transition: opacity 0.15s, background 0.15s, color 0.15s; }
.ss-btn svg { width: 15px; height: 15px; }
.ss-btn:not(:focus-visible) { display: none; }
.ss-row:hover .ss-btn { display: grid; opacity: 1; }
.ss-btn:focus-visible { opacity: 1; }
.ss-btn:hover { background: var(--g-fill); color: var(--g-text); }
.ss-form { display: flex; flex-direction: column; gap: 10px; flex: 1; }
.ss-form input[name="name"] {
  height: 40px;
  padding: 0 12px;
  border: 0;
  border-radius: 11px;
  outline: 0;
  background: var(--g-fill);
  font-size: 14px;
}
.ss-form input[name="name"]:focus { box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 70%, transparent); }
.ss-form input[name="name"]::placeholder { color: var(--g-text-3); }
.ss-check { display: flex; align-items: center; gap: 8px; color: var(--g-text-2); font-size: 13px; cursor: pointer; }
.ss-check input { width: 16px; height: 16px; margin: 0; accent-color: var(--accent); }
.ss-actions { display: flex; justify-content: flex-end; gap: 6px; margin-top: auto; }
.w-btn span { white-space: nowrap; }

/* Toast with an action (Undo) */
.nt-toast.has-action { display: flex; align-items: center; gap: 14px; padding-right: 8px; pointer-events: auto; }
.nt-toast button { padding: 4px 10px; border-radius: 8px; background: rgba(255, 255, 255, 0.14); color: #fff; font-weight: 600; }
.nt-toast button:hover { background: rgba(255, 255, 255, 0.24); }
.nt-toast:not(.is-visible) { pointer-events: none; }

/* ---------- Break: breathe + Echo ---------- */
.bk-body { flex: 1; display: flex; align-items: center; gap: 14px; min-height: 0; }
.bk-side { flex: 1; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-width: 0; }
.bk-phase { font: 500 18px/1.2 var(--font-display); letter-spacing: -0.01em; }
.bk-sub { margin-bottom: 8px; color: var(--g-text-2); font-size: 12px; font-variant-numeric: tabular-nums; }
.bk-side .pill { padding: 0 12px; }
.bk-share { margin-top: 2px; margin-left: -8px; }
.bk-orb-wrap { position: relative; display: grid; place-items: center; flex: none; width: 116px; height: 116px; }
.bk-orb-wrap::before { content: ""; position: absolute; inset: 0; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--g-fill); }
.bk-orb {
  width: 116px;
  height: 116px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, color-mix(in srgb, #fff 55%, var(--accent)), var(--accent) 55%, color-mix(in srgb, var(--accent) 60%, #000));
  box-shadow: 0 0 40px -6px color-mix(in srgb, var(--accent) 90%, transparent);
  transform: scale(0.5);
  transition: transform 4s cubic-bezier(0.45, 0, 0.55, 1), filter 4s;
  opacity: 0.92;
}
.bk-orb[data-phase="in"], .bk-orb[data-phase="hold"] { transform: scale(1); }
.bk-orb[data-phase="hold"] { filter: brightness(1.15); }
.bk-orb[data-phase="out"] { transform: scale(0.5); }
.echo-grid { display: grid; grid-template-columns: repeat(3, 36px); gap: 6px; flex: none; }
.echo-grid.shake { animation: shake 0.4s; }
@keyframes shake { 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } }
.echo-tile {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--c) 28%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 45%, transparent);
  transition: background 0.12s, box-shadow 0.12s, transform 0.12s var(--ease);
}
.echo-tile:not(:disabled) { cursor: pointer; }
.echo-tile:not(:disabled):hover { background: color-mix(in srgb, var(--c) 45%, transparent); }
.echo-tile:disabled { cursor: default; }
.echo-tile.lit { background: var(--c); box-shadow: 0 0 22px 2px color-mix(in srgb, var(--c) 80%, transparent); transform: scale(1.08); }
.w.is-calling { box-shadow: inset 0 1px 0 var(--g-highlight), 0 0 0 2px color-mix(in srgb, var(--accent) 70%, transparent), 0 0 40px -6px var(--accent); animation: calling 1.6s ease-in-out infinite; }
@keyframes calling { 50% { box-shadow: inset 0 1px 0 var(--g-highlight), 0 0 0 2px color-mix(in srgb, var(--accent) 30%, transparent), var(--g-shadow); } }

/* ---------- Plan: trial chip + lock card ---------- */
.trial-chip { font-size: 12px; }
.trial-chip.is-urgent { background: color-mix(in srgb, var(--accent) 70%, transparent); border-color: transparent; color: #fff; }
.w.lock-card {
  grid-column: 1 / -1;
  flex-direction: row;
  align-items: center;
  gap: 18px;
  width: min(720px, 100%);
  justify-self: center;
  padding: 22px 24px;
}
.lock-mark { display: grid; place-items: center; flex: none; width: 52px; height: 52px; border-radius: 16px; background: var(--pro); color: #fff; box-shadow: 0 12px 28px -10px rgba(76, 91, 240, 0.7); }
.lock-mark svg { width: 26px; height: 26px; }
.lock-text { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 0; }
.lock-text b { font: 600 17px/1.3 var(--font-display); }
.lock-text span { color: var(--g-text-2); font-size: 13px; line-height: 1.5; }
.lock-card .pill { flex: none; height: 40px; padding: 0 18px; }
:root[data-plan="expired"] .widgets { grid-auto-rows: auto; }
:root[data-plan="expired"] #zenBtn { display: none; }

/* ---------- Responsive ---------- */
/* Column count comes from fit() (widgets + window width) */
@media (max-width: 820px) {
  .glass-btn span { display: none; }
}
@media (max-width: 560px) {
  .widgets { grid-template-columns: 1fr; grid-auto-rows: auto; }
  .w { min-height: 220px; }
  .w.span-2 { grid-column: auto; }
}
@media (prefers-reduced-motion: reduce) {
  .bg-scene i { animation: none !important; }
  .bg-scene { transform: none !important; }
  [data-playing="true"] .eq i, .mx-tile svg, .zen-dot { animation: none !important; }
  .hero, .w { animation: none !important; }
}

/* Feedback row in Customize */
.fb-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.fb-row .pill { height: 34px; padding: 0 14px; }

/* Feedback button in the Customize header, next to close */
.fb-head-btn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 32px; margin-right: 6px; padding: 0 12px;
  border: 1px solid var(--border); border-radius: 999px;
  background: var(--surface-2); color: var(--text);
  font: 500 13px var(--font); cursor: pointer;
  transition: background .15s, border-color .15s, transform .2s var(--ease);
}
.fb-head-btn svg { width: 15px; height: 15px; color: var(--accent); }
.fb-head-btn:hover { background: var(--fill); border-color: var(--border-strong); }
.fb-head-btn:active { transform: scale(.97); }

/* ---------- Dock: shortcuts in a Mac-style glass bar at the bottom ---------- */
.dock-sep { display: none; }
:root[data-dock="on"] .nt-main { --pad-bottom: 112px; }
:root[data-dock="on"] .shortcuts {
  position: fixed;
  left: 50%;
  bottom: 16px;
  z-index: 20;
  translate: -50% 0;
  flex-wrap: nowrap;
  align-items: flex-end;
  gap: 8px;
  max-width: calc(100vw - 32px);
  margin: 0;
  padding: 9px 11px;
  border-radius: 26px;
  background: var(--g-bg);
  border: 1px solid var(--g-border);
  box-shadow: inset 0 1px 0 var(--g-highlight), 0 24px 60px -24px rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(30px) saturate(1.6);
  -webkit-backdrop-filter: blur(30px) saturate(1.6);
}
:root[data-dock="on"] .sc {
  width: auto;
  padding: 0;
  gap: 0;
  border-radius: 0;
  transform: translateY(calc(var(--m, 0) * -8px));
  transition: transform 0.18s ease-out;
}
:root[data-dock="on"] .sc:hover { background: none; }
:root[data-dock="on"] .sc-icon {
  --s: calc(50px * (1 + var(--m, 0) * 0.45));
  width: var(--s);
  height: var(--s);
  border-radius: calc(var(--s) * 0.3);
  background: var(--g-bg-hover);
  transition: width 0.18s ease-out, height 0.18s ease-out, border-radius 0.18s ease-out, transform 0.18s ease-out, box-shadow 0.18s ease-out;
}
:root[data-dock="on"] .sc-icon img { width: 56%; height: 56%; border-radius: 22%; }
:root[data-dock="on"] .sc-icon .letter { width: 60%; height: 60%; border-radius: 28%; font-size: calc(var(--s) * 0.3); }
:root[data-dock="on"] .sc-label {
  position: absolute;
  bottom: calc(100% + 12px);
  left: 50%;
  translate: -50% 6px;
  max-width: none;
  padding: 5px 10px;
  border-radius: 8px;
  background: rgba(16, 18, 30, 0.88);
  color: #fff;
  font-size: 12px;
  text-shadow: none;
  box-shadow: 0 8px 20px -8px rgba(0, 0, 0, 0.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s, translate 0.2s var(--ease);
}
:root[data-dock="on"] .sc:hover .sc-label, :root[data-dock="on"] .sc:focus-visible .sc-label { opacity: 1; translate: -50% 0; }
:root[data-dock="on"] .sc-edit { top: -6px; right: -6px; width: 20px; height: 20px; border-radius: 50%; z-index: 1; }
:root[data-dock="on"] .dock-sep { display: block; align-self: center; width: 1px; height: 38px; margin: 0 3px; background: var(--g-border); }
:root[data-dock="on"] .sc.add .sc-icon { background: transparent; }
:root[data-dock="on"][data-layout="dashboard"]:not([data-zen="on"]) .shortcuts { margin-top: 0; }
@media (prefers-reduced-motion: reduce) { :root[data-dock="on"] .sc, :root[data-dock="on"] .sc-icon { transition: none; } }
/* Like the Mac dock: the bar keeps its height, icons grow up out of it. */
:root[data-dock="on"] .shortcuts { height: 70px; overflow: visible; }
:root[data-dock="on"] .nt-toast { bottom: 104px; }
:root[data-dock="on"] .shortcuts:empty { display: none; }

/* Site icons: big ones fill nicely, small ones (16–47px) stay near their real size so they never look blurry */
.sc-icon img { object-fit: contain; }
.sc-icon.is-small img { width: 20px !important; height: 20px !important; border-radius: 4px; }
:root[data-dock="on"] .sc-icon.is-small img { width: calc(var(--s) * 0.4) !important; height: calc(var(--s) * 0.4) !important; max-width: 24px; max-height: 24px; }

/* Each widget knows its own size, so its content can get compact in short rows */
.w { container-type: size; }
.lock-card, :root[data-plan="expired"] .w { container-type: normal; }

/* ---------- Focus timer: a calm dial (visionOS thermostat style) ---------- */
.fx { --fx-c: var(--accent); flex: 1; display: flex; flex-direction: column; min-height: 0; }
.fx[data-fmode="short"], .fx[data-fmode="long"] { --fx-c: #4CC38A; }
.fx-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 30px; }
.fx-modes { display: flex; gap: 12px; min-width: 0; }
.fx-modes button { padding: 2px 0; color: var(--g-text-3); font: 600 13px/1.2 var(--font); white-space: nowrap; transition: color .2s; }
.fx-modes button:hover { color: var(--g-text-2); }
.fx-modes button[aria-selected="true"] { color: var(--g-text); }
.fx-dial {
  position: relative; flex: 1; min-height: 0; display: grid; place-items: center;
  /* the dial takes the space the card has */
  --d: min(calc(100cqw - 4px), calc(100cqh - 34px), 184px);
}
.fx-dial > svg { width: var(--d); height: var(--d); overflow: visible; }
.fx-dial > svg circle { fill: none; stroke-width: 5; transform: rotate(135deg); transform-origin: 60px 60px; }
.fx-track { stroke: var(--g-fill); stroke-linecap: round; }
.fx-bar { stroke: var(--fx-c); stroke-linecap: round; transition: stroke-dasharray .9s linear, stroke .3s; }
.fx-knob { transform: none !important; fill: #fff; filter: drop-shadow(0 1px 3px rgba(0, 0, 0, .35)); transition: cx .9s linear, cy .9s linear; }
.fx-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; padding-bottom: calc(var(--d) * 0.1); text-align: center; pointer-events: none; }
.fx .ring-time { position: static; display: block; font: 300 calc(var(--d) * 0.25)/1 var(--font-display); letter-spacing: -0.035em; font-variant-numeric: tabular-nums; }
.fx-status { margin-top: calc(var(--d) * 0.03); color: var(--g-text-2); font-size: 12px; font-weight: 500; }
/* controls sit in the open bottom of the dial */
.fx-controls {
  position: absolute; left: 50%; bottom: calc(50% - var(--d) / 2 - 6px); translate: -50% 0;
  display: flex; align-items: center; gap: 8px;
}
.fx-round {
  display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%;
  background: var(--g-fill); color: var(--g-text-2);
  transition: background .15s, color .15s, transform .15s var(--ease), opacity .2s;
}
.fx-round:hover { background: var(--g-bg-hover); color: var(--g-text); }
.fx-round:active { transform: scale(.92); }
.fx-round svg { width: 14px; height: 14px; }
.fx-play {
  display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%;
  background: var(--fx-c); color: #fff;
  box-shadow: 0 10px 24px -10px color-mix(in srgb, var(--fx-c) 85%, transparent), inset 0 1px 0 rgba(255, 255, 255, .25);
  transition: transform .2s var(--ease), filter .15s, background .3s;
}
.fx-play:hover { filter: brightness(1.08); transform: translateY(-1px); }
.fx-play:active { transform: scale(.95); }
.fx-play svg { width: 17px; height: 17px; }
/* which buttons show: ready = − ▶ +, running / paused = ↺ ▶ */
.fx[data-state="ready"] .fx-reset { display: none; }
.fx:not([data-state="ready"]) .fx-adj { display: none; }
/* sound: a round glass icon with an equalizer */
.fx-sound { width: 30px; height: 30px; }
.fx-sound .lbl { display: none; }
.fx-sound .eq { display: flex; align-items: flex-end; gap: 2px; height: 12px; }
.fx-sound .eq i { width: 2.5px; height: 5px; border-radius: 2px; background: currentColor; }
.fx-sound[data-playing="true"] { background: color-mix(in srgb, var(--accent) 24%, transparent); color: var(--g-text); }

.fx-line { display: none; }
/* Short rows: no ring — big time on the left with a thin progress line, play on the right */
@container (max-height: 168px) {
  .fx-dial { display: flex; align-items: center; justify-content: space-between; gap: 10px; --d: 140px; }
  .fx-dial > svg { display: none; }
  .fx-center { position: static; align-items: flex-start; padding: 0; min-width: 0; }
  .fx .ring-time { font-size: clamp(26px, 15cqw, 38px); }
  .fx-status { margin-top: 4px; font-size: 12px; }
  .fx-line { display: block; width: 100%; min-width: 64px; height: 3px; margin-top: 8px; border-radius: 3px; background: var(--g-fill); overflow: hidden; }
  .fx-line i { display: block; height: 100%; width: calc(var(--p, 1) * 100%); background: var(--fx-c); border-radius: inherit; transition: width .9s linear; }
  .fx-controls { position: static; translate: none; flex-direction: column; gap: 6px; }
  .fx .fx-adj { display: none; }
  .fx-play { width: 40px; height: 40px; order: -1; }
  .fx-round { width: 28px; height: 28px; }
}
@container (max-width: 200px) {
  .fx-modes { gap: 9px; }
  .fx-modes button { font-size: 12px; }
  .fx-sound { width: 26px; height: 26px; }
  .bk-orb-wrap { display: none !important; }
}

/* Compact widgets for short rows (small windows) */
@container (max-height: 168px) {
  .weather-now svg { width: 40px; height: 40px; }
  .weather-days { display: none; }
  .lock-note { font-size: 12px; }
  .lock-note .pill { margin-top: 6px; height: 30px; }
  .w-head { margin-bottom: 6px; min-height: 24px; }
  .bk-orb-wrap { width: min(96px, calc(100cqh - 46px)); height: min(96px, calc(100cqh - 46px)); }
  .bk-phase { font-size: 15px; }
  .bk-sub { margin-bottom: 4px; }
  .echo-grid { grid-template-columns: repeat(3, 28px); gap: 4px; }
  .echo-tile { width: 28px; height: 28px; }
  .st-total b { font-size: 28px; }
  .st-bars { margin-top: 8px; gap: 4px; }
  .st-day { gap: 3px; }
}
@container (max-width: 200px) {
  [data-widget="break"] .w-title { display: none; }
  .bk-body { gap: 10px; }
  .bk-share, .bk-sub { display: none; }
  .bk-orb-wrap { width: min(84px, calc(100cqh - 46px)); height: min(84px, calc(100cqh - 46px)); }
  .bk-phase { font-size: 14px; }
}

/* Short windows (laptops with big text, small screens): everything gets more compact, nothing is cut. Keep last. */
@media (max-height: 820px) {
  .clock { font-size: clamp(64px, min(11vw, 16vh), 156px); }
  .search { height: 50px; margin-top: clamp(14px, 3.5vh, 36px); }
}
@media (max-height: 640px) {
  .nt-top { padding: 12px 16px; }
  .greeting { font-size: 15px; margin-bottom: 0; }
  .clock { font-size: clamp(48px, min(10vw, 14vh), 120px); }
  .date { margin-top: 4px; font-size: 13px; }
  .search { height: 44px; border-radius: 14px; }
  .widgets { gap: 12px; }
  .w { padding: 14px 16px 16px; border-radius: 20px; }
  :root[data-dock="on"] .nt-main { --pad-bottom: 86px; }
  :root[data-dock="on"] .shortcuts { bottom: 10px; height: 60px; padding: 7px 9px; border-radius: 22px; }
  :root[data-dock="on"] .sc-icon { --s: calc(42px * (1 + var(--m, 0) * 0.45)); }
  :root[data-dock="on"] .dock-sep { height: 32px; }
}
/* ---------- Shortcut groups (a folder of apps in the dock) ---------- */
.sc-icon.g-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9%; padding: 17%; place-items: stretch; }
.g-mini { display: grid; place-items: center; min-width: 0; aspect-ratio: 1; border-radius: 28%; overflow: hidden; }
:root .sc-icon.g-grid .g-mini img { width: 100% !important; height: 100% !important; max-width: none !important; max-height: none !important; border-radius: 26%; object-fit: contain; }
:root .sc-icon.g-grid .g-mini .letter { width: 100%; height: 100%; border-radius: 28%; font-size: 9px; }
:root[data-dock="on"] .sc-icon.g-grid .g-mini .letter { font-size: calc(var(--s) * 0.15); }

.g-pop {
  --cols: 3;
  position: fixed; z-index: 45;
  width: min(calc(var(--cols) * 96px + 36px), calc(100vw - 24px));
  padding: 18px 18px 12px;
  border-radius: 24px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 84%, transparent);
  color: var(--text);
  box-shadow: var(--shadow-xl);
  backdrop-filter: blur(30px) saturate(1.6);
  -webkit-backdrop-filter: blur(30px) saturate(1.6);
  opacity: 0;
  transform: translateY(8px) scale(.96);
  transform-origin: var(--ox, 50%) 100%;
  transition: opacity .18s ease, transform .28s var(--ease);
}
.g-pop[data-side="bottom"] { transform: translateY(-8px) scale(.96); transform-origin: var(--ox, 50%) 0; }
.g-pop.is-open { opacity: 1; transform: none; }
.g-head { display: flex; align-items: baseline; gap: 10px; padding: 0 4px 10px; }
.g-head b { font: 700 18px/1.2 var(--font-display); letter-spacing: -.01em; }
.g-head small { color: var(--text-3); font-size: 13px; }
.g-edit { display: grid; place-items: center; width: 28px; height: 28px; margin-left: auto; align-self: center; border-radius: 9px; color: var(--text-3); }
.g-edit:hover { background: var(--fill); color: var(--text); }
.g-edit svg { width: 14px; height: 14px; }
.g-apps { display: grid; grid-template-columns: repeat(var(--cols), 1fr); gap: 4px; }
.g-app { display: flex; flex-direction: column; align-items: center; gap: 8px; min-width: 0; padding: 10px 4px 8px; border-radius: 16px; color: inherit; text-decoration: none; transition: background .15s; }
.g-app:hover, .g-app:focus-visible { background: var(--fill); }
.g-ico { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 16px; background: var(--fill); overflow: hidden; transition: transform .2s var(--ease); }
.g-app:hover .g-ico { transform: scale(1.06); }
.g-ico img { width: 64%; height: 64%; object-fit: contain; border-radius: 22%; }
.g-ico.is-small img { width: 26px; height: 26px; border-radius: 5px; }
.g-ico .letter, .g-row-ico .letter { display: grid; place-items: center; width: 64%; height: 64%; border-radius: 26%; background: var(--lc); color: #fff; font: 700 17px/1 var(--font-display); }
.g-name { max-width: 100%; overflow: hidden; font-size: 12.5px; font-weight: 500; white-space: nowrap; text-overflow: ellipsis; }
.g-empty { grid-column: 1 / -1; margin: 8px 4px 12px; color: var(--text-3); font-size: 13px; }

/* Drag in the dock */
.sc.is-dragging { opacity: .35; }
.sc.is-drop .sc-icon { box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 55%, transparent); }
.sc.is-group-ready .sc-icon { box-shadow: 0 0 0 3px var(--accent); transform: scale(1.12); }
.dock-hint {
  position: fixed; z-index: 46;
  padding: 6px 12px; border-radius: 10px;
  background: rgba(16, 18, 30, 0.9); color: #fff;
  font-size: 12.5px; font-weight: 600; white-space: nowrap;
  box-shadow: 0 8px 20px -8px rgba(0, 0, 0, 0.5);
  pointer-events: none;
  animation: hint-in .18s var(--ease);
}
@keyframes hint-in { from { opacity: 0; transform: translateY(4px); } }

/* Group editor + icon picker */
.sc-kind { margin: -4px 0 16px; }
.sc-kind[hidden], #scGroupRow[hidden] { display: none; }
.sheet select { height: 40px; padding: 0 10px; border: 0; border-radius: 10px; outline: 0; background: var(--fill); color: var(--text); font: 400 14px var(--font); }
.sheet select:focus { box-shadow: 0 0 0 2px var(--accent); }
.g-pick-label { margin: 4px 0 8px; color: var(--text-2); font-size: 12px; font-weight: 600; }
.g-pick { display: flex; flex-direction: column; gap: 2px; max-height: 260px; overflow: auto; margin: 0 -6px 8px; padding: 0 6px; }
.sheet .g-row { flex-direction: row; align-items: center; gap: 10px; margin: 0; padding: 6px 8px; border-radius: 10px; color: var(--text); font-size: 14px; font-weight: 500; cursor: pointer; }
.g-row:hover { background: var(--fill); }
.g-row input { width: 16px; height: 16px; margin: 0; accent-color: var(--accent); }
.g-row-ico { display: grid; place-items: center; flex: none; width: 28px; height: 28px; border-radius: 8px; background: var(--fill); overflow: hidden; }
.g-row-ico img { width: 72%; height: 72%; object-fit: contain; }
.g-row-ico.is-small img { width: 16px; height: 16px; }
.g-row-ico .letter { font-size: 12px; width: 100%; height: 100%; }
.g-row-name { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.is-loading > .letter { opacity: 0; }
.sc-icon > .letter, .g-mini > .letter, .g-ico > .letter, .g-row-ico > .letter { transition: opacity .2s ease; }
.sc-icon img, .g-mini img, .g-ico img, .g-row-ico img { animation: icon-in .25s ease both; }
@keyframes icon-in { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .g-pop { transition: none; } .sc-icon img, .g-mini img, .g-ico img, .g-row-ico img { animation: none; } }

@media (max-height: 500px) {
  .greeting { display: none; }
  .clock { font-size: clamp(44px, 12vh, 72px); }
}

/* Photo wallpapers in Customize */
.d-label { margin: 14px 0 8px; color: var(--text-3); font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.d-sec h3 + .d-label { margin-top: 4px; }
.walls { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.wall { position: relative; display: block; padding: 0; border-radius: 12px; overflow: hidden; aspect-ratio: 16 / 10; background: var(--fill); box-shadow: 0 0 0 1px var(--border); transition: transform .2s var(--ease), box-shadow .2s; }
.wall img { width: 100%; height: 100%; object-fit: cover; display: block; }
.wall span { position: absolute; left: 6px; bottom: 5px; color: #fff; font-size: 10.5px; font-weight: 600; text-shadow: 0 1px 3px rgba(0, 0, 0, .6); }
.wall:hover { transform: translateY(-1px); }
.wall[aria-checked="true"] { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--accent); }
/* Light text needs a soft shade on bright photos */
:root[data-wall="on"] .bg-vignette { opacity: 1; background: radial-gradient(120% 80% at 50% 20%, rgba(0, 0, 0, .18), transparent 60%), linear-gradient(180deg, rgba(0, 0, 0, .12), transparent 30%, transparent 70%, rgba(0, 0, 0, .25)); }
@container (max-height: 168px) { [data-widget="todo"] .w-empty { font-size: 0; } [data-widget="todo"] .w-empty b { font-size: 13px; margin: 0; } }
