:root {
  --primary: #0052cc;
  --primary-dark: #003c99;
  --stop: #4b5563;
  --stop-dark: #334155;
  --surface: #ffffff;
  --surface-muted: #f5f7fb;
  --text: #0f172a;
  --muted: #5f6b7c;
  --accent: #00a3af;
  --radius: 16px;
  --shadow: 0 20px 45px rgba(15, 23, 42, 0.08);
  font-family: "Inter", "Noto Sans JP", system-ui, -apple-system, sans-serif;
  color: var(--text);
  background: var(--surface-muted);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
}

.page {
  min-height: 100vh;
  max-width: 1024px;
  margin: 0 auto;
  padding: clamp(20px, 4vw, 48px) clamp(16px, 4vw, 48px) 64px;
}

.hero {
  margin-bottom: 24px;
}

h1 {
  font-size: clamp(30px, 5vw, 44px);
  margin: 0 0 8px;
}

.lede {
  margin: 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.6;
}

.card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: clamp(20px, 4vw, 32px);
}

.timer {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.timer-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  flex-wrap: wrap;
}

.title-group {
  display: flex;
  align-items: center;
  gap: 14px;
  justify-content: flex-start;
  flex: 1 1 220px;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-weight: 800;
  font-size: 20px;
  margin-left: auto;
  align-self: flex-end;
}

.status-label {
  font-size: 24px;
}

.status-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: #e2e8f0;
  color: #475569;
  transition: background 160ms ease, color 160ms ease;
}

.status-icon.on {
  background: #dcfce7;
  color: #15803d;
}

.mode-label {
  margin: 0;
  color: var(--muted);
  font-weight: 700;
  font-size: 18px;
}

.display {
  text-align: center;
  padding: clamp(12px, 4vw, 20px);
  background: var(--surface-muted);
  border-radius: var(--radius);
}

.time {
  margin: 4px 0 8px;
  font-size: clamp(68px, 20vw, 108px);
  letter-spacing: 0.04em;
  font-weight: 700;
}

.progress-info {
  margin: 0 0 12px;
  color: var(--muted);
  font-weight: 700;
  font-size: 16px;
}

.progress {
  position: relative;
  width: 100%;
  height: 12px;
  background: linear-gradient(90deg, rgba(0, 82, 204, 0.12), rgba(0, 163, 175, 0.12));
  border-radius: 999px;
  overflow: hidden;
}

.progress-elapsed,
.progress-value {
  position: absolute;
  inset: 0;
  height: 100%;
}

.progress-elapsed {
  background: linear-gradient(90deg, rgba(0, 82, 204, 0.18), rgba(0, 163, 175, 0.18));
  transform-origin: right center;
  transform: scaleX(var(--elapsed));
  transition: transform 0.25s ease;
}

.progress-value {
  background: linear-gradient(90deg, var(--primary), var(--accent));
  transform-origin: left center;
  transform: scaleX(var(--progress));
  transition: transform 0.25s ease;
}

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

.btn {
  height: 56px;
  border-radius: 12px;
  border: 1px solid transparent;
  font-weight: 800;
  font-size: 22px;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease, background 120ms ease, border-color 120ms ease;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 12px 30px rgba(0, 82, 204, 0.25);
}

.btn-primary:not(:disabled):hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
}

.btn-stop {
  background: var(--stop);
  color: #fff;
  box-shadow: 0 12px 30px rgba(51, 65, 85, 0.2);
}

.btn-stop:disabled {
  background: #fff;
  color: #94a3b8;
  border-color: #d4dbe5;
  box-shadow: none;
  cursor: not-allowed;
  opacity: 1;
}

.btn-stop:not(:disabled):hover {
  background: var(--stop-dark);
  transform: translateY(-1px);
}

.btn-outline {
  background: #fff;
  border-color: var(--primary);
  color: var(--primary);
}

.btn-outline:not(:disabled):hover {
  background: #eef2ff;
}

.notes {
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
  line-height: 1.6;
  font-size: 14px;
}

.notes li + li {
  margin-top: 6px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 22px;
  letter-spacing: 0.01em;
}

.badge-work {
  color: #0b3d91;
  background: #e0ecff;
}

.badge-break {
  color: #0f5132;
  background: #d1fae5;
}

.icon {
  width: 22px;
  height: 22px;
}

.toggle-row {
  display: flex;
  justify-content: flex-start;
  align-items: center;
}

.switch {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  color: var(--text);
  font-size: 16px;
}

.switch input {
  display: none;
}

.slider {
  position: relative;
  width: 52px;
  height: 28px;
  background: #cbd5e1;
  border-radius: 999px;
  transition: background 0.2s ease;
}

.slider::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  width: 20px;
  height: 20px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
  transition: transform 0.2s ease;
}

.switch input:checked + .slider {
  background: var(--primary);
}

.switch input:checked + .slider::after {
  transform: translateX(24px);
}

.switch-label {
  white-space: nowrap;
}

@media (max-width: 640px) {
  .timer-header {
    align-items: flex-start;
  }

  .title-group {
    width: 100%;
  }

  .status {
    width: 100%;
    justify-content: flex-end;
  }
}