:root {
  --scale: 0.86;
  --intensity: 1;
  --text: #f6f3ea;
  --muted: #b8c0d9;
  --accent: #94f2d0;
  --accent-2: #f8d477;
  --accent-3: #9eb6ff;
  --page-base-a: #f7f0df;
  --page-base-b: #dcecf0;
  --page-base-c: #f8d477;
  --atmosphere-a: rgba(148, 242, 208, calc(0.18 * var(--intensity)));
  --atmosphere-b: rgba(248, 212, 119, calc(0.15 * var(--intensity)));
  --atmosphere-c: rgba(126, 162, 255, calc(0.16 * var(--intensity)));
  --shift-a: rgba(148, 242, 208, 0.28);
  --shift-b: rgba(248, 212, 119, 0.2);
  --shift-c: rgba(158, 182, 255, 0.2);
  --line: rgba(255, 255, 255, 0.16);
  --glass-a: rgba(255, 255, 255, calc(0.12 * var(--intensity)));
  --glass-b: rgba(255, 255, 255, calc(0.045 * var(--intensity)));
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.34);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: #070b16;
  overflow-x: hidden;
}

body {
  margin: 0;
  width: 100%;
  max-width: 100%;
  min-height: 100vh;
  background: linear-gradient(135deg, var(--page-base-a), var(--page-base-b));
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  overflow-x: hidden;
  overflow-y: hidden;
}

.ambient-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  min-width: 100vw;
  min-height: 100vh;
  background:
    radial-gradient(circle at 12% 8%, var(--atmosphere-a), transparent 28%),
    radial-gradient(circle at 86% 18%, var(--atmosphere-b), transparent 25%),
    radial-gradient(circle at 78% 92%, var(--atmosphere-c), transparent 35%),
    linear-gradient(135deg, var(--page-base-a) 0%, var(--page-base-b) 56%, var(--page-base-c) 140%);
  pointer-events: none;
  transition: background 900ms ease;
}

body[data-weather="sunny"] {
  --text: #203044;
  --muted: #657286;
  --accent: #167a68;
  --accent-2: #b66b13;
  --accent-3: #4e78c7;
  --line: rgba(32, 48, 68, 0.16);
  --glass-a: rgba(255, 255, 255, calc(0.66 * var(--intensity)));
  --glass-b: rgba(255, 255, 255, calc(0.38 * var(--intensity)));
  --shadow: 0 24px 70px rgba(80, 94, 119, 0.2);
  --page-base-a: #f9efd7;
  --page-base-b: #d9eef2;
  --page-base-c: #ffe7a6;
  --atmosphere-a: rgba(98, 191, 170, calc(0.26 * var(--intensity)));
  --atmosphere-b: rgba(255, 206, 99, calc(0.36 * var(--intensity)));
  --atmosphere-c: rgba(108, 155, 218, calc(0.18 * var(--intensity)));
  --shift-a: rgba(61, 180, 151, 0.34);
  --shift-b: rgba(255, 199, 82, 0.34);
  --shift-c: rgba(117, 162, 224, 0.24);
}

body[data-weather="bright"] {
  --text: #243447;
  --muted: #667386;
  --accent: #247d80;
  --accent-2: #9a6b1d;
  --accent-3: #5575b8;
  --line: rgba(36, 52, 71, 0.15);
  --glass-a: rgba(255, 255, 255, calc(0.58 * var(--intensity)));
  --glass-b: rgba(255, 255, 255, calc(0.32 * var(--intensity)));
  --shadow: 0 24px 70px rgba(70, 86, 112, 0.2);
  --page-base-a: #eef4e9;
  --page-base-b: #d9e8ef;
  --page-base-c: #f4e9c9;
  --atmosphere-a: rgba(124, 184, 176, calc(0.22 * var(--intensity)));
  --atmosphere-b: rgba(218, 200, 139, calc(0.2 * var(--intensity)));
  --atmosphere-c: rgba(150, 177, 218, calc(0.18 * var(--intensity)));
}

body[data-weather="rain"],
body[data-weather="dark"] {
  --text: #f6f3ea;
  --muted: #b8c0d9;
  --accent: #94f2d0;
  --accent-2: #f8d477;
  --accent-3: #9eb6ff;
  --line: rgba(255, 255, 255, 0.16);
  --glass-a: rgba(255, 255, 255, calc(0.12 * var(--intensity)));
  --glass-b: rgba(255, 255, 255, calc(0.045 * var(--intensity)));
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.34);
  --page-base-a: #070b16;
  --page-base-b: #10172d;
  --page-base-c: #121827;
}

body[data-weather="evening"] {
  --text: #2a2630;
  --muted: #70687a;
  --accent: #3b8f83;
  --accent-2: #b66b4c;
  --accent-3: #7768c6;
  --line: rgba(42, 38, 48, 0.16);
  --glass-a: rgba(255, 255, 255, calc(0.54 * var(--intensity)));
  --glass-b: rgba(255, 255, 255, calc(0.26 * var(--intensity)));
  --shadow: 0 24px 70px rgba(92, 70, 94, 0.22);
  --page-base-a: #f4dcc8;
  --page-base-b: #d8d7ef;
  --page-base-c: #f5bd82;
  --atmosphere-a: rgba(242, 174, 126, calc(0.26 * var(--intensity)));
  --atmosphere-b: rgba(145, 132, 212, calc(0.2 * var(--intensity)));
  --atmosphere-c: rgba(83, 168, 153, calc(0.16 * var(--intensity)));
}

body[data-load="surviving"] {
  --accent-2: #c57a1b;
}

body[data-load="drowning"] {
  --accent: #4e78c7;
  --accent-2: #9a5c5c;
  --atmosphere-a: rgba(117, 139, 194, calc(0.22 * var(--intensity)));
  --atmosphere-b: rgba(148, 242, 208, calc(0.08 * var(--intensity)));
  --atmosphere-c: rgba(194, 126, 126, calc(0.12 * var(--intensity)));
}

body[data-mood="pre"],
body[data-mood="morning"],
body[data-mood="clear"] {
  --atmosphere-a: rgba(148, 242, 208, calc(0.22 * var(--intensity)));
  --atmosphere-b: rgba(174, 211, 255, calc(0.13 * var(--intensity)));
  --atmosphere-c: rgba(248, 212, 119, calc(0.12 * var(--intensity)));
  --shift-a: rgba(148, 242, 208, 0.34);
  --shift-b: rgba(174, 211, 255, 0.22);
  --shift-c: rgba(248, 212, 119, 0.18);
}

body[data-mood="midday"],
body[data-mood="steady"] {
  --atmosphere-a: rgba(126, 162, 255, calc(0.18 * var(--intensity)));
  --atmosphere-b: rgba(148, 242, 208, calc(0.16 * var(--intensity)));
  --atmosphere-c: rgba(248, 212, 119, calc(0.14 * var(--intensity)));
  --shift-a: rgba(126, 162, 255, 0.28);
  --shift-b: rgba(148, 242, 208, 0.28);
  --shift-c: rgba(248, 212, 119, 0.2);
}

body[data-mood="afternoon"],
body[data-mood="warm"] {
  --atmosphere-a: rgba(248, 212, 119, calc(0.18 * var(--intensity)));
  --atmosphere-b: rgba(148, 242, 208, calc(0.12 * var(--intensity)));
  --atmosphere-c: rgba(255, 157, 122, calc(0.13 * var(--intensity)));
  --shift-a: rgba(248, 212, 119, 0.32);
  --shift-b: rgba(148, 242, 208, 0.22);
  --shift-c: rgba(255, 157, 122, 0.22);
}

body[data-mood="landing"],
body[data-mood="shutdown"],
body[data-mood="deep"] {
  --atmosphere-a: rgba(158, 182, 255, calc(0.2 * var(--intensity)));
  --atmosphere-b: rgba(248, 212, 119, calc(0.11 * var(--intensity)));
  --atmosphere-c: rgba(148, 242, 208, calc(0.1 * var(--intensity)));
  --shift-a: rgba(158, 182, 255, 0.3);
  --shift-b: rgba(248, 212, 119, 0.22);
  --shift-c: rgba(148, 242, 208, 0.18);
}

button,
input,
select {
  font: inherit;
}

button {
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  border-radius: 999px;
  font-weight: 850;
  cursor: pointer;
  min-height: 42px;
  transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

button:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.28);
}

button:active {
  transform: translateY(1px);
}

.shell {
  width: 100%;
  max-width: 100%;
  min-height: 100vh;
  padding: clamp(16px, 1.55vw, 42px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: clamp(12px, 1vw, 26px);
  position: relative;
  z-index: 1;
}

.top,
.main,
.footer {
  display: grid;
  gap: clamp(12px, 1vw, 26px);
}

.top {
  grid-template-columns: minmax(520px, 1.35fr) minmax(320px, 0.65fr);
  align-items: stretch;
}

.main {
  grid-template-columns: minmax(0, 1.42fr) minmax(300px, 0.58fr);
  min-height: 0;
}

.footer {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.checkin {
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
  padding: clamp(14px, 1vw, 22px);
  min-height: 0;
}

.top-stack {
  display: grid;
  grid-template-rows: minmax(0, 0.9fr) auto;
  gap: clamp(12px, 1vw, 26px);
  min-height: 0;
}

.card,
.pill,
.settings-panel {
  border: 1px solid var(--line);
  background: linear-gradient(145deg, var(--glass-a), var(--glass-b));
  backdrop-filter: blur(18px);
  border-radius: 28px;
  box-shadow: var(--shadow);
}

.hero,
.status,
.marquee,
.mini {
  overflow: hidden;
}

.hero {
  padding: clamp(16px, 1.1vw, 28px);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.eyebrow,
.phase {
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 900;
}

.eyebrow {
  font-size: calc(clamp(12px, 0.58vw, 20px) * var(--scale));
  margin-bottom: 10px;
}

h1,
h2,
p {
  overflow-wrap: anywhere;
}

h1 {
  margin: 0;
  font-size: calc(clamp(28px, 2vw, 64px) * var(--scale));
  line-height: 0.96;
  letter-spacing: 0;
}

.subhero {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: calc(clamp(14px, 0.72vw, 24px) * var(--scale));
  line-height: 1.25;
  font-weight: 550;
  max-width: 1100px;
}

.checkin-label {
  color: var(--accent);
  font-size: calc(clamp(12px, 0.58vw, 18px) * var(--scale));
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 900;
}

.checkin-status {
  color: var(--muted);
  font-size: calc(clamp(13px, 0.68vw, 22px) * var(--scale));
  line-height: 1.2;
  margin-top: 4px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.checkin-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  align-items: center;
  margin-top: 12px;
}

.checkin-button {
  min-height: 40px;
  padding: 0 10px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.12);
}

.checkin-button.active {
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.38);
  background: linear-gradient(145deg, var(--shift-a), rgba(255, 255, 255, 0.18));
}

.status {
  padding: clamp(22px, 1.8vw, 46px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: clamp(240px, 25vh, 360px);
  position: relative;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.76), rgba(255, 255, 255, 0.46)),
    linear-gradient(90deg, rgba(148, 242, 208, 0.1), rgba(248, 212, 119, 0.08));
}

.shift-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  background:
    radial-gradient(circle at 20% 18%, var(--shift-a), transparent 46%),
    radial-gradient(circle at 72% 18%, var(--shift-b), transparent 48%),
    linear-gradient(120deg, rgba(255, 255, 255, 0.035), transparent 70%);
  opacity: 0.68;
  pointer-events: none;
  animation: shiftGlow 7s ease-in-out infinite;
}

body[data-weather="sunny"] .shift-bg,
body[data-weather="bright"] .shift-bg,
body[data-weather="evening"] .shift-bg {
  opacity: 0.42;
}

.shift-bg::before,
.shift-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.shift-bg::before {
  width: min(100%, calc(var(--progress, 0%) + 14%));
  background: linear-gradient(90deg, var(--shift-a), var(--shift-b), transparent);
  filter: blur(28px);
  opacity: 0.62;
  mask-image: linear-gradient(90deg, #000 0%, #000 34%, transparent 100%);
  transition: width 800ms ease;
}

.shift-bg::after {
  background: repeating-linear-gradient(115deg, rgba(255, 255, 255, 0.06) 0 2px, transparent 2px 14px);
  opacity: 0.5;
  mask-image: linear-gradient(90deg, #000 0%, rgba(0, 0, 0, 0.72) 42%, transparent 100%);
}

.status-content,
.mode {
  position: relative;
  z-index: 1;
}

.clock {
  font-size: calc(clamp(56px, 4.2vw, 132px) * var(--scale));
  line-height: 0.9;
  letter-spacing: 0;
  font-weight: 875;
}

.date,
.shift-label {
  color: var(--muted);
  font-size: calc(clamp(15px, 0.82vw, 28px) * var(--scale));
  margin-top: 8px;
  font-weight: 650;
  overflow-wrap: anywhere;
}

.shift-label strong {
  color: var(--accent);
  font-size: 1.18em;
  font-weight: 950;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.38);
}

.shift-track {
  position: relative;
  height: 24px;
  margin-top: 22px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(32, 48, 68, 0.1);
  border: 1px solid rgba(32, 48, 68, 0.18);
  box-shadow: inset 0 1px 4px rgba(32, 48, 68, 0.16), 0 8px 24px rgba(32, 48, 68, 0.08);
}

.shift-track-fill {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #167a68, #3db497, #f0a833);
  box-shadow: 0 0 24px rgba(22, 122, 104, 0.26);
  transition: width 800ms ease;
  position: relative;
}

.shift-track-fill::after {
  content: "";
  position: absolute;
  inset: 0;
  display: block;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  animation: trackSweep 4.8s ease-in-out infinite;
}

.shift-track-fill::before {
  content: "";
  position: absolute;
  top: 50%;
  right: -9px;
  width: 19px;
  height: 19px;
  border-radius: 999px;
  background: #fff8df;
  border: 2px solid rgba(32, 48, 68, 0.18);
  box-shadow: 0 0 18px rgba(22, 122, 104, 0.55);
  transform: translateY(-50%);
}

.shift-marker {
  position: absolute;
  top: 50%;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: rgba(32, 48, 68, 0.4);
  transform: translate(-50%, -50%);
}

.shift-marker.start {
  left: 0%;
}

.shift-marker.mid {
  left: 50%;
}

.shift-marker.end {
  left: 100%;
}

.shift-encouragement {
  color: var(--text);
  font-size: calc(clamp(15px, 0.82vw, 26px) * var(--scale));
  line-height: 1.2;
  margin-top: 16px;
  font-weight: 760;
  overflow-wrap: anywhere;
}

body[data-weather="rain"] .status,
body[data-weather="dark"] .status {
  background: linear-gradient(145deg, var(--glass-a), var(--glass-b));
}

body[data-weather="rain"] .shift-track,
body[data-weather="dark"] .shift-track {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.18);
}

body[data-weather="rain"] .shift-marker,
body[data-weather="dark"] .shift-marker {
  background: rgba(246, 243, 234, 0.55);
}

.mode {
  border-top: 1px solid var(--line);
  padding-top: 14px;
  color: var(--accent-2);
  font-size: calc(clamp(15px, 0.78vw, 27px) * var(--scale));
  line-height: 1.15;
  font-weight: 850;
  overflow-wrap: anywhere;
}

.marquee {
  padding: clamp(28px, 2.4vw, 76px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  min-height: 0;
  background: linear-gradient(155deg, rgba(148, 242, 208, 0.15), rgba(126, 162, 255, 0.1), rgba(255, 255, 255, 0.05));
  position: relative;
}

.marquee::after {
  content: "";
  position: absolute;
  width: 520px;
  height: 520px;
  right: -160px;
  bottom: -180px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(248, 212, 119, 0.16), transparent 62%);
  pointer-events: none;
}

.marquee-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  position: relative;
  z-index: 1;
}

.phase {
  font-size: calc(clamp(13px, 0.68vw, 25px) * var(--scale));
}

.counter,
.autoplay {
  color: var(--muted);
  font-size: calc(clamp(12px, 0.58vw, 20px) * var(--scale));
  font-weight: 750;
}

.progress-ring {
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
}

.progress-ring svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.ring-track,
.ring-fill {
  fill: none;
  stroke-width: 3.5;
}

.ring-track {
  stroke: rgba(255, 255, 255, 0.12);
}

.ring-fill {
  stroke: var(--accent);
  stroke-linecap: round;
  stroke-dasharray: 106.8;
  stroke-dashoffset: 106.8;
  transition: stroke-dashoffset 220ms linear;
}

.frame {
  align-self: center;
  position: relative;
  z-index: 1;
  transition: opacity 260ms ease, transform 260ms ease;
  min-width: 0;
}

.frame.fade {
  opacity: 0;
  transform: translateY(8px);
}

.frame-title {
  color: var(--accent-2);
  font-size: calc(clamp(20px, 1vw, 38px) * var(--scale));
  line-height: 1.05;
  font-weight: 900;
  margin-bottom: 20px;
  overflow-wrap: anywhere;
}

.frame-quote {
  font-size: calc(clamp(42px, 4vw, 136px) * var(--scale) * var(--fit-adjust, 1));
  line-height: 0.98;
  letter-spacing: 0;
  font-weight: 900;
  max-width: 1500px;
  overflow-wrap: anywhere;
  text-wrap: balance;
}

.frame-note {
  margin-top: 28px;
  color: var(--muted);
  font-size: calc(clamp(20px, 1.2vw, 44px) * var(--scale));
  line-height: 1.28;
  font-weight: 600;
  max-width: 1250px;
  overflow-wrap: anywhere;
}

.marquee-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  position: relative;
  z-index: 1;
}

.nav-buttons {
  display: flex;
  gap: 10px;
  align-items: center;
}

.nav-buttons button {
  min-width: 52px;
  height: 44px;
  padding: 0 16px;
  font-size: calc(17px * var(--scale));
}

.nav-buttons .icon-button {
  width: 52px;
  padding: 0;
  font-size: calc(28px * var(--scale));
  line-height: 1;
}

.side {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  gap: clamp(12px, 1vw, 26px);
  min-height: 0;
}

.rail-label {
  color: var(--muted);
  font-size: calc(clamp(11px, 0.52vw, 17px) * var(--scale));
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 900;
  padding: 0 4px;
}

.mini-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.mini-heading h2 {
  margin: 0;
}

.ghost-button {
  min-height: 32px;
  padding: 0 12px;
  color: var(--muted);
  font-size: 12px;
}

.priority-list {
  display: grid;
  gap: 10px;
}

.priority-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 10px 12px;
  border-radius: 17px;
  background: rgba(255, 255, 255, 0.065);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.priority-item input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 7px 0 0;
  accent-color: var(--accent);
}

.priority-item textarea {
  width: 100%;
  min-height: 32px;
  max-height: 92px;
  resize: none;
  border: 0;
  outline: 0;
  padding: 5px 0;
  background: transparent;
  color: var(--text);
  font-size: calc(clamp(14px, 0.72vw, 24px) * var(--scale));
  line-height: 1.18;
  font-weight: 650;
  overflow: hidden;
}

.priority-item textarea::placeholder {
  color: rgba(184, 192, 217, 0.58);
}

.priority-item textarea.done {
  color: var(--muted);
  text-decoration: line-through;
}

.priority-note {
  margin-top: 12px;
  color: var(--muted);
  font-size: calc(clamp(12px, 0.62vw, 20px) * var(--scale));
  line-height: 1.2;
  font-weight: 700;
}

.rhythm-card {
  display: block;
}

.mini {
  padding: clamp(18px, 1.15vw, 34px);
}

.mini h2 {
  margin: 0 0 14px;
  font-size: calc(clamp(22px, 1.1vw, 40px) * var(--scale));
  letter-spacing: 0;
}

.list {
  display: grid;
  gap: 10px;
}

.item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 11px;
  align-items: start;
  padding: 11px 13px;
  border-radius: 17px;
  background: rgba(255, 255, 255, 0.065);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: calc(clamp(14px, 0.72vw, 25px) * var(--scale));
  line-height: 1.18;
  font-weight: 650;
  overflow-wrap: anywhere;
}

.num,
.dot {
  display: inline-flex;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  align-items: center;
  justify-content: center;
  background: rgba(148, 242, 208, 0.16);
  color: var(--accent);
  font-size: 13px;
  font-weight: 900;
  margin-top: -1px;
  flex: 0 0 auto;
}

.dot {
  background: rgba(248, 212, 119, 0.16);
  color: var(--accent-2);
}

.pill {
  padding: 9px 13px;
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
  font-size: calc(clamp(14px, 0.72vw, 25px) * var(--scale));
  font-weight: 850;
  overflow-wrap: anywhere;
  opacity: 0.74;
}

.pulse {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 rgba(148, 242, 208, 0.7);
  animation: pulse 2.4s infinite;
  flex: 0 0 auto;
}

.settings-panel {
  position: fixed;
  top: 12px;
  right: 12px;
  z-index: 20;
  width: auto;
  background: transparent;
  color: var(--muted);
  border: 0;
  border-radius: 999px;
  box-shadow: none;
  backdrop-filter: none;
  opacity: 0.34;
  transition: opacity 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.settings-panel:hover,
.settings-panel:focus-within,
.settings-panel.settings-open {
  opacity: 1;
}

.settings-panel.settings-open {
  width: min(320px, calc(100vw - 24px));
  border: 1px solid var(--line);
  background: rgba(7, 11, 22, 0.78);
  border-radius: 24px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.settings-toggle {
  width: 38px;
  min-height: 38px;
  padding: 0;
  overflow: hidden;
  text-indent: -999px;
  white-space: nowrap;
  color: var(--text);
  background: rgba(255, 255, 255, 0.34);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
}

.settings-toggle::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  display: block;
  width: 10px;
  height: 10px;
  margin: 0;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 14px rgba(148, 242, 208, 0.45);
  transform: translate(-50%, -50%);
  text-indent: 0;
}

.settings-panel.settings-open .settings-toggle {
  width: 100%;
  padding: 8px 14px;
  text-indent: 0;
}

.settings-panel.settings-open .settings-toggle::before {
  position: static;
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 8px;
  transform: none;
}

.settings-body {
  padding: 12px;
  display: grid;
  gap: 10px;
}

.settings-body[hidden] {
  display: none;
}

.settings-body label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.weather-readout {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
  font-weight: 750;
  padding: 9px 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.settings-body input,
.settings-body select {
  min-height: 36px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 12px;
  padding: 0 10px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.settings-body select option {
  color: #10172d;
}

.wide-button {
  width: 100%;
}

.secondary {
  color: var(--muted);
}

.focus-mode {
  grid-template-rows: auto minmax(0, 1fr);
}

.focus-mode .top,
.focus-mode .checkin,
.focus-mode .footer,
.focus-mode .side {
  display: none;
}

.focus-mode .main {
  grid-template-columns: 1fr;
}

.focus-mode .marquee {
  min-height: calc(100vh - clamp(16px, 1.55vw, 42px) * 2);
}

.focus-mode .frame-quote {
  font-size: calc(clamp(54px, 6.4vw, 172px) * var(--scale) * var(--fit-adjust, 1));
}

.shutdown-mode .marquee {
  background: linear-gradient(155deg, rgba(248, 212, 119, 0.16), rgba(148, 242, 208, 0.1), rgba(255, 255, 255, 0.05));
}

.shutdown-mode .ring-fill,
.shutdown-mode .pulse {
  stroke: var(--accent-2);
  background: var(--accent-2);
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(148, 242, 208, 0.58);
  }
  70% {
    box-shadow: 0 0 0 18px rgba(148, 242, 208, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(148, 242, 208, 0);
  }
}

@keyframes shiftGlow {
  0%,
  100% {
    filter: saturate(1) brightness(1);
  }
  50% {
    filter: saturate(1.2) brightness(1.08);
  }
}

@keyframes trackSweep {
  0%,
  35% {
    transform: translateX(-100%);
  }
  75%,
  100% {
    transform: translateX(100%);
  }
}

@media (max-width: 1400px), (max-height: 820px) {
  body {
    overflow-y: auto;
  }

  .shell {
    height: auto;
    min-height: 100vh;
  }

  .top,
  .main,
  .footer,
  .checkin {
    grid-template-columns: 1fr;
  }

  .side {
    grid-template-rows: auto;
  }

  .rhythm-card {
    display: block;
  }

  .frame-quote {
    font-size: calc(clamp(38px, 8vw, 92px) * var(--scale) * var(--fit-adjust, 1));
  }

  .footer {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .shell {
    padding: 14px;
    padding-top: 64px;
  }

  .card,
  .pill {
    border-radius: 22px;
  }

  .settings-panel {
    left: 12px;
    right: 12px;
    width: auto;
  }

  .marquee {
    min-height: 62vh;
  }

  .marquee-controls {
    align-items: flex-start;
    flex-direction: column;
  }

  .footer {
    grid-template-columns: 1fr;
  }

  .checkin-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
  }

  .checkin-button {
    padding: 0 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    scroll-behavior: auto !important;
    transition-duration: 1ms !important;
  }
}
