:root {
  color-scheme: light;
  --bg: #f5f3ef;
  --ink: #171714;
  --muted: #6d6a62;
  --panel: #fffdfa;
  --line: #ded8ce;
  --accent: #d63f32;
  --accent-dark: #9f251d;
  --teal: #087b74;
  --teal-soft: #dff1ee;
  --shadow: rgba(36, 31, 24, 0.12);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background:
    linear-gradient(135deg, rgba(214, 63, 50, 0.12), transparent 28%),
    linear-gradient(315deg, rgba(8, 123, 116, 0.14), transparent 32%),
    var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button {
  font: inherit;
}

.shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.panel {
  width: min(100%, 430px);
  background: rgba(255, 253, 250, 0.92);
  border: 1px solid rgba(222, 216, 206, 0.92);
  box-shadow: 0 24px 70px var(--shadow);
  border-radius: 24px;
  padding: 22px;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.eyebrow,
h1,
.label,
.hint,
.status,
.window-meta {
  margin: 0;
}

.eyebrow {
  color: var(--teal);
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
}

h1 {
  margin-top: 2px;
  font-size: 1.55rem;
  line-height: 1.1;
}

.status {
  flex: 0 0 auto;
  max-width: 120px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 10px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  text-align: center;
  white-space: nowrap;
}

.status.active {
  border-color: rgba(214, 63, 50, 0.38);
  background: rgba(214, 63, 50, 0.1);
  color: var(--accent-dark);
}

.status.done {
  border-color: rgba(8, 123, 116, 0.35);
  background: var(--teal-soft);
  color: var(--teal);
}

.readout {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 10px;
  margin-bottom: 18px;
}

.metric {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.58);
  padding: 12px;
}

.metric.primary {
  background: #171714;
  border-color: #171714;
  color: #fffdfa;
}

.label {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.primary .label {
  color: #cfc8bc;
}

.metric strong {
  display: flex;
  align-items: baseline;
  gap: 5px;
  min-height: 42px;
  margin-top: 7px;
  font-size: 1.9rem;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.metric small {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
}

.pulse-button {
  position: relative;
  display: grid;
  place-items: center;
  width: min(100%, 280px);
  aspect-ratio: 1;
  margin: 0 auto 18px;
  border: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 44% 34%, #ff8175, var(--accent) 58%, var(--accent-dark));
  color: #fffdfa;
  cursor: pointer;
  box-shadow:
    0 20px 45px rgba(214, 63, 50, 0.28),
    inset 0 -14px 26px rgba(104, 23, 18, 0.24);
  transition: transform 120ms ease, box-shadow 120ms ease;
  touch-action: manipulation;
}

.pulse-button:hover {
  transform: translateY(-1px);
}

.pulse-button:active,
.pulse-button.pop {
  transform: scale(0.965);
  box-shadow:
    0 12px 26px rgba(214, 63, 50, 0.34),
    inset 0 -9px 22px rgba(104, 23, 18, 0.28);
}

.pulse-ring {
  position: absolute;
  inset: 18px;
  border: 2px solid rgba(255, 253, 250, 0.5);
  border-radius: 50%;
}

.tap-text {
  position: relative;
  font-size: 1.35rem;
  font-weight: 900;
  text-transform: uppercase;
}

.progress-wrap {
  margin-bottom: 14px;
}

.progress-track {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #e7e1d7;
}

.progress-fill {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal), var(--accent));
  transition: width 160ms linear;
}

.window-meta {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #ece7df;
  padding: 4px;
}

.segment,
.ghost,
.solid {
  min-height: 42px;
  border: 0;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 800;
}

.segment {
  background: transparent;
  color: var(--muted);
}

.segment.active {
  background: var(--panel);
  color: var(--ink);
  box-shadow: 0 4px 14px rgba(36, 31, 24, 0.08);
}

.actions {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
  margin-top: 14px;
}

.ghost {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
}

.solid {
  background: var(--ink);
  color: #fffdfa;
}

.ghost:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.hint {
  margin-top: 14px;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.35;
  text-align: center;
}

@media (max-width: 420px) {
  .shell {
    padding: 12px;
  }

  .panel {
    border-radius: 20px;
    padding: 16px;
  }

  .topbar {
    margin-bottom: 16px;
  }

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

  .metric {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
  }

  .metric strong {
    min-height: auto;
    margin-top: 0;
    font-size: 1.55rem;
  }

  .pulse-button {
    width: min(100%, 250px);
  }

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