.stopwatch-app[data-theme="dark"],
.stopwatch-modal[data-theme="dark"] {
  --fg: #e6edf3;
  --surface: rgba(11, 31, 51, 0.92);
  --accent: #5ea0ff;
  --primary-bg: #245dff;
  --primary-hover-bg: #1a4be8;
  --primary-fg: #ffffff;
  --muted: #94a3c1;
  --card: rgba(11, 31, 51, 0.72);
  --border: #1e2d45;
  --shadow: 0 14px 36px rgba(4, 10, 25, 0.55);
}

.stopwatch-shell {
  display: grid;
  gap: 16px;
}

.stopwatch-panel {
  display: grid;
  gap: 16px;
}

.stopwatch-display {
  display: grid;
  gap: 16px;
  align-items: center;
  justify-items: center;
  text-align: center;
}

.stopwatch-analog {
  width: min(320px, 85vw);
  aspect-ratio: 1 / 1;
  margin: 0 auto;
}

.stopwatch-digital {
  display: grid;
  gap: 6px;
  justify-items: center;
}

.stopwatch-time {
  font-variant-numeric: tabular-nums;
  font-size: clamp(2.2rem, 7vw, 3.6rem);
  letter-spacing: 0.04em;
}

.stopwatch-meta {
  color: var(--muted);
  font-size: 0.95rem;
}

.stopwatch-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

.stopwatch-controls .button {
  min-width: 120px;
}

.stopwatch-controls .button.primary {
  min-width: 180px;
  font-weight: 600;
}

.stopwatch-settings {
  display: grid;
  gap: 12px;
}

.stopwatch-settings-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.stopwatch-field label {
  display: block;
  font-size: 0.95rem;
  color: var(--muted);
  margin-bottom: 6px;
}

.stopwatch-field select,
.stopwatch-field input[type="checkbox"] {
  margin-right: 8px;
}

.stopwatch-toggles {
  display: grid;
  gap: 10px;
}

.stopwatch-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.stopwatch-hint {
  color: var(--muted);
  font-size: 0.9rem;
}

.stopwatch-laps {
  overflow-x: auto;
}

.stopwatch-laps table {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

.stopwatch-laps th,
.stopwatch-laps td {
  padding: 10px 8px;
  border-bottom: 1px solid var(--border);
  text-align: right;
}

.stopwatch-laps th:first-child,
.stopwatch-laps td:first-child {
  text-align: left;
}

.stopwatch-laps tbody tr.is-latest {
  background: rgba(11, 87, 208, 0.08);
}

.stopwatch-empty {
  color: var(--muted);
  font-size: 0.95rem;
}

.stopwatch-toast {
  min-height: 20px;
  font-size: 0.9rem;
  opacity: 0;
  transition: opacity 160ms ease;
}

.stopwatch-toast.is-show {
  opacity: 1;
}

.stopwatch-modal {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0;
  max-width: 560px;
  width: calc(100vw - 28px);
  color: var(--fg);
  background: var(--surface);
}

.stopwatch-modal::backdrop {
  background: rgba(0, 0, 0, 0.5);
}

.stopwatch-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

.stopwatch-modal-body {
  padding: 16px;
}

.stopwatch-modal-body ul {
  padding-left: 18px;
}

.stopwatch-minimal .stopwatch-settings,
.stopwatch-minimal .stopwatch-laps,
.stopwatch-minimal .stopwatch-actions,
.stopwatch-minimal .stopwatch-hint {
  display: none;
}

@media (min-width: 900px) {
  .stopwatch-shell {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
    align-items: start;
  }

  .stopwatch-display {
    justify-items: start;
    text-align: left;
  }

  .stopwatch-digital {
    justify-items: start;
  }
}
