:root,
html[data-theme="light"] {
  --bg: #f6f7fb;
  --surface: #ffffff;
  --surface-hover: #eef2f7;
  --text: #172033;
  --text-muted: #667085;
  --border: #d9e0ea;
  --accent: #2563eb;
  --accent-strong: #1d4ed8;
  --success: #13895f;
  --danger: #c2413a;
  --warning: #b7791f;
  --focus: #7c3aed;
  --shadow: 0 16px 44px rgba(17, 24, 39, 0.08);
  color-scheme: light;
}

html[data-theme="dark"] {
  --bg: #0e1118;
  --surface: #151a24;
  --surface-hover: #1d2532;
  --text: #edf2f7;
  --text-muted: #a6b0c2;
  --border: #2a3342;
  --accent: #6da4ff;
  --accent-strong: #9ec2ff;
  --success: #43c991;
  --danger: #ff776d;
  --warning: #e5b454;
  --focus: #c4b5fd;
  --shadow: 0 18px 52px rgba(0, 0, 0, 0.32);
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  html[data-theme="auto"] {
    --bg: #0e1118;
    --surface: #151a24;
    --surface-hover: #1d2532;
    --text: #edf2f7;
    --text-muted: #a6b0c2;
    --border: #2a3342;
    --accent: #6da4ff;
    --accent-strong: #9ec2ff;
    --success: #43c991;
    --danger: #ff776d;
    --warning: #e5b454;
    --focus: #c4b5fd;
    --shadow: 0 18px 52px rgba(0, 0, 0, 0.32);
    color-scheme: dark;
  }
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
  scroll-padding-top: 7rem;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background:
    linear-gradient(180deg, rgba(37, 99, 235, 0.06), transparent 260px),
    var(--bg);
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  line-height: 1.5;
}

button,
input,
select {
  font: inherit;
}

button {
  touch-action: manipulation;
}

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

[hidden] {
  display: none !important;
}

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

.skip-link {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 20;
  transform: translateY(-160%);
  padding: 0.65rem 0.85rem;
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.skip-link:focus {
  transform: translateY(0);
}

.app-header {
  position: sticky;
  top: 0.75rem;
  z-index: 10;
  display: grid;
  grid-template-columns: minmax(11rem, auto) auto minmax(0, 1fr);
  align-items: center;
  gap: 0.8rem;
  width: min(1440px, calc(100% - 3rem));
  margin: 0.75rem auto 0;
  padding: 0.55rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.brand-block {
  min-width: 14rem;
}

.brand-block h1,
.section-heading h2 {
  margin: 0;
  color: var(--text);
  font-weight: 760;
  line-height: 1.05;
}

.brand-block h1 {
  font-size: 1.55rem;
}

.app-footer {
  position: fixed;
  right: 0.75rem;
  bottom: 0.65rem;
  z-index: 20;
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
  padding: 0.35em 0.75em;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  box-shadow: 0 2px 10px color-mix(in srgb, var(--text) 16%, transparent);
  color: var(--text-muted);
  font-size: 0.7rem;
  line-height: 1.2;
  white-space: nowrap;
  backdrop-filter: blur(10px);
}

.app-footer-version {
  color: var(--text);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-weight: 700;
}

.app-footer-sep {
  opacity: 0.55;
  user-select: none;
}

.app-footer-link {
  color: var(--accent);
  text-decoration: none;
}

.app-footer-link:hover {
  text-decoration: underline;
}

.app-footer-by {
  color: inherit;
}

.section-heading h2 {
  font-size: 1.35rem;
}

.section-kicker {
  margin: 0 0 0.35rem;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 780;
  letter-spacing: 0;
  text-transform: uppercase;
}

.header-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.header-menu {
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(6rem, 1fr));
  gap: 0.2rem;
  padding: 0.2rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
}

.menu-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.25rem;
  padding: 0.4rem 0.75rem;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font: inherit;
  font-weight: 760;
  text-decoration: none;
}

.menu-link:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.menu-link[aria-pressed="true"] {
  background: var(--text);
  color: var(--bg);
}

.live-clock {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 2.45rem;
  padding: 0 0.85rem;
  border: 1px solid color-mix(in srgb, var(--accent) 36%, var(--border));
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  box-shadow: 0 1px 2px color-mix(in srgb, var(--text) 18%, transparent);
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-variant-numeric: tabular-nums;
  font-weight: 680;
  white-space: nowrap;
  transition: background-color 120ms ease, border-color 120ms ease, box-shadow 120ms ease, transform 120ms ease;
}

.live-clock::after {
  display: grid;
  width: 1.05rem;
  height: 1.05rem;
  place-items: center;
  border-left: 1px solid var(--border);
  color: var(--accent);
  content: "\2197";
  font-size: 0.95rem;
  font-weight: 780;
  line-height: 1;
  padding-left: 0.45rem;
}

.live-clock:hover {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 9%, var(--surface));
  box-shadow: 0 4px 10px color-mix(in srgb, var(--accent) 20%, transparent);
  transform: translateY(-1px);
}

.live-clock:active {
  transform: translateY(0);
}

.preference-stack {
  display: grid;
  justify-items: end;
  gap: 0.35rem;
}

.preference-switcher {
  display: inline-grid;
  grid-auto-flow: column;
  grid-auto-columns: 2.35rem;
  gap: 0.25rem;
  padding: 0.3rem;
  border: 1px solid color-mix(in srgb, var(--border) 82%, transparent);
  border-radius: 10px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  box-shadow: 0 8px 24px rgba(17, 24, 39, 0.06);
}

.theme-switcher {
  grid-auto-columns: 2.15rem;
}

.switcher-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 1.9rem;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 780;
  line-height: 1;
}

.switcher-btn:hover {
  background: color-mix(in srgb, var(--surface-hover) 74%, transparent);
}

.switcher-btn[aria-pressed="true"] {
  border-color: var(--accent);
  color: var(--accent);
}

.language-flag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.9rem;
  height: 1.25rem;
  line-height: 1;
}

.language-flag svg {
  display: block;
  max-width: 100%;
  max-height: 100%;
}

.theme-option {
  font-size: 1rem;
}

.theme-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.1rem;
  height: 1.1rem;
  line-height: 1;
}

.theme-icon svg {
  width: 1.05rem;
  height: 1.05rem;
}

.app-shell {
  display: grid;
  gap: 1.15rem;
  width: min(1440px, calc(100% - 3rem));
  margin: 0 auto;
  padding: 0.4rem 0 3rem;
}

.workspace-section {
  scroll-margin-top: 7rem;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 62%, transparent);
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 5.25rem;
  padding: 1rem 1.1rem;
  border-bottom: 1px solid var(--border);
}

.section-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.timer-heading-status {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.session-meta,
.inline-message {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.92rem;
}

.global-actions,
.timer-global-actions,
.countdown-actions,
.sound-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.global-actions,
.timer-global-actions {
  padding: 1rem 1.1rem 0;
}

.shortcut-strip {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.55rem 1rem;
  padding: 0.8rem 1.1rem 0;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 5rem;
  min-height: 2.6rem;
  padding: 0.62rem 0.95rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-weight: 720;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 120ms ease, border-color 120ms ease, transform 120ms ease;
}

.button:hover {
  background: var(--surface-hover);
}

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

.button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
  transform: none;
}

.button-primary {
  border-color: color-mix(in srgb, var(--accent) 88%, var(--border));
  background: var(--accent);
  color: #ffffff;
}

.button-primary:hover {
  background: var(--accent-strong);
}

.button-danger {
  border-color: color-mix(in srgb, var(--danger) 82%, var(--border));
  background: var(--danger);
  color: #ffffff;
}

.button-danger:hover {
  background: color-mix(in srgb, var(--danger) 86%, #000000);
}

.button-secondary {
  background: color-mix(in srgb, var(--surface) 82%, var(--surface-hover));
}

.button-quiet {
  color: var(--accent);
}

.stopwatch-list {
  display: grid;
  gap: 0.65rem;
  padding: 1rem 1.1rem 1.1rem;
}

.stopwatch-row {
  display: grid;
  grid-template-columns: minmax(15rem, 1fr) minmax(11ch, 13ch) auto;
  position: relative;
  align-items: center;
  gap: 1rem;
  padding: 0.9rem;
  border: 1px solid var(--border);
  border-left: 4px solid var(--stopwatch-accent, var(--accent));
  border-radius: 8px;
  background: var(--surface);
}

.stopwatch-row[data-status="running"] {
  border-color: color-mix(in srgb, var(--success) 45%, var(--border));
}

.stopwatch-row[data-status="stopped"] {
  border-color: color-mix(in srgb, var(--warning) 30%, var(--border));
}

.stopwatch-meta {
  display: grid;
  grid-template-columns: auto minmax(7rem, 1fr);
  align-items: center;
  gap: 0.7rem;
  min-width: 0;
  padding-top: 1.35rem;
}

.status-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 5.8rem;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 680;
}

.status-dot {
  width: 0.62rem;
  height: 0.62rem;
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--text-muted);
}

.stopwatch-row[data-status="running"] .status-dot {
  background: var(--success);
}

.stopwatch-row[data-status="stopped"] .status-dot,
.countdown-row[data-status="paused"] .status-dot {
  background: var(--warning);
}

.countdown-row[data-status="running"] .status-dot {
  background: var(--success);
}

.countdown-row[data-status="complete"] .status-dot {
  background: var(--danger);
}

.stopwatch-name-input,
.countdown-name-input,
.field input,
.field select,
.countdown-sound-select {
  width: 100%;
  min-height: 2.45rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
}

.stopwatch-name-input,
.countdown-name-input {
  min-width: 0;
  padding: 0.45rem 0.65rem;
  font-weight: 700;
}

.stopwatch-name-input {
  max-width: 22rem;
}

.stopwatch-color {
  width: 2.5rem;
  height: 2.45rem;
  padding: 0.2rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  cursor: pointer;
  position: absolute;
  top: 5.4rem;
  left: 0.65rem;
}

.stopwatch-shortcut {
  grid-column: 2 / 4;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.45rem;
  min-width: 0;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 720;
}

.timer-display {
  justify-self: end;
  min-width: 11ch;
  color: var(--text);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 2rem;
  font-variant-numeric: tabular-nums;
  font-weight: 780;
  line-height: 1;
  text-align: right;
  white-space: nowrap;
}

.timer-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(4.6rem, 1fr));
  gap: 0.45rem;
}

.timer-actions .button {
  min-width: 0;
  min-height: 2.45rem;
  padding: 0.5rem 0.7rem;
}

.lap-history {
  grid-column: 1 / -1;
  border-top: 1px solid var(--border);
  padding-top: 0.7rem;
}

.stopwatch-row .lap-history {
  margin-bottom: 0;
}

.lap-history summary {
  width: max-content;
  max-width: 100%;
  color: var(--text-muted);
  font-weight: 720;
  cursor: pointer;
}

.lap-list {
  display: grid;
  gap: 0.25rem;
  max-height: 15rem;
  margin: 0.65rem 0 0;
  padding: 0;
  overflow: auto;
  list-style: none;
}

.lap-item {
  display: grid;
  grid-template-columns: 5rem 1fr 1fr;
  gap: 0.75rem;
  padding: 0.45rem 0.55rem;
  border-radius: 6px;
  background: var(--bg);
  color: var(--text-muted);
  font-size: 0.92rem;
}

.lap-item strong,
.lap-time {
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.empty-state {
  color: var(--text-muted);
}

.countdown-list {
  display: grid;
  gap: 0.65rem;
  padding: 1rem 1.1rem;
}

.countdown-row {
  display: grid;
  grid-template-columns: minmax(13rem, 0.7fr) minmax(18rem, 1fr) minmax(11rem, 0.55fr) auto;
  position: relative;
  align-items: center;
  gap: 1rem;
  padding: 0.9rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}

.countdown-row[data-status="running"] {
  border-color: color-mix(in srgb, var(--success) 45%, var(--border));
}

.countdown-row[data-status="paused"] {
  border-color: color-mix(in srgb, var(--warning) 30%, var(--border));
}

.countdown-row[data-status="complete"] {
  border-color: color-mix(in srgb, var(--danger) 38%, var(--border));
}

.countdown-meta {
  display: grid;
  grid-template-columns: auto minmax(8rem, 1fr);
  align-items: center;
  gap: 0.7rem;
  min-width: 0;
}

.countdown-row .countdown-display {
  justify-self: center;
}

.countdown-sound {
  display: grid;
  gap: 0.38rem;
  min-width: 0;
}

.countdown-sound-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.countdown-sound-label {
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 720;
}

.countdown-sound-test {
  min-height: 1.7rem;
  padding: 0.2rem 0.45rem;
  font-size: 0.7rem;
}

.countdown-sound-heading .countdown-sound-test {
  width: auto;
}

.countdown-row .countdown-actions {
  flex-wrap: nowrap;
}

.countdown-row .countdown-actions .button {
  min-width: 0;
  min-height: 2.45rem;
  padding: 0.5rem 0.7rem;
}

.countdown-display-actions {
  display: grid;
  gap: 0.45rem;
  align-self: stretch;
  grid-template-rows: repeat(2, minmax(2.15rem, 1fr));
}

.countdown-display-actions .button {
  width: 100%;
}

html[lang="nl"] .countdown-display-actions [data-countdown-action="fullscreen"] {
  font-size: 0.7rem;
  line-height: 1.05;
}

.countdown-row .countdown-actions .remove-timer-button,
.stopwatch-row .timer-actions .remove-stopwatch-button {
  position: absolute;
  top: 0.45rem;
  left: 0.5rem;
  z-index: 1;
  min-height: 1.85rem;
  padding: 0.25rem 0.45rem;
  border-color: transparent;
  color: var(--text-muted);
  font-size: 0.7rem;
  opacity: 0.68;
}

.countdown-row .countdown-actions .remove-timer-button:hover:not(:disabled),
.stopwatch-row .timer-actions .remove-stopwatch-button:hover:not(:disabled) {
  border-color: color-mix(in srgb, var(--danger) 38%, var(--border));
  background: color-mix(in srgb, var(--danger) 9%, transparent);
  color: var(--danger);
  opacity: 1;
}

.countdown-grid {
  display: grid;
  grid-template-columns: minmax(13rem, 0.8fr) minmax(22rem, 1fr) auto;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.1rem;
}

.field {
  display: grid;
  gap: 0.38rem;
  min-width: 0;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 720;
}

.field input,
.field select,
.countdown-sound-select {
  padding: 0.48rem 0.65rem;
}

.countdown-display {
  display: inline-grid;
  grid-template-columns: 2.25ch 0.55ch 2.25ch 0.55ch 2.25ch auto;
  align-items: center;
  justify-self: center;
  gap: 0;
  min-width: 0;
  color: var(--text);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 2.5rem;
  font-variant-numeric: tabular-nums;
  font-weight: 820;
  line-height: 1;
  text-align: center;
}

.countdown-row[data-status="complete"] .countdown-display {
  color: var(--danger);
}

.countdown-segment-input {
  width: 2.25ch;
  min-width: 0;
  min-height: 3.1rem;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: inherit;
  font: inherit;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  text-align: center;
}

.countdown-segment-input:hover:not(:disabled) {
  border-color: var(--border);
  background: var(--surface-hover);
}

.countdown-segment-input:disabled {
  cursor: default;
  opacity: 1;
  -webkit-text-fill-color: currentColor;
}

.time-separator {
  display: grid;
  place-items: center;
  justify-self: stretch;
  color: var(--text-muted);
  transform: translateX(-0.1em);
}

.time-format-label {
  align-self: center;
  margin-left: 0.3rem;
  color: var(--text-muted);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  font-size: 0.95rem;
  font-weight: 780;
  line-height: 1;
  transform: translateY(0.08em);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 5.75rem;
  min-height: 2rem;
  padding: 0.25rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-muted);
  font-size: 0.86rem;
  font-weight: 760;
}

.countdown-section[data-status="running"] .status-pill {
  border-color: color-mix(in srgb, var(--success) 45%, var(--border));
  color: var(--success);
}

.countdown-section[data-status="complete"] .status-pill {
  border-color: color-mix(in srgb, var(--danger) 45%, var(--border));
  color: var(--danger);
}

.sound-row {
  padding: 0 1.1rem 1.1rem;
}

.compact-field {
  width: min(12rem, 100%);
}

.volume-field {
  width: min(22rem, 100%);
}

.volume-field input[type="range"] {
  --volume-progress: 100%;
  -webkit-appearance: none;
  appearance: none;
  display: block;
  width: 100%;
  height: 1.35rem;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.volume-field input[type="range"]::-webkit-slider-runnable-track {
  height: 0.55rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: linear-gradient(
    to right,
    var(--accent) 0,
    var(--accent) var(--volume-progress),
    var(--surface-hover) var(--volume-progress),
    var(--surface-hover) 100%
  );
}

.volume-field input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 1.15rem;
  height: 1.15rem;
  margin-top: -0.38rem;
  border: 2px solid var(--surface);
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 1px 2px color-mix(in srgb, var(--text) 24%, transparent);
}

.volume-field input[type="range"]::-moz-range-track {
  height: 0.55rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-hover);
}

.volume-field input[type="range"]::-moz-range-progress {
  height: 0.55rem;
  border-radius: 999px;
  background: var(--accent);
}

.volume-field input[type="range"]::-moz-range-thumb {
  width: 0.95rem;
  height: 0.95rem;
  border: 2px solid var(--surface);
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 1px 2px color-mix(in srgb, var(--text) 24%, transparent);
}

.shortcut-strip kbd,
.shortcut-key {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 4.25rem;
  min-height: 2.15rem;
  padding: 0.35rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
  color: var(--text);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-weight: 760;
}

.shortcut-key {
  cursor: pointer;
}

.shortcut-key[aria-pressed="true"] {
  border-color: var(--accent);
  color: var(--accent);
}

.shortcut-key:disabled {
  cursor: default;
  opacity: 0.65;
}

.clear-shortcut {
  min-width: 3.9rem;
  min-height: 2.15rem;
  padding: 0.35rem 0.55rem;
  font-size: 0.82rem;
}

.shortcut-mode-label {
  margin-left: 0.35rem;
}

.shortcut-mode {
  display: inline-flex;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
}

.shortcut-mode-button {
  min-height: 2.15rem;
  padding: 0.35rem 0.55rem;
  border: 0;
  border-right: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 760;
  cursor: pointer;
}

.shortcut-mode-button:last-child {
  border-right: 0;
}

.shortcut-mode-button[aria-pressed="true"] {
  background: var(--accent);
  color: #ffffff;
}

.shortcut-mode-button:hover:not([aria-pressed="true"]) {
  background: var(--surface-hover);
  color: var(--text);
}

.inline-message {
  flex: 1 1 18rem;
  min-height: 1.4rem;
  margin: 0;
}

.event-table-wrap {
  margin: 0 1.1rem 1.1rem;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.event-count,
#eventCount {
  padding: 1rem 1.1rem 0.65rem;
}

.event-table {
  width: 100%;
  min-width: 40rem;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.event-table th,
.event-table td {
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: middle;
}

.event-table th {
  background: var(--bg);
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.event-table td {
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.event-table tbody tr:last-child td {
  border-bottom: 0;
}

.fullscreen-countdown,
.fullscreen-clock {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  width: 100vw;
  height: 100vh;
  min-height: 100dvh;
  padding: clamp(1rem, 4vh, 3rem);
  background: var(--bg);
  color: var(--text);
}

.fullscreen-countdown[hidden],
.fullscreen-clock[hidden] {
  display: none;
}

.fullscreen-content {
  display: grid;
  justify-items: center;
  gap: clamp(1.2rem, 3vh, 2.4rem);
  width: min(92vw, 86rem);
  text-align: center;
}

.fullscreen-clock-content {
  display: grid;
  justify-items: center;
  gap: clamp(0.85rem, 2.5vh, 1.8rem);
  width: min(92vw, 86rem);
  text-align: center;
}

.fullscreen-clock-time {
  width: 100%;
  color: var(--text);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: clamp(5rem, 19vw, 19rem);
  font-variant-numeric: tabular-nums;
  font-weight: 860;
  line-height: 0.92;
}

.fullscreen-clock-date {
  margin: 0;
  color: var(--text-muted);
  font-size: clamp(1.4rem, 3.5vw, 3rem);
  font-weight: 760;
}

.fullscreen-name {
  max-width: 100%;
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--text-muted);
  font-size: clamp(1.5rem, 4vh, 3.4rem);
  font-weight: 820;
  text-transform: uppercase;
}

.fullscreen-time {
  width: 100%;
  color: var(--text);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: clamp(5rem, 18vw, 18rem);
  font-variant-numeric: tabular-nums;
  font-weight: 860;
  line-height: 0.92;
}

.fullscreen-countdown.countdown-complete .fullscreen-time {
  color: var(--danger);
}

.fullscreen-controls {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.7rem;
}

.fullscreen-controls .button {
  min-width: 10rem;
  min-height: 3.25rem;
  padding-inline: 1.25rem;
}

.fullscreen-progress {
  width: min(72rem, 86vw);
  height: 0.5rem;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-hover);
}

.fullscreen-progress span {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transform-origin: left center;
}

.fullscreen-exit {
  position: fixed;
  top: 1rem;
  right: 1rem;
}

@media (max-width: 460px) {
  .fullscreen-controls {
    width: min(100%, 20rem);
    display: grid;
    grid-template-columns: 1fr;
  }

  .fullscreen-controls .button {
    width: 100%;
  }
}

@media (max-width: 519px) {
  .app-footer {
    right: auto;
    left: 50%;
    max-width: calc(100vw - 1rem);
    transform: translateX(-50%);
    font-size: 0.62rem;
    padding: 0.3em 0.55em;
  }
}

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

@media (max-width: 1100px) {
  .app-header {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .header-tools {
    justify-content: space-between;
    width: 100%;
  }

  .header-menu {
    width: min(24rem, 100%);
  }

  .stopwatch-row {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .timer-display {
    justify-self: start;
    text-align: left;
  }

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

  .countdown-row {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .countdown-row .countdown-display {
    justify-self: start;
  }

  .countdown-row .countdown-actions {
    flex-wrap: wrap;
    justify-content: flex-start;
  }

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

  .countdown-display {
    justify-self: start;
  }

  .countdown-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 760px) {
  .app-header,
  .app-shell {
    width: min(100% - 1rem, 100%);
  }

  .app-header {
    top: 0.5rem;
    padding: 0.5rem;
  }

  .brand-block {
    min-width: 0;
  }

  .header-tools,
  .header-menu,
  .global-actions,
  .timer-global-actions,
  .sound-row {
    align-items: stretch;
    width: 100%;
  }

  .header-tools,
  .global-actions,
  .timer-global-actions,
  .sound-row {
    flex-direction: column;
  }

  .live-clock,
  .preference-stack,
  .preference-switcher,
  .header-tools .button,
  .global-actions .button,
  .timer-global-actions .button,
  .sound-row .button {
    width: 100%;
  }

  .preference-stack {
    grid-template-columns: 1fr 1fr;
    justify-items: stretch;
  }

  .preference-switcher {
    grid-auto-columns: minmax(0, 1fr);
  }

  .section-heading {
    align-items: flex-start;
    flex-direction: column;
    min-height: 0;
  }

  .timer-heading-status {
    align-items: flex-start;
    justify-content: flex-start;
    width: 100%;
  }

  .section-actions {
    align-items: stretch;
    flex-direction: column;
    width: 100%;
  }

  .section-actions .button {
    width: 100%;
  }

  .stopwatch-meta {
    grid-template-columns: 1fr auto;
  }

  .countdown-meta {
    grid-template-columns: 1fr;
  }

  .status-wrap {
    grid-column: 1 / -1;
  }

  .timer-display,
  .countdown-display {
    font-size: 2.2rem;
  }

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

  .lap-item {
    grid-template-columns: 1fr;
  }

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

  .stopwatch-shortcut {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .stopwatch-shortcut > span {
    grid-column: 1 / -1;
  }

  .shortcut-key,
  .clear-shortcut {
    width: 100%;
  }
}

@media (max-width: 460px) {
  .timer-actions,
  .countdown-row .countdown-actions {
    grid-template-columns: 1fr;
  }

  .preference-stack {
    grid-template-columns: 1fr;
  }

  .countdown-row .countdown-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .button {
    width: 100%;
  }
}
