:root {
  --bg: #f2efe6;
  --panel: rgba(255, 252, 246, 0.82);
  --panel-strong: #fffaf0;
  --ink: #171412;
  --muted: #655e57;
  --accent: #0f5f52;
  --accent-strong: #0a453c;
  --danger: #ae2e24;
  --line: rgba(23, 20, 18, 0.1);
  --shadow: 0 18px 60px rgba(23, 20, 18, 0.12);
  --radius: 24px;
}

* {
  box-sizing: border-box;
}

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

body {
  font-family: Georgia, "Times New Roman", serif;
  color: var(--ink);
  background: #f8f4eb;
}

button,
input {
  font: inherit;
}

.hidden {
  display: none !important;
}

.app-shell {
  min-height: 100dvh;
  padding: 20px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 20px;
  z-index: 60;
  max-width: min(88vw, 520px);
  padding: 12px 16px;
  color: #fffaf0;
  background: rgba(17, 17, 17, 0.92);
  border: 1px solid rgba(255, 250, 240, 0.14);
  border-radius: 14px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.28);
  transform: translateX(-50%);
}

.home-topbar,
.screen-header {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 16px;
}

.home-topbar {
  margin: -8px auto 20px;
  justify-content: space-between;
}

.screen-header {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 40;
  margin: 0;
}

.layout {
  margin: 0 auto;
  max-width: 720px;
}

[data-screen] {
  padding: 20px 0;
}

[data-screen="chant"],
[data-screen="settings"],
[data-screen="walking"] {
  padding-top: 76px;
}

[data-screen="chant"] {
  padding: 0;
  position: fixed;
  inset: 0;
  z-index: 5;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

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

h1,
h2 {
  margin-bottom: 0;
}

.hero-card,
.route-card {
  background: var(--panel-strong);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 18px;
}

.hero-card {
  margin-bottom: 18px;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 20px;
  align-items: center;
}

.hero-copy {
  min-width: 0;
}

.hero-art {
  display: flex;
  justify-content: center;
}

.hero-label {
  color: var(--muted);
  margin-bottom: 8px;
}

.hero-metric {
  font-size: clamp(3rem, 18vw, 5rem);
  line-height: 0.95;
  margin-bottom: 10px;
}

.hero-logo {
  width: min(120px, 28vw);
  height: auto;
  display: block;
}

.home-actions,
.stack {
  display: grid;
  gap: 12px;
}

.home-logo-wrap {
  display: flex;
  justify-content: center;
  margin-top: 24px;
}

.home-logo {
  width: min(240px, 72vw);
  height: auto;
  display: block;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.goal-button-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.primary-button,
.secondary-button,
.danger-button,
.ghost-button,
.chant-surface,
.goal-button,
.back-button {
  appearance: none;
  border: 0;
  border-radius: 18px;
  cursor: pointer;
  transition: transform 140ms ease, opacity 140ms ease, background 140ms ease;
}

.primary-button,
.secondary-button,
.danger-button,
.ghost-button,
.goal-button {
  min-height: 52px;
  padding: 0 18px;
}

.primary-button {
  color: #fff;
  background: var(--accent);
}

.secondary-button {
  color: var(--ink);
  background: #eadfcb;
}

.danger-button {
  color: #fff;
  background: var(--danger);
}

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

.back-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  padding: 0;
  color: var(--ink);
  background: rgba(23, 20, 18, 0.08);
  border: 1px solid rgba(23, 20, 18, 0.12);
  border-radius: 999px;
  font-size: 1.5rem;
  line-height: 1;
}

[data-screen="chant"] .back-button {
  color: #fffaf0;
  background: rgba(255, 250, 240, 0.14);
  border: 1px solid rgba(255, 250, 240, 0.22);
}

.goal-button {
  color: var(--ink);
  background: #f3ecdf;
  border: 1px solid var(--line);
}

.goal-button.is-selected {
  color: #fff;
  background: var(--accent-strong);
}

.settings-divider {
  height: 1px;
  margin: 10px 0 6px;
  background: rgba(23, 20, 18, 0.16);
}

.primary-button:hover,
.secondary-button:hover,
.danger-button:hover,
.ghost-button:hover,
.chant-surface:hover,
.goal-button:hover,
.back-button:hover {
  transform: translateY(-1px);
}

.field,
.toggle-row {
  display: grid;
  gap: 8px;
}

.toggle-row {
  grid-template-columns: 1fr auto;
  align-items: center;
}

input[type="text"],
input[type="password"],
input[type="number"],
input:not([type]) {
  width: 100%;
  min-height: 50px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

input[type="checkbox"] {
  width: 22px;
  height: 22px;
}

.help-text,
.muted {
  color: var(--muted);
}

.status-text {
  min-height: 54px;
  margin: 4px 0 0;
  padding: 12px 14px;
  border: 1px solid rgba(23, 20, 18, 0.12);
  border-radius: 14px;
  background: rgba(255, 250, 240, 0.9);
  color: var(--ink);
  box-shadow: 0 10px 24px rgba(23, 20, 18, 0.06);
}

.status-text[data-tone="info"] {
  border-color: rgba(15, 95, 82, 0.18);
  background: rgba(232, 245, 242, 0.95);
}

.status-text[data-tone="success"] {
  border-color: rgba(15, 95, 82, 0.28);
  background: rgba(221, 241, 236, 0.98);
}

.status-text[data-tone="error"] {
  border-color: rgba(174, 46, 36, 0.28);
  background: rgba(253, 234, 232, 0.98);
  color: #7f1d1d;
}

.chant-surface {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 100vw;
  min-height: 100dvh;
  padding: 96px 30px 40px;
  text-align: left;
  color: #fffaf0;
  background:
    radial-gradient(circle at 30% 20%, rgba(255, 245, 214, 0.18), transparent 20%),
    linear-gradient(180deg, #191919 0%, #080808 100%);
  border-radius: 0;
}

.chant-content {
  display: flex;
  width: min(70vw, 420px);
  min-height: 100%;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
}

.chant-count {
  font-size: clamp(4.4rem, 26.4vw, 8.8rem);
  line-height: 1;
  margin-bottom: 42px;
}

.chant-stats {
  display: grid;
  gap: 12px;
  font-size: 1.9rem;
  line-height: 1.45;
}

.chant-stat-row {
  display: flex;
  align-items: center;
  gap: 12px;
  color: rgba(255, 250, 240, 0.9);
}

.chant-icon {
  width: 30px;
  text-align: center;
}

@media (max-width: 640px) {
  .app-shell {
    padding: 14px;
  }

  .panel {
    padding: 16px;
  }

  .goal-button-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .button-row {
    flex-direction: column;
  }
}
