:root {
  --page: #f5f8f4;
  --surface: #ffffff;
  --surface-soft: #eef5f1;
  --text: #18312b;
  --muted: #5f6f69;
  --line: #dce7e1;
  --accent: #2d7c68;
  --accent-strong: #195f50;
  --blue: #496f9f;
  --warm: #c97655;
  --focus: #111f1b;
  --shadow: 0 18px 45px rgba(31, 54, 47, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  min-height: 100%;
  margin: 0;
  background: var(--page);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
  letter-spacing: 0;
}

button,
input,
select,
textarea {
  font: inherit;
  letter-spacing: 0;
}

button {
  cursor: pointer;
}

[hidden] {
  display: none !important;
}

button:focus-visible,
.completion-panel:focus-visible {
  outline: 3px solid rgba(25, 95, 80, 0.3);
  outline-offset: 3px;
}

.app-shell {
  width: min(100%, 720px);
  margin: 0 auto;
  padding: 18px;
}

.welcome {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 16px;
  align-items: center;
  padding: 20px 0 18px;
}

.reset-mark {
  position: relative;
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border: 2px solid var(--accent);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 10px 24px rgba(45, 124, 104, 0.14);
}

.reset-mark::before,
.reset-mark::after,
.reset-mark span {
  content: "";
  position: absolute;
  display: block;
  background: var(--accent);
  border-radius: 2px;
}

.reset-mark::before {
  width: 24px;
  height: 2px;
}

.reset-mark::after {
  width: 2px;
  height: 24px;
}

.reset-mark span {
  width: 16px;
  height: 16px;
  border: 2px solid var(--blue);
  background: transparent;
  transform: rotate(45deg);
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--warm);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 6px;
  font-size: 2.15rem;
  line-height: 1.04;
}

.lead {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.5;
}

.noscript-message {
  margin: 0 0 14px;
  padding: 12px;
  border: 1px solid rgba(201, 118, 85, 0.35);
  border-radius: 8px;
  background: #fff8f3;
  color: #7b452f;
  font-size: 0.94rem;
  font-weight: 700;
  line-height: 1.45;
}

.setup-panel,
.reset-card,
.timer-panel,
.email-panel {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.setup-panel {
  padding: 12px;
}

.choice-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.choice-card,
.length-button,
.category-button,
.primary-action,
.secondary-action,
.email-button {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
}

.choice-card {
  display: grid;
  gap: 5px;
  width: 100%;
  min-height: 86px;
  padding: 14px;
  text-align: left;
}

.choice-title {
  font-size: 1rem;
  font-weight: 700;
}

.choice-note {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.35;
}

.custom-options,
.length-section {
  margin-top: 16px;
}

fieldset {
  margin: 0;
  padding: 0;
  border: 0;
}

legend {
  margin-bottom: 9px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.length-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.category-button,
.length-button {
  min-height: 46px;
  padding: 10px 11px;
  font-weight: 700;
}

.choice-card:hover,
.length-button:hover,
.category-button:hover,
.secondary-action:hover,
.email-button:hover {
  border-color: rgba(45, 124, 104, 0.55);
  background: var(--surface-soft);
}

.is-selected {
  border-color: var(--accent);
  background: #e8f4ef;
  color: var(--accent-strong);
  box-shadow: inset 0 0 0 1px rgba(45, 124, 104, 0.14);
}

.reset-card {
  padding: 18px;
}

.reset-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbf9;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
}

.reset-card h2 {
  margin-bottom: 12px;
  font-size: 1.28rem;
  line-height: 1.25;
}

.reset-card ol {
  display: grid;
  gap: 10px;
  margin: 0;
  padding-left: 22px;
  color: var(--text);
  line-height: 1.48;
}

.reset-card li {
  white-space: pre-line;
  overflow-wrap: break-word;
}

.reset-card li::marker {
  color: var(--accent);
  font-weight: 700;
}

.timer-panel {
  display: grid;
  justify-items: center;
  gap: 16px;
  padding: 18px;
}

.timer-ring {
  --progress: 0deg;
  position: relative;
  display: grid;
  place-items: center;
  width: min(68vw, 236px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: conic-gradient(var(--accent) var(--progress), #dce7e1 0deg);
}

.timer-ring::before {
  content: "";
  position: absolute;
  inset: 11px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
}

.timer-content {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 4px;
  justify-items: center;
}

.timer-value {
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1;
}

.timer-label {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
}

.timer-message {
  width: 100%;
  margin: -6px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.4;
  text-align: center;
}

.timer-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  width: 100%;
}

.primary-action,
.secondary-action,
.email-button {
  min-height: 50px;
  padding: 12px 14px;
  font-weight: 800;
}

.primary-action {
  border-color: var(--accent-strong);
  background: var(--accent);
  color: #ffffff;
}

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

.secondary-action {
  background: #f8fbf9;
}

.complete-message,
.save-message,
.email-message {
  width: 100%;
  margin: 0;
  padding: 12px;
  border: 1px solid rgba(45, 124, 104, 0.26);
  border-radius: 8px;
  background: #edf7f2;
  color: var(--accent-strong);
  font-weight: 700;
  line-height: 1.4;
  text-align: center;
}

.completion-panel {
  display: grid;
  gap: 12px;
  width: 100%;
  padding-top: 4px;
}

.completion-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  width: 100%;
}

.save-message {
  background: #f8fbf9;
  color: var(--muted);
  font-weight: 700;
}

.disclaimer {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.45;
  text-align: center;
}

.app-disclaimer {
  margin: 14px 2px 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.45;
  text-align: center;
}

.email-panel {
  padding: 14px;
}

.email-button {
  width: 100%;
  border-color: rgba(73, 111, 159, 0.42);
  background: #f4f7fb;
  color: var(--blue);
}

.email-button:hover {
  border-color: var(--blue);
  background: #eef3f9;
}

.email-message {
  margin-top: 10px;
  border-color: rgba(73, 111, 159, 0.28);
  background: #f4f7fb;
  color: #315a8c;
}

.completion-email-message {
  margin-top: 0;
}

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

@media (min-width: 560px) {
  .app-shell {
    padding: 28px;
  }

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

  .length-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .category-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .timer-actions {
    max-width: 360px;
  }

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

  .completion-actions .email-button {
    grid-column: 1 / -1;
  }
}
