/* =========================================================
   此刻 · MOMENT
   A quiet timer for the present moment.
   ========================================================= */

:root {
  color-scheme: dark;
  --ui-font: "Manrope", "HarmonyOS Sans SC", "MiSans", "PingFang SC", "Microsoft YaHei", sans-serif;
  --text: #f7f5ef;
  --muted: rgba(247, 245, 239, 0.62);
  --faint: rgba(247, 245, 239, 0.48);
  --line: rgba(255, 255, 255, 0.13);
  --glass: rgba(255, 255, 255, 0.065);
  --glass-hover: rgba(255, 255, 255, 0.11);
  --panel: rgba(11, 15, 22, 0.86);
  --panel-deep: rgba(8, 11, 17, 0.95);
  --clock-color: #f7f3e8;
  --clock-glow: rgba(247, 243, 232, 0.32);
  --clock-stroke: #f7f3e8;
  --clock-gradient: linear-gradient(120deg, #f7f3e8, #f1d6a6);
  --clock-font: "Manrope", "HarmonyOS Sans SC", "MiSans", "PingFang SC", "Microsoft YaHei", sans-serif;
  --clock-weight: 600;
  --clock-factor: 1;
  --clock-scale: 1;
  --progress-accent: #f7f3e8;
  --veil-opacity: 0.3;
  --radius: 16px;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --shadow-panel: -24px 36px 100px rgba(0, 0, 0, 0.48);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  min-width: 300px;
  min-height: 100%;
  background: #071018;
}

body {
  min-height: 100vh;
  min-height: 100svh;
  margin: 0;
  overflow-x: hidden;
  color: var(--text);
  background: #071018;
  font-family: var(--ui-font);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body.drawer-open,
body.overlay-open {
  overflow: hidden;
}

button,
input,
select {
  font: inherit;
  color: inherit;
}

button {
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

button:disabled {
  cursor: not-allowed;
}

a {
  color: inherit;
}

svg {
  display: block;
}

::selection {
  color: #0b1018;
  background: rgba(247, 243, 232, 0.9);
}

:focus-visible {
  outline: 2px solid rgba(247, 243, 232, 0.86);
  outline-offset: 3px;
}

button:focus:not(:focus-visible) {
  outline: none;
}

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

/* ---------------------------------------------------------
   Background
   --------------------------------------------------------- */

.wallpaper {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background:
    radial-gradient(ellipse 80% 80% at 18% 18%, rgba(38, 96, 99, 0.32), transparent 62%),
    radial-gradient(ellipse 70% 80% at 84% 20%, rgba(65, 63, 125, 0.28), transparent 65%),
    linear-gradient(155deg, #071018 0%, #0a1220 52%, #15101f 100%);
}

.bg-layer {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition:
    opacity 1.15s var(--ease-out),
    transform 1.15s var(--ease-out),
    filter 1.15s var(--ease-out);
  will-change: opacity, transform, filter;
}

.bg-layer.is-active {
  opacity: 1;
}

body[data-bg-transition="slide"] .bg-layer {
  transform: translate3d(3%, 0, 0);
}

body[data-bg-transition="slide"] .bg-layer.is-active {
  transform: translate3d(0, 0, 0);
}

body[data-bg-transition="zoom"] .bg-layer {
  transform: scale(1.045);
}

body[data-bg-transition="zoom"] .bg-layer.is-active {
  transform: scale(1);
}

body[data-bg-transition="blur"] .bg-layer {
  filter: blur(9px);
}

body[data-bg-transition="blur"] .bg-layer.is-active {
  filter: blur(0);
}

.bg-canvas {
  position: absolute;
  inset: -4%;
  background-position: center center;
  background-repeat: no-repeat;
  background-size: cover;
  transform: scale(1.035) translate3d(-0.3%, -0.2%, 0);
  animation: wallpaperDrift 52s ease-in-out infinite alternate;
  will-change: transform;
}

.bg-layer[data-kind="photo"] .bg-canvas {
  filter: saturate(1.02) contrast(1.01);
}

.bg-scrim {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(3, 6, 11, 0.62) 0%, rgba(3, 6, 11, 0.04) 24%, rgba(3, 6, 11, 0.05) 52%, rgba(3, 6, 11, 0.62) 100%),
    radial-gradient(ellipse 80% 70% at 50% 44%, transparent 20%, rgba(3, 6, 11, 0.25) 100%);
}

.bg-veil {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: #020509;
  opacity: var(--veil-opacity);
  transition: opacity 0.35s ease;
}

.bg-grain {
  position: absolute;
  inset: -20%;
  pointer-events: none;
  opacity: 0.045;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.9'/%3E%3C/svg%3E");
  background-size: 190px 190px;
  mix-blend-mode: soft-light;
}

@keyframes wallpaperDrift {
  0% {
    transform: scale(1.035) translate3d(-0.35%, -0.25%, 0);
  }
  100% {
    transform: scale(1.105) translate3d(0.45%, 0.4%, 0);
  }
}

body.no-motion .bg-canvas,
body.no-motion .bg-grain {
  animation: none;
}

.finish-flash {
  position: fixed;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  background: radial-gradient(circle at 50% 47%, rgba(255, 253, 244, 0.2), transparent 55%);
  opacity: 0;
}

body.is-finished .finish-flash {
  animation: finishFlash 1.3s ease-out 1;
}

@keyframes finishFlash {
  0% { opacity: 0; }
  18% { opacity: 0.74; }
  100% { opacity: 0; }
}

/* ---------------------------------------------------------
   App shell
   --------------------------------------------------------- */

.app {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  width: 100%;
  min-height: 100vh;
  min-height: 100svh;
  padding:
    max(24px, env(safe-area-inset-top))
    clamp(18px, 4vw, 58px)
    max(20px, env(safe-area-inset-bottom));
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  width: 100%;
  max-width: 1600px;
  margin: 0 auto;
  animation: uiEnter 0.8s 0.05s var(--ease-out) both;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  display: grid;
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.065);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 14px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.09);
  backdrop-filter: blur(22px) saturate(130%);
  -webkit-backdrop-filter: blur(22px) saturate(130%);
  place-items: center;
}

.brand-mark svg {
  width: 23px;
  height: 23px;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
}

.brand-line {
  display: flex;
  align-items: baseline;
  gap: 7px;
  min-width: 0;
  white-space: nowrap;
}

.brand-name {
  font-size: 16px;
  font-weight: 650;
  letter-spacing: 0.14em;
}

.brand-en {
  color: var(--faint);
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.25em;
}

.brand-date {
  display: inline-block;
  max-width: 176px;
  margin-left: 3px;
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  font-weight: 450;
  letter-spacing: 0.055em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.standard-time {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  margin-top: 1px;
  padding: 2px 7px 2px 6px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.038);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 8px;
  font-size: 9px;
  line-height: 1.35;
  white-space: nowrap;
  transition: background 0.25s ease, border-color 0.25s ease, transform 0.25s var(--ease-out);
}

.standard-time:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.18);
  transform: translateY(-1px);
}

.standard-time-clock {
  color: var(--text);
  font-family: "Manrope", "Cascadia Mono", "Consolas", var(--ui-font);
  font-size: 11px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.035em;
}

.standard-time-label {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--faint);
  font-size: 8px;
  font-weight: 500;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.standard-time-expand {
  width: 10px;
  height: 10px;
  color: var(--faint);
  opacity: 0.7;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.standard-time:hover .standard-time-expand {
  opacity: 1;
  transform: translate(1px, -1px);
}

.sync-dot {
  display: block;
  flex: 0 0 auto;
  width: 4px;
  height: 4px;
  background: #9aa5b2;
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.035);
  transition: background 0.25s ease, box-shadow 0.25s ease;
}

.sync-dot[data-state="synced"] {
  background: #b9f5d9;
  box-shadow: 0 0 0 3px rgba(185, 245, 217, 0.07), 0 0 8px rgba(185, 245, 217, 0.36);
}

.sync-dot[data-state="stale"] {
  background: #ffdba1;
  box-shadow: 0 0 0 3px rgba(255, 219, 161, 0.06), 0 0 8px rgba(255, 219, 161, 0.26);
}

.sync-dot[data-state="syncing"] {
  background: #a9d4ff;
  animation: statusPulse 1.6s ease-in-out infinite;
}

.sync-dot[data-state="local"] {
  background: #ffb6a4;
  box-shadow: 0 0 0 3px rgba(255, 182, 164, 0.06);
}

.top-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
}

.weather-chip {
  display: flex;
  align-items: center;
  gap: 5px;
  height: 40px;
  padding: 0 11px 0 9px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  backdrop-filter: blur(20px) saturate(130%);
  -webkit-backdrop-filter: blur(20px) saturate(130%);
  transition: background 0.25s ease, border-color 0.25s ease, transform 0.25s var(--ease-out);
}

.weather-chip:hover {
  background: rgba(255, 255, 255, 0.105);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

.weather-chip-icon {
  display: grid;
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  color: #b9d8ff;
  place-items: center;
}

.weather-chip-icon svg {
  width: 18px;
  height: 18px;
}

.weather-chip-icon[data-tone="sun"] { color: #ffd28f; }
.weather-chip-icon[data-tone="moon"] { color: #c7b7ff; }
.weather-chip-icon[data-tone="rain"] { color: #a9d4ff; }
.weather-chip-icon[data-tone="storm"] { color: #c7b7ff; }
.weather-chip-icon[data-tone="snow"] { color: #dcecff; }
.weather-chip-icon[data-tone="fog"] { color: #cbd2da; }
.weather-chip-icon[data-tone="cloud"] { color: #cbd5e2; }

.weather-chip-temp {
  color: var(--text);
  font-family: var(--ui-font);
  font-size: 11px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
}

.mini-icon:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.mini-icon.is-spinning svg,
.mini-icon.is-locating svg {
  animation: spin 0.9s linear infinite;
}

.weather-chip-city {
  max-width: 54px;
  overflow: hidden;
  color: var(--muted);
  font-size: 8px;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.icon-btn {
  display: grid;
  width: 40px;
  height: 40px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  backdrop-filter: blur(20px) saturate(130%);
  -webkit-backdrop-filter: blur(20px) saturate(130%);
  transition: color 0.25s ease, background 0.25s ease, border-color 0.25s ease, transform 0.25s var(--ease-out);
  place-items: center;
}

.icon-btn:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.105);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

.icon-btn svg {
  width: 18px;
  height: 18px;
}

.sound-on {
  display: block;
}

.sound-off {
  display: none;
}

.sound-btn {
  position: relative;
}

#soundBtn[data-muted="true"] .sound-on {
  display: none;
}

#soundBtn[data-muted="true"] .sound-off {
  display: block;
  color: #ffc3b3;
}

#soundBtn[data-noise-playing="true"]::after {
  position: absolute;
  top: 15%;
  right: 15%;
  width: 5px;
  height: 5px;
  content: "";
  background: #b9f5d9;
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(4, 8, 13, 0.45), 0 0 8px rgba(185, 245, 217, 0.7);
  pointer-events: none;
  animation: statusPulse 1.7s ease-in-out infinite;
}

#fullscreenBtn .icon-collapse {
  display: none;
}

body.is-fullscreen #fullscreenBtn .icon-expand {
  display: none;
}

body.is-fullscreen #fullscreenBtn .icon-collapse {
  display: block;
}

.personalize {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 15px 0 13px;
  color: rgba(247, 245, 239, 0.82);
  font-size: 11px;
  font-weight: 550;
  letter-spacing: 0.06em;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(22px) saturate(130%);
  -webkit-backdrop-filter: blur(22px) saturate(130%);
  transition: background 0.25s ease, border-color 0.25s ease, color 0.25s ease, transform 0.25s var(--ease-out);
}

.personalize:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.22);
  transform: translateY(-1px);
}

.personalize[aria-expanded="true"] {
  color: #0b1018;
  background: var(--text);
  border-color: var(--text);
}

.personalize svg {
  width: 16px;
  height: 16px;
}

/* ---------------------------------------------------------
   Main timer
   --------------------------------------------------------- */

.timer-area {
  display: flex;
  flex: 1 0 auto;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: clamp(32px, 6vh, 70px) 0 clamp(22px, 4vh, 44px);
}

.mode-switch {
  position: relative;
  display: flex;
  flex: 0 0 auto;
  width: min(360px, calc(100vw - 40px));
  padding: 4px;
  background: rgba(8, 12, 18, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 999px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(24px) saturate(140%);
  -webkit-backdrop-filter: blur(24px) saturate(140%);
  animation: uiEnter 0.8s 0.1s var(--ease-out) both;
}

.mode-glider {
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 4px;
  width: calc((100% - 8px) / 3);
  background: rgba(247, 243, 232, 0.93);
  border-radius: 999px;
  box-shadow: 0 5px 18px rgba(0, 0, 0, 0.18), inset 0 -1px 0 rgba(0, 0, 0, 0.1);
  transition: transform 0.48s var(--ease-out);
}

.mode-switch[data-active="countdown"] .mode-glider {
  transform: translateX(100%);
}

.mode-switch[data-active="pomodoro"] .mode-glider {
  transform: translateX(200%);
}

.mode-btn {
  position: relative;
  z-index: 1;
  flex: 1 1 33.333%;
  height: 36px;
  color: rgba(247, 245, 239, 0.54);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  border-radius: 999px;
  transition: color 0.32s ease;
}

.mode-btn:hover {
  color: rgba(247, 245, 239, 0.82);
}

.mode-btn.is-active {
  color: #0b1018;
}

.mode-btn.is-active:hover {
  color: #0b1018;
}

/* Countdown setup */

.duration-setup {
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  align-items: center;
  gap: 13px;
  margin-top: 22px;
  animation: setupIn 0.45s var(--ease-out) both;
}

.duration-row {
  display: flex;
  align-items: center;
  gap: 9px;
  transition: transform 0.2s ease;
}

.duration-field {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  padding: 8px 13px 7px;
  background: rgba(8, 12, 18, 0.38);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  backdrop-filter: blur(22px) saturate(140%);
  -webkit-backdrop-filter: blur(22px) saturate(140%);
  transition: background 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.duration-field:hover {
  background: rgba(12, 18, 26, 0.48);
  border-color: rgba(255, 255, 255, 0.18);
}

.duration-field:focus-within {
  background: rgba(12, 18, 26, 0.58);
  border-color: rgba(255, 255, 255, 0.34);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.045);
}

.duration-field input {
  width: 64px;
  padding: 0;
  color: var(--text);
  font-family: var(--ui-font);
  font-size: 26px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  line-height: 1.22;
  text-align: center;
  background: transparent;
  border: 0;
  outline: none;
  appearance: textfield;
  -moz-appearance: textfield;
}

.duration-field input::-webkit-outer-spin-button,
.duration-field input::-webkit-inner-spin-button {
  margin: 0;
  appearance: none;
  -webkit-appearance: none;
}

.duration-field input::selection {
  color: #0b1018;
  background: var(--text);
}

.duration-field span {
  color: var(--faint);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.18em;
  transform: translateX(0.1em);
}

.duration-colon {
  color: rgba(255, 255, 255, 0.3);
  font-size: 19px;
  font-weight: 300;
  line-height: 1;
  transform: translateY(-5px);
}

.duration-row.is-invalid {
  animation: shake 0.42s ease;
}

.duration-setup.is-invalid .duration-field {
  border-color: rgba(255, 145, 122, 0.65);
}

.preset-times {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.preset-time {
  padding: 6px 10px;
  color: rgba(247, 245, 239, 0.48);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.035em;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid transparent;
  border-radius: 999px;
  transition: color 0.22s ease, background 0.22s ease, border-color 0.22s ease;
}

.preset-time:hover {
  color: rgba(247, 245, 239, 0.82);
  background: rgba(255, 255, 255, 0.075);
}

.preset-time.is-active {
  color: rgba(247, 245, 239, 0.9);
  background: rgba(255, 255, 255, 0.075);
  border-color: rgba(255, 255, 255, 0.18);
}

/* Pomodoro */

.pomodoro-setup {
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  align-items: center;
  gap: 9px;
  width: 100%;
  margin-top: 20px;
  animation: setupIn 0.45s var(--ease-out) both;
}

.pomodoro-phases {
  display: flex;
  width: min(360px, 100%);
  gap: 5px;
  padding: 4px;
  background: rgba(8, 12, 18, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  backdrop-filter: blur(20px) saturate(130%);
  -webkit-backdrop-filter: blur(20px) saturate(130%);
}

.pomodoro-phase {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  min-width: 0;
  padding: 6px 8px;
  color: rgba(247, 245, 239, 0.46);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 10px;
  transition: color 0.24s ease, background 0.24s ease, border-color 0.24s ease;
}

.pomodoro-phase:hover {
  color: rgba(247, 245, 239, 0.82);
  background: rgba(255, 255, 255, 0.045);
}

.pomodoro-phase.is-active {
  color: var(--text);
  background: rgba(255, 255, 255, 0.085);
  border-color: rgba(255, 255, 255, 0.17);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.pomodoro-phase span {
  overflow: hidden;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pomodoro-phase small {
  color: var(--faint);
  font-size: 9px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

.pomodoro-phase.is-active small {
  color: rgba(247, 245, 239, 0.56);
}

.pomodoro-lengths {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: min(390px, 100%);
}

.pomodoro-length {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  color: var(--faint);
  font-size: 9px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 9px;
  transition: border-color 0.22s ease, background 0.22s ease;
}

.pomodoro-length:focus-within {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.22);
}

.pomodoro-length-input {
  display: inline-flex;
  align-items: baseline;
  gap: 3px;
  color: var(--faint);
}

.pomodoro-length-input input {
  width: 40px;
  padding: 1px 2px;
  color: var(--text);
  font-family: var(--ui-font);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  text-align: center;
  background: transparent;
  border: 0;
  outline: none;
  appearance: textfield;
  -moz-appearance: textfield;
}

.pomodoro-length-input input::-webkit-outer-spin-button,
.pomodoro-length-input input::-webkit-inner-spin-button {
  margin: 0;
  appearance: none;
  -webkit-appearance: none;
}

.pomodoro-auto-row {
  padding: 2px 4px;
  margin: -2px -4px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.22s ease;
}

.pomodoro-auto-row:hover {
  background: rgba(255, 255, 255, 0.045);
}

.pomodoro-auto-state {
  padding: 1px 5px;
  color: var(--faint);
  font-size: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  transition: color 0.22s ease, background 0.22s ease, border-color 0.22s ease;
}

.pomodoro-auto-row[data-enabled="true"] .pomodoro-auto-state {
  color: #b9f5d9;
  background: rgba(185, 245, 217, 0.06);
  border-color: rgba(185, 245, 217, 0.22);
}

.pomodoro-config {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px 18px;
  width: min(390px, 100%);
  color: var(--faint);
  font-size: 9px;
}

.pomodoro-rounds {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.pomodoro-dots {
  display: flex;
  flex: 0 0 auto;
  gap: 4px;
}

.round-dot {
  display: block;
  width: 7px;
  height: 7px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: 50%;
  transition: background 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.round-dot.is-done {
  background: #ffb29f;
  border-color: #ffb29f;
  box-shadow: 0 0 8px rgba(255, 178, 159, 0.36);
}

.pomodoro-round-text {
  overflow: hidden;
  color: var(--faint);
  font-size: 9px;
  letter-spacing: 0.02em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pomodoro-auto-row {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.pomodoro-auto-row .switch {
  width: 36px;
  height: 22px;
}

.pomodoro-auto-row .switch::after {
  top: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
}

.pomodoro-auto-row .switch[aria-checked="true"]::after {
  transform: translateX(14px);
}

/* Clock */

.clock-stage {
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  align-items: center;
  width: 100%;
  margin-top: clamp(28px, 4.5vh, 44px);
  animation: uiEnter 0.9s 0.16s var(--ease-out) both;
}

.duration-setup:not([hidden]) ~ .clock-stage,
.pomodoro-setup:not([hidden]) ~ .clock-stage {
  margin-top: clamp(18px, 2.8vh, 28px);
}

.clock-display {
  display: flex;
  align-items: baseline;
  justify-content: center;
  width: 100%;
  color: var(--clock-color);
  font-family: var(--clock-font);
  font-size: calc(clamp(3.5rem, 11.3vw, 12.6rem) * var(--clock-scale) * var(--clock-factor));
  font-weight: var(--clock-weight);
  font-variant-numeric: tabular-nums lining-nums;
  font-feature-settings: "tnum" 1, "lnum" 1;
  line-height: 0.92;
  letter-spacing: -0.045em;
  text-align: center;
  white-space: nowrap;
  user-select: none;
  transition: color 0.35s ease, text-shadow 0.35s ease;
}

.clock-display .unit {
  display: inline-block;
  width: 2ch;
  text-align: center;
}

.clock-display .colon {
  display: inline-block;
  padding: 0 0.015em;
  opacity: 0.5;
  font-weight: inherit;
  transform: translateY(-0.035em);
}

.clock-display .centi {
  display: inline-block;
  margin-left: 0.11em;
  opacity: 0.5;
  font-size: 0.255em;
  font-weight: 500;
  letter-spacing: 0;
  transform: translateY(-0.12em);
}

.clock-display.is-centi-hidden .centi {
  display: none;
}

.clock-display.is-gradient .unit,
.clock-display.is-gradient .centi {
  background-image: var(--clock-gradient);
  background-size: 100% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}

.clock-display.is-gradient .colon {
  color: var(--clock-color);
}

/* Font effects */

body[data-effect="glow"] .clock-display {
  text-shadow:
    0 2px 18px rgba(0, 0, 0, 0.26),
    0 0 clamp(14px, 1.5vw, 28px) var(--clock-glow),
    0 0 clamp(40px, 4.5vw, 90px) var(--clock-glow);
}

body[data-effect="soft"] .clock-display {
  text-shadow: 0 16px 48px rgba(0, 0, 0, 0.35);
}

body[data-effect="outline"] .clock-display {
  color: transparent;
  -webkit-text-fill-color: transparent;
  -webkit-text-stroke: clamp(1px, 0.012em, 2.6px) var(--clock-stroke);
  text-shadow: none;
}

body[data-effect="outline"] .clock-display .colon {
  opacity: 0.68;
  color: transparent;
  -webkit-text-fill-color: transparent;
  -webkit-text-stroke-width: clamp(1px, 0.007em, 1.6px);
}

body[data-effect="outline"] .clock-display .centi {
  opacity: 0.72;
}

body[data-effect="outline"] .clock-display.is-gradient .unit,
body[data-effect="outline"] .clock-display.is-gradient .centi {
  background-image: none;
  color: transparent;
  -webkit-text-fill-color: transparent;
  -webkit-text-stroke-color: var(--clock-stroke);
}

body[data-effect="glow"] .clock-display.is-gradient {
  text-shadow: none;
}

body[data-effect="glow"] .clock-display.is-gradient .unit,
body[data-effect="glow"] .clock-display.is-gradient .centi {
  filter:
    drop-shadow(0 5px 18px rgba(0, 0, 0, 0.24))
    drop-shadow(0 0 18px var(--clock-glow));
}

body[data-effect="soft"] .clock-display.is-gradient {
  text-shadow: none;
}

body[data-effect="soft"] .clock-display.is-gradient .unit,
body[data-effect="soft"] .clock-display.is-gradient .centi {
  filter: drop-shadow(0 16px 22px rgba(0, 0, 0, 0.32));
}

body.is-finished .clock-display {
  animation: clockFinished 1.6s var(--ease-out) 1;
}

@keyframes clockFinished {
  0% { transform: scale(1); }
  32% { transform: scale(1.025); }
  100% { transform: scale(1); }
}

/* Progress */

.progress-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  width: min(390px, 65vw);
  margin-top: clamp(20px, 3vh, 30px);
}

.progress-track {
  position: relative;
  flex: 1;
  height: 3px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.13);
  border-radius: 999px;
}

.progress-fill {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--progress-accent);
  border-radius: inherit;
  box-shadow: 0 0 16px var(--progress-accent);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.08s linear, background-color 0.35s ease;
}

.progress-value {
  flex: 0 0 31px;
  color: var(--faint);
  font-size: 9px;
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-align: right;
}

.status-line {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 20px;
  margin: clamp(16px, 2.4vh, 22px) 0 0;
  padding: 0 10px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 450;
  letter-spacing: 0.055em;
  line-height: 1.5;
  text-align: center;
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.35);
}

.status-dot {
  display: block;
  flex: 0 0 auto;
  width: 5px;
  height: 5px;
  background: rgba(255, 255, 255, 0.32);
  border-radius: 50%;
  transition: background 0.3s ease, box-shadow 0.3s ease;
}

body[data-phase="running"] .status-dot {
  background: #b9f5d9;
  box-shadow: 0 0 0 4px rgba(185, 245, 217, 0.08), 0 0 12px rgba(185, 245, 217, 0.5);
  animation: statusPulse 2.4s ease-in-out infinite;
}

body[data-phase="paused"] .status-dot {
  background: #ffdba1;
  box-shadow: 0 0 10px rgba(255, 219, 161, 0.35);
}

body[data-phase="finished"] .status-dot {
  background: #ffb29f;
  box-shadow: 0 0 14px rgba(255, 178, 159, 0.45);
}

body[data-mode="pomodoro"][data-phase="running"] .status-dot {
  background: #ffb29f;
  box-shadow: 0 0 0 4px rgba(255, 178, 159, 0.06), 0 0 12px rgba(255, 178, 159, 0.42);
}

body[data-mode="pomodoro"][data-pomodoro-phase="shortBreak"][data-phase="running"] .status-dot,
body[data-mode="pomodoro"][data-pomodoro-phase="longBreak"][data-phase="running"] .status-dot {
  background: #b9f5d9;
  box-shadow: 0 0 0 4px rgba(185, 245, 217, 0.08), 0 0 12px rgba(185, 245, 217, 0.5);
}

@keyframes statusPulse {
  0%, 100% { opacity: 0.66; }
  50% { opacity: 1; }
}

/* Controls */

.controls {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 17px;
  margin-top: clamp(26px, 4vh, 38px);
  animation: uiEnter 0.9s 0.24s var(--ease-out) both;
}

.control-btn {
  position: relative;
  display: grid;
  width: 54px;
  height: 54px;
  color: rgba(247, 245, 239, 0.82);
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 50%;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(22px) saturate(140%);
  -webkit-backdrop-filter: blur(22px) saturate(140%);
  transition: color 0.25s ease, background 0.25s ease, border-color 0.25s ease, transform 0.25s var(--ease-out), opacity 0.25s ease;
  place-items: center;
}

.control-btn svg {
  width: 19px;
  height: 19px;
}

.control-btn:hover:not(:disabled) {
  color: var(--text);
  background: rgba(255, 255, 255, 0.105);
  border-color: rgba(255, 255, 255, 0.24);
  transform: translateY(-2px);
}

.control-btn:active:not(:disabled) {
  transform: translateY(0) scale(0.96);
}

.control-btn:disabled {
  opacity: 0.26;
}

.btn-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-width: 172px;
  height: 58px;
  padding: 0 25px;
  color: #0b1018;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  background: #f6f2e8;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 999px;
  box-shadow:
    0 14px 38px rgba(0, 0, 0, 0.22),
    0 0 0 1px rgba(255, 255, 255, 0.05),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  transition: background 0.25s ease, transform 0.25s var(--ease-out), box-shadow 0.25s ease;
}

.btn-primary:hover {
  background: #fffdf7;
  box-shadow:
    0 18px 45px rgba(0, 0, 0, 0.28),
    0 0 0 1px rgba(255, 255, 255, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  transform: translateY(-2px);
}

.btn-primary:active {
  transform: translateY(0) scale(0.98);
}

.btn-primary.is-paused {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.18);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.btn-primary.is-paused:hover {
  background: rgba(255, 255, 255, 0.16);
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.28);
}

.btn-icon {
  display: grid;
  width: 17px;
  height: 17px;
  place-items: center;
}

.btn-icon svg {
  width: 17px;
  height: 17px;
}

.alt-icon {
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
}

.alt-icon svg {
  width: 20px;
  height: 20px;
}

.alt-icon .plus-one {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.alt-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  display: grid;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  color: #0b1018;
  font-size: 8px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  background: var(--text);
  border-radius: 999px;
  place-items: center;
}

.control-hint {
  margin: 14px 0 0;
  color: rgba(247, 245, 239, 0.38);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-align: center;
  line-height: 1.8;
}

.control-hint span {
  padding: 0 4px;
}

/* Laps */

.laps-panel {
  width: min(430px, 100%);
  max-height: 230px;
  margin-top: 22px;
  padding: 12px 16px 10px;
  background: rgba(8, 12, 18, 0.32);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 18px;
  backdrop-filter: blur(24px) saturate(140%);
  -webkit-backdrop-filter: blur(24px) saturate(140%);
  animation: setupIn 0.34s var(--ease-out) both;
}

.laps-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 7px;
}

.laps-title {
  color: var(--muted);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.12em;
}

.text-btn {
  padding: 4px 6px;
  margin: -4px -6px;
  color: var(--faint);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.04em;
  transition: color 0.22s ease;
}

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

.laps-list {
  max-height: 164px;
  padding: 0;
  margin: 0;
  overflow-y: auto;
  list-style: none;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.laps-list li {
  display: grid;
  grid-template-columns: 34px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 7px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.065);
  font-variant-numeric: tabular-nums;
}

.laps-list li:first-child {
  border-top-color: rgba(255, 255, 255, 0.1);
}

.lap-no {
  color: var(--faint);
  font-size: 8px;
  letter-spacing: 0.08em;
}

.lap-total {
  color: var(--text);
  font-family: "JetBrains Mono", "Cascadia Mono", "Consolas", monospace;
  font-size: 12px;
  font-weight: 400;
  letter-spacing: -0.02em;
}

.lap-split {
  color: var(--muted);
  font-family: "JetBrains Mono", "Cascadia Mono", "Consolas", monospace;
  font-size: 10px;
  letter-spacing: -0.02em;
}

/* Quote */

.quote-card {
  position: relative;
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  align-items: center;
  width: min(720px, 100%);
  margin: 30px auto 0;
  padding: 20px 30px 2px;
  text-align: center;
  border-top: 1px solid rgba(255, 255, 255, 0.09);
}

.quote-glyph {
  position: absolute;
  top: 5px;
  left: 8px;
  color: rgba(247, 245, 239, 0.28);
  font-family: "Playfair Display", "Noto Serif SC", "Songti SC", serif;
  font-size: 42px;
  line-height: 1;
  pointer-events: none;
}

.quote-text {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 660px;
  min-height: 3.7em;
  margin: 0;
  color: var(--text);
  font-family: "Noto Serif SC", "Songti SC", "SimSun", "Playfair Display", serif;
  font-size: clamp(15px, 1.4vw, 19px);
  font-weight: 400;
  line-height: 1.9;
  letter-spacing: 0.025em;
  text-wrap: balance;
  text-shadow: 0 1px 18px rgba(0, 0, 0, 0.18);
}

.quote-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px 10px;
  margin-top: 9px;
  color: var(--muted);
  font-size: 10px;
}

.quote-author {
  letter-spacing: 0.04em;
}

.quote-theme-tag {
  padding: 2px 7px;
  color: var(--faint);
  font-size: 8px;
  letter-spacing: 0.08em;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 999px;
}

.quote-actions {
  display: inline-flex;
  gap: 4px;
  margin-left: 2px;
}

.quote-action {
  display: grid;
  width: 32px;
  height: 32px;
  color: var(--faint);
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 50%;
  place-items: center;
  transition: color 0.22s ease, background 0.22s ease, border-color 0.22s ease, transform 0.22s var(--ease-out);
}

.quote-action svg {
  width: 13px;
  height: 13px;
}

.quote-action:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.085);
  border-color: rgba(255, 255, 255, 0.18);
  transform: translateY(-1px);
}

.quote-card.is-changing .quote-text,
.quote-card.is-changing .quote-meta {
  animation: quoteChange 0.52s var(--ease-out) both;
}

@keyframes quoteChange {
  from {
    opacity: 0;
    transform: translateY(5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Footer */

.page-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  width: 100%;
  max-width: 1600px;
  margin: 0 auto;
  color: var(--faint);
  font-size: 9px;
  letter-spacing: 0.035em;
  animation: uiEnter 0.8s 0.3s var(--ease-out) both;
}

.credit {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.credit-dot {
  display: block;
  flex: 0 0 auto;
  width: 5px;
  height: 5px;
  background: rgba(255, 255, 255, 0.42);
  border-radius: 50%;
}

.credit-dot.is-bing {
  background: linear-gradient(135deg, #58e0c0, #7ba8ff 55%, #d896ff);
  box-shadow: 0 0 8px rgba(123, 168, 255, 0.4);
}

#bgCredit {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.footer-note {
  flex: 0 0 auto;
  color: rgba(247, 245, 239, 0.38);
}

/* ---------------------------------------------------------
   Drawer
   --------------------------------------------------------- */

.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(3, 6, 10, 0.38);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.38s ease;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.drawer-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

.settings-drawer {
  position: fixed;
  z-index: 50;
  top: max(14px, env(safe-area-inset-top));
  right: max(14px, env(safe-area-inset-right));
  bottom: max(14px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  width: min(430px, calc(100vw - 28px));
  overflow: hidden;
  visibility: hidden;
  opacity: 0;
  background:
    linear-gradient(180deg, rgba(18, 24, 34, 0.91) 0%, rgba(10, 14, 21, 0.94) 100%);
  border: 1px solid rgba(255, 255, 255, 0.155);
  border-radius: 26px;
  box-shadow: var(--shadow-panel), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(42px) saturate(140%);
  -webkit-backdrop-filter: blur(42px) saturate(140%);
  transform: translateX(calc(100% + 32px));
  transition:
    transform 0.56s var(--ease-out),
    opacity 0.35s ease,
    visibility 0s linear 0.56s;
}

.settings-drawer.is-open {
  visibility: visible;
  opacity: 1;
  transform: translateX(0);
  transition:
    transform 0.56s var(--ease-out),
    opacity 0.35s ease,
    visibility 0s linear 0s;
}

.drawer-head {
  display: flex;
  flex: 0 0 auto;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 24px 24px 17px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.drawer-heading {
  min-width: 0;
}

.eyebrow {
  margin: 0 0 6px;
  color: rgba(247, 245, 239, 0.44);
  font-size: 9px;
  font-weight: 650;
  letter-spacing: 0.26em;
}

.drawer-heading h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 550;
  letter-spacing: 0.02em;
  line-height: 1.25;
}

.drawer-close {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
}

.drawer-close svg {
  width: 16px;
  height: 16px;
}

.panel-tabs {
  display: flex;
  flex: 0 0 auto;
  gap: 4px;
  margin: 15px 20px 0;
  padding: 4px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.075);
  border-radius: 13px;
}

.panel-tab {
  flex: 1;
  height: 33px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 550;
  letter-spacing: 0.06em;
  border-radius: 9px;
  transition: color 0.22s ease, background 0.22s ease, box-shadow 0.22s ease;
}

.panel-tab:hover {
  color: var(--text);
}

.panel-tab.is-active {
  color: var(--text);
  background: rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.drawer-scroll {
  flex: 1 1 auto;
  padding: 0 24px 26px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.drawer-scroll::-webkit-scrollbar,
.laps-list::-webkit-scrollbar {
  width: 6px;
}

.drawer-scroll::-webkit-scrollbar-track,
.laps-list::-webkit-scrollbar-track {
  background: transparent;
}

.drawer-scroll::-webkit-scrollbar-thumb,
.laps-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.16);
  border-radius: 999px;
}

.panel-page {
  animation: panelIn 0.3s var(--ease-out) both;
}

.panel-section {
  padding: 18px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.065);
}

.panel-section:first-child {
  border-top: 0;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 20px;
  margin-bottom: 12px;
}

.heading-line {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.section-heading h3 {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.035em;
}

.section-note {
  overflow: hidden;
  color: var(--faint);
  font-size: 9px;
  font-weight: 450;
  letter-spacing: 0.03em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.section-desc {
  margin: -2px 0 11px;
  color: var(--faint);
  font-size: 11px;
  line-height: 1.65;
}

.mini-icon {
  display: grid;
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  color: var(--faint);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 50%;
  transition: color 0.22s ease, background 0.22s ease;
  place-items: center;
}

.mini-icon:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.09);
}

.mini-icon svg {
  width: 13px;
  height: 13px;
}

.mini-icon.is-spinning svg {
  animation: spin 0.9s linear infinite;
}

.bing-mark {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: rgba(247, 245, 239, 0.47);
  font-size: 8px;
  font-weight: 650;
  letter-spacing: 0.05em;
}

.bing-mark-dot {
  display: block;
  width: 5px;
  height: 5px;
  background: linear-gradient(135deg, #58e0c0, #7ba8ff 55%, #d896ff);
  border-radius: 50%;
}

/* Presets */

.preset-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.preset-card {
  position: relative;
  display: flex;
  align-items: flex-end;
  aspect-ratio: 1.48 / 1;
  overflow: hidden;
  padding: 0;
  text-align: left;
  background-color: #131a24;
  background-position: center;
  background-size: cover;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 11px;
  isolation: isolate;
  transition: transform 0.28s var(--ease-out), border-color 0.28s ease, box-shadow 0.28s ease;
}

.preset-card::after {
  position: absolute;
  inset: 0;
  z-index: 0;
  content: "";
  background: linear-gradient(180deg, rgba(3, 6, 10, 0) 30%, rgba(3, 6, 10, 0.72) 100%);
}

.preset-card:hover {
  border-color: rgba(255, 255, 255, 0.32);
  transform: translateY(-1px);
}

.preset-card.is-selected {
  border-color: rgba(255, 255, 255, 0.82);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.15);
}

.preset-label {
  position: relative;
  z-index: 1;
  padding: 8px;
  color: rgba(255, 255, 255, 0.88);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.03em;
  text-shadow: 0 1px 5px rgba(0, 0, 0, 0.4);
}

.preset-check {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 2;
  display: grid;
  width: 15px;
  height: 15px;
  color: #0c1118;
  background: #f6f2e8;
  border-radius: 50%;
  opacity: 0;
  transition: opacity 0.2s ease;
  place-items: center;
}

.preset-check svg {
  width: 9px;
  height: 9px;
}

.preset-card.is-selected .preset-check {
  opacity: 1;
}

/* Bing gallery */

.bing-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 28px;
  margin-bottom: 10px;
}

.select-wrap {
  position: relative;
  flex: 0 0 auto;
}

.select-wrap select {
  height: 28px;
  padding: 0 27px 0 10px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.02em;
  appearance: none;
  -webkit-appearance: none;
  background-color: rgba(255, 255, 255, 0.045);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none'%3E%3Cpath d='m3 4.7 3 3 3-3' stroke='%23f7f5ef' stroke-opacity='.55' stroke-width='1.1' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 11px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  outline: none;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.select-wrap select:hover {
  border-color: rgba(255, 255, 255, 0.17);
}

.select-wrap select:focus {
  border-color: rgba(255, 255, 255, 0.32);
}

.select-wrap option {
  color: #f7f5ef;
  background: #121820;
}

.bing-status {
  overflow: hidden;
  color: var(--faint);
  font-size: 9px;
  letter-spacing: 0.025em;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bing-status.is-error {
  color: #ffb6a4;
}

.bing-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  min-height: 100px;
  transition: opacity 0.25s ease;
}

.bing-grid.is-updating {
  opacity: 0.74;
}

.bing-card {
  position: relative;
  display: block;
  aspect-ratio: 1.62 / 1;
  overflow: hidden;
  padding: 0;
  text-align: left;
  background: #141c26;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 11px;
  isolation: isolate;
  transition: transform 0.3s var(--ease-out), border-color 0.25s ease, box-shadow 0.25s ease;
}

.bing-card::after {
  position: absolute;
  inset: 0;
  z-index: 1;
  content: "";
  pointer-events: none;
  background: linear-gradient(180deg, rgba(3, 6, 10, 0.04) 25%, rgba(3, 6, 10, 0.75) 100%);
}

.bing-card:hover {
  border-color: rgba(255, 255, 255, 0.32);
  transform: translateY(-2px);
}

.bing-thumb {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.95;
  transition: transform 0.7s var(--ease-out), opacity 0.25s ease;
}

.bing-card:hover .bing-thumb {
  transform: scale(1.04);
}

.bing-card.is-selected {
  border-color: rgba(255, 255, 255, 0.8);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.16), 0 10px 25px rgba(0, 0, 0, 0.18);
}

.bing-date {
  position: absolute;
  top: 7px;
  left: 7px;
  z-index: 2;
  padding: 2px 6px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 8px;
  font-variant-numeric: tabular-nums;
  font-weight: 550;
  letter-spacing: 0.04em;
  background: rgba(3, 6, 10, 0.38);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.bing-title {
  position: absolute;
  right: 9px;
  bottom: 8px;
  left: 9px;
  z-index: 2;
  display: -webkit-box;
  overflow: hidden;
  color: rgba(255, 255, 255, 0.92);
  font-size: 10px;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: 0.015em;
  text-shadow: 0 1px 5px rgba(0, 0, 0, 0.4);
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.bing-check {
  position: absolute;
  top: 7px;
  right: 7px;
  z-index: 3;
  display: grid;
  width: 17px;
  height: 17px;
  color: #0b1018;
  background: #f6f2e8;
  border-radius: 50%;
  opacity: 0;
  transition: opacity 0.2s ease;
  place-items: center;
}

.bing-check svg {
  width: 9px;
  height: 9px;
}

.bing-card.is-selected .bing-check {
  opacity: 1;
}

.bing-card.is-loading {
  pointer-events: none;
}

.bing-card.is-loading .bing-thumb {
  opacity: 0.5;
}

.bing-card.is-loading::before {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 4;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  content: "";
  border: 1.5px solid rgba(255, 255, 255, 0.22);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.bing-message {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  min-height: 84px;
  padding: 14px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.6;
  background: rgba(255, 255, 255, 0.025);
  border: 1px dashed rgba(255, 255, 255, 0.11);
  border-radius: 11px;
}

.bing-message button {
  margin-top: 8px;
  color: var(--text);
  font-size: 9px;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.bing-legal {
  margin: 0;
  padding-top: 2px;
  color: rgba(247, 245, 239, 0.36);
  font-size: 9px;
  line-height: 1.7;
}

/* Custom background */

.upload-zone {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  min-height: 68px;
  padding: 12px 13px;
  text-align: left;
  background: rgba(255, 255, 255, 0.025);
  border: 1px dashed rgba(255, 255, 255, 0.17);
  border-radius: 12px;
  transition: background 0.25s ease, border-color 0.25s ease;
}

.upload-zone:hover,
.upload-zone.is-dragging {
  background: rgba(255, 255, 255, 0.065);
  border-color: rgba(255, 255, 255, 0.37);
}

.upload-zone.is-selected {
  background: rgba(255, 255, 255, 0.055);
  border-color: rgba(255, 255, 255, 0.55);
}

.upload-zone.is-busy {
  pointer-events: none;
  opacity: 0.6;
}

.upload-icon {
  display: grid;
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  place-items: center;
}

.upload-icon svg {
  width: 18px;
  height: 18px;
}

.upload-copy {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.upload-copy strong {
  color: var(--text);
  font-size: 10px;
  font-weight: 550;
  letter-spacing: 0.025em;
}

.upload-copy small {
  overflow: hidden;
  color: var(--faint);
  font-size: 9px;
  font-weight: 400;
  letter-spacing: 0.01em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upload-action {
  flex: 0 0 auto;
  padding: 5px 8px;
  color: var(--muted);
  font-size: 8px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 7px;
}

.url-field {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
}

.url-field input {
  flex: 1;
  min-width: 0;
  height: 36px;
  padding: 0 11px;
  color: var(--text);
  font-size: 10px;
  letter-spacing: 0.015em;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 9px;
  outline: none;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.url-field input::placeholder {
  color: rgba(247, 245, 239, 0.25);
}

.url-field input:focus {
  background: rgba(255, 255, 255, 0.065);
  border-color: rgba(255, 255, 255, 0.3);
}

.url-field input.is-current {
  background: rgba(255, 255, 255, 0.075);
  border-color: rgba(255, 255, 255, 0.42);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08);
}

/* Background loop */

.bg-loop-status {
  color: var(--faint);
  font-size: 8px;
  letter-spacing: 0.03em;
  text-align: right;
}

.bg-loop-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.bg-loop-control {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
  color: var(--faint);
  font-size: 9px;
}

.bg-loop-input {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 36px;
  padding: 0 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 9px;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.bg-loop-input:focus-within {
  background: rgba(255, 255, 255, 0.065);
  border-color: rgba(255, 255, 255, 0.3);
}

.bg-loop-input input {
  flex: 1;
  min-width: 0;
  padding: 0;
  color: var(--text);
  font-family: var(--ui-font);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  background: transparent;
  border: 0;
  outline: none;
  appearance: textfield;
  -moz-appearance: textfield;
}

.bg-loop-input input::-webkit-outer-spin-button,
.bg-loop-input input::-webkit-inner-spin-button {
  margin: 0;
  appearance: none;
  -webkit-appearance: none;
}

.bg-loop-input > span {
  flex: 0 0 auto;
  color: var(--faint);
  font-size: 9px;
}

.bg-loop-control .select-wrap,
.bg-loop-control .select-wrap select {
  width: 100%;
}

.bg-loop-control .select-wrap select {
  height: 36px;
  font-size: 10px;
}

.bg-loop-label {
  display: block;
  margin-top: 11px;
  color: var(--faint);
  font-size: 9px;
}

.bg-loop-scopes {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.bg-loop-scope {
  padding: 6px 9px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.035em;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 8px;
  transition: color 0.22s ease, background 0.22s ease, border-color 0.22s ease;
}

.bg-loop-scope:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.075);
}

.bg-loop-scope.is-active {
  color: #0b1018;
  background: rgba(247, 243, 232, 0.9);
  border-color: rgba(247, 243, 232, 0.9);
}

.bg-loop-custom-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 9px;
}

.bg-loop-custom-row input {
  flex: 1;
  min-width: 0;
  height: 36px;
  padding: 0 11px;
  color: var(--text);
  font-size: 10px;
  letter-spacing: 0.015em;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 9px;
  outline: none;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.bg-loop-custom-row input::placeholder {
  color: rgba(247, 245, 239, 0.25);
}

.bg-loop-custom-row input:focus {
  background: rgba(255, 255, 255, 0.065);
  border-color: rgba(255, 255, 255, 0.3);
}

.bg-loop-custom-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.bg-loop-thumb {
  position: relative;
  width: 64px;
  height: 42px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
}

.bg-loop-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.bg-loop-thumb-remove {
  position: absolute;
  top: 2px;
  right: 2px;
  display: grid;
  width: 18px;
  height: 18px;
  color: var(--text);
  background: rgba(7, 12, 18, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 50%;
  place-items: center;
  transition: background 0.2s ease;
}

.bg-loop-thumb-remove:hover {
  background: rgba(120, 44, 44, 0.86);
}

.bg-loop-thumb-remove svg {
  width: 9px;
  height: 9px;
}

.bg-loop-empty {
  color: var(--faint);
  font-size: 8px;
}

.bg-loop-actions {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
}

.bg-loop-actions .hint {
  max-width: 280px;
  margin: 0;
  font-size: 8px;
  line-height: 1.65;
}

.bg-loop-actions .btn-mini {
  height: 32px;
  padding: 0 10px;
  font-size: 9px;
}

.btn-mini {
  flex: 0 0 auto;
  height: 36px;
  padding: 0 13px;
  color: #0b1018;
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.02em;
  background: rgba(247, 243, 232, 0.9);
  border-radius: 9px;
  transition: background 0.2s ease, opacity 0.2s ease;
}

.btn-mini:hover {
  background: #fffdf7;
}

.btn-mini:disabled {
  opacity: 0.45;
}

.hint {
  margin: 8px 0 0;
  color: var(--faint);
  font-size: 9px;
  line-height: 1.7;
}

.hint.center {
  text-align: center;
}

/* Typography panel */

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

.font-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 76px;
  padding: 11px 12px 9px;
  overflow: hidden;
  text-align: left;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.075);
  border-radius: 12px;
  transition: background 0.25s ease, border-color 0.25s ease, transform 0.25s var(--ease-out);
}

.font-card:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.18);
}

.font-card.is-selected {
  background: rgba(255, 255, 255, 0.075);
  border-color: rgba(255, 255, 255, 0.46);
}

.font-sample {
  display: block;
  overflow: hidden;
  color: rgba(247, 245, 239, 0.92);
  font-size: 26px;
  line-height: 1.1;
  letter-spacing: -0.035em;
  text-overflow: clip;
  white-space: nowrap;
}

.font-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.font-name {
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.025em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.font-en {
  flex: 0 0 auto;
  color: rgba(247, 245, 239, 0.38);
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.12em;
}

.font-check {
  position: absolute;
  top: 7px;
  right: 7px;
  display: grid;
  width: 15px;
  height: 15px;
  color: #0c1118;
  background: #f6f2e8;
  border-radius: 50%;
  opacity: 0;
  transition: opacity 0.2s ease;
  place-items: center;
}

.font-check svg {
  width: 9px;
  height: 9px;
}

.font-card.is-selected .font-check {
  opacity: 1;
}

.font-card.is-selected .font-en {
  opacity: 0;
}

/* Swatches */

.swatch-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.swatch {
  position: relative;
  display: block;
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  padding: 0;
  background: var(--swatch, #f7f3e8);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 50%;
  transition: transform 0.2s var(--ease-out), border-color 0.2s ease;
}

.swatch:hover {
  transform: scale(1.06);
  border-color: rgba(255, 255, 255, 0.4);
}

.swatch::after {
  position: absolute;
  inset: -4px;
  content: "";
  border: 1px solid transparent;
  border-radius: 50%;
  transition: border-color 0.2s ease;
}

.swatch.is-selected::after {
  border-color: rgba(255, 255, 255, 0.82);
}

.custom-swatch {
  overflow: hidden;
  cursor: pointer;
  background: conic-gradient(from 210deg, #ff7c88, #ffd28f, #c6f6a1, #8de9ed, #9db6ff, #d3a5ff, #ff7c88);
  border-color: rgba(255, 255, 255, 0.23);
}

.custom-swatch input[type="color"] {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  padding: 0;
  cursor: pointer;
  opacity: 0;
  border: 0;
}

.custom-swatch .color-plus {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 1;
  display: grid;
  width: 14px;
  height: 14px;
  color: rgba(10, 14, 20, 0.8);
  font-size: 14px;
  font-weight: 300;
  line-height: 1;
  background: rgba(255, 255, 255, 0.8);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  place-items: center;
}

.custom-swatch:focus-within {
  outline: 2px solid rgba(247, 243, 232, 0.86);
  outline-offset: 4px;
}

/* Effects + ranges */

.effect-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.effect-btn {
  height: 38px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.04em;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 9px;
  transition: color 0.22s ease, background 0.22s ease, border-color 0.22s ease;
}

.effect-btn:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.07);
}

.effect-btn.is-active {
  color: var(--text);
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.24);
}

.value-pill {
  flex: 0 0 auto;
  padding: 3px 7px;
  color: var(--muted);
  font-size: 9px;
  font-variant-numeric: tabular-nums;
  font-weight: 550;
  letter-spacing: 0.03em;
  background: rgba(255, 255, 255, 0.055);
  border-radius: 999px;
}

.range {
  --value: 50%;
  display: block;
  width: 100%;
  height: 24px;
  padding: 0;
  margin: 1px 0 0;
  background: transparent;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
}

.range::-webkit-slider-runnable-track {
  height: 4px;
  background: linear-gradient(90deg, rgba(247, 243, 232, 0.9) 0 var(--value), rgba(255, 255, 255, 0.14) var(--value) 100%);
  border-radius: 999px;
}

.range::-moz-range-track {
  height: 4px;
  background: linear-gradient(90deg, rgba(247, 243, 232, 0.9) 0 var(--value), rgba(255, 255, 255, 0.14) var(--value) 100%);
  border-radius: 999px;
}

.range::-webkit-slider-thumb {
  width: 15px;
  height: 15px;
  margin-top: -5.5px;
  background: #f7f3e8;
  border: 0;
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
  appearance: none;
  -webkit-appearance: none;
  transition: transform 0.15s ease;
}

.range::-moz-range-thumb {
  width: 15px;
  height: 15px;
  background: #f7f3e8;
  border: 0;
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

.range:active::-webkit-slider-thumb {
  transform: scale(0.88);
}

.range:focus-visible {
  outline: 2px solid rgba(247, 243, 232, 0.72);
  outline-offset: 3px;
  border-radius: 999px;
}

.range:focus-visible::-webkit-slider-thumb {
  box-shadow: 0 0 0 3px rgba(247, 243, 232, 0.25), 0 2px 8px rgba(0, 0, 0, 0.35);
}

.range-ends {
  display: flex;
  justify-content: space-between;
  margin-top: 1px;
  color: rgba(247, 245, 239, 0.36);
  font-size: 9px;
}

/* Preferences */

.pref-list {
  margin-top: -4px;
}

.pref-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 12px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.pref-row:first-child {
  border-top: 0;
}

.pref-copy {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.pref-copy strong {
  color: var(--text);
  font-size: 11px;
  font-weight: 550;
  letter-spacing: 0.02em;
}

.pref-copy span {
  color: var(--faint);
  font-size: 9px;
  line-height: 1.55;
}

.quote-theme-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.quote-theme-btn {
  padding: 6px 9px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.035em;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 8px;
  transition: color 0.22s ease, background 0.22s ease, border-color 0.22s ease;
}

.quote-theme-btn:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.075);
}

.quote-theme-btn.is-active {
  color: #0b1018;
  background: rgba(247, 243, 232, 0.9);
  border-color: rgba(247, 243, 232, 0.9);
}

.quote-interval-field {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
  padding: 9px 11px;
  color: var(--muted);
  font-size: 9px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 10px;
}

.quote-interval-control {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  color: var(--faint);
  font-size: 9px;
}

.quote-interval-control input {
  width: 58px;
  padding: 3px 4px;
  color: var(--text);
  font-family: var(--ui-font);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  text-align: right;
  background: rgba(0, 0, 0, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  outline: none;
  appearance: textfield;
  -moz-appearance: textfield;
}

.quote-interval-control input:focus {
  border-color: rgba(255, 255, 255, 0.3);
}

.quote-interval-control input::-webkit-outer-spin-button,
.quote-interval-control input::-webkit-inner-spin-button {
  margin: 0;
  appearance: none;
  -webkit-appearance: none;
}

.switch {
  position: relative;
  flex: 0 0 auto;
  width: 42px;
  height: 24px;
  padding: 0;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  transition: background 0.24s ease, border-color 0.24s ease;
}

.switch::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  content: "";
  background: rgba(247, 245, 239, 0.7);
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.22);
  transition: transform 0.28s var(--ease-out), background 0.24s ease;
}

.switch[aria-checked="true"] {
  background: rgba(247, 243, 232, 0.9);
  border-color: rgba(247, 243, 232, 0.9);
}

.switch[aria-checked="true"]::after {
  background: #0c1118;
  transform: translateX(18px);
}

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

.shortcut-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  color: var(--muted);
  font-size: 10px;
}

.shortcut-row span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

kbd {
  flex: 0 0 auto;
  min-width: 25px;
  padding: 2px 6px;
  color: var(--muted);
  font-family: var(--ui-font);
  font-size: 9px;
  font-weight: 500;
  text-align: center;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-bottom-color: rgba(255, 255, 255, 0.16);
  border-radius: 5px;
}

.outline-btn {
  width: 100%;
  height: 39px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.04em;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 9px;
  transition: color 0.22s ease, background 0.22s ease, border-color 0.22s ease;
}

.outline-btn:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.055);
  border-color: rgba(255, 255, 255, 0.23);
}

.drawer-foot {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 11px 24px;
  color: rgba(247, 245, 239, 0.38);
  font-size: 9px;
  letter-spacing: 0.045em;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.save-note {
  display: flex;
  align-items: center;
  gap: 5px;
}

.save-note svg {
  width: 11px;
  height: 11px;
}

/* ---------------------------------------------------------
   Standard time + weather dialogs
   --------------------------------------------------------- */

.overlay-backdrop {
  position: fixed;
  inset: 0;
  z-index: 55;
  background: rgba(3, 6, 10, 0.58);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.38s ease;
  backdrop-filter: blur(12px) saturate(105%);
  -webkit-backdrop-filter: blur(12px) saturate(105%);
}

.overlay-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

.overlay-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 60;
  display: flex;
  flex-direction: column;
  width: min(600px, calc(100vw - 32px));
  max-height: calc(100vh - 40px);
  max-height: calc(100dvh - 40px);
  overflow: hidden;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(20, 26, 37, 0.95) 0%, rgba(9, 13, 20, 0.97) 100%);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 26px;
  box-shadow: 0 30px 100px rgba(0, 0, 0, 0.56), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(42px) saturate(140%);
  -webkit-backdrop-filter: blur(42px) saturate(140%);
  transform: translate(-50%, calc(-50% + 12px)) scale(0.975);
  transition:
    transform 0.42s var(--ease-out),
    opacity 0.3s ease,
    visibility 0s linear 0.42s;
}

.overlay-modal.is-open {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
  transition:
    transform 0.42s var(--ease-out),
    opacity 0.3s ease,
    visibility 0s linear 0s;
}

.weather-modal {
  width: min(620px, calc(100vw - 32px));
}

.modal-head {
  display: flex;
  flex: 0 0 auto;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 24px 24px 17px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.065);
}

.modal-head h2 {
  margin: 0;
  font-size: 21px;
  font-weight: 550;
  letter-spacing: 0.02em;
  line-height: 1.25;
}

.modal-close {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
}

.modal-close svg {
  width: 16px;
  height: 16px;
}

.standard-clock-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 28px 28px 24px;
  overflow-y: auto;
}

.standard-clock-zone {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  font-weight: 450;
  letter-spacing: 0.08em;
}

.standard-clock-zone .sync-dot {
  width: 5px;
  height: 5px;
}

.standard-clock-large {
  width: 100%;
  color: var(--text);
  font-family: var(--clock-font);
  font-size: clamp(3rem, 10.4vw, 6.8rem);
  font-weight: 500;
  font-variant-numeric: tabular-nums lining-nums;
  letter-spacing: -0.055em;
  line-height: 1;
  text-align: center;
  text-shadow: 0 0 50px rgba(255, 255, 255, 0.08);
  user-select: none;
}

.standard-clock-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  padding-bottom: 15px;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.03em;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.standard-sync-text {
  color: var(--faint);
  font-size: 9px;
}

.standard-clock-extra {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 22px;
  color: var(--muted);
  font-size: 11px;
}

.standard-extra-label {
  display: block;
  margin-bottom: 2px;
  color: var(--faint);
  font-size: 8px;
  font-weight: 500;
  letter-spacing: 0.14em;
}

#standardTimeZone {
  overflow-wrap: anywhere;
}

#standardTimeUtc {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
}

.standard-clock-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding-top: 15px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.standard-clock-actions .hint {
  margin: 0;
}

.btn-mini.ghost {
  color: var(--muted);
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.btn-mini.ghost:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.07);
}

.btn-mini.ghost:disabled {
  opacity: 0.45;
}

.weather-body {
  flex: 1 1 auto;
  min-height: 0;
  padding: 17px 24px 24px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.weather-body::-webkit-scrollbar {
  width: 6px;
}

.weather-body::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.16);
  border-radius: 999px;
}

.weather-location-bar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.weather-location-copy {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 3px 7px;
  min-width: 0;
}

#weatherCityName {
  overflow: hidden;
  color: var(--text);
  font-size: 19px;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#weatherCityRegion {
  color: var(--muted);
  font-size: 10px;
  font-weight: 450;
}

.weather-updated {
  flex-basis: 100%;
  color: var(--faint);
  font-size: 9px;
  letter-spacing: 0.02em;
}

.weather-location-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 6px;
}

.weather-search-area {
  position: relative;
  margin-top: 14px;
}

.weather-search-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.weather-search-row input {
  flex: 1;
  min-width: 0;
  height: 36px;
  padding: 0 11px;
  color: var(--text);
  font-size: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 9px;
  outline: none;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.weather-search-row input::placeholder {
  color: rgba(247, 245, 239, 0.3);
}

.weather-search-row input:focus {
  background: rgba(255, 255, 255, 0.065);
  border-color: rgba(255, 255, 255, 0.3);
}

.weather-search-results {
  position: absolute;
  top: calc(100% + 5px);
  right: 0;
  left: 0;
  z-index: 12;
  max-height: min(228px, 42vh);
  overflow-y: auto;
  background: rgba(12, 17, 24, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 12px;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.38);
}

.weather-result {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 9px 11px;
  color: var(--muted);
  text-align: left;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  transition: background 0.18s ease;
}

.weather-result:first-child {
  border-top: 0;
}

.weather-result:hover,
.weather-result:focus-visible {
  background: rgba(255, 255, 255, 0.065);
}

.weather-result strong {
  color: var(--text);
  font-size: 11px;
  font-weight: 550;
}

.weather-result small {
  overflow: hidden;
  color: var(--faint);
  font-size: 9px;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.weather-result.is-empty {
  justify-content: center;
  color: var(--faint);
  font-size: 10px;
  cursor: default;
}

.weather-loading {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 24px 0;
  color: var(--muted);
  font-size: 11px;
}

.weather-spinner {
  display: block;
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  border: 1.5px solid rgba(255, 255, 255, 0.18);
  border-top-color: var(--text);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.weather-error {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  padding: 15px 16px;
  color: #ffb6a4;
  font-size: 10px;
  background: rgba(255, 145, 122, 0.055);
  border: 1px solid rgba(255, 145, 122, 0.16);
  border-radius: 10px;
}

.weather-error p {
  margin: 0;
}

.weather-error .text-btn {
  flex: 0 0 auto;
  color: #ffc7b8;
}

.weather-content {
  animation: panelIn 0.35s var(--ease-out) both;
}

.weather-now {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-top: 16px;
  padding: 15px 16px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 17px;
}

.weather-now-icon {
  display: grid;
  flex: 0 0 auto;
  width: 60px;
  height: 60px;
  color: #ffd28f;
  place-items: center;
}

.weather-now-icon svg {
  width: 56px;
  height: 56px;
}

.weather-now-temp {
  color: var(--text);
  font-family: "Manrope", var(--ui-font);
  font-size: 46px;
  font-weight: 300;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.055em;
  line-height: 0.95;
  white-space: nowrap;
}

.weather-now-temp sup {
  margin-left: 1px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0;
  vertical-align: top;
}

.weather-now-copy {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.weather-now-copy strong {
  color: var(--text);
  font-size: 13px;
  font-weight: 550;
}

.weather-now-copy span {
  color: var(--muted);
  font-size: 10px;
}

.weather-now-highlow {
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
  color: var(--muted);
  font-size: 9px;
  font-variant-numeric: tabular-nums;
}

.weather-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 9px;
}

.weather-fact {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 9px 11px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 11px;
}

.weather-fact span {
  color: var(--faint);
  font-size: 8px;
  letter-spacing: 0.06em;
}

.weather-fact strong {
  color: var(--text);
  font-size: 11px;
  font-weight: 550;
  font-variant-numeric: tabular-nums;
}

.weather-section {
  margin-top: 19px;
}

.weather-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 9px;
}

.weather-section-head h3 {
  margin: 0;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.weather-section-head span {
  color: var(--faint);
  font-size: 8px;
  letter-spacing: 0.02em;
}

.weather-hourly {
  display: flex;
  gap: 7px;
  padding: 1px 1px 7px;
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.16) transparent;
}

.weather-hour {
  display: flex;
  flex: 0 0 62px;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 5px;
  background: rgba(255, 255, 255, 0.028);
  border: 1px solid rgba(255, 255, 255, 0.065);
  border-radius: 11px;
}

.weather-hour.is-now {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.15);
}

.weather-hour-time {
  color: var(--faint);
  font-size: 8px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

.weather-hour-icon {
  display: grid;
  width: 24px;
  height: 24px;
  color: var(--text);
  place-items: center;
}

.weather-hour-icon svg {
  width: 22px;
  height: 22px;
}

.weather-hour-temp {
  color: var(--text);
  font-size: 11px;
  font-weight: 550;
  font-variant-numeric: tabular-nums;
}

.weather-daily {
  display: flex;
  flex-direction: column;
}

.weather-day {
  display: grid;
  grid-template-columns: 42px 24px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  padding: 8px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.055);
  font-size: 10px;
}

.weather-day:first-child {
  border-top: 0;
}

.weather-day-name {
  color: var(--text);
  font-size: 10px;
  font-weight: 500;
}

.weather-day-icon {
  display: grid;
  width: 22px;
  height: 22px;
  color: #cbd5e2;
  place-items: center;
}

.weather-day-icon svg {
  width: 20px;
  height: 20px;
}

.weather-day-condition {
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.weather-day-temps {
  color: var(--text);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.weather-day-temps .is-high {
  color: var(--text);
}

.weather-day-temps .is-low {
  margin-left: 5px;
  color: var(--faint);
}

.weather-source {
  margin: 16px 0 0;
  color: rgba(247, 245, 239, 0.3);
  font-size: 8px;
  letter-spacing: 0.015em;
  text-align: center;
}

.weather-glyph[data-tone="sun"] { color: #ffd28f; }
.weather-glyph[data-tone="moon"] { color: #c7b7ff; }
.weather-glyph[data-tone="rain"] { color: #a9d4ff; }
.weather-glyph[data-tone="storm"] { color: #c7b7ff; }
.weather-glyph[data-tone="snow"] { color: #dcecff; }
.weather-glyph[data-tone="fog"] { color: #cbd2da; }
.weather-glyph[data-tone="cloud"] { color: #cbd5e2; }

/* ---------------------------------------------------------
   Sound & music
   --------------------------------------------------------- */

.sound-modal {
  width: min(560px, calc(100vw - 32px));
}

.sound-body {
  flex: 1 1 auto;
  min-height: 0;
  padding: 18px 24px 24px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.sound-body::-webkit-scrollbar {
  width: 6px;
}

.sound-body::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.16);
  border-radius: 999px;
}

.sound-section {
  padding: 19px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.sound-section:first-child {
  padding-top: 0;
  border-top: 0;
}

.sound-section:last-child {
  padding-bottom: 0;
}

.sound-cue {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 13px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 13px;
}

.sound-cue-icon {
  display: grid;
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  color: #ffd28f;
  place-items: center;
}

.sound-cue-icon svg {
  width: 24px;
  height: 24px;
}

.sound-cue-copy {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.sound-cue-copy strong {
  color: var(--text);
  font-size: 11px;
  font-weight: 550;
}

.sound-cue-copy span {
  color: var(--faint);
  font-size: 9px;
  line-height: 1.55;
}

.sound-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.sound-section-head h3 {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.sound-section-head span {
  color: var(--faint);
  font-size: 8px;
  letter-spacing: 0.03em;
}

.noise-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.noise-option {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 9px 9px;
  color: var(--muted);
  text-align: left;
  background: rgba(255, 255, 255, 0.028);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 11px;
  transition: color 0.22s ease, background 0.22s ease, border-color 0.22s ease;
}

.noise-option:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.065);
}

.noise-option.is-active {
  color: var(--text);
  background: rgba(255, 255, 255, 0.085);
  border-color: rgba(255, 255, 255, 0.2);
}

.noise-icon {
  display: grid;
  flex: 0 0 auto;
  width: 25px;
  height: 25px;
  color: #cbd5e2;
  place-items: center;
}

.noise-option[data-noise-type="rain"] .noise-icon { color: #a9d4ff; }
.noise-option[data-noise-type="ocean"] .noise-icon { color: #9ce7ff; }
.noise-option[data-noise-type="wind"] .noise-icon { color: #b9f5d9; }
.noise-option[data-noise-type="fire"] .noise-icon { color: #ffb98f; }
.noise-option[data-noise-type="white"] .noise-icon { color: #dcecff; }
.noise-option[data-noise-type="pink"] .noise-icon { color: #ffc2d8; }

.noise-icon svg {
  width: 23px;
  height: 23px;
}

.noise-option-copy {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.noise-option-copy strong {
  overflow: hidden;
  color: var(--text);
  font-size: 10px;
  font-weight: 550;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.noise-option-copy small {
  overflow: hidden;
  color: var(--faint);
  font-size: 8px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.noise-player {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.085);
  border-radius: 14px;
}

.noise-play {
  display: grid;
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  color: #0b1018;
  background: rgba(247, 243, 232, 0.92);
  border-radius: 50%;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.2);
  place-items: center;
  transition: background 0.22s ease, transform 0.22s var(--ease-out), box-shadow 0.22s ease;
}

.noise-play:hover {
  background: #fffdf6;
  transform: translateY(-1px);
}

.noise-play.is-playing {
  color: var(--text);
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 0 0 4px rgba(185, 245, 217, 0.045), 0 0 22px rgba(185, 245, 217, 0.12);
}

.noise-play svg {
  width: 19px;
  height: 19px;
}

.noise-player-copy {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.noise-player-copy strong {
  color: var(--text);
  font-size: 11px;
  font-weight: 550;
}

.noise-player-copy span {
  overflow: hidden;
  color: var(--faint);
  font-size: 8px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.noise-volume {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 5px;
  color: var(--faint);
}

.noise-volume svg {
  width: 16px;
  height: 16px;
}

.noise-volume input {
  width: 88px;
  accent-color: var(--text);
  cursor: pointer;
}

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

.sound-service {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  padding: 11px;
  color: var(--muted);
  text-decoration: none;
  background: rgba(255, 255, 255, 0.028);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 12px;
  transition: background 0.22s ease, border-color 0.22s ease, transform 0.22s var(--ease-out);
}

.sound-service:hover {
  background: rgba(255, 255, 255, 0.065);
  border-color: rgba(255, 255, 255, 0.16);
  transform: translateY(-1px);
}

.sound-service-icon {
  display: grid;
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  color: #ffd28f;
  place-items: center;
}

.sound-service-icon svg {
  width: 22px;
  height: 22px;
}

.sound-service-copy {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.sound-service-copy strong {
  color: var(--text);
  font-size: 10px;
  font-weight: 550;
}

.sound-service-copy small {
  overflow: hidden;
  color: var(--faint);
  font-size: 8px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.sound-service-arrow {
  flex: 0 0 auto;
  width: 13px;
  height: 13px;
  margin-left: auto;
  color: var(--faint);
  opacity: 0.75;
}

.sound-section .hint {
  margin-top: 10px;
}

/* ---------------------------------------------------------
   Toast + helpers
   --------------------------------------------------------- */

.toast {
  position: fixed;
  bottom: max(26px, env(safe-area-inset-bottom));
  left: 50%;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 9px;
  max-width: min(430px, calc(100vw - 32px));
  padding: 11px 16px 11px 12px;
  color: var(--text);
  font-size: 10px;
  font-weight: 450;
  line-height: 1.5;
  background: rgba(11, 15, 22, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  box-shadow: 0 14px 45px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(24px) saturate(140%);
  -webkit-backdrop-filter: blur(24px) saturate(140%);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition: opacity 0.28s ease, transform 0.28s var(--ease-out);
}

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

.toast.is-error .toast-mark {
  color: #ffb6a4;
  background: rgba(255, 145, 122, 0.12);
  border-radius: 50%;
}

.toast-mark {
  display: grid;
  flex: 0 0 auto;
  width: 19px;
  height: 19px;
  color: #c6f6dc;
  background: rgba(198, 246, 220, 0.1);
  border-radius: 50%;
  place-items: center;
}

.toast-mark svg {
  width: 10px;
  height: 10px;
}

.no-js {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 200;
  width: min(360px, calc(100vw - 40px));
  padding: 18px;
  color: #f7f5ef;
  font-size: 12px;
  line-height: 1.7;
  text-align: center;
  background: #111821;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 14px;
  transform: translate(-50%, -50%);
}

/* ---------------------------------------------------------
   Animations
   --------------------------------------------------------- */

@keyframes uiEnter {
  from {
    opacity: 0;
    transform: translateY(14px);
    filter: blur(5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
}

@keyframes setupIn {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes panelIn {
  from {
    opacity: 0;
    transform: translateY(5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-5px); }
  40% { transform: translateX(4px); }
  60% { transform: translateX(-3px); }
  80% { transform: translateX(2px); }
}

/* ---------------------------------------------------------
   Responsive
   --------------------------------------------------------- */

@media (max-width: 900px) {
  .app {
    padding-right: 26px;
    padding-left: 26px;
  }

  .weather-chip-city {
    display: none;
  }

  .weather-chip {
    padding-right: 9px;
    padding-left: 8px;
  }

  .clock-display {
    font-size: calc(clamp(3.15rem, 12.2vw, 8.9rem) * var(--clock-scale) * var(--clock-factor));
  }
}

@media (max-width: 720px) {
  .app {
    padding:
      max(18px, env(safe-area-inset-top))
      17px
      max(14px, env(safe-area-inset-bottom));
  }

  .topbar {
    gap: 12px;
  }

  .brand-mark {
    width: 38px;
    height: 38px;
    border-radius: 12px;
  }

  .brand-mark svg {
    width: 21px;
    height: 21px;
  }

  .brand-name {
    font-size: 15px;
  }

  .brand-en {
    display: none;
  }

  .brand-date {
    display: none;
  }

  .brand-copy {
    gap: 2px;
  }

  .standard-time {
    padding: 4px 6px;
  }

  .standard-time-clock {
    font-size: 10.5px;
  }

  .standard-time-label {
    font-size: 8px;
  }

  .weather-chip {
    height: 37px;
    padding: 0 8px;
  }

  .weather-chip-icon,
  .weather-chip-icon svg {
    width: 16px;
    height: 16px;
  }

  .weather-chip-temp {
    font-size: 10px;
  }

  .top-actions {
    gap: 6px;
  }

  .icon-btn {
    width: 37px;
    height: 37px;
  }

  .personalize {
    width: 37px;
    height: 37px;
    padding: 0;
    border-radius: 50%;
    justify-content: center;
  }

  .personalize-label {
    display: none;
  }

  .timer-area {
    padding-top: clamp(28px, 6vh, 52px);
    padding-bottom: 22px;
  }

  .mode-btn {
    height: 34px;
    font-size: 10px;
    letter-spacing: 0.06em;
  }

  .duration-setup {
    gap: 11px;
    margin-top: 18px;
  }

  .pomodoro-setup {
    gap: 8px;
    margin-top: 16px;
  }

  .pomodoro-phase {
    padding: 6px 5px;
  }

  .pomodoro-config {
    gap: 8px 14px;
  }

  .pomodoro-round-text {
    font-size: 8px;
  }

  .duration-field {
    padding: 7px 10px 6px;
    border-radius: 12px;
  }

  .duration-field input {
    width: 52px;
    font-size: 23px;
  }

  .duration-colon {
    font-size: 17px;
  }

  .preset-times {
    gap: 4px;
  }

  .preset-time {
    padding: 5px 8px;
    font-size: 9px;
  }

  .clock-stage {
    margin-top: 26px;
  }

  .duration-setup:not([hidden]) ~ .clock-stage,
  .pomodoro-setup:not([hidden]) ~ .clock-stage {
    margin-top: 18px;
  }

  .clock-display {
    font-size: calc(clamp(2.75rem, 13.2vw, 5.4rem) * var(--clock-scale) * var(--clock-factor));
    letter-spacing: -0.055em;
  }

  .clock-display .colon {
    padding: 0;
  }

  .progress-wrap {
    width: min(320px, 76vw);
    margin-top: 18px;
  }

  .status-line {
    margin-top: 14px;
    padding: 0;
    font-size: 10px;
    letter-spacing: 0.025em;
  }

  .controls {
    gap: 13px;
    margin-top: 25px;
  }

  .control-btn {
    width: 50px;
    height: 50px;
  }

  .control-btn svg {
    width: 18px;
    height: 18px;
  }

  .btn-primary {
    min-width: 154px;
    height: 53px;
    padding: 0 21px;
    font-size: 12px;
  }

  .control-hint {
    margin-top: 12px;
    font-size: 9px;
  }

  .laps-panel {
    margin-top: 18px;
  }

  .page-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
    font-size: 9px;
  }

  .footer-note {
    font-size: 9px;
  }

  #bgCredit {
    max-width: calc(100vw - 60px);
  }

  .settings-drawer {
    top: max(7px, env(safe-area-inset-top));
    right: 7px;
    bottom: max(7px, env(safe-area-inset-bottom));
    left: 7px;
    width: auto;
    border-radius: 23px;
    transform: translateY(calc(100% + 18px));
    transition:
      transform 0.52s var(--ease-out),
      opacity 0.3s ease,
      visibility 0s linear 0.52s;
  }

  .settings-drawer.is-open {
    transform: translateY(0);
    transition:
      transform 0.52s var(--ease-out),
      opacity 0.3s ease,
      visibility 0s linear 0s;
  }

  .drawer-head {
    padding: 19px 18px 14px;
  }

  .drawer-heading h2 {
    font-size: 19px;
  }

  .drawer-close {
    width: 32px;
    height: 32px;
  }

  .panel-tabs {
    margin: 12px 14px 0;
  }

  .drawer-scroll {
    padding: 0 18px 22px;
  }

  .drawer-foot {
    padding: 10px 18px;
  }

  .panel-section {
    padding: 16px 0;
  }

  .toast {
    bottom: max(18px, env(safe-area-inset-bottom));
    font-size: 9px;
  }

  .bing-card {
    border-radius: 10px;
  }

  .overlay-modal {
    top: max(8px, env(safe-area-inset-top));
    right: 8px;
    bottom: max(8px, env(safe-area-inset-bottom));
    left: 8px;
    width: auto;
    max-height: none;
    border-radius: 24px;
    transform: translateY(14px) scale(0.99);
  }

  .overlay-modal.is-open {
    transform: translateY(0) scale(1);
  }

  .modal-head {
    padding: 20px 18px 14px;
  }

  .modal-head h2 {
    font-size: 19px;
  }

  .modal-close {
    width: 32px;
    height: 32px;
  }

  .standard-clock-body {
    gap: 14px;
    padding: 22px 18px 20px;
  }

  .standard-clock-large {
    font-size: clamp(2.8rem, 14.5vw, 5.4rem);
  }

  .standard-clock-extra {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
  }

  .standard-clock-meta {
    gap: 5px;
    font-size: 9px;
  }

  .standard-clock-actions {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .weather-body {
    padding: 15px 18px 22px;
  }

  .weather-search-row input {
    font-size: 16px;
  }

  .weather-now {
    gap: 11px;
    padding: 13px;
  }

  .weather-now-icon {
    width: 48px;
    height: 48px;
  }

  .weather-now-icon svg {
    width: 44px;
    height: 44px;
  }

  .weather-now-temp {
    font-size: 39px;
  }

  .weather-now-copy strong {
    font-size: 12px;
  }

  .weather-now-highlow {
    display: none;
  }

  .weather-facts {
    gap: 6px;
  }

  .weather-fact {
    padding: 8px 9px;
  }

  .weather-section {
    margin-top: 17px;
  }

  /* iOS zooms into text fields smaller than 16px; keep form fields usable. */
  .url-field input {
    font-size: 16px;
  }
}

@media (max-width: 460px) {
  .app {
    padding-right: 13px;
    padding-left: 13px;
  }

  .brand {
    gap: 6px;
  }

  .brand-mark {
    width: 34px;
    height: 34px;
    border-radius: 11px;
  }

  .brand-mark svg {
    width: 19px;
    height: 19px;
  }

  .brand-name {
    font-size: 14px;
    letter-spacing: 0.1em;
  }

  .brand-date {
    display: none;
  }

  .standard-time {
    gap: 4px;
    padding: 5px 7px;
  }

  .standard-time-clock {
    font-size: 10px;
  }

  .standard-time-label {
    gap: 0;
  }

  .standard-time-label #standardTimeLabel {
    display: none;
  }

  .standard-time-expand {
    width: 9px;
    height: 9px;
  }

  .top-actions {
    gap: 4px;
  }

  .icon-btn {
    width: 33px;
    height: 33px;
  }

  .icon-btn svg {
    width: 15px;
    height: 15px;
  }

  .personalize {
    width: 33px;
    height: 33px;
  }

  .weather-chip {
    height: 33px;
    gap: 3px;
    padding: 0 7px;
  }

  .weather-chip-icon,
  .weather-chip-icon svg {
    width: 15px;
    height: 15px;
  }

  .weather-chip-temp {
    font-size: 10px;
  }

  .mode-switch {
    width: min(330px, calc(100vw - 30px));
  }

  .mode-btn {
    font-size: 9px;
    letter-spacing: 0.045em;
  }

  .pomodoro-phase span {
    font-size: 9px;
  }

  .pomodoro-phase small {
    font-size: 9px;
  }

  .pomodoro-round-text {
    max-width: 160px;
  }

  .pomodoro-lengths {
    gap: 5px;
  }

  .pomodoro-length {
    gap: 4px;
    padding: 4px 6px;
  }

  .pomodoro-length-input input {
    width: 34px;
    font-size: 10px;
  }

  .pomodoro-auto-row {
    font-size: 8px;
  }

  .duration-field input {
    width: 43px;
    font-size: 21px;
  }

  .duration-field {
    padding-right: 8px;
    padding-left: 8px;
  }

  .duration-field span {
    font-size: 9px;
  }

  .duration-colon {
    font-size: 15px;
  }

  .preset-time {
    padding: 5px 7px;
    font-size: 9px;
  }

  .clock-display {
    font-size: calc(clamp(2.55rem, 13.4vw, 4.7rem) * var(--clock-scale) * var(--clock-factor));
  }

  .clock-display .centi {
    margin-left: 0.06em;
  }

  .status-line {
    max-width: 94vw;
    font-size: 10px;
  }

  .controls {
    gap: 10px;
  }

  .control-btn {
    width: 46px;
    height: 46px;
  }

  .btn-primary {
    min-width: 146px;
    height: 51px;
    font-size: 11px;
  }

  .control-hint {
    display: none;
  }

  .footer-note {
    display: none;
  }

  .font-sample {
    font-size: 23px;
  }

  .font-grid {
    gap: 6px;
  }

  .font-card {
    min-height: 70px;
    padding: 10px;
  }

  .swatch {
    width: 30px;
    height: 30px;
  }

  .swatch-grid {
    gap: 9px;
  }

  .effect-btn {
    height: 36px;
    font-size: 9px;
  }

  .shortcut-grid {
    gap: 8px 12px;
  }

  .drawer-foot > span:last-child {
    display: none;
  }

  .overlay-modal {
    top: max(6px, env(safe-area-inset-top));
    right: 6px;
    bottom: max(6px, env(safe-area-inset-bottom));
    left: 6px;
    border-radius: 22px;
  }

  .modal-head {
    padding: 18px 16px 12px;
  }

  .standard-clock-body {
    padding: 18px 16px 18px;
  }

  .standard-clock-large {
    font-size: clamp(2.45rem, 16vw, 4.3rem);
  }

  .standard-clock-meta {
    flex-direction: column;
    align-items: flex-start;
  }

  .standard-clock-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .standard-clock-actions .btn-mini {
    width: 100%;
  }

  .weather-body {
    padding: 13px 16px 20px;
  }

  .weather-now-icon {
    width: 42px;
    height: 42px;
  }

  .weather-now-icon svg {
    width: 38px;
    height: 38px;
  }

  .weather-now-temp {
    font-size: 35px;
  }

  .weather-now-copy strong {
    font-size: 11px;
  }

  .weather-hour {
    flex-basis: 58px;
  }

  .weather-day {
    grid-template-columns: 37px 22px minmax(0, 1fr) auto;
    gap: 7px;
  }

  .weather-day-name {
    font-size: 9px;
  }

  .weather-day-condition {
    font-size: 8px;
  }

  .weather-day-temps {
    font-size: 9px;
  }

  .weather-source {
    font-size: 8px;
  }
}

@media (max-width: 360px) {
  .app {
    padding-right: 11px;
    padding-left: 11px;
  }

  .topbar {
    gap: 6px;
  }

  .brand {
    gap: 5px;
  }

  .brand-mark {
    width: 32px;
    height: 32px;
  }

  .brand-name {
    font-size: 13px;
  }

  .standard-time {
    padding: 4px 6px;
  }

  .standard-time-clock {
    font-size: 9.5px;
  }

  .standard-time-expand {
    width: 8px;
    height: 8px;
  }

  .top-actions {
    gap: 3px;
  }

  .icon-btn,
  .personalize {
    width: 31px;
    height: 31px;
  }

  .icon-btn svg {
    width: 14px;
    height: 14px;
  }

  .weather-chip {
    height: 31px;
    padding: 0 6px;
  }

  .weather-chip-icon,
  .weather-chip-icon svg {
    width: 14px;
    height: 14px;
  }

  .weather-chip-temp {
    font-size: 9.5px;
  }
}

@media (max-width: 720px) {
  .quote-card {
    margin-top: 24px;
    padding: 16px 20px 2px;
  }

  .quote-glyph {
    top: 2px;
    left: 2px;
    font-size: 34px;
  }

  .quote-text {
    min-height: 4.4em;
    font-size: 15px;
  }

  .sound-body {
    padding: 15px 18px 22px;
  }

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

@media (max-width: 460px) {
  .quote-card {
    margin-top: 20px;
    padding: 14px 10px 0;
  }

  .quote-glyph {
    top: 0;
    left: 0;
    font-size: 30px;
    opacity: 0.36;
  }

  .quote-text {
    min-height: 5.4em;
    font-size: 15px;
    line-height: 1.85;
    letter-spacing: 0.015em;
  }

  .quote-meta {
    gap: 5px 8px;
    margin-top: 8px;
    font-size: 9px;
  }

  .quote-theme-tag {
    font-size: 8px;
  }

  .quote-action {
    width: 30px;
    height: 30px;
  }

  .sound-body {
    padding: 13px 16px 20px;
  }

  .sound-section {
    padding: 16px 0;
  }

  .sound-cue {
    gap: 9px;
    padding: 10px 11px;
  }

  .sound-cue-copy span {
    font-size: 8px;
  }

  .noise-grid {
    gap: 6px;
  }

  .noise-option {
    gap: 7px;
    padding: 8px;
  }

  .noise-icon,
  .noise-icon svg {
    width: 22px;
    height: 22px;
  }

  .noise-player {
    flex-wrap: wrap;
    gap: 10px;
  }

  .noise-volume {
    width: 100%;
  }

  .noise-volume svg {
    display: none;
  }

  .noise-volume input {
    flex: 1;
    width: auto;
  }

  .sound-service-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .sound-section .hint {
    font-size: 8px;
  }

  .bg-loop-controls {
    grid-template-columns: minmax(0, 1fr);
  }

  .bg-loop-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .bg-loop-actions .hint {
    max-width: none;
  }

  .bg-loop-actions .btn-mini {
    width: 100%;
  }
}

@media (max-width: 360px) {
  .quote-text {
    min-height: 5.8em;
    font-size: 14px;
  }

  .quote-theme-tag {
    display: none;
  }

  .noise-option-copy small {
    font-size: 8px;
  }
}

@media (max-height: 760px) and (min-width: 721px) {
  .timer-area {
    padding-top: 26px;
    padding-bottom: 18px;
  }

  .clock-stage {
    margin-top: 24px;
  }

  .controls {
    margin-top: 22px;
  }

  .status-line {
    margin-top: 13px;
  }

  .control-hint {
    margin-top: 10px;
  }

  .settings-drawer {
    top: 10px;
    bottom: 10px;
  }
}

@media (hover: none) and (pointer: coarse) {
  /* Prevent iOS Safari from auto-zooming when form fields gain focus. */
  .url-field input,
  .weather-search-row input,
  .quote-interval-control input,
  .pomodoro-length-input input,
  .bg-loop-input input,
  .bg-loop-custom-row input {
    font-size: 16px;
  }

  .quote-interval-control input {
    width: 72px;
  }

  .pomodoro-length-input input {
    width: 42px;
  }

  .bg-loop-control .select-wrap select {
    font-size: 16px;
  }

  .url-field .btn-mini,
  .weather-search-row .btn-mini {
    font-size: 11px;
  }
}

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

  .bg-canvas,
  .bg-grain {
    animation: none !important;
  }
}
