:root {
  font-family:
    Inter,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    "PingFang SC",
    "Microsoft YaHei",
    sans-serif;
  color-scheme: light;
  --bg: #f6f5f0;
  --panel: #efeee7;
  --text: #292c2b;
  --muted: #82847c;
  --line: #e0e0d7;
  --accent: #b65f42;
  --accent-soft: #ece1d5;
  --time-color: #292c2b;
  --white: #fff;
  --clock-font: Inter, "Helvetica Neue", Arial, sans-serif;
  --extra-digit-spacing: 0em;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  transition:
    background 0.35s,
    color 0.35s;
}
body[data-theme="midnight"] {
  color-scheme: dark;
  --bg: #171c23;
  --panel: #222831;
  --text: #e8e9e6;
  --muted: #949ca4;
  --line: #333b45;
  --accent: #b8cae0;
  --accent-soft: #303a47;
  --white: #19212c;
}
body[data-theme="forest"] {
  color-scheme: dark;
  --bg: #1e302a;
  --panel: #2a3c34;
  --text: #e1e8cf;
  --muted: #9eafa1;
  --line: #3d4e43;
  --accent: #c2cf93;
  --accent-soft: #3c503e;
  --white: #24332b;
}
body[data-theme="retro"] {
  --bg: #e9dfcc;
  --panel: #dfd3bc;
  --text: #5b4034;
  --muted: #8c7966;
  --line: #cdbfa6;
  --accent: #9e4b30;
  --accent-soft: #dbbfa1;
  --white: #f4ebdb;
}
body[data-font="classic"] {
  --clock-font: Georgia, "Times New Roman", serif;
}
body[data-font="mono"] {
  --clock-font: "Courier New", monospace;
}
button,
input,
select {
  font: inherit;
}
button,
a,
input,
select {
  -webkit-tap-highlight-color: transparent;
}
button {
  color: inherit;
  cursor: pointer;
  border: 0;
  background: none;
}
button:disabled {
  cursor: default;
  opacity: 0.4;
}
button,
a,
input,
select {
  touch-action: manipulation;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 5px;
}
button {
  transition:
    background 0.18s,
    color 0.18s,
    transform 0.18s;
}
button:hover:not(:disabled) {
  filter: brightness(0.94);
}
button:active:not(:disabled) {
  transform: translateY(1px);
}
[hidden] {
  display: none !important;
}
svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}
.icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}
kbd {
  font: 10px inherit;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 2px 5px;
  color: var(--muted);
}
.app-shell {
  max-width: 1536px;
  margin: auto;
  padding: 0 5.2%;
}
.header {
  height: 105px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  border-bottom: 1px solid var(--line);
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  color: var(--text);
  text-decoration: none;
}
.brand-icon {
  background: var(--accent);
  color: var(--bg);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
}
.brand-icon svg {
  width: 26px;
  height: 26px;
  stroke-width: 1.2;
}
.brand-name {
  font-size: 21px;
  letter-spacing: 3px;
  font-weight: 650;
  line-height: 1.2;
}
.brand-name > span {
  display: block;
  font-size: 8px;
  letter-spacing: 2px;
  font-weight: 500;
  margin-top: 5px;
}
.mode-nav {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 4px;
  border-radius: 11px;
  gap: 3px;
}
.mode {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 22px;
  font-size: 13px;
  color: var(--muted);
  border-radius: 7px;
  white-space: nowrap;
}
.mode svg {
  width: 17px;
  height: 17px;
}
.mode.active {
  background: var(--bg);
  box-shadow: 0 1px 3px #0000000c;
  color: var(--text);
}
.focus-button {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 12px;
  padding: 10px 0 10px 10px;
}
.focus-button svg {
  width: 16px;
  height: 16px;
}
.focus-button kbd {
  margin-left: 7px;
}
.clock-stage {
  min-height: 510px;
  display: flex;
  flex-direction: column;
}
.stage-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 31px;
}
.eyebrow {
  font-size: 11px;
  letter-spacing: 2px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
}
.live-dot {
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
}
.stage-note {
  font-size: 11px;
  letter-spacing: 1px;
  color: var(--muted);
}
.time-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 38px 0 31px;
  min-width: 0;
}
.date-line {
  display: flex;
  align-items: center;
  gap: 15px;
  font-size: 13px;
  letter-spacing: 2px;
  margin-bottom: 11px;
  color: var(--muted);
  min-height: 19px;
}
.date-dot {
  color: var(--accent);
}
.display-panel {
  width: 100%;
  display: flex;
  align-items: center;
  flex-direction: column;
}
.digital-clock {
  font-family: var(--clock-font);
  font-size: clamp(100px, 15.8vw, 232px);
  font-weight: 500;
  letter-spacing: calc(-0.075em + var(--extra-digit-spacing));
  line-height: 1.16;
  display: flex;
  align-items: baseline;
  justify-content: center;
  color: var(--time-color);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.colon {
  font-weight: 350;
  position: relative;
  top: -0.055em;
  margin: 0 0.035em;
}
.seconds-group {
  display: flex;
  align-self: stretch;
  justify-content: flex-end;
  flex-direction: column;
  align-items: flex-start;
  margin-left: 24px;
  letter-spacing: calc(-0.025em + var(--extra-digit-spacing));
  padding-bottom: 0.78em;
  font-size: 0.28em;
  line-height: 1;
}
.period {
  color: var(--muted);
  letter-spacing: 1px;
  font:
    11px Inter,
    Arial,
    sans-serif;
  margin: 0 0 15px 4px;
}
.period:empty {
  display: none;
}
.timezone-line {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 19px;
  font-size: 10px;
  letter-spacing: 1.6px;
  color: var(--muted);
}
.zone-dot {
  width: 5px;
  height: 5px;
  background: var(--muted);
  border-radius: 50%;
  opacity: 0.65;
}
.timezone-separator {
  opacity: 0.4;
  margin: 0 2px;
}
.stage-bottom {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 18px 0 28px;
}
.small-label {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.7px;
}
.view-switch {
  display: flex;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 4px;
  gap: 3px;
}
.view-switch button {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 17px;
  border-radius: 5px;
  font-size: 11px;
  color: var(--muted);
}
.view-switch button.active {
  background: var(--panel);
  color: var(--text);
}
.view-switch svg {
  width: 16px;
  height: 16px;
}
.appearance-link {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  color: var(--muted);
  padding: 10px 0 10px 10px;
}
.appearance-link svg {
  width: 16px;
  height: 16px;
}
.appearance-chevron {
  font-size: 16px;
  margin-left: 8px;
}
.personalize {
  border-top: 1px solid var(--line);
  padding-top: 29px;
}
.personalize-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 26px;
}
h1 {
  font-size: 18px;
  letter-spacing: 0.6px;
  font-weight: 550;
  margin: 0 0 8px;
}
h1 span {
  color: var(--accent);
}
.personalize-heading p {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.5px;
  margin: 0;
}
.reset-appearance {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  color: var(--muted);
  padding: 8px 0 8px 8px;
}
.reset-appearance svg {
  width: 12px;
  height: 12px;
}
.settings-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr 0.85fr;
  gap: 0;
}
.setting-section {
  padding: 0 32px;
  border-left: 1px solid var(--line);
}
.setting-section:first-child {
  padding-left: 0;
  border-left: 0;
}
.setting-section:last-child {
  padding-right: 0;
}
.setting-section h2 {
  font-size: 11px;
  letter-spacing: 1px;
  font-weight: 500;
  margin: 0 0 19px;
  display: flex;
  align-items: center;
  gap: 11px;
}
.setting-section h2 > span {
  font-size: 9px;
  letter-spacing: 0;
  color: var(--muted);
}
.theme-options {
  display: flex;
  gap: 11px;
}
.theme-option {
  padding: 0;
  flex: 1;
  max-width: 100px;
  font-size: 10px;
  color: var(--muted);
}
.theme-option.selected {
  color: var(--text);
}
.theme-preview {
  height: 66px;
  border-radius: 7px;
  display: grid;
  place-items: center;
  position: relative;
  font-family: Arial, sans-serif;
  font-size: 21px;
  letter-spacing: -1px;
  border: 1px solid #0000000b;
  margin-bottom: 10px;
}
.theme-preview i {
  position: absolute;
  bottom: 4px;
  right: 4px;
  display: none;
  border-radius: 50%;
  width: 14px;
  height: 14px;
  background: var(--accent);
  color: var(--bg);
}
.theme-preview i svg {
  width: 10px;
  height: 10px;
  stroke-width: 2.4;
}
.theme-option.selected .theme-preview {
  outline: 1.5px solid var(--accent);
  outline-offset: 3px;
}
.theme-option.selected i {
  display: grid;
  place-items: center;
}
.theme-cream {
  background: #f6f5f0;
  color: #292c2b;
}
.theme-midnight {
  background: #20262f;
  color: #d9e4ef;
}
.theme-forest {
  background: #2d4438;
  color: #d1ddbb;
}
.theme-retro {
  background: #e3cfaa;
  color: #6d4a37;
}
.color-options {
  display: flex;
  gap: 12px;
  margin: 4px 0 22px;
  align-items: center;
}
.color-swatch {
  width: 25px;
  height: 25px;
  border-radius: 50%;
  background: var(--swatch);
  border: 1px solid #8882;
  position: relative;
  display: grid;
  place-items: center;
}
.color-swatch.selected:after {
  content: "";
  position: absolute;
  inset: -4px;
  border: 1px solid var(--muted);
  border-radius: 50%;
}
.color-swatch svg {
  width: 13px;
  height: 13px;
  stroke-width: 2;
  color: var(--check-color);
  display: none;
}
.color-swatch.selected svg {
  display: block;
}
.color-custom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  font-size: 10px;
  color: var(--muted);
}
.color-input-wrap {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 7px 9px;
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--text);
  font-family: monospace;
  font-size: 10px;
  cursor: pointer;
}
.color-input-wrap input {
  position: absolute;
  inset: 0;
  opacity: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
}
.color-input-wrap svg {
  width: 12px;
  height: 12px;
  color: var(--muted);
}
.preferences {
  display: flex;
  flex-direction: column;
  gap: 13px;
}
.preferences label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: var(--muted);
}
.toggle {
  appearance: none;
  -webkit-appearance: none;
  position: relative;
  width: 29px;
  height: 17px;
  border-radius: 12px;
  background: var(--line);
  cursor: pointer;
  margin: 0;
  transition: background 0.2s;
  flex-shrink: 0;
}
.toggle:after {
  content: "";
  display: block;
  width: 11px;
  height: 11px;
  position: absolute;
  left: 3px;
  top: 3px;
  border-radius: 50%;
  background: var(--bg);
  transition: transform 0.2s;
  box-shadow: 0 1px 2px #0001;
}
.toggle:checked {
  background: var(--accent);
}
.toggle:checked:after {
  transform: translateX(12px);
}
.settings-extra {
  border-top: 1px solid var(--line);
  margin-top: 26px;
  padding-top: 17px;
  display: flex;
  align-items: center;
  gap: 28px;
  font-size: 10px;
  color: var(--muted);
}
.settings-extra > label {
  display: flex;
  align-items: center;
  gap: 10px;
}
.settings-extra select {
  background: transparent;
  border: 0;
  color: var(--text);
  font-size: 10px;
  padding: 5px 18px 5px 4px;
  max-width: 150px;
  cursor: pointer;
}
.settings-extra select option {
  background: var(--bg);
  color: var(--text);
}
.saved-note {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 9px;
}
.saved-note > span {
  width: 4px;
  height: 4px;
  background: var(--muted);
  border-radius: 50%;
}
footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.5px;
  padding: 30px 0 22px;
}
footer > span:nth-child(2) {
  display: flex;
  align-items: center;
  gap: 9px;
}
.footer-spark {
  font-size: 18px;
  color: var(--accent);
}
footer kbd {
  font-size: 9px;
  padding: 1px 4px;
  margin: 0 2px;
}
.analog-clock {
  height: 287px;
  width: 287px;
  margin: 4px 0;
}
.dial {
  width: 100%;
  height: 100%;
  stroke: none;
  overflow: visible;
}
.dial-face {
  fill: var(--panel);
  stroke: var(--line);
  stroke-width: 0.8;
}
.dial-mark {
  stroke: var(--muted);
  stroke-width: 1.2;
  opacity: 0.45;
}
.dial-mark.major {
  stroke: var(--time-color);
  stroke-width: 2;
  opacity: 0.65;
}
.dial-numbers {
  fill: var(--time-color);
  font-family: var(--clock-font);
  font-size: 20px;
  text-anchor: middle;
}
.dial-brand {
  font-size: 8px;
  fill: var(--muted);
  letter-spacing: 2.5px;
  text-anchor: middle;
}
.hand {
  stroke: var(--time-color);
  transform-origin: 160px 160px;
  stroke-linecap: round;
}
.hour-hand {
  stroke-width: 6;
}
.minute-hand {
  stroke-width: 4;
}
.second-hand {
  stroke: var(--accent);
  stroke-width: 1.5;
}
.dial-pin {
  fill: var(--accent);
}
body.analog-view .time-area {
  padding-top: 22px;
  padding-bottom: 18px;
}
body.analog-view .date-line {
  margin-bottom: 16px;
}
body.analog-view .timezone-line {
  margin-top: 15px;
}
.numeric {
  font-family: var(--clock-font);
  font-variant-numeric: tabular-nums;
  font-weight: 450;
  letter-spacing: calc(-0.065em + var(--extra-digit-spacing));
  color: var(--time-color);
}
.timer-readout,
.stopwatch-readout {
  font-size: clamp(90px, 12vw, 175px);
  line-height: 1.22;
}
.stopwatch-fraction {
  font-size: 0.36em;
  letter-spacing: calc(-0.03em + var(--extra-digit-spacing));
  margin-left: 10px;
  color: var(--muted);
}
.timer-progress {
  width: 220px;
  height: 2px;
  background: var(--line);
  margin: 12px 0 25px;
  overflow: hidden;
}
.timer-progress span {
  display: block;
  background: var(--accent);
  width: 100%;
  height: 100%;
  transition: width 0.2s linear;
}
.timer-presets {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}
.timer-presets button {
  border-radius: 5px;
  color: var(--muted);
  font-size: 10px;
  border: 1px solid var(--line);
  padding: 7px 12px;
}
.timer-presets button.selected {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}
.action-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 23px;
}
.round-button {
  border: 1px solid var(--line);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
}
.round-button svg {
  width: 16px;
  height: 16px;
}
.primary-button {
  background: var(--accent);
  color: var(--bg);
  border-radius: 7px;
  min-height: 41px;
  padding: 11px 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 11px;
  font-size: 12px;
}
.primary-button svg {
  width: 15px;
  height: 15px;
}
.action-note {
  font-size: 10px;
  color: var(--muted);
  margin-left: 4px;
}
.secondary-button {
  font-size: 11px;
  padding: 12px 18px;
  border: 1px solid var(--line);
  border-radius: 7px;
}
.timer-settings {
  display: flex;
  flex-direction: column;
  align-items: center;
}
#customTimerForm {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  font-size: 11px;
  color: var(--muted);
}
#customTimerForm label {
  display: flex;
  gap: 5px;
  align-items: center;
}
#customTimerForm input {
  width: 47px;
  padding: 6px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--text);
  text-align: center;
}
#customTimerForm button {
  padding: 7px 10px;
  background: var(--panel);
  border-radius: 4px;
}
.laps {
  width: min(430px, 100%);
  margin-top: 22px;
  font-size: 11px;
  max-height: 156px;
  overflow: auto;
  padding: 0 7px;
}
.lap-heading,
.lap-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  text-align: right;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}
.lap-heading {
  font-size: 9px;
  color: var(--muted);
}
.lap-heading > :first-child,
.lap-row > :first-child {
  text-align: left;
}
.laps ol {
  margin: 0;
  padding: 0;
  list-style: none;
  font-variant-numeric: tabular-nums;
}
.lap-row span:first-child {
  color: var(--muted);
}
body:not(.clock-mode) .time-area {
  padding: 30px 0;
}
.toast {
  position: fixed;
  left: 50%;
  bottom: 27px;
  transform: translateX(-50%);
  padding: 12px 21px;
  background: var(--text);
  color: var(--bg);
  border-radius: 8px;
  box-shadow: 0 8px 30px #0001;
  font-size: 12px;
  z-index: 20;
  max-width: 90%;
  text-align: center;
}
.exit-focus {
  position: fixed;
  right: 30px;
  top: 25px;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--muted);
  background: var(--panel);
  padding: 12px 16px;
  border-radius: 8px;
  z-index: 15;
  display: flex;
  opacity: 0.45;
  transition: opacity 0.2s;
}
.exit-focus:hover,
.exit-focus:focus {
  opacity: 1;
}
.exit-focus span {
  font-size: 9px;
  opacity: 0.6;
  margin-left: 5px;
}
.exit-focus svg {
  width: 15px;
  height: 15px;
}
.focus-mode .header,
.focus-mode .stage-heading,
.focus-mode .stage-bottom,
.focus-mode .personalize,
.focus-mode footer {
  display: none !important;
}
.focus-mode .app-shell {
  max-width: none;
  padding: 0 4%;
}
.focus-mode .clock-stage {
  min-height: 100svh;
}
.focus-mode .time-area {
  padding: 70px 0;
}
.focus-mode .digital-clock {
  font-size: clamp(100px, 24vw, 450px);
}
.focus-mode .date-line {
  font-size: clamp(12px, 1.4vw, 20px);
  margin-bottom: 20px;
}
.focus-mode .timezone-line {
  font-size: 12px;
}
.focus-mode .analog-clock {
  width: min(63vh, 70vw);
  height: min(63vh, 70vw);
}
.focus-mode .timer-readout,
.focus-mode .stopwatch-readout {
  font-size: clamp(90px, 22vw, 370px);
}
.focus-mode .timer-settings,
.focus-mode .action-note {
  display: none;
}
.focus-mode .time-area .action-row {
  margin-top: 35px;
}
dialog {
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 45px 45px 40px;
  text-align: center;
  max-width: calc(100% - 40px);
  box-shadow: 0 20px 100px #0003;
}
dialog::backdrop {
  background: #1117;
  backdrop-filter: blur(6px);
}
.dialog-close {
  position: absolute;
  right: 15px;
  top: 15px;
  padding: 5px;
  color: var(--muted);
}
.done-icon {
  margin: 0 auto 25px;
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 50%;
}
.done-icon svg {
  width: 30px;
  height: 30px;
}
dialog .eyebrow {
  font-size: 9px;
}
dialog h2 {
  font-size: 23px;
  font-weight: 500;
  margin: 15px 0;
}
dialog p {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 28px;
}
dialog .primary-button {
  min-width: 150px;
}
body.timer-finished .timer-readout {
  animation: finished 1.6s ease-in-out infinite;
}
@keyframes finished {
  50% {
    opacity: 0.4;
  }
}
@media (min-width: 1600px) {
  .clock-stage {
    min-height: 590px;
  }
  .time-area {
    padding-top: 55px;
    padding-bottom: 50px;
  }
  .personalize {
    padding-top: 38px;
  }
  .personalize-heading {
    margin-bottom: 35px;
  }
  .theme-preview {
    height: 75px;
  }
  .settings-extra {
    margin-top: 32px;
  }
}
@media (max-width: 1100px) {
  .app-shell {
    padding: 0 4%;
  }
  .setting-section {
    padding: 0 23px;
  }
  .color-options {
    gap: 9px;
  }
  .color-swatch {
    width: 23px;
    height: 23px;
  }
  .theme-options {
    gap: 9px;
  }
  .theme-preview {
    font-size: 18px;
  }
  .action-note {
    display: none;
  }
  .clock-stage {
    min-height: 490px;
  }
}
@media (max-width: 800px) {
  .header {
    height: 88px;
  }
  .mode {
    padding: 10px 14px;
  }
  .focus-button kbd {
    display: none;
  }
  .focus-button span {
    display: none;
  }
  .focus-button svg {
    width: 19px;
    height: 19px;
  }
  .brand-name {
    font-size: 19px;
  }
  .brand-icon {
    width: 33px;
    height: 33px;
  }
  .brand-icon svg {
    width: 23px;
    height: 23px;
  }
  .settings-grid {
    grid-template-columns: 1.1fr 1fr;
  }
  .display-section {
    grid-column: 1/-1;
    border-left: 0;
    border-top: 1px solid var(--line);
    padding: 20px 0 0;
    margin-top: 22px;
    display: flex;
    align-items: center;
    gap: 30px;
  }
  .display-section h2 {
    margin: 0;
  }
  .preferences {
    flex: 1;
    flex-direction: row;
    gap: 25px;
    justify-content: space-between;
  }
  .preferences label {
    gap: 12px;
  }
  .setting-section:nth-child(2) {
    padding-right: 0;
  }
  .clock-stage {
    min-height: 440px;
  }
  .time-area {
    padding: 42px 0;
  }
  .settings-extra {
    gap: 15px;
    flex-wrap: wrap;
  }
  .saved-note {
    margin-left: 0;
  }
  .stage-note {
    font-size: 10px;
  }
  .theme-preview {
    height: 68px;
  }
  .color-options {
    gap: 15px;
  }
  .color-swatch {
    width: 26px;
    height: 26px;
  }
  .digital-clock {
    font-size: 19vw;
  }
  .seconds-group {
    margin-left: 17px;
  }
  footer > span:nth-child(2) {
    display: none;
  }
  .focus-mode .digital-clock {
    font-size: 23vw;
  }
}
@media (max-width: 580px) {
  .app-shell {
    padding: 0 23px;
  }
  .header {
    height: 124px;
    align-items: flex-start;
    padding-top: 23px;
  }
  .brand-name {
    font-size: 18px;
  }
  .brand-name > span {
    font-size: 7px;
  }
  .mode-nav {
    top: 76px;
    padding: 3px;
    gap: 3px;
    border-radius: 9px;
  }
  .mode {
    padding: 9px 19px;
    font-size: 11px;
    gap: 7px;
  }
  .mode svg {
    width: 14px;
    height: 14px;
  }
  .focus-button {
    padding-top: 7px;
  }
  .stage-heading {
    padding-top: 24px;
  }
  .eyebrow {
    font-size: 10px;
    letter-spacing: 1px;
  }
  .stage-note {
    font-size: 9px;
    letter-spacing: 0;
  }
  .clock-stage {
    min-height: 365px;
  }
  .time-area {
    padding: 38px 0 32px;
  }
  .date-line {
    font-size: 11px;
    letter-spacing: 0.6px;
    gap: 10px;
    margin-bottom: 17px;
  }
  .digital-clock {
    font-size: 21vw;
    letter-spacing: calc(-0.065em + var(--extra-digit-spacing));
  }
  .seconds-group {
    margin-left: 10px;
    font-size: 0.27em;
    padding-bottom: 0.78em;
  }
  .period {
    font-size: 8px;
    margin: 0 0 8px 2px;
  }
  .timezone-line {
    font-size: 8px;
    gap: 7px;
    letter-spacing: 1px;
    margin-top: 18px;
  }
  .stage-bottom {
    grid-template-columns: 1fr auto;
    padding: 13px 0 23px;
  }
  .small-label {
    display: none;
  }
  .view-switch {
    justify-self: start;
  }
  .view-switch button {
    font-size: 10px;
    padding: 7px 10px;
    gap: 5px;
  }
  .view-switch svg {
    width: 14px;
    height: 14px;
  }
  .appearance-link {
    font-size: 10px;
    padding-left: 8px;
    gap: 4px;
  }
  .appearance-link svg {
    display: none;
  }
  .appearance-chevron {
    margin-left: 1px;
  }
  .personalize {
    padding-top: 24px;
  }
  .personalize-heading {
    margin-bottom: 25px;
  }
  h1 {
    font-size: 15px;
    letter-spacing: 0;
  }
  .personalize-heading p {
    font-size: 10px;
  }
  .reset-appearance {
    font-size: 9px;
  }
  .reset-appearance svg {
    display: none;
  }
  .settings-grid {
    grid-template-columns: 1fr;
  }
  .setting-section {
    padding: 0;
    border: 0;
  }
  .setting-section h2 {
    font-size: 10px;
    margin-bottom: 16px;
  }
  .theme-options {
    gap: 14px;
  }
  .theme-option {
    max-width: none;
    font-size: 10px;
  }
  .theme-preview {
    height: 66px;
    font-size: 22px;
  }
  .color-section {
    margin-top: 26px;
    border-top: 1px solid var(--line);
    padding-top: 21px !important;
    display: grid;
    grid-template-columns: 1fr auto;
    column-gap: 12px;
  }
  .color-section h2 {
    grid-column: 1/-1;
  }
  .color-options {
    gap: 12px;
    margin: 3px 0 0;
  }
  .color-swatch {
    width: 24px;
    height: 24px;
  }
  .color-custom {
    justify-content: flex-end;
  }
  .color-custom > label:first-child {
    display: none;
  }
  .color-input-wrap {
    gap: 7px;
    font-size: 9px;
    padding: 7px;
  }
  .display-section {
    gap: 0;
    display: block;
    margin-top: 23px;
    padding-top: 21px;
  }
  .display-section h2 {
    margin-bottom: 17px;
  }
  .preferences {
    gap: 12px;
  }
  .preferences label {
    font-size: 10px;
    gap: 7px;
  }
  .toggle {
    width: 26px;
    height: 16px;
  }
  .toggle:after {
    width: 10px;
    height: 10px;
  }
  .toggle:checked:after {
    transform: translateX(10px);
  }
  .settings-extra {
    margin-top: 23px;
    gap: 14px 22px;
    padding-top: 15px;
    justify-content: space-between;
  }
  .settings-extra > label {
    font-size: 9px;
    gap: 6px;
  }
  .settings-extra select {
    font-size: 9px;
    max-width: 130px;
  }
  .saved-note {
    font-size: 9px;
  }
  footer {
    font-size: 8px;
    padding: 25px 0;
  }
  footer > span:last-child {
    font-size: 8px;
  }
  footer kbd {
    font-size: 8px;
  }
  .analog-clock {
    width: 245px;
    height: 245px;
  }
  .analog-view .time-area {
    padding-top: 26px;
    padding-bottom: 25px;
  }
  .analog-view .clock-stage {
    min-height: 440px;
  }
  .timer-readout,
  .stopwatch-readout {
    font-size: 24vw;
  }
  .stopwatch-fraction {
    font-size: 0.29em;
    margin-left: 4px;
  }
  .timer-presets {
    gap: 6px;
  }
  .timer-presets button {
    font-size: 9px;
    padding: 6px 9px;
  }
  .timer-progress {
    margin: 12px 0 19px;
    width: 180px;
  }
  .action-row {
    margin-top: 19px;
  }
  .primary-button {
    font-size: 11px;
    padding: 10px 21px;
  }
  .round-button {
    width: 36px;
    height: 36px;
  }
  .focus-mode .digital-clock {
    font-size: 23vw;
  }
  .focus-mode .time-area {
    padding-top: 90px;
  }
  .exit-focus {
    top: 20px;
    right: 20px;
    padding: 10px 12px;
    font-size: 10px;
  }
  .exit-focus span {
    display: none;
  }
  dialog {
    padding: 40px 24px 30px;
  }
  dialog h2 {
    font-size: 20px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *:before,
  *:after {
    transition: none !important;
    animation: none !important;
  }
}

.timer-readout.long-time {
  font-size: clamp(65px, 10vw, 145px);
}
.stopwatch-readout.long-time {
  font-size: clamp(65px, 10vw, 145px);
}
.focus-mode .timer-readout.long-time,
.focus-mode .stopwatch-readout.long-time {
  font-size: clamp(65px, 16vw, 270px);
}
@media (max-width: 580px) {
  .timer-readout.long-time,
  .stopwatch-readout.long-time {
    font-size: 17vw;
  }
  .focus-mode .timer-readout.long-time,
  .focus-mode .stopwatch-readout.long-time {
    font-size: 17vw;
  }
  .preferences label {
    min-height: 32px;
  }
  .color-input-wrap {
    min-height: 32px;
  }
}

/* Keep the interface limited to timing and appearance controls. */
.header {
  justify-content: flex-end;
}
.view-switch {
  grid-column: 2;
}
.appearance-link {
  grid-column: 3;
}
.personalize-heading {
  justify-content: flex-end;
  margin-bottom: 18px;
}
footer {
  justify-content: flex-end;
}
#timerDoneDialog h2 {
  margin-bottom: 26px;
}
@media (max-width: 580px) {
  .header {
    height: 80px;
    align-items: center;
    padding-top: 0;
    justify-content: space-between;
  }
  .mode-nav {
    position: static;
    transform: none;
  }
  .mode {
    padding: 9px 15px;
  }
  .focus-button {
    padding: 8px 0 8px 12px;
  }
  .view-switch {
    grid-column: 1;
  }
  .appearance-link {
    grid-column: 2;
  }
}

/* 间距控制保留即时样例，大数字超出可用空间时由脚本调整字号。 */
.digital-clock,
.timer-readout,
.stopwatch-readout {
  width: max-content;
  flex-shrink: 0;
  white-space: nowrap;
}
.spacing-settings {
  border-top: 1px solid var(--line);
  margin-top: 26px;
  padding-top: 18px;
}
.spacing-heading {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
}
.spacing-heading output {
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.spacing-heading button {
  margin-left: auto;
  min-height: 44px;
}
.spacing-controls {
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: 650px;
}
.spacing-step {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--text);
  font-size: 22px;
}
.spacing-step:disabled {
  opacity: 0.35;
  cursor: default;
}
.spacing-slider {
  flex: 1;
  min-width: 60px;
}
.spacing-slider input {
  display: block;
  width: 100%;
  height: 44px;
  margin: 0;
  accent-color: var(--accent);
  cursor: pointer;
}
.spacing-labels {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: var(--muted);
}
.spacing-preview {
  width: 180px;
  text-align: center;
  font-family: var(--clock-font);
  font-size: 34px;
  font-variant-numeric: tabular-nums;
  letter-spacing: calc(-0.075em + var(--extra-digit-spacing));
  color: var(--time-color);
}
.spacing-hint {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.7;
  margin: 14px 0 0;
}
@media (max-width: 580px) {
  .spacing-controls {
    flex-wrap: wrap;
    gap: 10px;
  }
  .spacing-preview {
    width: 100%;
    margin-top: 10px;
  }
}

/* 设置按需展开，触屏也能清楚退出全屏。 */
.message-settings {
  width: min(440px, 100%);
  margin-top: 20px;
  font-size: 13px;
  text-align: left;
}
.message-settings summary {
  min-height: 44px;
  display: list-item;
  padding: 12px 8px;
  cursor: pointer;
  color: var(--muted);
  text-align: center;
}
.message-editor {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
}
.message-editor label {
  display: block;
  margin-bottom: 10px;
}
.message-editor textarea {
  display: block;
  width: 100%;
  min-height: 92px;
  padding: 12px;
  font: inherit;
  line-height: 1.6;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: var(--bg);
}
.message-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 11px;
  color: var(--muted);
  margin-top: 8px;
}
.message-meta #messageCount {
  white-space: nowrap;
}
.message-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.message-actions button {
  min-height: 44px;
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-radius: 7px;
}
.message-actions button:first-child {
  background: var(--accent);
  color: var(--bg);
}
.done-message {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-width: 32rem;
  line-height: 1.8;
  font-size: clamp(16px, 3vw, 24px);
  color: var(--text);
}
#timerDoneDialog {
  width: min(560px, calc(100% - 32px));
  max-height: calc(100dvh - 32px);
  overflow: auto;
}
#timerDoneDialog .done-message {
  font-size: clamp(16px, 3vw, 24px);
  color: var(--text);
}
.exit-focus {
  opacity: 1;
  min-height: 44px;
  top: max(16px, env(safe-area-inset-top));
  right: max(16px, env(safe-area-inset-right));
}
.focus-mode .message-settings {
  display: none;
}
.appearance-link,
.focus-button,
.view-switch button,
.timer-presets button,
.primary-button,
.dialog-close,
.reset-appearance {
  min-height: 44px;
}
.round-button,
.dialog-close {
  min-width: 44px;
}
.preferences label,
.settings-extra > label {
  min-height: 44px;
}
textarea:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}
#customTimerForm {
  flex-wrap: wrap;
  justify-content: center;
}
#customTimerForm input,
#customTimerForm button {
  min-height: 44px;
}
@media (max-width: 580px) {
  .app-shell {
    padding: 0 16px;
  }
  .header {
    gap: 8px;
  }
  .mode {
    padding: 10px 12px;
    min-height: 44px;
  }
  .stage-bottom {
    gap: 8px;
  }
  .view-switch button {
    padding: 8px;
  }
  .message-editor textarea {
    font-size: 16px;
  }
  .timer-presets {
    flex-wrap: wrap;
    justify-content: center;
  }
  .settings-extra select {
    font-size: 13px;
    min-height: 44px;
  }
}
