@font-face {
  font-family: "Corner Numbers";
  src: local("Barlow Light"), local("Barlow Semi Condensed Light"), local("Avenir Next Condensed Ultra Light");
  font-weight: 200 500;
}

:root {
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", sans-serif;
  font-synthesis: none;
  --ease-out: cubic-bezier(.2, .85, .25, 1);
  --timer-size: clamp(238px, 62vw, 320px);
}

* { box-sizing: border-box; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

html {
  min-width: 360px;
  min-height: 560px;
  background: #f7f1e7;
}

body {
  --active: var(--work-accent);
  --active-soft: var(--work-soft);
  --phase-bg: var(--work-bg);
  --phase-ink: var(--ink);
  margin: 0;
  min-width: 360px;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--phase-ink);
  background: var(--phase-bg);
  transition: background-color .55s var(--ease-out), color .4s ease;
  -webkit-user-select: none;
  user-select: none;
}

body[data-phase="break"] {
  --active: var(--break-accent);
  --active-soft: var(--break-soft);
  --phase-bg: var(--break-bg);
  --phase-ink: var(--break-ink, var(--ink));
}

body.phase-flash .timer-wrap { animation: phase-arrival .7s var(--ease-out); }

@keyframes phase-arrival {
  0% { transform: scale(.94); opacity: .5; }
  45% { transform: scale(1.025); opacity: 1; }
  100% { transform: scale(1); }
}

button, input, select { font: inherit; }

button {
  color: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible, input:focus-visible, select:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--active) 58%, transparent);
  outline-offset: 3px;
}

.paper-grain {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: var(--grain-opacity, .12);
  background-image:
    repeating-linear-gradient(95deg, transparent 0 13px, color-mix(in srgb, var(--ink) 4%, transparent) 14px 15px),
    radial-gradient(circle at 20% 20%, color-mix(in srgb, var(--ink) 12%, transparent) 0 .6px, transparent .9px),
    radial-gradient(circle at 75% 65%, color-mix(in srgb, var(--ink) 10%, transparent) 0 .7px, transparent 1px);
  background-size: auto, 12px 13px, 17px 19px;
  mix-blend-mode: multiply;
}

.app-shell {
  position: relative;
  z-index: 1;
  width: min(100%, 620px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 24px clamp(22px, 6vw, 38px) 20px;
  display: flex;
  flex-direction: column;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.eyebrow {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 750;
  letter-spacing: .21em;
  line-height: 1.2;
}

.brand-block h1 {
  margin: 0;
  font-size: 18px;
  font-weight: 710;
  letter-spacing: -.035em;
  line-height: 1.1;
}

.brand-block h1 span { color: var(--active); }

.icon-button {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--button-radius, 50%);
  background: var(--panel);
  box-shadow: var(--small-shadow);
  transition: transform .22s var(--ease-out), background-color .2s ease, border-color .2s ease;
}

.icon-button svg {
  width: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linejoin: round;
}

.icon-button:hover {
  transform: translateY(-2px) rotate(4deg);
  border-color: var(--active);
}

.icon-button:active { transform: translateY(1px) scale(.94); }

.theme-switcher {
  width: min(100%, 330px);
  margin: 22px auto 4px;
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  gap: 6px;
}

.arrow-button {
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: var(--button-radius, 50%);
  color: var(--muted);
  background: transparent;
  font-family: Georgia, serif;
  font-size: 34px;
  font-weight: 300;
  line-height: 1;
  transition: transform .22s var(--ease-out), color .2s ease, background .2s ease;
}

.arrow-button:hover {
  color: var(--active);
  background: color-mix(in srgb, var(--panel) 72%, transparent);
  transform: scale(1.09);
}

.arrow-button:active { transform: scale(.88); }

.theme-title {
  min-width: 0;
  border: 0;
  background: transparent;
  text-align: center;
  transition: transform .2s var(--ease-out);
}

.theme-title:hover { transform: translateY(-1px); }
.theme-title:active { transform: scale(.98); }

.theme-title strong {
  display: block;
  font-family: var(--display-font, inherit);
  font-size: 24px;
  font-weight: var(--display-weight, 740);
  letter-spacing: var(--display-spacing, -.045em);
  line-height: 1.05;
}

.theme-index {
  display: block;
  margin-bottom: 2px;
  color: var(--active);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: .18em;
}

.theme-dots {
  height: 7px;
  margin-top: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.theme-dots i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--line-strong);
}

.theme-dots i:nth-child(2) {
  width: 13px;
  border-radius: 8px;
  background: var(--active);
}

.timer-section {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 470px;
}

.timer-wrap {
  position: relative;
  width: var(--timer-size);
  height: var(--timer-size);
  margin: 8px auto 0;
  filter: drop-shadow(var(--ring-shadow, 0 14px 30px rgba(68, 42, 17, .09)));
}

.progress-ring {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.ring-track,
.ring-progress {
  fill: none;
  stroke-width: var(--ring-width, 8);
}

.ring-track { stroke: var(--track); }

.ring-progress {
  stroke: var(--active);
  stroke-linecap: var(--ring-cap, round);
  stroke-dasharray: 904.779;
  stroke-dashoffset: 904.779;
  transform: rotate(-90deg);
  transform-origin: 160px 160px;
  transition: stroke-dashoffset .28s linear, stroke .45s ease;
}

.ring-detail {
  fill: var(--phase-bg);
  stroke: var(--active);
  stroke-width: 3px;
  transition: fill .5s ease, stroke .5s ease;
}

.timer-face {
  position: absolute;
  inset: 12%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: var(--face-border, 1px solid transparent);
  border-radius: var(--face-radius, 50%);
  background: var(--face-bg, transparent);
  box-shadow: var(--face-shadow, none);
  text-align: center;
}

.phase-label {
  width: 104px;
  margin-bottom: 3px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--active);
}

.phase-label span {
  height: 1px;
  flex: 1;
  background: currentColor;
  opacity: .45;
}

.phase-label b {
  font-size: 9px;
  font-weight: 850;
  letter-spacing: .21em;
}

#timeDisplay {
  display: block;
  font-family: "Corner Numbers", "Avenir Next Condensed", "SF Pro Display", sans-serif;
  font-size: clamp(66px, 16vw, 88px);
  font-variant-numeric: tabular-nums lining-nums;
  font-weight: 250;
  letter-spacing: -.065em;
  line-height: .98;
  transform: translateX(-.025em);
}

#phaseNote {
  max-width: 184px;
  margin: 11px 0 0;
  color: var(--muted);
  font-family: var(--note-font, inherit);
  font-size: 10px;
  font-style: var(--note-style, normal);
  font-weight: 560;
  letter-spacing: .02em;
  line-height: 1.35;
}

.session-row {
  width: min(100%, 306px);
  margin: 12px auto 13px;
  padding: 0 4px;
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: .17em;
}

.running-status { display: flex; align-items: center; gap: 6px; }

.running-status i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--active);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--active) 15%, transparent);
  animation: status-pulse 2s ease-in-out infinite;
}

body.is-paused .running-status i {
  background: var(--muted);
  box-shadow: none;
  animation: none;
}

@keyframes status-pulse {
  0%, 100% { transform: scale(.85); opacity: .75; }
  50% { transform: scale(1.12); opacity: 1; }
}

.controls {
  display: grid;
  grid-template-columns: repeat(2, 58px);
  gap: 10px;
}

.control-button {
  height: 58px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--control-radius, 14px);
  color: var(--ink);
  background: var(--panel);
  box-shadow: var(--small-shadow);
  transition: transform .18s var(--ease-out), box-shadow .2s ease, border-color .2s ease, background .25s ease;
}

.control-button span {
  font-family: "SF Pro Display", sans-serif;
  font-size: 23px;
  line-height: 1;
}

.control-button.primary {
  border-color: var(--active);
  color: var(--active-ink, #fff);
  background: var(--active);
  box-shadow: 0 9px 20px color-mix(in srgb, var(--active) 25%, transparent);
}

.control-button:hover {
  transform: translateY(-3px);
  border-color: var(--active);
  box-shadow: 0 10px 24px color-mix(in srgb, var(--ink) 13%, transparent);
}

.control-button:active {
  transform: translateY(1px) scale(.96);
  box-shadow: none;
}

.silent-compact {
  width: min(100%, 330px);
  margin: 11px auto 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}

.silent-toggle {
  min-height: 36px;
  margin: 0;
  padding: 5px 6px 5px 7px;
  display: grid;
  grid-template-columns: 22px auto 36px;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  background: color-mix(in srgb, var(--panel) 60%, transparent);
  transition: transform .2s var(--ease-out), border-color .25s ease, background .25s ease, box-shadow .25s ease;
}

.silent-toggle:hover {
  transform: translateY(-2px);
  border-color: var(--active);
  box-shadow: 0 6px 16px color-mix(in srgb, var(--ink) 10%, transparent);
}

.silent-toggle:active { transform: translateY(1px) scale(.985); }

.silent-toggle.needs-attention { animation: sound-nudge 1.1s ease-in-out 2; }

@keyframes sound-nudge {
  0%, 100% { transform: translateX(0); }
  35% { transform: translateX(-3px); }
  65% { transform: translateX(3px); }
}

.silent-toggle-icon {
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-family: Georgia, serif;
  font-size: 15px;
}

.silent-toggle > b {
  font-size: 8px;
  font-weight: 850;
  letter-spacing: .12em;
}

.silent-toggle-state {
  padding: 5px 4px;
  border: 0;
  border-radius: 999px;
  color: var(--muted);
  background: color-mix(in srgb, var(--ink) 7%, transparent);
  font-size: 7px;
  font-weight: 900;
  letter-spacing: .1em;
  text-align: center;
}

.silent-toggle.is-on,
body.is-silent .silent-toggle {
  border-color: var(--active);
  background: var(--active-soft);
}

.silent-toggle.is-on .silent-toggle-icon,
body.is-silent .silent-toggle-icon { color: var(--active); }

.silent-toggle.is-on .silent-toggle-state,
body.is-silent .silent-toggle-state {
  border-color: var(--active);
  color: var(--active-ink, #fff);
  background: var(--active);
}

.silent-schedule {
  min-height: 36px;
  padding: 5px 9px;
  display: flex;
  align-items: center;
  gap: 6px;
  border: 0;
  border-radius: 999px;
  color: var(--muted);
  background: transparent;
  transition: color .2s ease, background .2s ease, transform .2s var(--ease-out);
}

.silent-schedule > span { color: var(--active); font-size: 14px; }
.silent-schedule b { font-size: 8px; font-weight: 780; letter-spacing: .04em; }
.silent-schedule i { font-family: Georgia, serif; font-size: 17px; font-style: normal; line-height: 1; }
.silent-schedule:hover { color: var(--ink); background: var(--active-soft); transform: translateY(-1px); }
.silent-schedule:active { transform: translateY(1px) scale(.97); }

.weather-strip {
  width: min(100%, 330px);
  min-height: 72px;
  margin: 5px auto 11px;
  padding: 5px 0;
  display: grid;
  grid-template-columns: 84px 1fr;
  align-items: stretch;
  gap: 10px;
  transition: opacity .25s ease;
}

.weather-strip.is-loading { opacity: .62; }

.weather-strip-head {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.weather-strip-head > span,
.weather-strip-head b,
.weather-strip-head small { display: block; }

.weather-strip-head b {
  overflow: hidden;
  font-size: 14px;
  font-weight: 790;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.weather-strip-head small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 8.5px;
  font-weight: 850;
  letter-spacing: .1em;
}

.weather-strip-head button {
  width: 23px;
  height: 23px;
  padding: 0;
  border: 0;
  border-radius: var(--button-radius, 50%);
  color: var(--active);
  background: transparent;
  font-size: 14px;
  transition: transform .2s var(--ease-out), background .2s ease;
}

.weather-strip-head button:hover { transform: rotate(-35deg); background: var(--active-soft); }
.weather-strip-head button:active { transform: rotate(-75deg) scale(.9); }
.weather-strip.is-loading .weather-strip-head button { animation: weather-spin 1.1s linear infinite; }

@keyframes weather-spin { to { transform: rotate(360deg); } }

.forecast-row {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: center;
}

.forecast-item {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
}

.forecast-item span {
  max-width: 100%;
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  font-weight: 820;
  letter-spacing: .04em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.forecast-item i {
  height: 24px;
  color: var(--active);
  font-family: Georgia, serif;
  font-size: 23px;
  font-style: normal;
  line-height: 1;
}

.forecast-item strong {
  font-family: "Corner Numbers", "Avenir Next Condensed", sans-serif;
  font-size: 19px;
  font-variant-numeric: tabular-nums;
  font-weight: 480;
  letter-spacing: -.04em;
}

.footer-note {
  width: 100%;
  padding-top: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 7px;
  font-weight: 820;
  letter-spacing: .16em;
}

.footer-mark { color: var(--active); font-size: 10px; }

.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 4;
  background: color-mix(in srgb, var(--ink) 24%, transparent);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity .25s ease;
}

.drawer-backdrop.is-visible { opacity: 1; }

.drawer {
  position: fixed;
  right: 12px;
  bottom: 12px;
  left: 12px;
  z-index: 5;
  max-width: 560px;
  max-height: calc(100vh - 38px);
  margin: 0 auto;
  padding: 24px;
  overflow: auto;
  border: 1px solid var(--line-strong);
  border-radius: var(--drawer-radius, 24px);
  color: var(--ink);
  background: color-mix(in srgb, var(--panel) 96%, transparent);
  box-shadow: 0 28px 80px color-mix(in srgb, #000 35%, transparent);
  transform: translateY(calc(100% + 24px));
  opacity: 0;
  transition: transform .38s var(--ease-out), opacity .25s ease;
}

.drawer.is-open { transform: translateY(0); opacity: 1; }

.drawer-header {
  margin-bottom: 22px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.drawer-header h2 {
  margin: 0;
  font-family: var(--display-font, inherit);
  font-size: 28px;
  letter-spacing: -.045em;
}

.close-button { font-size: 25px; font-weight: 300; line-height: 1; }

.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.field-card,
.select-field {
  display: block;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: var(--field-radius, 14px);
  background: var(--phase-bg);
}

.field-card > span:first-child,
.select-field > span:first-child {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.number-field {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.number-field input {
  width: 70px;
  padding: 0;
  border: 0;
  color: var(--ink);
  background: transparent;
  font-family: "Corner Numbers", "Avenir Next Condensed", sans-serif;
  font-size: 30px;
  font-variant-numeric: tabular-nums;
  font-weight: 350;
}

.number-field em {
  color: var(--active);
  font-size: 8px;
  font-style: normal;
  font-weight: 850;
  letter-spacing: .12em;
}

.select-field { margin-top: 10px; }

.weather-detail {
  margin-top: 8px;
  padding: 10px 12px;
  display: grid;
  grid-template-columns: 30px 1fr 32px;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--line);
  border-radius: var(--field-radius, 14px);
  background: var(--active-soft);
}

.weather-detail-icon {
  color: var(--active);
  font-family: Georgia, serif;
  font-size: 25px;
  text-align: center;
}

.weather-detail b,
.weather-detail small { display: block; }
.weather-detail b { font-size: 14px; }
.weather-detail small { margin-top: 3px; color: var(--muted); font-size: 11px; line-height: 1.35; }

.weather-detail button {
  width: 30px;
  height: 30px;
  border: 1px solid color-mix(in srgb, var(--active) 45%, var(--line));
  border-radius: var(--button-radius, 50%);
  color: var(--active);
  background: var(--panel);
  font-size: 16px;
  transition: transform .2s var(--ease-out), background .2s ease;
}

.weather-detail button:hover { transform: rotate(-35deg); background: var(--phase-bg); }
.weather-detail button:active { transform: rotate(-75deg) scale(.92); }

.select-wrap { position: relative; display: block; }

.select-wrap select {
  width: 100%;
  padding: 3px 24px 3px 0;
  border: 0;
  color: var(--ink);
  background: transparent;
  font-size: 16px;
  font-weight: 680;
  -webkit-appearance: none;
  appearance: none;
}

.select-wrap > span {
  position: absolute;
  right: 2px;
  top: 1px;
  color: var(--active);
  font-size: 18px;
  pointer-events: none;
}

.preview-button {
  width: 100%;
  margin: 10px 0;
  padding: 12px;
  border: 1px solid var(--active);
  border-radius: var(--field-radius, 14px);
  color: var(--active-ink, #fff);
  background: var(--active);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: .04em;
  transition: transform .18s var(--ease-out), filter .2s ease;
}

.preview-button span { margin-right: 5px; }
.preview-button:hover { transform: translateY(-2px); filter: brightness(1.06); }
.preview-button:active { transform: translateY(1px) scale(.985); }

.quiet-hours-grid { margin-top: 10px; }

.time-field { display: block; }

.time-field input {
  width: 100%;
  padding: 0;
  border: 0;
  color: var(--ink);
  background: transparent;
  font-family: "Corner Numbers", "Avenir Next Condensed", sans-serif;
  font-size: 25px;
  font-variant-numeric: tabular-nums;
  font-weight: 420;
}

.silent-card { margin: 10px 0; }

.info-card {
  padding: 12px 13px;
  display: grid;
  grid-template-columns: 28px 1fr auto;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--line);
  border-radius: var(--field-radius, 14px);
  background: var(--active-soft);
}

.pin-icon { color: var(--active); }
.info-card b { display: block; font-size: 11px; }
.info-card small { display: block; margin-top: 2px; color: var(--muted); font-size: 9px; line-height: 1.35; }
.on-pill { padding: 4px 7px; border-radius: 9px; color: var(--active-ink, #fff); background: var(--active); font-size: 7px; font-weight: 850; letter-spacing: .12em; }

.settings-help { margin: 12px 3px 0; color: var(--muted); font-size: 9px; line-height: 1.45; }

.theme-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.theme-card {
  position: relative;
  min-height: 96px;
  padding: 13px;
  overflow: hidden;
  border: 2px solid transparent;
  border-radius: var(--field-radius, 14px);
  color: var(--card-ink);
  background: var(--card-bg);
  text-align: left;
  transition: transform .2s var(--ease-out), box-shadow .2s ease, border-color .2s ease;
}

.theme-card::after {
  content: "";
  position: absolute;
  right: -13px;
  bottom: -20px;
  width: 74px;
  height: 74px;
  border: 10px solid var(--card-accent);
  border-radius: 50%;
  opacity: .28;
}

.theme-card:hover { transform: translateY(-3px) rotate(-.4deg); box-shadow: 0 10px 22px rgba(0,0,0,.13); }
.theme-card:active { transform: scale(.97); }
.theme-card.is-selected { border-color: var(--card-accent); }
.theme-card small { display: block; margin-bottom: 7px; color: var(--card-accent); font-size: 7px; font-weight: 850; letter-spacing: .17em; }
.theme-card strong { position: relative; z-index: 1; display: block; font-family: var(--card-font, inherit); font-size: 18px; letter-spacing: -.035em; }
.theme-card span { position: relative; z-index: 1; display: block; max-width: 95px; margin-top: 5px; font-size: 8px; line-height: 1.35; opacity: .72; }

/* 01 — Simple */
body[data-theme="simple"] {
  --ink: #2f2923;
  --muted: #8b7e70;
  --work-accent: #f26a2e;
  --work-soft: #ffeadb;
  --work-bg: #fbf5ea;
  --break-accent: #4f9a78;
  --break-soft: #e1f0e5;
  --break-bg: #f1f7eb;
  --panel: #fffaf2;
  --track: #e8dccd;
  --line: #e4d7c8;
  --line-strong: #d4c3b0;
  --small-shadow: 0 5px 14px rgba(91, 59, 29, .07);
  --active-ink: #fffaf2;
}

/* 02 — Cyber */
body[data-theme="cyber"] {
  color-scheme: dark;
  --ink: #dbffff;
  --muted: #6ea8b5;
  --work-accent: #16f4e2;
  --work-soft: #073a40;
  --work-bg: #07191f;
  --break-accent: #b8ff3e;
  --break-soft: #18351c;
  --break-bg: #0b201b;
  --panel: #0b252c;
  --track: #153c44;
  --line: #1c4650;
  --line-strong: #24717b;
  --small-shadow: 0 5px 18px rgba(0, 0, 0, .27);
  --ring-shadow: 0 0 26px color-mix(in srgb, var(--active) 25%, transparent);
  --face-border: 1px solid color-mix(in srgb, var(--active) 16%, transparent);
  --face-bg: radial-gradient(circle, color-mix(in srgb, var(--active) 7%, transparent), transparent 66%);
  --active-ink: #041518;
  --grain-opacity: .22;
  --display-spacing: .03em;
}

body[data-theme="cyber"] .paper-grain {
  background-image: linear-gradient(color-mix(in srgb, var(--active) 6%, transparent) 1px, transparent 1px), linear-gradient(90deg, color-mix(in srgb, var(--active) 6%, transparent) 1px, transparent 1px);
  background-size: 24px 24px;
}

/* 03 — Retro */
body[data-theme="retro"] {
  --ink: #452d24;
  --muted: #8c6c55;
  --work-accent: #ae462e;
  --work-soft: #f1d2b4;
  --work-bg: #ead9bb;
  --break-accent: #3e7567;
  --break-soft: #c9d8c5;
  --break-bg: #dce3cc;
  --panel: #f3e4c9;
  --track: #cab692;
  --line: #c8ae87;
  --line-strong: #8f7051;
  --display-font: Georgia, serif;
  --display-weight: 700;
  --display-spacing: -.03em;
  --note-font: Georgia, serif;
  --note-style: italic;
  --button-radius: 6px;
  --control-radius: 6px;
  --field-radius: 5px;
  --drawer-radius: 7px;
  --ring-cap: butt;
  --active-ink: #fff3d9;
  --small-shadow: 3px 4px 0 rgba(69, 45, 36, .14);
  --grain-opacity: .24;
}

/* 04 — Craft */
body[data-theme="craft"] {
  color-scheme: dark;
  --ink: #ffe9a8;
  --muted: #c09558;
  --work-accent: #ff7a1a;
  --work-soft: #372312;
  --work-bg: #17130f;
  --break-accent: #f0ce50;
  --break-soft: #353019;
  --break-bg: #1d1c12;
  --panel: #241c13;
  --track: #45301b;
  --line: #51391f;
  --line-strong: #9b672b;
  --button-radius: 3px;
  --control-radius: 3px;
  --field-radius: 2px;
  --drawer-radius: 4px;
  --ring-cap: square;
  --ring-width: 10;
  --face-border: 1px dashed #6f4c26;
  --face-radius: 47%;
  --display-font: "Arial Narrow", "Avenir Next Condensed", sans-serif;
  --display-spacing: .06em;
  --active-ink: #17130f;
  --small-shadow: 4px 4px 0 #050403;
  --grain-opacity: .28;
}

/* 05 — Heritage */
body[data-theme="heritage"] {
  color-scheme: dark;
  --ink: #f0dfb7;
  --muted: #9f9173;
  --work-accent: #f0dfb7;
  --work-soft: #342f27;
  --work-bg: #121211;
  --break-accent: #b9a274;
  --break-soft: #302d27;
  --break-bg: #1b1a17;
  --panel: #1d1c19;
  --track: #39362e;
  --line: #464137;
  --line-strong: #81775f;
  --display-font: Didot, Georgia, serif;
  --display-weight: 650;
  --display-spacing: -.02em;
  --note-font: Georgia, serif;
  --note-style: italic;
  --button-radius: 50%;
  --control-radius: 0;
  --field-radius: 0;
  --drawer-radius: 0;
  --face-border: 1px solid #514a3d;
  --face-shadow: inset 0 0 0 7px #121211, inset 0 0 0 8px #302d26;
  --active-ink: #121211;
  --small-shadow: none;
  --grain-opacity: .18;
}

body[data-theme="heritage"] .brand-block h1 { font-family: Didot, Georgia, serif; text-transform: uppercase; letter-spacing: .06em; }

/* 06 — Raceway */
body[data-theme="raceway"] {
  --ink: #193d33;
  --muted: #816e53;
  --work-accent: #c93425;
  --work-soft: #f0c9ad;
  --work-bg: #ede1c4;
  --break-accent: #176149;
  --break-soft: #c5d5b9;
  --break-bg: #e3e6c7;
  --panel: #f5eacf;
  --track: #d0bd96;
  --line: #cdb78f;
  --line-strong: #8b7959;
  --display-font: "Arial Black", "Avenir Next Condensed", sans-serif;
  --display-weight: 900;
  --display-spacing: -.08em;
  --button-radius: 2px;
  --control-radius: 2px;
  --field-radius: 2px;
  --drawer-radius: 3px;
  --ring-cap: butt;
  --ring-width: 12;
  --active-ink: #fff4d7;
  --small-shadow: 5px 5px 0 rgba(25, 61, 51, .18);
  --grain-opacity: .24;
}

body[data-theme="raceway"] .theme-title strong { text-transform: uppercase; transform: skew(-7deg); }

/* 07 — Calenton */
body[data-theme="calenton"] {
  --ink: #3b110d;
  --muted: #7c2b1e;
  --work-accent: #e92818;
  --work-soft: #ffb41f;
  --work-bg: #efcf24;
  --break-accent: #2a721e;
  --break-soft: #b7e625;
  --break-bg: #cfe830;
  --panel: #ffde35;
  --track: #d29e22;
  --line: #9f3521;
  --line-strong: #511910;
  --display-font: "Arial Black", Impact, sans-serif;
  --display-weight: 900;
  --display-spacing: -.07em;
  --button-radius: 50%;
  --control-radius: 50%;
  --field-radius: 16px;
  --drawer-radius: 26px;
  --ring-cap: round;
  --ring-width: 13;
  --active-ink: #fff232;
  --small-shadow: 3px 4px 0 #571b12;
  --grain-opacity: .2;
}

body[data-theme="calenton"] .timer-face { transform: rotate(-1deg); }

/* 08 — Label */
body[data-theme="label"] {
  --ink: #261c13;
  --muted: #756553;
  --work-accent: #ce3023;
  --work-soft: #e6ed87;
  --work-bg: #f0e8cf;
  --break-accent: #577d32;
  --break-soft: #d9e6a4;
  --break-bg: #e9eccd;
  --panel: #f7efd8;
  --track: #cfc2a2;
  --line: #a99a7a;
  --line-strong: #514332;
  --display-font: "Arial Narrow", "Avenir Next Condensed", sans-serif;
  --display-weight: 850;
  --display-spacing: .02em;
  --button-radius: 1px;
  --control-radius: 1px;
  --field-radius: 1px;
  --drawer-radius: 1px;
  --ring-cap: butt;
  --ring-width: 6;
  --face-border: 1px dashed #8a795f;
  --face-radius: 2px;
  --active-ink: #fff3d8;
  --small-shadow: 2px 3px 0 rgba(38, 28, 19, .22);
  --grain-opacity: .22;
}

body[data-theme="label"] .brand-block h1,
body[data-theme="label"] .theme-title strong { text-transform: uppercase; letter-spacing: .08em; }

/* Larger desktop presentation: the default 680 px window uses this scale. */
@media (min-width: 600px) and (min-height: 800px) {
  :root { --timer-size: 390px; }
  .app-shell { max-width: 680px; padding: 30px 50px 22px; }
  .eyebrow { margin-bottom: 6px; font-size: 11px; }
  .brand-block h1 { font-size: 24px; }
  .icon-button { width: 48px; height: 48px; }
  .icon-button svg { width: 21px; }
  .theme-switcher {
    width: 440px;
    margin-top: 26px;
    grid-template-columns: 56px 1fr 56px;
    gap: 10px;
  }
  .arrow-button { width: 52px; height: 52px; font-size: 42px; }
  .theme-title strong { font-size: 31px; }
  .theme-index { margin-bottom: 3px; font-size: 9px; }
  .theme-dots { margin-top: 7px; }
  .timer-section { min-height: 650px; }
  .timer-wrap { margin-top: 10px; }
  .phase-label { width: 126px; margin-bottom: 5px; gap: 10px; }
  .phase-label b { font-size: 11px; }
  #timeDisplay { font-size: 104px; }
  #phaseNote { max-width: 230px; margin-top: 14px; font-size: 12px; }
  .session-row { width: 380px; margin-top: 14px; margin-bottom: 15px; font-size: 9.5px; }
  .controls { grid-template-columns: repeat(2, 68px); gap: 13px; }
  .control-button { height: 62px; }
  .control-button span { font-size: 27px; }
  .silent-compact { width: 460px; margin-top: 12px; gap: 10px; }
  .silent-toggle { min-height: 40px; padding: 6px 7px 6px 9px; grid-template-columns: 25px auto 41px; gap: 7px; }
  .silent-toggle-icon { width: 23px; height: 23px; font-size: 17px; }
  .silent-toggle > b { font-size: 9px; }
  .silent-toggle-state { padding: 6px 5px; font-size: 8px; }
  .silent-schedule { min-height: 40px; padding-right: 11px; padding-left: 11px; gap: 7px; }
  .silent-schedule > span { font-size: 16px; }
  .silent-schedule b { font-size: 9px; }
  .weather-strip {
    width: 460px;
    min-height: 86px;
    margin-top: 6px;
    margin-bottom: 12px;
    padding: 6px 0;
    grid-template-columns: 105px 1fr;
    gap: 12px;
  }
  .weather-strip-head b { font-size: 16px; }
  .weather-strip-head small { font-size: 10px; }
  .weather-strip-head button { width: 28px; height: 28px; font-size: 17px; }
  .forecast-item span { font-size: 12px; }
  .forecast-item i { height: 32px; font-size: 31px; }
  .forecast-item strong { font-size: 23px; }
  .footer-note { padding-top: 14px; font-size: 8.5px; }
  .drawer { max-width: 650px; padding: 30px; }
  .drawer-header h2 { font-size: 34px; }
}

@media (max-height: 710px) {
  :root { --timer-size: clamp(218px, 50vh, 270px); }
  .app-shell { padding-top: 17px; padding-bottom: 14px; }
  .theme-switcher { margin-top: 12px; }
  .timer-section { min-height: 400px; }
  .timer-wrap { margin-top: 2px; }
  .session-row { margin-top: 8px; margin-bottom: 9px; }
  .control-button { height: 52px; }
  .silent-compact { margin-top: 7px; }
  .silent-toggle, .silent-schedule { min-height: 34px; }
  .weather-strip { min-height: 64px; margin-bottom: 7px; padding-top: 4px; padding-bottom: 4px; }
  .footer-note { padding-top: 8px; }
}

@media (max-height: 610px) {
  :root { --timer-size: 220px; }
  .app-shell { min-height: 610px; }
  .timer-section { min-height: 395px; }
  .footer-note { margin-top: 8px; }
  body { overflow-y: auto; }
}

@media (max-width: 390px) {
  .app-shell { padding-right: 18px; padding-left: 18px; }
  .topbar { gap: 8px; }
  .topbar-actions { gap: 5px; }
  .theme-switcher { width: 300px; }
  .weather-strip { width: 300px; grid-template-columns: 68px 1fr; padding-right: 7px; padding-left: 7px; gap: 5px; }
  .controls { grid-template-columns: repeat(2, 56px); gap: 9px; }
  .silent-compact { width: 300px; }
  .theme-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
.portal-back{position:fixed;z-index:1000;left:14px;bottom:14px;padding:10px 13px;border:1px solid rgba(36,29,24,.3);border-radius:999px;background:rgba(255,250,241,.92);color:#2a211c!important;box-shadow:0 8px 28px rgba(53,31,19,.16);backdrop-filter:blur(10px);font:800 11px/1 system-ui;text-decoration:none;letter-spacing:.05em}.portal-back:hover{transform:translateY(-2px)}
