/* =========================================================
   Zen Meditation Timer — styles
   Bright, calm, mobile-first
   ========================================================= */

:root {
  --bg: #f7f4ef;
  --bg-soft: #f0ebe3;
  --surface: rgba(255, 255, 255, 0.78);
  --surface-solid: #fffcf8;
  --text: #2c2926;
  --text-muted: #6b6560;
  --accent: #5c7a6a;
  --accent-hover: #4a6557;
  --accent-soft: rgba(92, 122, 106, 0.12);
  --border: rgba(44, 41, 38, 0.1);
  --shadow: 0 8px 32px rgba(44, 41, 38, 0.08);
  --radius: 16px;
  --radius-sm: 10px;
  --font: "Noto Sans TC", "Noto Sans SC", "Noto Sans", system-ui, -apple-system, sans-serif;
  --header-h: 64px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --ring-circumference: 339.292; /* 2 * π * 54 */
}

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

html {
  height: 100%;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100%;
  min-height: 100dvh;
  font-family: var(--font);
  font-weight: 400;
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}

/* ---------- Background layers ---------- */
.bg-layer {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -2;
  pointer-events: none;
}

.bg-default {
  background:
    radial-gradient(ellipse 80% 60% at 50% 20%, #fff9f0 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 80% 80%, #e8f0ea 0%, transparent 50%),
    radial-gradient(ellipse 50% 40% at 15% 70%, #f5efe6 0%, transparent 50%),
    var(--bg);
  transition: opacity 0.8s ease;
}

.bg-video {
  opacity: 0;
  transition: opacity 1s ease;
  background: #1a1a1a;
}

.bg-video.is-visible {
  opacity: 1;
  z-index: -1;
}

.bg-overlay {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: transparent;
  transition: background 0.8s ease;
}

/* During meditation: keep UI thin so background video stays visible */
body.is-meditating .bg-overlay {
  /* Soft vignette only — avoid a full-screen dark sheet over the video */
  background:
    radial-gradient(ellipse 70% 55% at 50% 42%, rgba(0, 0, 0, 0.22) 0%, transparent 70%),
    linear-gradient(to bottom, rgba(0, 0, 0, 0.28) 0%, transparent 18%, transparent 78%, rgba(0, 0, 0, 0.35) 100%);
}

body.is-meditating {
  color: #f8f5f0;
  background: #0a0a0a;
}

body.is-meditating .bg-default {
  opacity: 0;
}

body.is-meditating .site-header {
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-color: transparent;
  box-shadow: none;
}

body.is-meditating .site-footer {
  /* Hide bulky footer chrome while meditating — free the frame for video */
  display: none;
}

body.is-meditating .brand-text {
  color: #f0ebe3;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.55);
}

body.is-meditating .brand-logo {
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}

body.is-meditating .lang-select {
  background: rgba(0, 0, 0, 0.28)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23f0ebe3' d='M6 8L1 3h10z'/%3E%3C/svg%3E")
    no-repeat right 0.65rem center;
  color: #f8f5f0;
  border-color: rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

body.is-meditating .main {
  /* Full-bleed stage: video is the hero */
  align-items: stretch;
  justify-content: stretch;
  padding: 0;
  min-height: 0;
}

body.is-meditating .timer-panel.panel,
body.is-meditating .panel.timer-panel {
  max-width: none;
  width: 100%;
  height: 100%;
  min-height: calc(100dvh - var(--header-h) - var(--safe-top) - 0.5rem);
  margin: 0;
  padding: 0.5rem 1rem calc(1.25rem + var(--safe-bottom));
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border: none;
  border-radius: 0;
  box-shadow: none;
  color: #f8f5f0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
}

body.is-meditating .timer-status {
  color: rgba(248, 245, 240, 0.88);
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.65);
  margin: 0.25rem 0 0;
  font-size: 0.85rem;
}

body.is-meditating .complete-sub {
  color: rgba(248, 245, 240, 0.85);
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.55);
}

body.is-meditating .timer-display-wrap {
  /* Slim ring — less opaque disc over the video */
  width: min(220px, 58vw);
  margin: 0;
  filter: drop-shadow(0 4px 18px rgba(0, 0, 0, 0.35));
}

body.is-meditating .progress-ring-bg {
  stroke: rgba(255, 255, 255, 0.18);
  stroke-width: 2.5;
}

body.is-meditating .progress-ring-fg {
  stroke: rgba(220, 232, 220, 0.92);
  stroke-width: 2.5;
}

body.is-meditating .timer-display {
  font-size: clamp(1.85rem, 7.5vw, 2.6rem);
  text-shadow:
    0 2px 16px rgba(0, 0, 0, 0.7),
    0 0 2px rgba(0, 0, 0, 0.5);
}

body.is-meditating .timer-actions {
  width: min(340px, 92vw);
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  padding: 0.35rem;
}

body.is-meditating .timer-actions .btn {
  min-height: 44px;
  background: rgba(0, 0, 0, 0.32);
  color: #f8f5f0;
  border-color: rgba(255, 255, 255, 0.28);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

body.is-meditating .timer-actions .btn:hover {
  background: rgba(0, 0, 0, 0.48);
  border-color: rgba(255, 255, 255, 0.4);
}

body.is-meditating .btn-ghost {
  color: #f0ebe3;
  border-color: rgba(255, 255, 255, 0.28);
}

body.is-meditating .btn-secondary {
  background: rgba(0, 0, 0, 0.32);
  color: #f8f5f0;
  border-color: rgba(255, 255, 255, 0.28);
}

body.is-meditating .btn-primary {
  background: rgba(92, 122, 106, 0.75);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

body.is-meditating .complete-msg {
  margin-top: 0;
  padding: 0.65rem 1rem;
  border: none;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

body.is-meditating .complete-msg p {
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.5);
}

/* ---------- Accessibility ---------- */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: -100px;
  left: 1rem;
  z-index: 100;
  padding: 0.5rem 1rem;
  background: var(--accent);
  color: #fff;
  border-radius: var(--radius-sm);
  text-decoration: none;
}

.skip-link:focus {
  top: calc(var(--safe-top) + 0.5rem);
}

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

body.is-meditating :focus-visible {
  outline-color: #c8d9c8;
}

.is-hidden,
[hidden] {
  display: none !important;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-height: var(--header-h);
  padding: calc(0.5rem + var(--safe-top)) 1rem 0.5rem;
  background: rgba(247, 244, 239, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  transition: background 0.4s ease, border-color 0.4s ease;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: inherit;
  min-width: 0;
}

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

.brand-logo {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.brand-text {
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.2s ease;
}

.lang-select {
  appearance: none;
  -webkit-appearance: none;
  font: inherit;
  font-size: 0.875rem;
  padding: 0.4rem 2rem 0.4rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-solid)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b6560' d='M6 8L1 3h10z'/%3E%3C/svg%3E")
    no-repeat right 0.65rem center;
  color: var(--text);
  cursor: pointer;
  max-width: 9.5rem;
}

/* ---------- Main ---------- */
.main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem 1rem 2rem;
  width: 100%;
}

.panel {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 4px);
  box-shadow: var(--shadow);
  padding: 1.75rem 1.35rem 1.5rem;
  transition: background 0.4s ease, color 0.4s ease, border-color 0.4s ease;
}

.app-title {
  margin: 0;
  font-size: clamp(1.35rem, 4vw, 1.65rem);
  font-weight: 500;
  text-align: center;
  letter-spacing: 0.04em;
}

.app-subtitle {
  margin: 0.4rem 0 1.5rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 300;
}

/* Mode tabs */
.mode-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.35rem;
  padding: 0.3rem;
  background: var(--bg-soft);
  border-radius: var(--radius-sm);
  margin-bottom: 1.35rem;
}

body.is-meditating .mode-tabs {
  background: rgba(255, 255, 255, 0.08);
}

.mode-tab {
  font: inherit;
  font-size: 0.9rem;
  padding: 0.55rem 0.5rem;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.2s, color 0.2s, box-shadow 0.2s;
}

.mode-tab.is-active {
  background: var(--surface-solid);
  color: var(--text);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
  font-weight: 500;
}

.mode-tab:hover:not(.is-active) {
  color: var(--text);
}

/* Time inputs */
.time-inputs {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 0.35rem;
}

.time-field {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
}

.time-field.grow {
  width: 100%;
  align-items: stretch;
}

.time-field label {
  font-size: 0.75rem;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

.time-field input[type="number"],
.time-field input[type="time"] {
  font: inherit;
  font-size: 1.5rem;
  font-variant-numeric: tabular-nums;
  width: 4.2rem;
  text-align: center;
  padding: 0.55rem 0.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-solid);
  color: var(--text);
  -moz-appearance: textfield;
}

.time-field input[type="number"]::-webkit-outer-spin-button,
.time-field input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.time-field input[type="time"] {
  width: 100%;
  font-size: 1.25rem;
  padding: 0.65rem 0.75rem;
}

.time-field input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.time-sep {
  font-size: 1.5rem;
  font-weight: 300;
  color: var(--text-muted);
  padding-bottom: 0.55rem;
  user-select: none;
}

.hint {
  margin: 0.75rem 0 0;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.presets {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem;
  margin-top: 1rem;
}

.preset-btn {
  font: inherit;
  font-size: 0.85rem;
  min-width: 2.5rem;
  padding: 0.35rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.preset-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.preset-btn.is-active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 500;
}

.endtime-row {
  margin-top: 0.25rem;
}

/* Header icon button + music dialog */
.header-actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-shrink: 0;
}

.icon-btn {
  font: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-solid);
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s, box-shadow 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.icon-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.music-open-btn.has-music {
  color: var(--accent);
  border-color: rgba(92, 122, 106, 0.45);
  background: var(--accent-soft);
}

.music-open-btn.is-muted {
  color: var(--text-muted);
  opacity: 0.85;
}

body.is-meditating .site-header {
  background: rgba(20, 22, 20, 0.35);
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

body.is-meditating .icon-btn {
  background: rgba(0, 0, 0, 0.32);
  color: #f0ebe3;
  border-color: rgba(255, 255, 255, 0.28);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

body.is-meditating .music-open-btn.has-music {
  color: #d7e6d7;
  border-color: rgba(200, 217, 200, 0.45);
}

.music-dialog {
  border: none;
  padding: 0;
  border-radius: calc(var(--radius) + 4px);
  background: transparent;
  color: var(--text);
  max-width: min(400px, calc(100vw - 2rem));
  width: 100%;
  box-shadow: none;
}

.music-dialog::backdrop {
  background: rgba(28, 26, 24, 0.45);
  backdrop-filter: blur(4px);
}

.music-dialog-card {
  margin: 0;
  padding: 1.15rem 1.2rem 1.25rem;
  border-radius: calc(var(--radius) + 4px);
  background: var(--surface-solid);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.music-dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.music-dialog-title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.music-dialog-close {
  font-size: 1.45rem;
  line-height: 1;
  color: var(--text-muted);
}

.music-hint {
  margin: 0;
  text-align: start;
}

.music-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.music-row .btn {
  width: auto;
  flex: 1 1 auto;
  min-width: 7rem;
}

.btn-compact {
  min-height: 42px;
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
}

.music-file-name {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-muted);
  word-break: break-all;
  text-align: start;
  padding: 0.55rem 0.7rem;
  border-radius: var(--radius-sm);
  background: var(--bg-soft);
}

.music-file-name.has-file {
  color: var(--text);
}

.music-mute {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.95rem;
  color: var(--text);
  cursor: pointer;
  user-select: none;
}

.music-mute-row {
  margin-top: 0.15rem;
  padding: 0.35rem 0;
}

.music-mute input {
  width: 1.05rem;
  height: 1.05rem;
  accent-color: var(--accent);
  cursor: pointer;
}

.music-dialog-error {
  margin: 0;
  text-align: start;
}

.music-dialog-done {
  margin-top: 0.25rem;
  width: 100%;
}

/* Buttons */
.actions {
  margin-top: 1.5rem;
}

.btn {
  font: inherit;
  font-size: 1rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  width: 100%;
  min-height: 48px;
  padding: 0.75rem 1.25rem;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.15s, box-shadow 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 4px 14px rgba(92, 122, 106, 0.35);
}

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

.btn-secondary {
  background: var(--bg-soft);
  color: var(--text);
  border-color: var(--border);
}

.btn-secondary:hover {
  background: #e6e0d6;
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border-color: var(--border);
}

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

.error-msg {
  margin: 0.85rem 0 0;
  text-align: center;
  color: #a33;
  font-size: 0.875rem;
}

/* ---------- Timer panel ---------- */
.timer-panel {
  text-align: center;
  max-width: 440px;
}

.timer-status {
  margin: 0 0 0.5rem;
  font-size: 0.95rem;
  color: var(--text-muted);
  letter-spacing: 0.06em;
}

.timer-display-wrap {
  position: relative;
  width: min(280px, 72vw);
  aspect-ratio: 1;
  margin: 0.5rem auto 1.25rem;
  display: grid;
  place-items: center;
}

/* Cluster status + clock so flex layout can pin controls to the bottom */
.timer-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  width: 100%;
  min-height: 0;
  gap: 0.35rem;
}

.progress-ring {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.progress-ring-bg,
.progress-ring-fg {
  fill: none;
  stroke-width: 3.5;
}

.progress-ring-bg {
  stroke: rgba(44, 41, 38, 0.1);
}

.progress-ring-fg {
  stroke: var(--accent);
  stroke-linecap: round;
  stroke-dasharray: var(--ring-circumference);
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 0.35s linear;
}

.timer-display {
  position: relative;
  z-index: 1;
  font-size: clamp(2rem, 9vw, 2.75rem);
  font-weight: 300;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
  line-height: 1;
}

.timer-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
}

.timer-actions .btn {
  width: 100%;
}

/* Odd last control (e.g. Reset under Pause + Mute) spans full row */
.timer-actions .btn:last-child:nth-child(odd) {
  grid-column: 1 / -1;
}

.complete-msg {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

body.is-meditating .complete-msg {
  border-color: rgba(255, 255, 255, 0.12);
}

.complete-msg p {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 500;
  letter-spacing: 0.08em;
}

.complete-sub {
  margin-top: 0.35rem !important;
  font-size: 0.9rem !important;
  font-weight: 300 !important;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

/* ---------- Footer ---------- */
.site-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.65rem;
  padding: 1rem 1rem calc(1.25rem + var(--safe-bottom));
  border-top: 1px solid var(--border);
  background: rgba(247, 244, 239, 0.7);
  transition: background 0.4s ease, border-color 0.4s ease;
}

.donate-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0.45rem 1.25rem;
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  color: var(--accent);
  border: 1px solid rgba(92, 122, 106, 0.35);
  border-radius: 999px;
  background: rgba(92, 122, 106, 0.06);
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.donate-btn:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.footer-note {
  margin: 0;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.footer-note a {
  color: inherit;
  text-decoration: none;
}

.footer-note a:hover {
  color: var(--accent);
  text-decoration: underline;
}

/* ---------- RTL ---------- */
[dir="rtl"] .brand {
  flex-direction: row;
}

[dir="rtl"] .lang-select {
  background-position: left 0.65rem center;
  padding: 0.4rem 0.75rem 0.4rem 2rem;
}

[dir="rtl"] .time-inputs {
  flex-direction: row;
}

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

/* ---------- High contrast ---------- */
@media (prefers-contrast: more) {
  :root {
    --border: rgba(0, 0, 0, 0.35);
    --text-muted: #3a3632;
  }

  .btn-primary {
    border: 2px solid #000;
  }

  .panel {
    border-width: 2px;
  }
}

/* ---------- Larger screens ---------- */
@media (min-width: 640px) {
  .site-header {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }

  .brand-logo {
    width: 48px;
    height: 48px;
  }

  .brand-text {
    font-size: 1.1rem;
  }

  .panel {
    padding: 2.25rem 2rem 1.85rem;
  }

  .main {
    padding: 2rem 1.5rem 2.5rem;
  }
}

@media (min-width: 960px) {
  .timer-display {
    font-size: 3rem;
  }

  .timer-display-wrap {
    width: 300px;
  }
}

/* Landscape phones: compact layout */
@media (max-height: 500px) and (orientation: landscape) {
  .site-header {
    min-height: 48px;
  }

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

  .main {
    padding: 0.5rem 1rem 1rem;
  }

  .panel {
    padding: 1rem 1.25rem;
  }

  .app-subtitle {
    margin-bottom: 0.75rem;
  }

  .timer-display-wrap {
    width: min(180px, 40vh);
    margin-bottom: 0.75rem;
  }

  .presets {
    display: none;
  }
}
