/* Pomodoro — pomodoro.yany.lol
   Liquid glass: translucent layers, refracted edges, specular highlights. */

:root {
  --accent: #ff5f6d;
  --ink: #f6f7f9;
  --ink-dim: rgba(246, 247, 249, .68);
  --ink-faint: rgba(246, 247, 249, .44);

  /* glass material */
  --glass-blur: 30px;
  --glass-sat: 190%;
  --glass-tint: rgba(255, 255, 255, .10);
  --glass-tint-strong: rgba(255, 255, 255, .17);
  --glass-rim: rgba(255, 255, 255, .14);
  --glass-spec: rgba(255, 255, 255, .38);

  --lift: 0 26px 64px -18px rgba(0, 0, 0, .62), 0 8px 22px -10px rgba(0, 0, 0, .45);
  --lift-sm: 0 10px 26px -12px rgba(0, 0, 0, .55);

  --radius: 30px;
  --spring: cubic-bezier(.34, 1.38, .52, 1);
  --ease: cubic-bezier(.32, .72, 0, 1);

  --bg-image: linear-gradient(160deg, #1f2233 0%, #10121a 55%, #0a0b10 100%);
  --bg-blur: 0px;
  --bg-dim: .35;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI Variable Display", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: #0a0b10;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
}

/* ---------- background layers ---------- */

#bg {
  position: fixed;
  inset: -40px;
  z-index: -2;
  background-image: var(--bg-image);
  background-size: cover;
  background-position: center;
  filter: blur(var(--bg-blur));
  transform: scale(1.04);
  transition: filter .25s ease;
}

#bg-tint {
  position: fixed;
  inset: 0;
  z-index: -1;
  background: radial-gradient(120% 90% at 50% 40%, rgba(0, 0, 0, .12), rgba(0, 0, 0, .55));
  opacity: var(--bg-dim);
  transition: opacity .25s ease;
}

/* ---------- the glass material ----------
   Each surface is a translucent tint over a blurred, saturated backdrop,
   wrapped in a 1px refracted rim and lit by a specular sheen that follows
   the pointer. */

.card, .panel, .icon-btn, .ghost-btn {
  position: relative;
  isolation: isolate;
  background: var(--glass-tint);
  backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-sat));
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-sat));
  border: 0;
  box-shadow:
    inset 0 1px 0 var(--glass-spec),
    inset 0 -1px 0 rgba(255, 255, 255, .08),
    inset 0 0 0 1px var(--glass-rim),
    var(--lift);
}

/* refracted edge: bright where light enters, gone through the middle,
   picking up again on the far side — the giveaway of a real lens */
.card::before, .panel::before, .icon-btn::before, .ghost-btn::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  border-radius: inherit;
  padding: 1.5px;
  pointer-events: none;
  background: linear-gradient(145deg,
    rgba(255, 255, 255, .85) 0%,
    rgba(255, 255, 255, .22) 22%,
    rgba(255, 255, 255, 0) 45%,
    rgba(255, 255, 255, .05) 62%,
    rgba(255, 255, 255, .45) 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
}

/* specular sheen, anchored to the pointer */
.card::after, .panel::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: inherit;
  pointer-events: none;
  background: radial-gradient(520px circle at var(--mx, 50%) var(--my, -10%),
    rgba(255, 255, 255, .16), rgba(255, 255, 255, .04) 42%, transparent 68%);
  transition: opacity .4s var(--ease);
}

/* ---------- top bar ---------- */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px clamp(16px, 4vw, 34px);
  gap: 12px;
}

.brand {
  display: inline-flex;
  align-items: baseline;
  gap: 7px;
  text-decoration: none;
  color: var(--ink);
  font-size: 15px;
  letter-spacing: .01em;
  padding: 6px 4px;
  opacity: .88;
  text-shadow: 0 1px 10px rgba(0, 0, 0, .55);
  transition: opacity .2s var(--ease);
}

.brand:hover { opacity: 1; }

.brand-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 14px var(--accent);
  align-self: center;
}

.brand-name { font-weight: 650; }
.brand-sub { color: var(--ink-faint); font-weight: 500; }

.topbar-actions { display: flex; gap: 9px; }

.icon-btn {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: var(--ink-dim);
  cursor: pointer;
  transition: color .2s var(--ease), transform .35s var(--spring), box-shadow .25s var(--ease);
}

.icon-btn:hover {
  color: var(--ink);
  transform: translateY(-1px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .5),
    inset 0 0 0 1px rgba(255, 255, 255, .2),
    var(--lift);
}

.icon-btn:active { transform: scale(.9); }

.icon-btn[aria-pressed="true"] {
  color: var(--ink);
  background: var(--glass-tint-strong);
}

.icon-btn svg, .ghost-btn svg {
  position: relative;
  z-index: 3;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-btn svg { width: 19px; height: 19px; stroke-width: 1.7; }

/* ---------- stage / card ---------- */

.stage {
  flex: 1;
  display: grid;
  place-items: center;
  padding: 0 16px;
  min-height: 0;
}

.card {
  width: min(452px, 100%);
  padding: 24px clamp(18px, 4vw, 28px) 28px;
  border-radius: var(--radius);
  text-align: center;
}

.card > * { position: relative; z-index: 3; }

/* ---------- mode switcher (sliding liquid pill) ---------- */

.modes {
  position: relative;
  display: flex;
  padding: 4px;
  border-radius: 999px;
  background: rgba(0, 0, 0, .22);
  box-shadow:
    inset 0 1px 2px rgba(0, 0, 0, .35),
    inset 0 0 0 1px rgba(255, 255, 255, .07);
  overflow: hidden;
}

.mode-pill {
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 0;
  z-index: 0;
  border-radius: 999px;
  background: var(--accent);
  background: color-mix(in srgb, var(--accent) 82%, transparent);
  backdrop-filter: blur(6px) saturate(180%);
  -webkit-backdrop-filter: blur(6px) saturate(180%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .55),
    inset 0 0 0 1px color-mix(in srgb, var(--accent) 55%, rgba(255, 255, 255, .5)),
    0 6px 18px -8px var(--accent);
  transform: translateX(var(--pill-x, 0px));
  width: var(--pill-w, 0px);
  transition: transform .5s var(--spring), width .5s var(--spring), background .3s var(--ease);
}

.modes.no-anim .mode-pill, .panel-tabs.no-anim .tab-pill { transition: none; }

.mode {
  position: relative;
  z-index: 1;
  flex: 1;
  padding: 10px 6px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink-dim);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .01em;
  cursor: pointer;
  white-space: nowrap;
  transition: color .3s var(--ease), transform .3s var(--spring);
}

.mode:hover { color: var(--ink); }
.mode:active { transform: scale(.96); }
.mode.is-active { color: #fff; text-shadow: 0 1px 6px rgba(0, 0, 0, .3); }

/* ---------- dial ---------- */

.dial {
  position: relative;
  width: min(300px, 74vw);
  margin: 26px auto 22px;
  aspect-ratio: 1;
}

/* glass lens inside the ring — a breath of light, not a disc */
.dial::before {
  content: "";
  position: absolute;
  inset: 6%;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 26%, rgba(255, 255, 255, .07), rgba(255, 255, 255, .02) 48%, rgba(255, 255, 255, 0) 72%);
}

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

.ring circle {
  fill: none;
  stroke-width: 7;
  stroke-linecap: round;
}

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

/* The bloom is three stacked arcs rather than a drop-shadow: a filter here
   would create a backdrop root and punch a visible rectangle through the
   card's backdrop-filter. Alpha lives in the stroke colour for the same
   reason — opacity < 1 would also break compositing. */
.ring-halo, .ring-halo2, .ring-progress {
  stroke-dasharray: var(--ring-len, 0);
  stroke-dashoffset: var(--ring-off, 0);
  transition: stroke-dashoffset .3s linear, stroke .3s ease;
}

.ring-halo {
  stroke: rgba(255, 255, 255, .1);
  stroke: color-mix(in srgb, var(--accent) 14%, transparent);
  stroke-width: 19;
}

.ring-halo2 {
  stroke: rgba(255, 255, 255, .16);
  stroke: color-mix(in srgb, var(--accent) 26%, transparent);
  stroke-width: 12;
}

.ring-progress {
  stroke: var(--accent);
}

.dial-inner {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.time {
  font-size: clamp(52px, 15vw, 70px);
  font-weight: 250;
  letter-spacing: -.025em;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  text-shadow: 0 2px 18px rgba(0, 0, 0, .3);
}

.phase {
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

/* ---------- controls ---------- */

.controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
}

.start-btn {
  min-width: 176px;
  padding: 16px 34px;
  border: 0;
  border-radius: 999px;
  color: #fff;
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .14em;
  cursor: pointer;
  position: relative;
  isolation: isolate;
  background: var(--accent);
  background: color-mix(in srgb, var(--accent) 80%, transparent);
  backdrop-filter: blur(16px) saturate(190%);
  -webkit-backdrop-filter: blur(16px) saturate(190%);
  text-shadow: 0 1px 8px rgba(0, 0, 0, .28);
  box-shadow:
    inset 0 1.5px 0 rgba(255, 255, 255, .55),
    inset 0 -2px 6px -2px rgba(0, 0, 0, .25),
    inset 0 0 0 1px color-mix(in srgb, var(--accent) 45%, rgba(255, 255, 255, .55)),
    0 14px 30px -12px var(--accent),
    var(--lift-sm);
  transition: transform .4s var(--spring), filter .25s var(--ease), box-shadow .25s var(--ease);
}

.start-btn:hover { filter: brightness(1.09) saturate(1.05); transform: translateY(-1px); }
.start-btn:active { transform: scale(.955) translateY(1px); }

.ghost-btn {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: var(--ink-dim);
  cursor: pointer;
  transition: color .2s var(--ease), transform .35s var(--spring), box-shadow .25s var(--ease);
}

.ghost-btn:hover {
  color: var(--ink);
  transform: translateY(-1px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .5),
    inset 0 0 0 1px rgba(255, 255, 255, .2),
    var(--lift-sm);
}

.ghost-btn:active { transform: scale(.9); }

.ghost-btn svg { width: 17px; height: 17px; stroke-width: 1.8; }

#btn-skip svg path:first-child { fill: currentColor; stroke-width: 1; }

.meta {
  margin-top: 20px;
  font-size: 12.5px;
  color: var(--ink-faint);
  letter-spacing: .02em;
}

.dot-sep { opacity: .5; margin: 0 6px; }

.hint {
  padding: 0 20px 22px;
  text-align: center;
  font-size: 11.5px;
  color: var(--ink-faint);
  letter-spacing: .02em;
  text-shadow: 0 1px 10px rgba(0, 0, 0, .55);
}

kbd {
  font: inherit;
  font-size: 11px;
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .09);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22), inset 0 0 0 1px rgba(255, 255, 255, .12);
  color: var(--ink-dim);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

/* ---------- settings panel ---------- */

.overlay {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: rgba(0, 0, 0, .42);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  animation: fade .3s var(--ease);
}

@keyframes fade { from { opacity: 0; } }

.panel {
  position: fixed;
  top: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 31;
  width: min(392px, calc(100% - 24px));
  display: flex;
  flex-direction: column;
  border-radius: 28px;
  overflow: hidden;
  animation: slide .5s var(--spring);
}

@keyframes slide { from { transform: translateX(28px) scale(.98); opacity: 0; } }

.panel > .panel-head, .panel > .panel-tabs, .panel > .panel-body { position: relative; z-index: 3; }

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 18px 12px;
}

.panel-head h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 650;
  letter-spacing: .01em;
}

.panel-head .icon-btn { width: 34px; height: 34px; }
.panel-head .icon-btn svg { width: 16px; height: 16px; }

.panel-tabs {
  position: relative;
  display: flex;
  margin: 0 18px 4px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(0, 0, 0, .24);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, .32), inset 0 0 0 1px rgba(255, 255, 255, .06);
  overflow: hidden;
}

.tab-pill {
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 0;
  z-index: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, .16);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .4), inset 0 0 0 1px rgba(255, 255, 255, .1);
  backdrop-filter: blur(6px) saturate(160%);
  -webkit-backdrop-filter: blur(6px) saturate(160%);
  transform: translateX(var(--tab-x, 0px));
  width: var(--tab-w, 0px);
  transition: transform .5s var(--spring), width .5s var(--spring);
}

.ptab {
  position: relative;
  z-index: 1;
  flex: 1;
  padding: 9px 4px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink-dim);
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: color .3s var(--ease);
}

.ptab:hover, .ptab.is-active { color: var(--ink); }

.panel-body {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 8px 18px 30px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, .2) transparent;
}

.panel-body::-webkit-scrollbar { width: 8px; }
.panel-body::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .18); border-radius: 8px; }

.ptab-panel { display: none; }
.ptab-panel.is-active { display: block; animation: rise .35s var(--ease); }

@keyframes rise { from { opacity: 0; transform: translateY(6px); } }

.panel h3 {
  margin: 22px 0 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-faint);
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.panel h3 .unit {
  font-size: 10px;
  letter-spacing: .06em;
  text-transform: none;
  opacity: .7;
  font-weight: 500;
}

.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }

.field { display: block; }

.field > span {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  color: var(--ink-dim);
}

.field.row { display: flex; align-items: center; gap: 10px; }
.field.row > span { margin: 0; flex: 1; font-size: 13px; }
.field.row input { width: 84px; }
.field.row input[type="color"] { width: 56px; padding: 3px; height: 36px; }
.field.row .suffix { font-size: 12px; color: var(--ink-faint); }

input[type="number"],
input[type="url"],
input[type="text"],
select {
  width: 100%;
  padding: 11px 13px;
  border-radius: 14px;
  border: 0;
  background: rgba(255, 255, 255, .07);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .16), inset 0 0 0 1px rgba(255, 255, 255, .1);
  backdrop-filter: blur(10px) saturate(150%);
  -webkit-backdrop-filter: blur(10px) saturate(150%);
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  outline: none;
  transition: box-shadow .25s var(--ease), background .25s var(--ease);
}

input:focus, select:focus {
  background: rgba(255, 255, 255, .11);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .22),
    inset 0 0 0 1px color-mix(in srgb, var(--accent) 70%, transparent),
    0 0 0 4px color-mix(in srgb, var(--accent) 22%, transparent);
}

select option { background: #14161e; color: var(--ink); }

input[type="color"] {
  border: 0;
  border-radius: 12px;
  background: rgba(255, 255, 255, .07);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14);
  cursor: pointer;
}

.quick {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  margin-top: 12px;
}

.quick-label {
  font-size: 11px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-right: 2px;
}

.chip {
  position: relative;
  padding: 8px 14px;
  border-radius: 999px;
  border: 0;
  background: rgba(255, 255, 255, .08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .28), inset 0 0 0 1px rgba(255, 255, 255, .12);
  backdrop-filter: blur(12px) saturate(160%);
  -webkit-backdrop-filter: blur(12px) saturate(160%);
  color: var(--ink-dim);
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: color .2s var(--ease), transform .35s var(--spring), box-shadow .25s var(--ease);
}

.chip:hover {
  color: var(--ink);
  transform: translateY(-1px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45), inset 0 0 0 1px rgba(255, 255, 255, .22), var(--lift-sm);
}

.chip:active { transform: scale(.94); }

.chip.solid {
  background: var(--accent);
  background: color-mix(in srgb, var(--accent) 78%, transparent);
  color: #fff;
  box-shadow:
    inset 0 1.5px 0 rgba(255, 255, 255, .5),
    inset 0 0 0 1px color-mix(in srgb, var(--accent) 45%, rgba(255, 255, 255, .5)),
    0 10px 22px -12px var(--accent);
}

.row-gap { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }

.switch {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  font-size: 13.5px;
  color: var(--ink-dim);
  cursor: pointer;
}

.switch input { position: absolute; opacity: 0; pointer-events: none; }

.switch .track {
  flex: none;
  position: relative;
  width: 42px;
  height: 25px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .12);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, .35), inset 0 0 0 1px rgba(255, 255, 255, .08);
  transition: background .35s var(--ease), box-shadow .35s var(--ease);
}

.switch .track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  background: linear-gradient(180deg, #fff, #e9ecf2);
  box-shadow: 0 2px 6px rgba(0, 0, 0, .45), inset 0 1px 0 rgba(255, 255, 255, .9);
  transition: transform .45s var(--spring), width .25s var(--ease);
}

.switch input:checked + .track {
  background: var(--accent);
  background: color-mix(in srgb, var(--accent) 80%, transparent);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .45),
    inset 0 0 0 1px color-mix(in srgb, var(--accent) 50%, rgba(255, 255, 255, .4)),
    0 6px 16px -8px var(--accent);
}

.switch input:checked + .track::after { transform: translateX(17px); }
.switch:active .track::after { width: 23px; }
.switch input:focus-visible + .track { outline: 2px solid var(--accent); outline-offset: 3px; }

.slider { display: block; margin: 14px 0 4px; }

.slider > span {
  display: flex;
  justify-content: space-between;
  font-size: 12.5px;
  color: var(--ink-dim);
  margin-bottom: 9px;
}

.slider i { font-style: normal; color: var(--ink-faint); font-variant-numeric: tabular-nums; }

input[type="range"] {
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .12);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, .35);
  appearance: none;
  -webkit-appearance: none;
  outline: none;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: linear-gradient(180deg, #fff, #e6e9f0);
  box-shadow: 0 2px 8px rgba(0, 0, 0, .5), inset 0 0 0 2px color-mix(in srgb, var(--accent) 85%, transparent);
  cursor: pointer;
}

input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border: 2px solid var(--accent);
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .5);
  cursor: pointer;
}

.preset-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.preset {
  position: relative;
  aspect-ratio: 1;
  border-radius: 16px;
  border: 0;
  cursor: pointer;
  padding: 0;
  overflow: hidden;
  background-size: cover;
  background-position: center;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3), inset 0 0 0 1px rgba(255, 255, 255, .14);
  transition: transform .4s var(--spring), box-shadow .25s var(--ease);
}

.preset:hover { transform: translateY(-3px) scale(1.03); }
.preset:active { transform: scale(.96); }

.preset.is-active {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .5),
    0 0 0 2px color-mix(in srgb, var(--accent) 90%, transparent),
    0 8px 20px -10px var(--accent);
}

.preset span {
  position: absolute;
  inset: auto 0 0 0;
  padding: 14px 4px 5px;
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: .02em;
  color: #fff;
  background: linear-gradient(to top, rgba(0, 0, 0, .72), transparent);
  text-shadow: 0 1px 2px rgba(0, 0, 0, .6);
}

.accent-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.swatch {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 0;
  padding: 0;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5), 0 0 0 1px rgba(255, 255, 255, .18), 0 3px 8px rgba(0, 0, 0, .35);
  transition: transform .35s var(--spring), box-shadow .25s var(--ease);
}

.swatch:hover { transform: scale(1.14); }

.swatch.is-active {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6), 0 0 0 2px #fff, 0 0 0 4px currentColor, 0 4px 12px rgba(0, 0, 0, .4);
}

.note {
  margin: 12px 0 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--ink-faint);
}

.note.warn { color: #ffb4a2; }

.text-btn {
  margin-top: 22px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink-faint);
  font: inherit;
  font-size: 12.5px;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.text-btn:hover { color: var(--ink-dim); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* ---------- toast ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 34px;
  z-index: 50;
  transform: translate(-50%, 14px);
  padding: 11px 18px;
  border-radius: 999px;
  font-size: 13px;
  color: var(--ink);
  background: rgba(255, 255, 255, .1);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .38),
    inset 0 0 0 1px rgba(255, 255, 255, .14),
    var(--lift-sm);
  opacity: 0;
  transition: opacity .35s var(--ease), transform .45s var(--spring);
}

.toast.is-up { opacity: 1; transform: translate(-50%, 0); }

/* ---------- focus mode (fullscreen the timer card only) ---------- */

.zen-exit {
  display: none;
  position: fixed;
  top: max(18px, env(safe-area-inset-top));
  right: max(18px, env(safe-area-inset-right));
  z-index: 5;
}

.card.is-zen {
  width: 100%;
  height: 100%;
  max-width: none;
  padding: 4vmin;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(18px, 4vmin, 46px);
  border-radius: 0;
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow: none;
}

/* fallback when the browser refuses element fullscreen */
.card.is-zen.is-zen-fallback {
  position: fixed;
  inset: 0;
  z-index: 40;
}

/* the page background layers live outside the card, so repaint them here */
.card.is-zen::before {
  content: "";
  position: fixed;
  inset: -40px;
  z-index: 0;
  padding: 0;
  border-radius: 0;
  background: var(--bg-image) center / cover;
  filter: blur(var(--bg-blur));
  -webkit-mask: none;
  mask: none;
}

.card.is-zen::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  border-radius: 0;
  background: radial-gradient(120% 90% at 50% 40%, rgba(0, 0, 0, .12), rgba(0, 0, 0, .55));
  opacity: var(--bg-dim);
}

.card.is-zen > *:not(.zen-exit) { position: relative; z-index: 3; margin: 0; }
.card.is-zen .zen-exit { display: grid; }
.card.is-zen .modes { width: min(430px, 84vw); }
.card.is-zen .dial { width: min(62vh, 78vw); }
.card.is-zen .time { font-size: clamp(56px, 17vmin, 170px); }
.card.is-zen .phase { font-size: clamp(12px, 1.6vmin, 17px); }
.card.is-zen .meta { font-size: clamp(12px, 1.5vmin, 16px); }

@media (max-height: 560px) {
  .card.is-zen { gap: 12px; }
  .card.is-zen .dial { width: min(52vh, 62vw); }
}

/* ---------- fallbacks ---------- */

/* no backdrop-filter (older Firefox): lean on opacity instead of blur */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .card, .icon-btn, .ghost-btn { background: rgba(20, 22, 30, .84); }
  .panel { background: rgba(16, 18, 24, .95); }
  .chip, input[type="number"], input[type="url"], select { background: rgba(255, 255, 255, .14); }
}

/* Apple's own Reduce Transparency setting */
@media (prefers-reduced-transparency: reduce) {
  .card, .panel, .icon-btn, .ghost-btn {
    background: rgba(17, 19, 26, .95);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
  .card::before, .panel::before, .icon-btn::before, .ghost-btn::before,
  .card::after, .panel::after { display: none; }
  .dial::before { backdrop-filter: none; -webkit-backdrop-filter: none; }
}

/* ---------- responsive ---------- */

@media (max-width: 480px) {
  .card { padding: 18px 16px 22px; border-radius: 26px; }
  .dial { margin: 20px auto 18px; }
  .start-btn { min-width: 148px; padding: 15px 26px; }
  .hint { display: none; }
  .preset-grid { grid-template-columns: repeat(3, 1fr); }
  .panel { top: 0; right: 0; bottom: 0; width: 100%; border-radius: 26px 26px 0 0; }
}

@media (max-height: 640px) {
  .dial { width: min(220px, 60vw); margin: 16px auto 14px; }
  .hint { display: none; }
}

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