:root {
  --paper: #f7f3ea;
  --ink: #202421;
  --muted: #68716a;
  --line: #ddd5c7;
  --panel: #fffaf1;
  --green: #2f7661;
  --green-dark: #205444;
  --red: #a33f3f;
  --blue: #426b8c;
  --shadow: 0 16px 40px rgb(41 36 27 / 10%);
}

* {
  box-sizing: border-box;
}

body {
  display: flex;
  flex-direction: column;
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
  color: var(--green-dark);
  font-weight: 700;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

.sr-only {
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  width: 1px;
}

.topbar {
  align-items: center;
  background: rgb(247 243 234 / 92%);
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 1rem;
  grid-template-columns: 48px 1fr 48px;
  padding: 0.9rem max(1rem, calc((100vw - 1120px) / 2));
  position: sticky;
  top: 0;
  z-index: 3;
}

.brand {
  color: var(--ink);
  font-size: clamp(1.45rem, 5vw, 2rem);
  font-weight: 900;
  grid-column: 2;
  justify-self: center;
  line-height: 1;
  text-align: center;
}

.menu {
  grid-column: 3;
  justify-self: end;
  position: relative;
}

.home-link {
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--green-dark);
  display: inline-flex;
  grid-column: 1;
  grid-row: 1;
  height: 48px;
  justify-content: center;
  width: 48px;
}

.home-icon {
  display: block;
  height: 23px;
  width: 23px;
}

.home-icon path {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.2;
}

.menu-button {
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 3px;
  height: 48px;
  justify-content: center;
  list-style: none;
  width: 48px;
}

.menu-button::-webkit-details-marker {
  display: none;
}

.menu-line {
  background: var(--green-dark);
  border-radius: 999px;
  display: block;
  height: 2px;
  width: 21px;
}

.nav-links {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 0.2rem;
  min-width: 190px;
  padding: 0.45rem;
  position: absolute;
  right: 0;
  top: calc(100% + 0.55rem);
}

.nav-links a,
.nav-links .link-button {
  border-radius: 6px;
  color: var(--green-dark);
  display: block;
  font-weight: 800;
  min-height: 44px;
  padding: 0.7rem 0.8rem;
  text-align: left;
  width: 100%;
}

.nav-links form {
  margin: 0;
}

.nav-links .sign-out-link {
  color: var(--red);
}

.page-shell {
  flex: 1;
  margin: 0 auto;
  max-width: 1120px;
  padding: 1rem;
  width: 100%;
}

.site-footer {
  align-items: center;
  background: #f1ece2;
  border-top: 1px solid var(--line);
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  font-size: 0.9rem;
  gap: 0.4rem 1rem;
  justify-content: center;
  padding: 1rem;
  text-align: center;
}

.hero-panel,
.active-timer,
.panel,
.form-panel,
.auth-card,
.empty-state {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.hero-panel,
.active-timer,
.page-heading {
  align-items: center;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
}

.hero-panel,
.active-timer {
  margin-bottom: 1rem;
  padding: 1.2rem;
}

.running-sessions {
  margin-bottom: 1rem;
}

.hero-panel h1,
.page-heading h1,
.form-panel h1,
.auth-card h1 {
  font-size: clamp(2rem, 7vw, 4.5rem);
  line-height: 0.95;
  margin: 0;
}

.page-heading {
  margin-bottom: 1rem;
}

.panel,
.form-panel,
.auth-card,
.empty-state,
.quick-start {
  margin-bottom: 1rem;
  padding: 1rem;
}

.onboarding-empty-state {
  display: grid;
  gap: 1.25rem;
  padding: 1.4rem;
}

.onboarding-empty-state h2 {
  font-size: clamp(1.8rem, 7vw, 3rem);
  line-height: 1.05;
  margin: 0;
}

.onboarding-empty-state p {
  font-size: 1.05rem;
  line-height: 1.35;
  max-width: 32rem;
}

.onboarding-action {
  justify-self: start;
}

.quick-start {
  background: #edf4ee;
  border: 1px solid #ccdbce;
  border-radius: 8px;
}

.section-heading {
  align-items: baseline;
  display: flex;
  gap: 0.75rem;
  justify-content: space-between;
  margin-bottom: 0.8rem;
}

.section-heading h2,
.active-timer h2,
.list-card h2 {
  margin: 0;
}

.section-heading p,
.active-timer p,
.session-row p,
.list-card p,
.auth-card p,
.empty-state p,
.quiet {
  color: var(--muted);
  margin: 0.25rem 0 0;
}

.eyebrow {
  color: var(--blue);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  margin: 0 0 0.35rem;
  text-transform: uppercase;
}

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

.settings-grid {
  display: grid;
  gap: 1rem;
}

.chip-grid,
.activity-grid,
.goal-grid,
.card-list {
  display: grid;
  gap: 0.75rem;
}

.chip-grid {
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
}

.activity-grid {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  margin-top: 1rem;
}

.choice-chip input {
  inline-size: 1px;
  opacity: 0;
  position: absolute;
}

.choice-chip span {
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  display: flex;
  justify-content: center;
  min-height: 48px;
  padding: 0.75rem 1rem;
}

.choice-chip input:checked + span {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}

.activity-button,
.primary-action,
.secondary-action,
.danger-action,
.duration-presets button {
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 800;
  min-height: 48px;
  padding: 0.8rem 1rem;
}

.activity-button {
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  color: var(--ink);
  display: flex;
  gap: 0.65rem;
  justify-content: flex-start;
  text-align: left;
}

.activity-button span,
.dot {
  border-radius: 50%;
  display: inline-block;
  flex: 0 0 auto;
  height: 0.8rem;
  width: 0.8rem;
}

.activity-button span {
  background: var(--accent);
}

.primary-action {
  background: var(--green);
  color: #fff;
}

.secondary-action {
  background: #e4ece5;
  color: var(--green-dark);
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
}

.log-past-action {
  background: #edf4ee;
  border: 1px solid #ccdbce;
  border-radius: 8px;
  margin-bottom: 1rem;
  padding: 1rem;
}

.full-width-action {
  justify-content: center;
  width: 100%;
}

.action-icon {
  display: block;
  flex: 0 0 auto;
  height: 1.25rem;
  width: 1.25rem;
}

.action-icon circle,
.action-icon path {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.danger-action {
  background: #f3dddd;
  color: var(--red);
  margin-top: 1rem;
  width: 100%;
}

.link-button {
  background: transparent;
  border: 0;
  color: var(--green-dark);
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  padding: 0;
}

.session-list,
.breakdown-list {
  display: grid;
  gap: 0.65rem;
}

.session-row,
.breakdown-row,
.list-card {
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 0.65rem;
  grid-template-columns: auto 1fr auto;
  padding: 0.85rem;
}

.breakdown-row {
  grid-template-columns: auto 1fr auto;
}

.row-link {
  font-size: 0.9rem;
}

.goal-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.goal-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 0.75rem;
  padding: 1rem;
}

.goal-card h3 {
  font-size: 1.1rem;
  margin: 0;
}

.meter {
  background: #e7dfd2;
  border-radius: 999px;
  height: 0.7rem;
  overflow: hidden;
}

.meter span {
  background: var(--green);
  display: block;
  height: 100%;
}

.stacked-form {
  display: grid;
  gap: 0.8rem;
}

.auth-heading {
  display: grid;
  gap: 0.65rem;
  margin-bottom: 1.5rem;
}

.auth-heading .eyebrow {
  background: #e8eff1;
  border: 1px solid #c9d9df;
  border-radius: 999px;
  color: var(--blue);
  font-size: 0.82rem;
  justify-self: start;
  letter-spacing: 0.06em;
  margin: 0;
  padding: 0.35rem 0.65rem;
}

.signup-access-callout {
  background: #edf4ee;
  border: 1px solid #ccdbce;
  border-radius: 8px;
  display: grid;
  gap: 1rem;
  margin-top: 1.25rem;
  padding: 1rem;
}

.signup-access-callout h2 {
  font-size: 1.15rem;
  margin: 0;
}

.signup-access-callout p {
  line-height: 1.45;
  margin-top: 0.35rem;
}

.stacked-form label,
legend {
  font-weight: 800;
}

.stacked-form input:not([type="submit"]),
.stacked-form select,
.stacked-form textarea {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 48px;
  padding: 0.75rem;
  width: 100%;
}

.stacked-form input[type="submit"] {
  width: 100%;
}

.stacked-form input[type="color"].color-field {
  cursor: pointer;
  max-width: 96px;
  padding: 0.25rem;
}

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

.duration-presets {
  display: grid;
  gap: 0.5rem;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.duration-presets button {
  background: #e8eff1;
  color: #24485d;
}

.inline-field {
  align-items: center;
  display: grid;
  gap: 0.5rem;
  grid-template-columns: 1fr auto;
}

.notice {
  background: #e5f0df;
  border: 1px solid #bfd0b3;
  border-radius: 8px;
  margin-bottom: 1rem;
  padding: 0.8rem;
}

.notice-alert {
  background: #f4e2dd;
  border-color: #d6b8af;
}

.row-actions {
  align-items: center;
  display: flex;
  gap: 1rem;
  margin-top: 0.5rem;
}

.activity-list {
  display: grid;
  gap: 0.65rem;
}

.activity-settings-row {
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 0.65rem;
  grid-template-columns: auto 1fr auto;
  padding: 0.85rem;
}

.activity-settings-row .row-actions {
  margin-top: 0;
}

.danger-link {
  color: var(--red);
}

.auth-card,
.form-panel {
  margin-inline: auto;
  max-width: 620px;
}

.auth-secondary {
  border-top: 1px solid var(--line);
  margin-top: 1.25rem;
  padding-top: 1rem;
  text-align: center;
}

.auth-secondary a {
  display: inline-flex;
  font-size: 1.05rem;
  min-height: 44px;
  align-items: center;
}

@media (max-width: 720px) {
  .hero-panel,
  .active-timer,
  .page-heading,
  .section-heading {
    align-items: stretch;
    flex-direction: column;
  }

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

  .duration-presets {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .nav-links {
    justify-content: flex-start;
  }

  .onboarding-empty-state {
    padding: 1.2rem;
  }

  .onboarding-action {
    justify-content: center;
    width: 100%;
  }
}
