:root {
  --display: 'Playfair Display', Georgia, serif;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --ink: #fff;
  --ink-soft: rgba(255, 255, 255, 0.78);
  --ink-faint: rgba(255, 255, 255, 0.55);
  --panel: rgba(18, 20, 19, 0.78);
  --panel-solid: #161817;
  --line: rgba(255, 255, 255, 0.12);
  --accent: #8fb39a;
  --accent-strong: #5f8a6c;
  --ease: cubic-bezier(0.22, 0.7, 0.18, 1);
  --slow: 700ms;
  --med: 380ms;
  --fast: 180ms;
  --shadow-text: 0 1px 10px rgba(0, 0, 0, 0.35);
  --radius: 14px;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; }
body {
  font-family: var(--sans);
  color: var(--ink);
  background: #1d221f;
  -webkit-font-smoothing: antialiased;
  user-select: none;
}
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input, textarea, select { font: inherit; color: inherit; }
[hidden] { display: none !important; }
a { color: inherit; }

.ico { display: inline-flex; width: 22px; height: 22px; }
.ico svg { width: 100%; height: 100%; }

/* ---------- Background ---------- */
#bg { position: fixed; inset: 0; overflow: hidden; z-index: 0; }
.bg-layer {
  position: absolute; inset: -2%;
  background-size: cover; background-position: center;
  opacity: 0; transition: opacity 1400ms var(--ease), filter 900ms var(--ease);
  will-change: opacity, transform;
}
.bg-layer.show { opacity: 1; }
body.motion .bg-layer.show { animation: drift 90s ease-in-out infinite alternate; }
@keyframes drift { from { transform: scale(1.02) translate(0, 0); } to { transform: scale(1.08) translate(-1%, -0.6%); } }
body.blur-bg .bg-layer { filter: blur(14px) brightness(0.85); }
#scrim { position: fixed; inset: 0; z-index: 1; background: rgba(0, 0, 0, 0.16); pointer-events: none; transition: background var(--slow) var(--ease); }
body.focus-mode #scrim { background: rgba(0, 0, 0, 0.26); }

/* ---------- Layout ---------- */
#app {
  position: fixed; inset: 0; z-index: 2;
  display: grid; grid-template-rows: auto 1fr auto;
  padding: 22px 26px 20px;
  text-shadow: var(--shadow-text);
  transition: opacity var(--slow) var(--ease);
}
body.loading #app { opacity: 0; }
.region { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.top-left, .top-right { display: flex; gap: 22px; align-items: flex-start; }
.center {
  flex-direction: column; justify-content: center; align-items: center;
  text-align: center; padding-bottom: 4vh;
}
.bottom { align-items: flex-end; }
.bottom-left { flex: 1; display: flex; align-items: center; gap: 16px; min-width: 0; }
.bottom-center { flex: 2; text-align: center; }
.bottom-right { flex: 1; display: flex; justify-content: flex-end; gap: 22px; align-items: flex-end; }

/* Widgets fade as a group when hidden by settings, peek or focus mode */
.widget, .greeting, .focus, .bottom-center, .bottom-left > *, .dock-item {
  transition: opacity var(--slow) var(--ease), transform var(--slow) var(--ease), filter var(--slow) var(--ease);
}
body.peek #app > * > *:not(.bottom-left),
body.peek .bottom-left > *:not(.photo-info) { opacity: 0; pointer-events: none; }
body.peek .photo-info .photo-meta { opacity: 1; }
body.peek #scrim { background: rgba(0, 0, 0, 0); }

/* Icon over label buttons (top corners, dock) */
.tile {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  font-size: 13.5px; font-weight: 500; color: var(--ink);
  opacity: 0.92; transition: opacity var(--fast), transform var(--fast) var(--ease);
}
.tile:hover { opacity: 1; transform: translateY(-1px); }
.tile .ico { width: 24px; height: 24px; }
.tile .big { font-size: 26px; font-weight: 500; line-height: 24px; letter-spacing: -0.01em; display: flex; align-items: center; gap: 6px; }
.tile .big .ico { width: 24px; height: 24px; }

/* ---------- Popovers ---------- */
.pop {
  position: absolute; z-index: 20;
  background: var(--panel); border: 1px solid var(--line);
  backdrop-filter: blur(22px) saturate(1.2); -webkit-backdrop-filter: blur(22px) saturate(1.2);
  border-radius: var(--radius);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
  text-shadow: none; padding: 16px;
  opacity: 0; transform: translateY(6px) scale(0.985);
  transition: opacity var(--med) var(--ease), transform var(--med) var(--ease);
  user-select: text;
}
.pop.open { opacity: 1; transform: none; }
.pop h3 { margin: 0 0 12px; font-size: 17px; font-weight: 600; display: flex; align-items: center; gap: 10px; }
.pop h3 .ico { width: 20px; height: 20px; }
.anchor { position: relative; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 8px 14px; border-radius: 999px; background: rgba(255, 255, 255, 0.12);
  font-size: 14px; font-weight: 500; transition: background var(--fast);
}
.btn:hover { background: rgba(255, 255, 255, 0.2); }
.btn.primary { background: var(--accent-strong); }
.btn.primary:hover { background: #6d9a7a; }
.icon-btn {
  width: 30px; height: 30px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  opacity: 0.8; transition: opacity var(--fast), background var(--fast);
}
.icon-btn:hover { opacity: 1; background: rgba(255, 255, 255, 0.12); }
.icon-btn .ico { width: 18px; height: 18px; }

/* ---------- Clock ---------- */
.clock-wrap { position: relative; display: flex; align-items: center; justify-content: center; }
.clock {
  font-family: var(--display); font-weight: 800;
  font-size: clamp(96px, 15vw, 210px); line-height: 0.95; letter-spacing: -0.02em;
  font-variant-numeric: lining-nums tabular-nums;
  cursor: default;
}
.clock .ampm { font-size: 0.16em; font-weight: 600; margin-left: 0.15em; letter-spacing: 0.04em; vertical-align: 0.4em; opacity: 0.8; font-family: var(--sans); }
.clock .sec { font-size: 0.32em; font-weight: 600; margin-left: 0.08em; opacity: 0.7; }
.side-btn {
  position: absolute; top: 50%; transform: translateY(-50%);
  opacity: 0; transition: opacity var(--med) var(--ease);
}
.clock-wrap:hover .side-btn, .side-btn:focus-visible { opacity: 0.85; }
.side-btn.left { left: -48px; }
.side-btn.right { right: -48px; }

.greeting {
  font-family: var(--display); font-weight: 700;
  font-size: clamp(30px, 3.6vw, 52px); margin: 0.2em 0 0; letter-spacing: -0.005em;
  position: relative;
}
.greeting .name { outline: none; border-radius: 6px; }
.greeting .name[contenteditable='true'] { background: rgba(0, 0, 0, 0.18); padding: 0 6px; }
.greeting .edit {
  position: absolute; right: -40px; top: 50%; transform: translateY(-50%);
  opacity: 0; transition: opacity var(--med);
}
.greeting:hover .edit { opacity: 0.8; }

/* ---------- Main goal ---------- */
.focus { margin-top: clamp(28px, 6vh, 64px); min-height: 110px; }
.goal-prompt {
  font-family: var(--display); font-weight: 500; font-size: clamp(24px, 2.4vw, 34px);
  margin: 0 0 12px; opacity: 0; animation: rise var(--slow) var(--ease) forwards;
}
.goal-input {
  width: min(560px, 80vw); text-align: center;
  font-family: var(--display); font-size: clamp(24px, 2.4vw, 32px); font-weight: 500;
  background: transparent; border: 0; border-bottom: 2px solid rgba(255, 255, 255, 0.85);
  padding: 4px 8px 8px; outline: none; text-shadow: var(--shadow-text);
  transition: border-color var(--med);
}
.goal-input:focus { border-color: #fff; }
.goal-label { font-size: 14px; font-weight: 600; letter-spacing: 0.22em; text-transform: uppercase; opacity: 0.85; margin-bottom: 12px; }
.goal-row { display: inline-flex; align-items: center; gap: 16px; position: relative; animation: rise var(--slow) var(--ease); }
.goal-text { font-family: var(--display); font-size: clamp(26px, 2.8vw, 40px); font-weight: 600; transition: opacity var(--med); }
.goal-row.done .goal-text { text-decoration: line-through; text-decoration-thickness: 2px; opacity: 0.72; }
.check {
  width: 26px; height: 26px; border-radius: 7px; border: 2px solid rgba(255, 255, 255, 0.9);
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  transition: background var(--med) var(--ease), border-color var(--med);
}
.check .ico { width: 18px; height: 18px; opacity: 0; transform: scale(0.6); transition: opacity var(--med), transform var(--med) var(--ease); }
.check.on { background: rgba(255, 255, 255, 0.95); color: #1d221f; }
.check.on .ico { opacity: 1; transform: none; }
.goal-row .more { opacity: 0; transition: opacity var(--med); }
.goal-row:hover .more { opacity: 0.85; }
.goal-cheer { margin-top: 14px; font-size: 16px; opacity: 0; transition: opacity var(--slow); }
.goal-cheer.show { opacity: 0.9; }

/* ---------- Top three ---------- */
.top-card {
  width: min(560px, 86vw); margin: 0 auto; padding: 18px 22px 14px; border-radius: 22px; text-align: left; text-shadow: none;
  background: rgba(255, 255, 255, 0.12); border: 1px solid rgba(255, 255, 255, 0.24);
  backdrop-filter: blur(28px) saturate(1.6); -webkit-backdrop-filter: blur(28px) saturate(1.6);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28), 0 24px 60px rgba(0, 0, 0, 0.28);
}
body.low-perf .top-card { backdrop-filter: none; -webkit-backdrop-filter: none; background: var(--panel); }
body.theme-light .top-card { background: rgba(255, 255, 255, 0.58); border-color: rgba(255, 255, 255, 0.7); color: #1d1f1e; }
.top-card .goal-label { font-size: 11px; opacity: 0.75; }
.top-when { font-size: 12px; opacity: 0.75; }
.top-list { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.top-row { display: flex; align-items: flex-start; gap: 16px; text-align: left; animation: rise var(--slow) var(--ease); }
.top-row .check { margin-top: 3px; }
.top-mid { min-width: 0; }
.top-title { font-family: var(--display); font-size: clamp(20px, 1.9vw, 26px); font-weight: 600; line-height: 1.25; }
.top-why { margin-top: 2px; font-size: 14px; opacity: 0.85; }
.top-row.done .top-title { text-decoration: line-through; text-decoration-thickness: 2px; opacity: 0.72; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.menu { min-width: 180px; padding: 6px; }
.menu button { display: flex; width: 100%; gap: 10px; align-items: center; padding: 9px 12px; border-radius: 8px; font-size: 14px; text-align: left; }
.menu button:hover { background: rgba(255, 255, 255, 0.1); }
.menu .ico { width: 16px; height: 16px; }

/* ---------- Bottom ---------- */
.quote { font-size: 17px; line-height: 1.45; max-width: 760px; margin: 0 auto; position: relative; cursor: default; }
.quote .q-text { font-weight: 500; }
.quote .q-author {
  display: block; font-size: 14px; color: var(--ink-soft); height: 0; opacity: 0; overflow: hidden;
  transform: translateY(4px); transition: opacity var(--med) var(--ease), transform var(--med) var(--ease), height var(--med) var(--ease);
}
.quote .q-actions { position: absolute; right: -76px; bottom: 0; display: flex; gap: 2px; opacity: 0; transition: opacity var(--med); }
.quote:hover .q-author { height: 22px; opacity: 1; transform: none; }
.quote:hover .q-actions { opacity: 1; }
.quote .icon-btn.on { color: #f3a5a5; opacity: 1; }
.quote.mantra .q-text { font-style: italic; font-weight: 400; opacity: 0.9; }

.photo-info { display: flex; align-items: center; gap: 4px; min-width: 0; max-width: 40vw; position: relative; }
.photo-title { font-size: 14px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: default; padding: 6px 0; }
.photo-meta {
  position: absolute; left: 100%; bottom: 0; top: 0;
  display: flex; align-items: center; gap: 2px; margin-left: 10px;
  opacity: 0; transform: translateX(-4px); transition: opacity var(--med) var(--ease), transform var(--med) var(--ease);
}
.photo-credit { font-size: 12.5px; color: var(--ink-soft); white-space: nowrap; margin-right: 4px; }
.photo-credit a { text-decoration: none; }
.photo-credit a:hover { text-decoration: underline; }
.photo-info:hover .photo-meta { opacity: 1; transform: none; }
.photo-meta .icon-btn.on { color: #f3a5a5; opacity: 1; }
.photo-meta .icon-btn.pinned { color: var(--accent); opacity: 1; }
.peek-ring {
  position: absolute; left: -2px; right: -2px; bottom: 0; height: 2px; border-radius: 2px;
  background: rgba(255, 255, 255, 0.85); transform-origin: left; transform: scaleX(0);
}
.photo-title:hover ~ .peek-ring, .photo-info.peeking .peek-ring { transform: scaleX(1); transition: transform 1400ms linear; }

.settings-btn .ico { width: 24px; height: 24px; }

/* ---------- Links & search ---------- */
.links-pop { top: 62px; left: 0; width: 280px; }
.links-list { display: flex; flex-direction: column; gap: 2px; max-height: 50vh; overflow: auto; }
.link-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; text-decoration: none; font-size: 14.5px; }
.link-row:hover { background: rgba(255, 255, 255, 0.1); }
.link-row img { width: 16px; height: 16px; border-radius: 3px; }
.link-row .x { margin-left: auto; opacity: 0; }
.link-row:hover .x { opacity: 0.7; }
.link-add { display: flex; gap: 6px; margin-top: 10px; }
.field {
  width: 100%; padding: 9px 12px; border-radius: 9px; border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.07); outline: none; font-size: 14px; transition: border-color var(--fast), background var(--fast);
}
.field:focus { border-color: rgba(255, 255, 255, 0.35); background: rgba(255, 255, 255, 0.1); }

.search { display: flex; align-items: center; gap: 8px; border-bottom: 1.5px solid transparent; padding: 3px 0; transition: border-color var(--med); }
.search:focus-within { border-color: rgba(255, 255, 255, 0.8); }
.search input { background: transparent; border: 0; outline: none; width: 140px; font-size: 15px; transition: width var(--med) var(--ease); text-shadow: var(--shadow-text); }
.search input:focus { width: 260px; }
.search input::placeholder { color: var(--ink-soft); }

/* ---------- Tasks ---------- */
.tasks-pop { right: 0; bottom: 58px; width: 380px; height: min(480px, 62vh); display: flex; flex-direction: column; padding: 0; }
.tasks-head { display: flex; align-items: center; gap: 8px; padding: 14px 14px 10px 18px; }
.tasks-head .title { display: flex; align-items: center; gap: 10px; font-size: 17px; font-weight: 600; flex: 1; }
.tasks-head .title .ico { width: 20px; height: 20px; }
.list-switch { display: flex; gap: 4px; padding: 0 14px 8px; }
.chip { font-size: 12.5px; padding: 5px 11px; border-radius: 999px; background: rgba(255, 255, 255, 0.07); color: var(--ink-soft); transition: background var(--fast), color var(--fast); }
.chip:hover { background: rgba(255, 255, 255, 0.13); }
.chip.on { background: rgba(255, 255, 255, 0.92); color: #1b1d1c; }
.chip .n { opacity: 0.6; margin-left: 4px; }
.task-list { flex: 1; overflow: auto; padding: 4px 8px; }
.task {
  display: flex; align-items: flex-start; gap: 12px; padding: 9px 10px; border-radius: 9px; font-size: 15px; line-height: 1.35;
  transition: background var(--fast), opacity var(--med), transform var(--med) var(--ease);
  animation: rise var(--med) var(--ease);
}
.task:hover { background: rgba(255, 255, 255, 0.07); }
.task .check { width: 19px; height: 19px; border-radius: 5px; border-width: 1.6px; margin-top: 1px; }
.task .check .ico { width: 13px; height: 13px; }
.task .t { flex: 1; outline: none; word-break: break-word; }
.task.done .t { text-decoration: line-through; opacity: 0.55; }
.task .src { font-size: 11px; padding: 2px 7px; border-radius: 999px; background: rgba(143, 179, 154, 0.25); color: #cfe3d5; white-space: nowrap; margin-top: 1px; }
.task .x { opacity: 0; }
.task:hover .x { opacity: 0.65; }
.task.dragging { opacity: 0.4; }
.task.leaving { opacity: 0; transform: translateX(10px); }
.empty { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; color: var(--ink-faint); font-size: 14px; }
.empty .ico { width: 44px; height: 44px; opacity: 0.4; }
.new-task { display: flex; align-items: center; gap: 10px; padding: 12px 18px 16px; border-top: 1px solid var(--line); }
.new-task .ico { width: 18px; height: 18px; opacity: 0.7; }
.new-task input { flex: 1; background: transparent; border: 0; outline: none; font-size: 15px; }
.new-task input::placeholder { color: var(--ink-faint); }
.badge { font-size: 11px; font-weight: 600; background: rgba(255, 255, 255, 0.9); color: #1b1d1c; border-radius: 999px; padding: 1px 6px; margin-left: 4px; text-shadow: none; }

/* ---------- Toasts ---------- */
.toasts { position: fixed; left: 50%; top: 22px; transform: translateX(-50%); z-index: 50; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast {
  background: var(--panel); border: 1px solid var(--line); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  padding: 10px 18px; border-radius: 999px; font-size: 14px; opacity: 0; transform: translateY(-8px);
  transition: opacity var(--med) var(--ease), transform var(--med) var(--ease);
}
.toast.in { opacity: 1; transform: none; }
.toast.ai { border-color: rgba(143, 179, 154, 0.5); }

/* ---------- Onboarding ---------- */
.onboard { position: fixed; inset: 0; z-index: 30; display: flex; align-items: center; justify-content: center; flex-direction: column; text-shadow: var(--shadow-text); }
.onboard h2 { font-family: var(--display); font-weight: 600; font-size: clamp(30px, 3.4vw, 46px); margin: 0 0 18px; animation: rise var(--slow) var(--ease); }
.onboard input { animation: rise 900ms var(--ease); }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 1ms !important; transition-duration: 1ms !important; }
}

.off { opacity: 0 !important; pointer-events: none !important; }
.bottom:has(.photo-info:hover) .bottom-center { opacity: 0; }

/* ---------- Shared bits ---------- */
.muted { color: var(--ink-faint); font-size: 14px; margin: 0 0 10px; }
.small { font-size: 13px; }
.stack { display: flex; flex-direction: column; gap: 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
code { font-size: 12.5px; background: rgba(255, 255, 255, 0.1); padding: 1px 6px; border-radius: 5px; }
.icon-btn.pinned { color: var(--accent); opacity: 1; }
.tile.stat .big { font-weight: 500; }

/* ---------- Focus mode ---------- */
.focus-pill {
  position: absolute; top: 18px; left: 50%; transform: translate(-50%, -12px);
  display: flex; align-items: center; gap: 10px; font-size: 24px; font-weight: 600;
  opacity: 0; pointer-events: none; transition: opacity var(--slow) var(--ease), transform var(--slow) var(--ease);
}
.focus-pill.open { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.focus-pill > .ico { width: 24px; height: 24px; }
.focus-pill .stop { width: 34px; height: 34px; border-radius: 50%; background: rgba(255, 255, 255, 0.18); display: inline-flex; align-items: center; justify-content: center; transition: background var(--fast); }
.focus-pill .stop:hover { background: rgba(255, 255, 255, 0.3); }
.focus-pill .sq { width: 11px; height: 11px; border-radius: 2px; background: #fff; }
.focus-tools { display: flex; gap: 6px; align-items: center; }
.focus-tools .icon-btn { width: 40px; height: 40px; }
.focus-tools .icon-btn .ico { width: 22px; height: 22px; }

body.focus-mode .greeting, body.focus-mode .focus { display: none; }
body.focus-mode .top-left > [data-widget='focusButton'], body.focus-mode .top-left > [data-widget='notes'] { display: none; }
body.focus-mode #weather, body.focus-mode #search,
body.focus-mode .top-left > [data-widget='focusButton'] { opacity: 0; pointer-events: none; }
body:not(.focus-mode) .focus-tools { display: none; }

.timer {
  position: relative; width: min(62vh, 560px); aspect-ratio: 1; display: flex; align-items: center; justify-content: center;
  animation: rise 900ms var(--ease);
}
.ring { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.ring circle { fill: none; stroke-width: 1.3; stroke-linecap: round; }
.ring .track { stroke: rgba(255, 255, 255, 0.28); }
.ring .prog { stroke: rgba(205, 228, 210, 0.95); transition: stroke-dashoffset 600ms linear, stroke var(--slow); }
.ring .prog.break { stroke: rgba(246, 214, 160, 0.95); }
.timer-inner { position: relative; text-align: center; display: flex; flex-direction: column; align-items: center; margin-top: -4%; }
.phase-tabs { display: flex; gap: 22px; margin-bottom: 4px; }
.phase-tabs button { font-size: 15px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; opacity: 0.5; transition: opacity var(--med); }
.phase-tabs button.on, .phase-tabs button:hover { opacity: 1; }
.timer-time { font-family: var(--display); font-weight: 800; font-size: clamp(84px, 12vw, 168px); line-height: 1; font-variant-numeric: lining-nums tabular-nums; letter-spacing: -0.02em; }
.timer-intent {
  margin-top: 10px; font-family: var(--display); font-weight: 600; font-size: clamp(22px, 2.3vw, 34px);
  min-width: 200px; max-width: calc(min(62vh, 560px) * 0.76); outline: none; border-radius: 8px; padding: 0 8px; cursor: text; user-select: text;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.timer-intent:focus { white-space: normal; text-overflow: clip; }
.timer-intent:empty::before { content: attr(data-placeholder); opacity: 0.9; }
.timer-intent:focus { background: rgba(0, 0, 0, 0.12); }
.timer-play {
  position: absolute; bottom: 9%; left: 50%; transform: translateX(-50%);
  width: 68px; height: 68px; border-radius: 50%; background: rgba(95, 138, 108, 0.85);
  display: flex; align-items: center; justify-content: center; transition: transform var(--fast) var(--ease), background var(--fast);
}
.timer-play:hover { transform: translateX(-50%) scale(1.05); background: rgba(108, 156, 122, 0.95); }
.timer-play .ico { width: 28px; height: 28px; }
.timer-play svg path { fill: currentColor; }
.timer-reset { position: absolute; bottom: 11%; left: calc(50% + 54px); opacity: 0; }
.timer:hover .timer-reset { opacity: 0.8; }

/* ---------- Sounds ---------- */
.sound-pill {
  display: flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 12px;
  background: rgba(255, 255, 255, 0.16); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); cursor: pointer;
}
.sound-pill > .ico { width: 22px; height: 22px; }
.sp-label { font-size: 13px; font-weight: 500; }
.sp-vol { width: 0; opacity: 0; transition: width var(--med) var(--ease), opacity var(--med); accent-color: #fff; }
.sound-pill:hover .sp-vol { width: 80px; opacity: 1; }
.sounds-pop { top: 62px; left: 0; width: 520px; }
.scene-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.scene {
  position: relative; aspect-ratio: 1.15; border-radius: 12px; padding: 10px; display: flex; align-items: flex-end;
  font-size: 13.5px; font-weight: 600; text-align: left; outline: 2px solid transparent; outline-offset: 2px;
  transition: transform var(--fast) var(--ease), outline-color var(--fast), filter var(--fast);
}
.scene:hover { transform: translateY(-2px); filter: brightness(1.12); }
.scene.on { outline-color: rgba(255, 255, 255, 0.9); }
.scene-eq { position: absolute; top: 10px; right: 10px; display: flex; gap: 2px; align-items: flex-end; height: 14px; }
.scene-eq i { width: 3px; background: #fff; border-radius: 2px; animation: eq 900ms ease-in-out infinite alternate; }
.scene-eq i:nth-child(2) { animation-delay: -300ms; }
.scene-eq i:nth-child(3) { animation-delay: -600ms; }
@keyframes eq { from { height: 3px; } to { height: 14px; } }
.custom-sound { display: flex; gap: 8px; margin-top: 12px; }

/* ---------- Weather ---------- */
.weather-pop { top: 62px; right: 0; width: 340px; }
.wx-now { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.wx-place { font-size: 18px; font-weight: 600; }
.wx-desc { color: var(--ink-soft); font-size: 14px; margin-top: 2px; }
.wx-meta { color: var(--ink-faint); font-size: 12.5px; margin-top: 6px; }
.wx-big { display: flex; align-items: center; gap: 6px; font-size: 34px; font-weight: 500; }
.wx-big .ico { width: 32px; height: 32px; }
.wx-days { display: flex; flex-direction: column; gap: 2px; border-top: 1px solid var(--line); padding-top: 8px; }
.wx-day { display: grid; grid-template-columns: 1fr 26px 44px 44px 40px; align-items: center; font-size: 14px; padding: 5px 0; }
.wx-day .ico { width: 18px; height: 18px; }
.wx-day .hi { text-align: right; }
.wx-day .lo { text-align: right; color: var(--ink-faint); }
.wx-day .pp { text-align: right; color: #a9cbe0; font-size: 12px; }
.wx-sun { color: var(--ink-faint); font-size: 12.5px; margin: 10px 0; }
.wx-foot { display: flex; gap: 8px; align-items: center; }
.wx-foot .field { padding: 6px 10px; font-size: 13px; }

/* ---------- Calendar ---------- */
.calendar-pop { top: 62px; right: 0; width: 340px; }
.cal-connect details { margin: 6px 0; font-size: 14px; }
.cal-connect summary { cursor: pointer; padding: 4px 0; font-weight: 500; }
.cal-connect form { margin-top: 10px; }
.cal-list { display: flex; flex-direction: column; gap: 12px; max-height: 52vh; overflow: auto; }
.cal-day { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-faint); margin-bottom: 4px; }
.cal-item { display: flex; align-items: center; gap: 10px; padding: 6px 0; font-size: 14px; }
.cal-item.now .cal-time { color: var(--accent); }
.cal-time { width: 66px; flex: none; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.cal-title { flex: 1; }
.cal-item .chip { text-decoration: none; }

/* ---------- Settings ---------- */
.settings {
  position: fixed; left: 18px; bottom: 70px; top: auto; z-index: 40; width: min(860px, calc(100vw - 36px)); height: min(640px, calc(100vh - 100px));
  display: grid; grid-template-columns: 200px 1fr; padding: 0; overflow: hidden; background: rgba(20, 22, 21, 0.86);
}
.settings nav { padding: 22px 12px; display: flex; flex-direction: column; gap: 2px; border-right: 1px solid var(--line); }
.settings nav button { text-align: left; padding: 9px 14px; border-radius: 9px; font-size: 15px; color: var(--ink-soft); transition: background var(--fast), color var(--fast); }
.settings nav button:hover { background: rgba(255, 255, 255, 0.06); color: #fff; }
.settings nav button.on { color: #fff; font-weight: 600; background: rgba(255, 255, 255, 0.08); }
.settings-body { overflow: auto; padding: 26px 30px 40px; }
.settings-body h2 { font-size: 26px; margin: 0; font-weight: 600; }
.settings-body .sub { color: var(--ink-soft); margin: 4px 0 20px; font-size: 14.5px; }
.settings-close { position: absolute; top: 14px; right: 14px; }
.card { background: rgba(255, 255, 255, 0.05); border: 1px solid var(--line); border-radius: 12px; padding: 14px 18px; margin-bottom: 16px; }
.card h4 { margin: 0 0 6px; font-size: 16px; font-weight: 600; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 0; }
.row + .row { border-top: 1px solid rgba(255, 255, 255, 0.05); }
.row.col { flex-direction: column; align-items: stretch; gap: 6px; }
.row-title { font-size: 14.5px; }
.row-desc { font-size: 12.5px; color: var(--ink-faint); margin-top: 2px; word-break: break-all; }
.switch { appearance: none; width: 38px; height: 22px; border-radius: 999px; background: rgba(255, 255, 255, 0.2); position: relative; cursor: pointer; flex: none; transition: background var(--med); }
.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform var(--med) var(--ease); }
.switch:checked { background: var(--accent-strong); }
.switch:checked::after { transform: translateX(16px); }
.select { width: auto; min-width: 160px; }
.select option { background: var(--panel-solid); }
.num-wrap { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-soft); }
.num { width: 76px; }
.thumbs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.thumb { aspect-ratio: 16 / 10; border-radius: 8px; background-size: cover; background-position: center; }
.steps { margin: 6px 0; padding-left: 20px; font-size: 14px; line-height: 1.8; color: var(--ink-soft); }
.status { font-size: 13.5px; color: var(--ink-soft); }
.btn.danger { background: rgba(214, 92, 92, 0.25); }
.file { font-size: 13px; }
textarea.field { resize: vertical; }

/* ---------- Today board ---------- */
.board {
  position: fixed; inset: 0; z-index: 35; display: flex; align-items: center; justify-content: center;
  background: rgba(10, 12, 11, 0.45); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  opacity: 0; transition: opacity var(--slow) var(--ease); text-shadow: var(--shadow-text);
}
.board.open { opacity: 1; }
body.board-open #app { opacity: 0; }
.board-inner { width: min(760px, 86vw); max-height: 86vh; overflow: auto; }
.board-close { position: absolute; top: 22px; right: 22px; }
.board-date { font-size: 15px; letter-spacing: 0.16em; text-transform: uppercase; opacity: 0.8; }
.board h1 { font-family: var(--display); font-size: clamp(56px, 7vw, 96px); font-weight: 800; margin: 4px 0 18px; }
.board-goal { font-family: var(--display); font-size: 26px; font-weight: 600; margin-bottom: 22px; }
.board-goal .lbl { display: block; font-family: var(--sans); font-size: 12px; letter-spacing: 0.18em; text-transform: uppercase; opacity: 0.7; margin-bottom: 4px; font-weight: 600; }
.board-goal.done { text-decoration: line-through; opacity: 0.7; }
.board-list { list-style: none; margin: 0; padding: 0; }
.board-list li { display: flex; align-items: center; gap: 18px; font-family: var(--display); font-size: clamp(24px, 2.6vw, 34px); font-weight: 500; padding: 10px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.12); animation: rise var(--med) var(--ease); }
.board-list li.done span { text-decoration: line-through; opacity: 0.55; }
.board-add { width: 100%; margin-top: 16px; background: transparent; border: 0; border-bottom: 1.5px solid rgba(255, 255, 255, 0.4); font-size: 20px; padding: 8px 0; outline: none; }
.board-add::placeholder { color: var(--ink-faint); }
.board-events { margin-top: 26px; display: flex; flex-wrap: wrap; gap: 10px 26px; font-size: 16px; }
.board-events .time { color: var(--ink-soft); margin-right: 8px; }
.board-count { margin-top: 22px; color: var(--ink-soft); font-size: 15px; }

/* ---------- Spotify ---------- */
.sound-tabs { padding: 0 0 12px; }
.sounds-pop { max-height: 76vh; overflow: auto; }
.sp-embed-wrap { margin-bottom: 12px; }
.sp-embed { width: 100%; height: 152px; border: 0; border-radius: 12px; display: block; }
.sp-setup p { margin: 0 0 8px; font-size: 14px; }
.sp-setup a { color: #9fd7ae; }
.copy-row { display: flex; align-items: center; gap: 8px; margin: 6px 0 4px; }
.copy-row code { word-break: break-all; }
.sp-login { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.btn.sp-btn { background: #1db954; color: #0b0b0b; font-weight: 600; padding: 10px 18px; }
.btn.sp-btn:hover { background: #22c95d; }
.sp-head { display: flex; justify-content: space-between; align-items: center; font-size: 13.5px; color: var(--ink-soft); margin-bottom: 10px; gap: 8px; }
.badge-soft { margin-left: 8px; font-size: 11px; padding: 2px 8px; border-radius: 999px; background: rgba(29, 185, 84, 0.22); color: #b8f0c9; }
.sp-section { font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-faint); margin: 14px 0 8px; }
.sp-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 8px; }
.sp-grid:empty { display: none; }
.sp-tile { position: relative; min-width: 0; }
.sp-cover {
  width: 100%; aspect-ratio: 1; border-radius: 8px; background: #2a2d2b center / cover; position: relative;
  display: flex; align-items: center; justify-content: center; overflow: hidden; transition: transform var(--fast) var(--ease);
}
.sp-cover > .ico { width: 34px; height: 34px; color: #fff; }
.sp-tile:first-child .sp-cover:has(> .ico) { background: #4a3fb0; }
.sp-cover:hover { transform: translateY(-2px); }
.sp-play {
  position: absolute; right: 6px; bottom: 6px; width: 30px; height: 30px; border-radius: 50%; background: #1db954; color: #0b0b0b;
  display: flex; align-items: center; justify-content: center; opacity: 0; transform: translateY(4px); transition: opacity var(--fast), transform var(--fast);
}
.sp-play .ico { width: 14px; height: 14px; }
.sp-play svg path { fill: currentColor; }
.sp-cover:hover .sp-play, .sp-tile.on .sp-play { opacity: 1; transform: none; }
.sp-name { font-size: 13px; font-weight: 500; margin-top: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sp-sub { font-size: 11.5px; color: var(--ink-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sp-tile.on .sp-name { color: #6fe39a; }
.sp-focus { position: absolute; top: 4px; right: 4px; width: 26px; height: 26px; background: rgba(0, 0, 0, 0.45); opacity: 0; }
.sp-tile:hover .sp-focus, .sp-focus.pinned { opacity: 1; }
.sp-focus .ico { width: 14px; height: 14px; }
.sound-pill.spotify .sp-label { max-width: 220px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sound-pill.spotify > .ico { color: #1db954; }

/* ---------- Clock styles ---------- */
.clock[data-style='percent'] { display: flex; flex-direction: column; align-items: center; }
.clock .pct-label { font-family: var(--sans); font-size: 15px; font-weight: 600; letter-spacing: 0.2em; text-transform: uppercase; opacity: 0.75; margin-top: 6px; }
.clock .analog { width: clamp(180px, 22vw, 280px); height: auto; display: block; filter: drop-shadow(0 2px 10px rgba(0, 0, 0, 0.3)); }
.analog .face { fill: rgba(0, 0, 0, 0.12); stroke: rgba(255, 255, 255, 0.85); stroke-width: 1.4; }
.analog .tick { stroke: rgba(255, 255, 255, 0.8); stroke-width: 1.4; stroke-linecap: round; }
.analog .hh, .analog .mh { stroke: #fff; stroke-linecap: round; }
.analog .sh { stroke: #f3c58f; stroke-linecap: round; }
.analog .pin { fill: #fff; }
.menu-seg { display: flex; gap: 2px; padding: 4px; margin-bottom: 4px; border-bottom: 1px solid var(--line); }
.menu .menu-seg button { justify-content: center; padding: 6px 8px; font-size: 13px; }
.menu .menu-seg button.on { background: rgba(255, 255, 255, 0.16); }

/* ---------- Below the center ---------- */
.below-wrap { position: relative; display: flex; flex-direction: column; align-items: center; margin-top: clamp(28px, 6vh, 64px); min-height: 110px; }
.below-wrap > .focus { margin-top: 0; }
.below-switch {
  position: absolute; left: -70px; top: 50%; transform: translateY(-50%); display: flex; gap: 2px; padding: 4px;
  border-radius: 999px; background: rgba(0, 0, 0, 0.22); opacity: 0; transition: opacity var(--med); text-shadow: none;
}
.below-wrap:hover .below-switch { opacity: 1; }
.below-switch .icon-btn.on { background: rgba(255, 255, 255, 0.2); opacity: 1; }
.below { display: flex; flex-direction: column; align-items: center; gap: 14px; animation: rise var(--slow) var(--ease); }
.big-search { width: min(520px, 80vw); text-align: center; background: transparent; border: 0; border-bottom: 2px solid rgba(255, 255, 255, 0.85); font-size: 24px; padding: 6px 8px 10px; outline: none; text-shadow: var(--shadow-text); }
.big-search::placeholder { color: var(--ink-soft); }
.quick-links { display: flex; gap: 18px; flex-wrap: wrap; justify-content: center; }
.ql, .lp { display: flex; flex-direction: column; align-items: center; gap: 6px; text-decoration: none; font-size: 12.5px; width: 64px; opacity: 0.9; transition: opacity var(--fast), transform var(--fast) var(--ease); }
.ql:hover, .lp:hover { opacity: 1; transform: translateY(-2px); }
.ql img, .lp img { width: 36px; height: 36px; border-radius: 10px; background: rgba(255, 255, 255, 0.9); padding: 6px; }
.ql span, .lp span { max-width: 64px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.launchpad { display: flex; gap: 14px; justify-content: center; margin-top: 14px; animation: rise var(--slow) var(--ease); }
.pill-btn { display: inline-flex; align-items: center; gap: 8px; padding: 9px 18px; border-radius: 999px; background: rgba(255, 255, 255, 0.16); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); font-size: 15px; font-weight: 500; transition: background var(--fast); }
.pill-btn:hover { background: rgba(255, 255, 255, 0.26); }
.pill-btn .ico { width: 18px; height: 18px; }
.below-hint { font-size: 15px; opacity: 0.85; }
.below-hint.big { font-family: var(--display); font-size: 26px; }
.next-big { font-family: var(--display); font-size: clamp(24px, 2.6vw, 36px); font-weight: 600; display: flex; align-items: center; gap: 12px; }
.next-big > span { font-family: var(--sans); font-size: 0.55em; font-weight: 500; opacity: 0.85; }

/* ---------- Widgets ---------- */
.widgets-row { display: flex; gap: 22px; }
.w-tile { position: relative; }
.w-tile .w-x { position: absolute; top: -10px; right: -14px; width: 22px; height: 22px; opacity: 0; background: rgba(0, 0, 0, 0.4); }
.w-tile .w-x .ico { width: 12px; height: 12px; }
.w-tile:hover .w-x { opacity: 0.9; }
.add-btn { opacity: 0; transition: opacity var(--med); }
.top-right:hover .add-btn, .add-pop.open ~ .add-btn, .anchor:has(.add-pop.open) .add-btn { opacity: 0.92; }
.add-pop { top: 62px; right: 0; width: 300px; }
.add-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.add-grid button { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px 6px; border-radius: 10px; font-size: 13px; background: rgba(255, 255, 255, 0.06); transition: background var(--fast); }
.add-grid button:hover { background: rgba(255, 255, 255, 0.14); }

/* ---------- Focus stats ---------- */
.stats-pop { top: 62px; right: 0; width: 360px; cursor: default; }
.stats-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.stats-head h3 { margin: 0; }
.stats-head .list-switch { padding: 0; }
.stats-total { font-size: 15px; font-weight: 600; margin: 12px 0 8px; }
.chart { position: relative; height: 140px; display: flex; align-items: flex-end; gap: 6px; padding-top: 6px; border-radius: 10px; background: rgba(255, 255, 255, 0.04); padding: 6px 8px 0; }
.chart .bar { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; }
.chart .fill { width: 100%; max-width: 26px; min-height: 2px; border-radius: 4px 4px 2px 2px; background: rgba(205, 228, 210, 0.55); transition: height var(--slow) var(--ease); }
.chart .bar.today .fill { background: rgba(205, 228, 210, 0.95); }
.chart .bar span { font-size: 10.5px; color: var(--ink-faint); height: 14px; }
.goal-line { position: absolute; left: 8px; right: 8px; border-top: 1px dashed rgba(255, 255, 255, 0.4); }
.goal-line span { position: absolute; right: 0; top: -16px; font-size: 10.5px; color: var(--ink-faint); }
.stats-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 12px 0; }
.stats-cards > div { background: rgba(255, 255, 255, 0.06); border-radius: 10px; padding: 10px; text-align: center; }
.stats-cards b { display: block; font-size: 20px; }
.stats-cards span { display: flex; align-items: center; justify-content: center; gap: 4px; font-size: 12px; color: var(--ink-soft); }
.stats-cards .ico { width: 13px; height: 13px; }
.stats-history summary { cursor: pointer; font-size: 14px; padding: 6px 0; }
.stats-history .row { font-size: 13.5px; padding: 6px 0; }

/* ---------- Settings controls ---------- */
.seg { display: flex; gap: 2px; padding: 3px; border-radius: 9px; background: rgba(255, 255, 255, 0.07); flex-wrap: wrap; justify-content: flex-end; }
.seg button { font-size: 12.5px; padding: 5px 10px; border-radius: 7px; color: var(--ink-soft); transition: background var(--fast), color var(--fast); }
.seg button.on { background: rgba(255, 255, 255, 0.16); color: #fff; }
.head-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.head-row > h2 { flex: 1 1 100%; }
.settings-body > .head-row > .btn { margin-bottom: 16px; }
.tabs-row { padding: 6px 0 10px; }
.font-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.font-opt { padding: 10px 6px; border-radius: 9px; background: rgba(255, 255, 255, 0.06); font-size: 17px; font-weight: 700; transition: background var(--fast); }
.font-opt.on { background: rgba(255, 255, 255, 0.2); }
.thumbs { grid-template-columns: repeat(4, 1fr); }
.thumb-wrap { position: relative; min-width: 0; }
button.thumb { width: 100%; display: block; transition: transform var(--fast) var(--ease); }
button.thumb:hover { transform: scale(1.03); }
.thumb-title { font-size: 11.5px; color: var(--ink-faint); margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thumb-x { position: absolute; top: 4px; right: 4px; width: 26px; height: 26px; background: rgba(0, 0, 0, 0.5); }
kbd { font: 600 12px var(--sans); padding: 3px 8px; border-radius: 6px; background: rgba(255, 255, 255, 0.12); border: 1px solid var(--line); }
a.row.link { text-decoration: none; }
a.row.link .ico { width: 16px; height: 16px; opacity: 0.7; }
.mantra-line { font-weight: 600; }

/* ---------- Notes ---------- */
.notes-pop { top: 62px; left: 0; width: 560px; }
.notes-body { display: grid; grid-template-columns: 170px 1fr; gap: 12px; height: 320px; }
.note-list { overflow: auto; display: flex; flex-direction: column; gap: 2px; border-right: 1px solid var(--line); padding-right: 8px; }
.note-new { display: flex; align-items: center; gap: 6px; font-size: 13px; padding: 8px; border-radius: 8px; color: var(--ink-soft); }
.note-new:hover { background: rgba(255, 255, 255, 0.07); }
.note-new .ico { width: 14px; height: 14px; }
.note-item { position: relative; padding: 8px; border-radius: 8px; cursor: pointer; }
.note-item:hover { background: rgba(255, 255, 255, 0.06); }
.note-item.on { background: rgba(255, 255, 255, 0.12); }
.note-title { font-size: 13.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-right: 22px; }
.note-date { font-size: 11.5px; color: var(--ink-faint); }
.note-item .x { position: absolute; right: 2px; top: 8px; width: 24px; height: 24px; opacity: 0; }
.note-item:hover .x { opacity: 0.7; }
.note-editor { resize: none; background: transparent; border: 0; outline: none; font-size: 15px; line-height: 1.55; user-select: text; }
.note-editor::placeholder { color: var(--ink-faint); }

/* ---------- Bookmarks bar ---------- */
.bookmarks-bar { position: fixed; top: 0; left: 0; right: 0; z-index: 5; display: flex; gap: 2px; padding: 4px 12px; background: rgba(0, 0, 0, 0.22); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); font-size: 12.5px; overflow-x: auto; }
.bm { display: inline-flex; align-items: center; gap: 6px; padding: 4px 8px; border-radius: 6px; white-space: nowrap; text-decoration: none; max-width: 180px; }
.bm span { overflow: hidden; text-overflow: ellipsis; }
.bm:hover { background: rgba(255, 255, 255, 0.12); }
.bm img, .bm .ico { width: 14px; height: 14px; }
.bm-pop { top: 30px; left: 0; width: 280px; max-height: 60vh; overflow: auto; }
body.with-bookmarks #app { top: 30px; }

/* ---------- Appearance ---------- */
body.theme-light { --panel: rgba(250, 248, 244, 0.9); --line: rgba(0, 0, 0, 0.1); }
body.theme-light .pop, body.theme-light .settings { color: #1d1f1e; --ink-soft: rgba(0, 0, 0, 0.7); --ink-faint: rgba(0, 0, 0, 0.5); }
body.theme-light .settings { background: rgba(250, 248, 244, 0.94); }
body.theme-light .pop .field, body.theme-light .settings .field { background: rgba(0, 0, 0, 0.04); }
body.theme-light .pop .chip, body.theme-light .settings .chip, body.theme-light .settings .seg, body.theme-light .card { background: rgba(0, 0, 0, 0.05); }
body.theme-light .settings nav button.on, body.theme-light .seg button.on { background: rgba(0, 0, 0, 0.1); color: #111; }
body.theme-light .chip.on { background: #1d1f1e; color: #fff; }
body.theme-light .check { border-color: rgba(0, 0, 0, 0.6); }
body.labels-hover .tile:not(:hover) > :not(.ico):not(.big):not(.badge) { opacity: 0; }
body.labels-hover .tile > * { transition: opacity var(--med); }
body.low-perf .bg-layer { animation: none !important; }
body.low-perf .pop, body.low-perf .board, body.low-perf .sound-pill, body.low-perf .toast, body.low-perf .bookmarks-bar { backdrop-filter: none !important; -webkit-backdrop-filter: none !important; }
body.low-perf .pop { background: var(--panel-solid); }
body.contrast-low #scrim { background: rgba(0, 0, 0, 0.3); }
body.contrast-high #scrim { background: rgba(0, 0, 0, 0.48); }

/* ---------- Balance and focus visibility ---------- */
body.downtime [data-widget='todo'], body.downtime [data-widget='focusButton'], body.downtime [data-widget='focusStat'],
body.downtime [data-widget='calendar'], body.downtime [data-widget='agenda'], body.downtime [data-widget='widgets'], body.downtime .widgets-row,
body.downtime .below-wrap, body.downtime [data-widget='notes'] { opacity: 0; pointer-events: none; }
body.focus-mode.focus-hide-tasks [data-widget='todo'],
body.focus-mode.focus-hide-links #links,
body.focus-mode.focus-hide-calendar [data-widget='calendar'], body.focus-mode.focus-hide-calendar [data-widget='agenda'],
body.focus-mode.focus-hide-widgets .widgets-row, body.focus-mode.focus-hide-widgets [data-widget='widgets'],
body.focus-mode [data-widget='notes'] { opacity: 0; pointer-events: none; }

/* ---------- Agent cards ---------- */
.card-stack {
  position: fixed; right: 26px; top: 50%; transform: translateY(-50%); z-index: 3; width: 330px; max-height: 64vh; overflow: auto;
  display: flex; flex-direction: column; gap: 10px; text-shadow: none; scrollbar-width: none;
}
.acard {
  position: relative; background: var(--panel); border: 1px solid var(--line); border-left: 3px solid var(--accent, transparent);
  backdrop-filter: blur(20px) saturate(1.2); -webkit-backdrop-filter: blur(20px) saturate(1.2);
  border-radius: 14px; padding: 12px 14px; font-size: 14px; line-height: 1.45; animation: rise var(--slow) var(--ease); user-select: text;
}
.acard.prio-high { box-shadow: 0 0 0 1px rgba(243, 197, 143, 0.35); }
.acard header { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.acard header > .ico { width: 16px; height: 16px; opacity: 0.85; }
.ac-title { font-weight: 600; font-size: 14.5px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ac-agent { font-size: 11px; color: var(--ink-faint); white-space: nowrap; }
.ac-x { width: 24px; height: 24px; margin-right: -6px; opacity: 0; }
.acard:hover .ac-x { opacity: 0.7; }
.ac-x .ico { width: 13px; height: 13px; }
.ac-text p { margin: 0 0 6px; }
.ac-text ul { margin: 4px 0 6px; padding-left: 18px; }
.ac-text a, .ac-link { color: #b9dcc4; }
.ac-list { list-style: none; margin: 0; padding: 0; }
.ac-list li { display: flex; gap: 10px; align-items: flex-start; padding: 6px 0; border-bottom: 1px solid var(--line); }
.ac-list li:last-child { border-bottom: 0; }
.ac-list li.done > div { text-decoration: line-through; opacity: 0.55; }
.ac-list .check { width: 18px; height: 18px; border-radius: 5px; border-width: 1.5px; margin-top: 1px; }
.ac-list .check .ico { width: 12px; height: 12px; }
.ac-sub { font-size: 12.5px; color: var(--ink-faint); }
.ac-stat { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.ac-big { font-family: var(--display); font-size: 34px; font-weight: 800; line-height: 1; }
.ac-delta { font-size: 13px; font-weight: 600; }
.ac-delta.up { color: #9fd7ae; } .ac-delta.down { color: #f3a5a5; }
.ac-stat .ac-sub { flex-basis: 100%; }
.ac-between { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 6px; }
.gh-bar { height: 6px; border-radius: 3px; background: rgba(255, 255, 255, 0.14); overflow: hidden; }
.gh-bar > span { display: block; height: 100%; background: #8fb39a; border-radius: 3px; transition: width var(--slow) var(--ease); }
.ac-chart svg { width: 100%; height: 120px; display: block; }
.ac-axis { display: flex; justify-content: space-between; font-size: 10.5px; color: var(--ink-faint); margin-top: 4px; }
.ac-legend { display: flex; gap: 12px; font-size: 11.5px; color: var(--ink-soft); margin-top: 6px; }
.ac-legend i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 5px; }
.ac-frame { width: 100%; height: 120px; border: 0; display: block; background: transparent; }
.ac-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.ac-actions .btn { padding: 6px 13px; font-size: 13px; }
.ac-reply { margin-top: 10px; }
.ac-link { display: inline-flex; align-items: center; gap: 4px; margin-top: 8px; font-size: 13px; text-decoration: none; }
.ac-link .ico { width: 13px; height: 13px; }
.ac-more { align-self: flex-end; }
.agent-tiles { display: flex; gap: 22px; }
.below-wrap.has-center { display: none; }
.center-card { margin-top: clamp(28px, 6vh, 64px); }
body.focus-mode .below-wrap, body.focus-mode .center-card { display: none; }
.center-card .acard { width: min(560px, 86vw); text-align: left; text-shadow: none; }
.ac-pills { position: fixed; left: 50%; bottom: 64px; transform: translateX(-50%); display: flex; gap: 8px; z-index: 3; text-shadow: none; }
.ac-pill { font-size: 13.5px; padding: 7px 14px; }
.ac-sheet {
  position: fixed; inset: 0; z-index: 36; display: flex; align-items: center; justify-content: center;
  background: rgba(10, 12, 11, 0.4); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  opacity: 0; transition: opacity var(--med) var(--ease);
}
.ac-sheet.open { opacity: 1; }
.sheet-inner { position: relative; width: min(820px, 92vw); max-height: 86vh; overflow: auto; }
.sheet-inner .acard { padding: 22px 24px; }
.sheet-inner .ac-title { font-family: var(--display); font-size: 24px; }
.sheet-close { position: absolute; top: 14px; right: 14px; z-index: 2; }
body.focus-mode .card-stack, body.focus-mode .ac-pills { opacity: 0; pointer-events: none; }

/* ---------- World clock city search ---------- */
.city-results { display: flex; flex-direction: column; gap: 2px; max-height: 220px; overflow: auto; }
.city-results button { display: flex; justify-content: space-between; gap: 8px; text-align: left; padding: 8px 10px; border-radius: 8px; font-size: 14px; }
.city-results button:hover, .city-results button:focus-visible { background: rgba(255, 255, 255, 0.1); outline: none; }
.city-results small { color: var(--ink-faint); white-space: nowrap; }
.chips.popular { margin-top: 6px; }

/* ======================================================================
   QA pass: layering, layout at smaller widths, consistency, light theme
   ====================================================================== */

/* Photo actions sit above the quote while you use them */
.bottom-left { position: relative; z-index: 2; }
.bottom:has(.photo-info:hover) .bottom-center { opacity: 0; pointer-events: none; }

/* Hidden widgets give their space back (no gaps in the corner rows) */
.off { display: none !important; }

/* Tiles are buttons everywhere; a pinned tile uses the accent */
button.tile { font: inherit; font-size: 13.5px; font-weight: 500; }
.tile.pinned { color: #b9dcc4; }
.focus-tools { gap: 22px; align-items: flex-start; }

/* "Add" appears on hover without holding space in the top-right row */
.anchor[data-widget='widgets'] { width: 0; margin-right: -22px; }
.add-btn { position: absolute; right: 22px; top: 0; }

/* Text labels "only on hover": shrink the label text, keep icons, numbers and badges */
body.labels-hover .tile { transition: font-size var(--med) var(--ease); }
body.labels-hover .tile:not(:hover) { font-size: 0; gap: 0; }
body.labels-hover .tile:not(:hover) .badge { font-size: 11px; }

/* Goal switcher: a small centered row above the goal, so it never covers the checkbox */
.below-switch { left: 50%; top: -42px; transform: translateX(-50%); }

/* Clock menu opens under the clock, so it doesn't jump when the clock changes width */
.clock-menu { top: calc(100% + 10px); left: 50%; transform: translate(-50%, 6px); }
.clock-menu.open { transform: translate(-50%, 0); }
body.focus-mode .clock-wrap .side-btn { display: none; }

/* Toasts sit above the quote, away from the corner tiles and the Focusing pill */
.toasts { top: auto; bottom: 96px; flex-direction: column-reverse; }
.toast { transform: translateY(8px); }

/* Agent cards: tidy scrolling, a visible "more" chip, a soft exit */
.card-stack { scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, 0.25) transparent; }
.ac-more { background: var(--panel); color: var(--ink); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.acard { transition: opacity var(--med) var(--ease), transform var(--med) var(--ease); }
.acard.leaving { opacity: 0; transform: translateX(12px); }
.sheet-inner .acard header { padding-right: 34px; }
/* When the Tasks panel is open, agent cards move to the left so neither hides the other */
body:has(.tasks-pop.open) .card-stack { right: auto; left: 26px; }

/* Thin, dark scrollbars in panels */
.settings-body, .city-results, .task-list, .links-list, .cal-list, .note-list, .sounds-pop, .sheet-inner {
  scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, 0.25) transparent;
}
.pop, .settings { color-scheme: dark; }

/* Small wrapping fixes */
.btn, .chip, .add-grid button { white-space: nowrap; }
.add-grid button { font-size: 12.5px; }
.city-results button span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.head-row { row-gap: 0; }

/* Smaller screens */
@media (max-width: 1280px) {
  .card-stack { width: 300px; }
  .top-left, .top-right { gap: 16px; }
  .anchor[data-widget='widgets'] { margin-right: -16px; }
}
@media (max-width: 1100px) {
  .widgets-row, .agent-tiles { display: none; }
  .tile .big { font-size: 22px; }
  .card-stack { top: auto; bottom: 64px; transform: none; max-height: 42vh; width: 280px; }
}

/* Light theme: everything inside panels reads dark-on-light */
body.theme-light .pop, body.theme-light .settings { color-scheme: light; }
body.theme-light .toast { color: #1d1f1e; }
body.theme-light .switch { background: rgba(0, 0, 0, 0.18); }
body.theme-light .switch:checked { background: var(--accent-strong); }
body.theme-light .menu button:hover, body.theme-light .link-row:hover, body.theme-light .city-results button:hover,
body.theme-light .task:hover, body.theme-light .note-item:hover, body.theme-light .icon-btn:hover,
body.theme-light .settings nav button:hover { background: rgba(0, 0, 0, 0.06); }
body.theme-light .note-item.on { background: rgba(0, 0, 0, 0.08); }
body.theme-light .scene { color: #fff; }
body.theme-light .scene.on { outline-color: #1d1f1e; }
body.theme-light .ac-text a, body.theme-light .ac-link, body.theme-light .sp-setup a { color: #2f6b45; }
body.theme-light .acard { color: #1d1f1e; }
body.theme-light .settings-body, body.theme-light .sheet-inner, body.theme-light .task-list { scrollbar-color: rgba(0, 0, 0, 0.25) transparent; }

/* ---------- Glass panels: bus times (left middle) and calendar (right middle) until moved ---------- */
.transit { left: 26px; }
.agenda { right: 26px; }
.gpanel { position: fixed; top: 50%; translate: 0 -50%; z-index: 3; text-shadow: none; }
.gpanel.placed { translate: none; right: auto; }
.gpanel.dragging, .gpanel.dragging * { transition: none !important; }
.gp-card {
  position: relative; width: 320px; padding: 16px 16px 10px; border-radius: 22px; animation: rise var(--slow) var(--ease);
  background: rgba(255, 255, 255, 0.12); border: 1px solid rgba(255, 255, 255, 0.24);
  backdrop-filter: blur(28px) saturate(1.6); -webkit-backdrop-filter: blur(28px) saturate(1.6);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28), 0 24px 60px rgba(0, 0, 0, 0.28);
}
.gp-head { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 6px 10px; margin-bottom: 10px; cursor: grab; touch-action: none; }
.gpanel.dragging .gp-head { cursor: grabbing; }
.gp-label { font-size: 10.5px; font-weight: 600; letter-spacing: 0.16em; color: var(--ink-faint); }
.gp-title { grid-column: 1 / -1; justify-self: start; max-width: 100%; min-width: 0; font-family: var(--display); font-size: 20px; font-weight: 700; line-height: 1.2; }
.tr-stop { display: inline-flex; align-items: center; gap: 7px; text-align: left; cursor: pointer; }
.tr-stop .ico { width: 14px; height: 14px; flex: none; opacity: 0; transition: opacity var(--fast); }
.tr-stop:hover .ico, .tr-stop:focus-visible .ico, .tr-stop[aria-expanded='true'] .ico { opacity: 0.75; }
.tr-pick { margin-bottom: 10px; }
.tr-search {
  width: 100%; padding: 8px 11px; border-radius: 11px; font-size: 13.5px; outline: none;
  background: rgba(0, 0, 0, 0.22); border: 1px solid rgba(255, 255, 255, 0.2); color: inherit;
}
.tr-search:focus { border-color: rgba(255, 255, 255, 0.45); }
.tr-search::placeholder { color: var(--ink-faint); }
.tr-results { display: flex; flex-direction: column; gap: 1px; margin-top: 6px; }
.tr-results button { text-align: left; padding: 7px 10px; border-radius: 8px; font-size: 13px; transition: background var(--fast); }
.tr-results button:hover, .tr-results button:focus-visible { background: rgba(255, 255, 255, 0.14); outline: none; }
.tr-results button.on { font-weight: 600; }
.tr-hint { padding: 6px 10px; font-size: 12.5px; color: var(--ink-faint); }
.gp-resize {
  position: absolute; right: 7px; bottom: 7px; width: 12px; height: 12px; cursor: nwse-resize; touch-action: none;
  border-right: 2px solid rgba(255, 255, 255, 0.7); border-bottom: 2px solid rgba(255, 255, 255, 0.7); border-bottom-right-radius: 5px;
  opacity: 0; transition: opacity var(--fast);
}
.gp-card:hover .gp-resize, .gpanel.dragging .gp-resize { opacity: 0.75; }
.tr-dir { display: flex; padding: 2px; border-radius: 999px; background: rgba(0, 0, 0, 0.18); }
.tr-dir:empty { display: none; }
.tr-dir button { padding: 4px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 500; color: var(--ink-soft); transition: background var(--fast), color var(--fast); }
.tr-dir button.on { background: rgba(255, 255, 255, 0.22); color: var(--ink); }
.tr-list { list-style: none; margin: 0; padding: 0; }
.tr-row {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px;
  height: 58px; overflow: hidden; border-top: 1px solid rgba(255, 255, 255, 0.14);
  transition: opacity 450ms var(--ease), transform 450ms var(--ease), height 450ms var(--ease), border-color 450ms;
}
.tr-row.enter { opacity: 0; transform: translateY(10px); }
.tr-row.leave { opacity: 0; transform: translateX(-14px); height: 0; border-color: transparent; }
.tr-badge {
  min-width: 38px; height: 30px; padding: 0 8px; border-radius: 9px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--route); color: var(--route-ink); font-weight: 700; font-size: 14px; letter-spacing: 0.02em;
}
.tr-mid { min-width: 0; }
.tr-dest { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tr-sub { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-soft); margin-top: 2px; font-variant-numeric: tabular-nums; }
.tr-live { display: none; width: 7px; height: 7px; border-radius: 50%; background: #7fe0a0; flex: none; animation: tr-pulse 1.6s ease-in-out infinite; }
.tr-row.live .tr-live, .tr-foot .tr-live { display: inline-block; }
.tr-eta { font-size: 21px; font-weight: 600; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.tr-eta.soon { color: #9fe7b4; }
.gp-empty { padding: 16px 0 12px; font-size: 13.5px; color: var(--ink-soft); border-top: 1px solid rgba(255, 255, 255, 0.14); }
.gp-foot {
  width: 100%; display: flex; align-items: center; gap: 7px; padding-top: 9px; border-top: 1px solid rgba(255, 255, 255, 0.14);
  font-size: 11.5px; color: var(--ink-faint); text-decoration: none;
}
.gp-foot .ico { width: 12px; height: 12px; margin-left: auto; opacity: 0; transition: opacity var(--fast); }
.gp-foot:hover .ico { opacity: 0.8; }
.tr-foot.stale .tr-live { background: rgba(255, 255, 255, 0.4); animation: none; }
.gp-foot[hidden] { display: none; }
.ag-list { list-style: none; margin: 0; padding: 0; max-height: 56vh; overflow: auto; scrollbar-width: none; }
.ag-day { padding: 9px 0 3px; border-top: 1px solid rgba(255, 255, 255, 0.14); font-size: 11.5px; font-weight: 600; color: var(--ink-soft); }
.ag-row { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 12px; min-height: 46px; margin-bottom: 4px; padding-left: 11px; position: relative; }
.ag-row::before { content: ''; position: absolute; left: 0; top: 6px; bottom: 6px; width: 3px; border-radius: 2px; background: var(--cal); }
.ag-mid { min-width: 0; }
.ag-title, .ag-sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ag-title { font-size: 14px; font-weight: 600; }
.ag-sub { margin-top: 2px; font-size: 12px; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.ag-in { font-size: 13px; font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ag-row.now .ag-in { color: #9fe7b4; }
.ag-join { padding: 5px 12px; border-radius: 999px; background: rgba(255, 255, 255, 0.22); color: inherit; font-size: 12.5px; font-weight: 600; text-decoration: none; }
.ag-join:hover { background: rgba(255, 255, 255, 0.32); }
.ag-more { padding: 4px 0 9px; font-size: 12px; color: var(--ink-faint); }
.ag-connect { padding-bottom: 8px; border-top: 1px solid rgba(255, 255, 255, 0.14); }
@keyframes tr-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }
body.peek .gpanel { opacity: 0; pointer-events: none; }
body.low-perf .gp-card { backdrop-filter: none; -webkit-backdrop-filter: none; background: var(--panel); }
body.theme-light .gp-card { background: rgba(255, 255, 255, 0.58); border-color: rgba(255, 255, 255, 0.7); color: #1d1f1e; }
body.theme-light .gpanel .tr-sub, body.theme-light .gpanel .gp-empty { color: rgba(29, 31, 30, 0.72); }
body.theme-light .gpanel .gp-label, body.theme-light .gpanel .gp-foot { color: rgba(29, 31, 30, 0.55); }
body.theme-light .gpanel .tr-row, body.theme-light .gpanel .gp-empty, body.theme-light .gpanel .gp-foot { border-color: rgba(0, 0, 0, 0.1); }
body.theme-light .gpanel .ag-sub, body.theme-light .gpanel .ag-day, body.theme-light .gpanel .ag-more { color: rgba(29, 31, 30, 0.72); border-color: rgba(0, 0, 0, 0.1); }
body.theme-light .gpanel .ag-row.now .ag-in { color: #2f6b45; }
body.theme-light .gpanel .ag-join { background: rgba(0, 0, 0, 0.1); }
body.theme-light .gpanel .tr-dir { background: rgba(0, 0, 0, 0.08); }
body.theme-light .gpanel .tr-dir button { color: rgba(29, 31, 30, 0.7); }
body.theme-light .gpanel .tr-dir button.on { background: #fff; color: #1d1f1e; }
body.theme-light .gpanel .tr-eta.soon { color: #2f6b45; }
body.theme-light .gpanel .tr-search { background: rgba(255, 255, 255, 0.6); border-color: rgba(0, 0, 0, 0.12); }
body.theme-light .gpanel .tr-results button:hover { background: rgba(0, 0, 0, 0.06); }
body.theme-light .gpanel .gp-resize { border-color: rgba(0, 0, 0, 0.45); }
@media (prefers-reduced-motion: reduce) { .tr-live { animation: none; } }
@media (max-width: 1100px) { .transit { left: 18px; } .agenda { right: 18px; } .gp-card { width: 270px; } }
@media (max-width: 900px) { .gpanel { display: none; } }
/* Agent cards share the right side: the calendar moves to the top and the cards sit under it */
body:has(.card-stack .acard) .agenda:not(.placed) { top: 92px; translate: none; }
body:has(.card-stack .acard):has(.agenda:not(.placed):not(.off)) .card-stack { top: auto; bottom: 90px; transform: none; max-height: 34vh; }
