/* =========================================================================
   Regularity Coach — calm, warm, private gut-health companion
   Palette: linen + sage + honey + plum. Type: Fraunces (display) / Mulish (UI).
   Mobile-first; bottom tab navigation for thumb reach.
   ========================================================================= */

:root {
  --linen: #fbf7f0;
  --cream: #fffdf8;
  --sage: #2e7d6b;
  --sage-deep: #235e51;
  --sage-soft: #dcede7;
  --honey: #cf8a3f;
  --honey-soft: #fbecd8;
  --plum: #7c5a77;
  --plum-soft: #efe6ef;
  --ink: #2b2925;
  --muted: #6e6258;
  --line: #ece3d6;
  --good: #3f8f78;
  --good-soft: #e1f0ea;
  --watch: #c0792f;
  --watch-soft: #f8e9d6;
  --alert: #b23a48;
  --alert-soft: #f7e0e2;

  --shadow-sm: 0 1px 2px rgba(43, 41, 37, 0.06);
  --shadow-md: 0 6px 20px rgba(43, 41, 37, 0.08);
  --radius: 16px;
  --radius-sm: 10px;

  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Mulish", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --maxw: 640px;
  --tabbar-h: 76px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--linen);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.2;
  margin: 0;
  color: var(--ink);
}

button {
  font-family: inherit;
  cursor: pointer;
}

input,
textarea,
select {
  font-family: inherit;
  font-size: 1rem;
  accent-color: var(--sage);
}

:focus-visible {
  outline: 3px solid var(--sage);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---------------------------------------------------------------- layout */
.app {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.appbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--linen) 88%, transparent);
  backdrop-filter: saturate(1.1) blur(8px);
  border-bottom: 1px solid var(--line);
}

.brand {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: var(--sage-soft);
  color: var(--sage);
  flex: none;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.brand-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.15rem;
  letter-spacing: 0.2px;
}

.brand-tag {
  font-size: 0.74rem;
  color: var(--muted);
  letter-spacing: 0.2px;
}

.content {
  flex: 1;
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 20px 20px calc(var(--tabbar-h) + 28px);
  animation: viewIn 0.28s ease both;
}

@keyframes viewIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ------------------------------------------------------------- tab bar */
.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  display: flex;
  justify-content: space-around;
  gap: 2px;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
  background: var(--cream);
  border-top: 1px solid var(--line);
  box-shadow: 0 -4px 20px rgba(43, 41, 37, 0.05);
}

.tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 6px 4px;
  border: none;
  background: none;
  color: var(--muted);
  border-radius: 12px;
  transition: color 0.15s ease, background 0.15s ease;
}

.tab-icon {
  display: block;
}

.tab-label {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.2px;
}

.tab.is-active {
  color: var(--sage);
  background: var(--sage-soft);
}

/* --------------------------------------------------------------- buttons */
.btn {
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 12px 22px;
  font-size: 0.98rem;
  font-weight: 700;
  letter-spacing: 0.2px;
  transition: transform 0.08s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--sage);
  color: #fff;
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  background: var(--sage-deep);
}

.btn-ghost {
  background: transparent;
  color: var(--sage);
  border-color: color-mix(in srgb, var(--sage) 35%, transparent);
}

.btn-ghost:hover {
  background: var(--sage-soft);
}

.btn-danger {
  background: transparent;
  color: var(--alert);
  border-color: color-mix(in srgb, var(--alert) 40%, transparent);
}

.btn-danger:hover {
  background: var(--alert-soft);
}

.btn-small {
  padding: 8px 16px;
  font-size: 0.85rem;
}

.link-btn {
  background: none;
  border: none;
  color: var(--sage);
  font-weight: 700;
  font-size: 0.9rem;
  padding: 4px 0;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1.5px;
}

.link-btn:hover {
  color: var(--sage-deep);
}

.link-btn.inline {
  font-size: inherit;
  padding: 0;
}

/* ----------------------------------------------------------------- cards */
.card {
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.card-head h2 {
  font-size: 1.12rem;
}

.card h2 {
  font-size: 1.12rem;
  margin-bottom: 10px;
}

.card-note {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 12px 0 0;
}

/* ------------------------------------------------------------------ hero */
.hero {
  border-radius: var(--radius);
  padding: 22px 20px 20px;
  margin-bottom: 16px;
  border: 1px solid var(--line);
  background: var(--sage-soft);
  box-shadow: var(--shadow-md);
}

.hero.status-good {
  background: var(--good-soft);
}
.hero.status-watch {
  background: var(--honey-soft);
}
.hero.status-stalled {
  background: var(--watch-soft);
}
.hero.status-neutral {
  background: var(--sage-soft);
}

.hero-eyebrow {
  margin: 0;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--muted);
}

.hero-since {
  margin: 4px 0 2px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 2rem;
  line-height: 1.1;
  color: var(--ink);
}

.hero-status-word {
  margin: 8px 0 2px;
  font-weight: 800;
  font-size: 1.02rem;
  color: var(--sage-deep);
}

.hero.status-watch .hero-status-word,
.hero.status-stalled .hero-status-word {
  color: var(--watch);
}

.hero-status-line {
  margin: 0;
  font-size: 0.92rem;
  color: var(--muted);
  max-width: 46ch;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

/* ---------------------------------------------------------------- ribbon */
.ribbon {
  margin: 18px 0 2px;
}

.ribbon-row {
  display: flex;
  gap: 5px;
  align-items: flex-end;
}

.ribbon-day {
  flex: 1;
  aspect-ratio: 1 / 1;
  max-width: 26px;
  color: color-mix(in srgb, var(--ink) 16%, transparent);
}

.ribbon-day .leaf-shape {
  fill: currentColor;
  opacity: 0.35;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.ribbon-day.is-logged {
  color: var(--sage);
}

.ribbon-day.is-logged .leaf-shape {
  opacity: 1;
}

.ribbon-day.is-today .leaf-shape {
  transform-origin: center;
  transform: scale(1.12);
}

.ribbon-caption {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  font-size: 0.7rem;
  color: var(--muted);
}

/* ------------------------------------------------------------- encourage */
.encourage {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, var(--honey-soft), var(--plum-soft));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
}

.encourage-sun {
  position: absolute;
  top: -40px;
  right: -30px;
  width: 130px;
  height: 130px;
  border-radius: 50%;
  background: radial-gradient(
    circle at center,
    color-mix(in srgb, var(--honey) 55%, transparent),
    transparent 70%
  );
  pointer-events: none;
}

.encourage-eyebrow {
  position: relative;
  margin: 0 0 6px;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--honey);
}

.encourage-text {
  position: relative;
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-size: 1.22rem;
  line-height: 1.4;
  color: var(--ink);
}

/* -------------------------------------------------------- wellness chips */
.wchip-row {
  display: grid;
  gap: 10px;
}

.wchip {
  display: block;
  width: 100%;
  text-align: left;
  background: var(--linen);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  transition: background 0.15s ease;
}

.wchip:hover {
  background: #fff;
}

.wchip-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 8px;
}

.wchip-label {
  font-weight: 700;
  font-size: 0.92rem;
}

.wchip-val {
  font-size: 0.85rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.wchip-val.is-met {
  color: var(--good);
  font-weight: 700;
}

.wchip-bar {
  display: block;
  height: 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--ink) 8%, transparent);
  overflow: hidden;
}

.wchip-fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--sage);
  transition: width 0.3s ease;
}

/* ------------------------------------------------------------------ stats */
.stat-row {
  display: flex;
  gap: 10px;
}

.stat {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  background: var(--linen);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px 8px;
}

.stat-value {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--sage-deep);
  font-variant-numeric: tabular-nums;
}

.stat-label {
  font-size: 0.78rem;
  font-weight: 600;
  margin-top: 2px;
}

.stat-sub {
  font-size: 0.7rem;
  color: var(--muted);
}

/* ------------------------------------------------------------------ forms */
.form-page,
.rec-page,
.history-page,
.learn-page,
.dashboard {
  animation: viewIn 0.28s ease both;
}

.page-title {
  font-size: 1.6rem;
  margin-bottom: 4px;
}

.page-sub {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 0.92rem;
}

.page-head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.page-head-row .page-title {
  margin-bottom: 4px;
}

.field {
  margin-bottom: 18px;
  border: none;
  padding: 0;
}

.field > label,
.field-legend {
  display: block;
  font-weight: 700;
  font-size: 0.92rem;
  margin-bottom: 8px;
}

.field-hint {
  margin: -2px 0 12px;
  font-size: 0.82rem;
  color: var(--muted);
}

.field input[type="text"],
.field input[type="number"],
.field input[type="datetime-local"],
.field textarea,
.setting-control input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--cream);
  color: var(--ink);
}

.field textarea {
  resize: vertical;
}

input[type="range"] {
  width: 100%;
  height: 26px;
  accent-color: var(--sage);
}

.range-ends {
  display: flex;
  justify-content: space-between;
  font-size: 0.74rem;
  color: var(--muted);
  margin-top: 2px;
}

.form-error {
  color: var(--alert);
  background: var(--alert-soft);
  border: 1px solid color-mix(in srgb, var(--alert) 30%, transparent);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 0.9rem;
  font-weight: 600;
}

.form-actions {
  display: flex;
  gap: 10px;
  margin-top: 8px;
}

.form-actions .btn {
  flex: 1;
}

/* choice rows (straining / completeness) */
.choice-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.choice {
  flex: 1 1 auto;
  min-width: 80px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--cream);
  color: var(--ink);
  font-weight: 600;
  font-size: 0.9rem;
  transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}

.choice.is-selected {
  background: var(--sage);
  border-color: var(--sage);
  color: #fff;
}

/* ----------------------------------------------------------- bristol pick */
.bristol-fieldset {
  border: none;
  padding: 0;
  margin: 0 0 18px;
}

.bristol-grid {
  display: grid;
  gap: 8px;
}

.bristol-option {
  display: grid;
  grid-template-columns: 38px 1fr auto;
  align-items: center;
  gap: 12px;
  text-align: left;
  padding: 12px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--band, var(--line));
  border-radius: var(--radius-sm);
  background: var(--cream);
  transition: box-shadow 0.12s ease, border-color 0.12s ease, background 0.12s ease;
}

.bristol-option.is-selected {
  background: #fff;
  border-color: var(--sage);
  box-shadow: 0 0 0 2px var(--sage-soft);
}

.bristol-num {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: color-mix(in srgb, var(--band, var(--sage)) 18%, transparent);
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.1rem;
}

.bristol-text {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.bristol-label {
  font-weight: 700;
  font-size: 0.92rem;
}

.bristol-desc {
  font-size: 0.8rem;
  color: var(--muted);
}

.bristol-band {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 999px;
  white-space: nowrap;
}

/* shared band coloring (pills, tags) */
.band-ideal {
  background: var(--good-soft);
  color: var(--good);
}
.band-constipated {
  background: var(--watch-soft);
  color: var(--watch);
}
.band-loose {
  background: var(--plum-soft);
  color: var(--plum);
}

/* ----------------------------------------------------------- steppers */
.stepper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.stepper-label {
  font-weight: 700;
  font-size: 1.02rem;
}

.stepper-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.step-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--cream);
  color: var(--sage);
  font-size: 1.5rem;
  line-height: 1;
  display: grid;
  place-items: center;
  transition: background 0.12s ease;
}

.step-btn:hover {
  background: var(--sage-soft);
}

.stepper-value {
  min-width: 78px;
  text-align: center;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.stepper-unit {
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--linen);
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 600;
  transition: background 0.12s ease;
}

.chip:hover {
  background: var(--sage-soft);
}

.chip-sub {
  color: var(--muted);
  font-weight: 700;
  font-size: 0.74rem;
}

/* ------------------------------------------------------- recommendations */
.rec-list {
  list-style: none;
  padding: 0;
  margin: 0 0 18px;
  display: grid;
  gap: 12px;
}

.rec {
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow-sm);
}

.rec-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.rec-tag {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--sage-soft);
  color: var(--sage-deep);
}

.tag-care {
  background: var(--watch-soft);
  color: var(--watch);
}
.tag-fiber {
  background: var(--good-soft);
  color: var(--good);
}
.tag-calm,
.tag-position {
  background: var(--plum-soft);
  color: var(--plum);
}

.rec-title {
  font-size: 1.04rem;
  flex: 1;
  min-width: 60%;
}

.rec-body {
  margin: 0 0 8px;
  font-size: 0.92rem;
  color: var(--ink);
}

.rec-detail {
  margin-top: 8px;
  padding: 12px;
  background: var(--linen);
  border-radius: var(--radius-sm);
  font-size: 0.86rem;
}

.rec-detail p {
  margin: 0 0 6px;
}

.rec-detail p:last-child {
  margin-bottom: 0;
}

.rec-source {
  color: var(--muted);
  font-style: italic;
}

.care-banner {
  background: var(--honey-soft);
  border: 1px solid color-mix(in srgb, var(--honey) 25%, transparent);
  border-radius: var(--radius);
  padding: 14px 16px;
  font-size: 0.88rem;
}

.care-banner p {
  margin: 0;
}

/* --------------------------------------------------------------- history */
.empty {
  text-align: center;
  padding: 36px 16px;
  background: var(--cream);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
}

.empty-title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  margin: 0 0 6px;
}

.empty-body {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0 auto 16px;
  max-width: 38ch;
}

.entry-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 10px;
}

.entry {
  position: relative;
  display: flex;
  align-items: stretch;
  gap: 12px;
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 14px 14px 0;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.entry-band {
  width: 6px;
  flex: none;
  border-radius: 0 4px 4px 0;
}

.entry-main {
  flex: 1;
  min-width: 0;
}

.entry-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.entry-when {
  font-weight: 700;
  font-size: 0.9rem;
}

.entry-pill {
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  padding: 3px 9px;
  border-radius: 999px;
}

.entry-desc {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.entry-notes {
  margin: 6px 0 0;
  font-size: 0.85rem;
  color: var(--ink);
  font-style: italic;
}

.entry-delete {
  align-self: flex-start;
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 0.9rem;
  margin-right: 4px;
}

.entry-delete:hover {
  background: var(--alert-soft);
  color: var(--alert);
}

/* ----------------------------------------------------------------- learn */
.disclaimer {
  background: var(--sage-soft);
  border-color: color-mix(in srgb, var(--sage) 22%, transparent);
}

.disclaimer p {
  margin: 0;
  font-size: 0.88rem;
  color: var(--sage-deep);
}

.redflags {
  border-color: color-mix(in srgb, var(--alert) 28%, transparent);
}

.redflags-title {
  color: var(--alert);
  font-size: 1.18rem;
  margin-bottom: 6px;
}

.redflags-intro {
  margin: 0 0 14px;
  font-size: 0.88rem;
  color: var(--muted);
}

.redflags-sub {
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin: 14px 0 8px;
}

.redflags-sub.urgent {
  color: var(--alert);
}

.redflags-sub.soon {
  color: var(--watch);
}

.redflags-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 7px;
}

.flag {
  position: relative;
  padding: 9px 12px 9px 34px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  border: 1px solid var(--line);
}

.flag::before {
  position: absolute;
  left: 12px;
  top: 9px;
  font-weight: 800;
}

.flag-urgent {
  background: var(--alert-soft);
  border-color: color-mix(in srgb, var(--alert) 25%, transparent);
}

.flag-urgent::before {
  content: "!";
  color: var(--alert);
}

.flag-soon {
  background: var(--watch-soft);
  border-color: color-mix(in srgb, var(--watch) 25%, transparent);
}

.flag-soon::before {
  content: "•";
  color: var(--watch);
}

.basics-list {
  margin: 0;
  padding-left: 20px;
  display: grid;
  gap: 8px;
  font-size: 0.92rem;
}

.basics-list li {
  padding-left: 4px;
}

.bristol-ref {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 8px;
}

.bristol-ref-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  border-left: 5px solid var(--line);
  background: var(--linen);
  font-size: 0.88rem;
}

.bristol-ref-item.band-ideal {
  border-left-color: var(--good);
}
.bristol-ref-item.band-constipated {
  border-left-color: var(--watch);
}
.bristol-ref-item.band-loose {
  border-left-color: var(--plum);
}

.bristol-ref-num {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  flex: none;
  border-radius: 8px;
  background: #fff;
  border: 1px solid var(--line);
  font-family: var(--font-display);
  font-weight: 600;
}

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.setting-row label {
  font-weight: 600;
  font-size: 0.92rem;
}

.setting-control {
  display: flex;
  align-items: center;
  gap: 8px;
}

.setting-control input {
  width: 86px;
  text-align: center;
}

.setting-unit {
  font-size: 0.82rem;
  color: var(--muted);
}

.data-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.sources-note {
  font-size: 0.76rem;
  color: var(--muted);
  line-height: 1.5;
  margin: 4px 4px 0;
}

/* ----------------------------------------------------------------- toast */
.toast-wrap {
  position: fixed;
  left: 0;
  right: 0;
  bottom: calc(var(--tabbar-h) + 12px);
  z-index: 40;
  display: flex;
  justify-content: center;
  padding: 0 16px;
  pointer-events: none;
}

.toast {
  max-width: 440px;
  background: var(--ink);
  color: #fdfcf9;
  padding: 12px 18px;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 600;
  box-shadow: var(--shadow-md);
  animation: toastIn 0.25s ease both;
  text-align: center;
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ------------------------------------------------------------- desktop+ */
@media (min-width: 720px) {
  .tabbar {
    bottom: 16px;
    border-radius: 999px;
    border: 1px solid var(--line);
    box-shadow: var(--shadow-md);
    padding: 8px 12px;
    gap: 6px;
  }
  .content {
    padding-bottom: calc(var(--tabbar-h) + 40px);
  }
  .hero-since {
    font-size: 2.3rem;
  }
}

/* --------------------------------------------------- reduced motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
