/* ═══════════════════════════════════════════════════════════
   Fast Wasp — Design System
   Palette: black + amber gold (from logo.svg)
   ═══════════════════════════════════════════════════════════ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* Backgrounds — warm near-black, matching wasp body */
  --bg:        #100e08;
  --bg2:       #1a1710;
  --bg3:       #252018;
  --border:    #3d3418;

  /* Gold — exact colours from logo.svg */
  --accent:    #e4af28;   /* logo primary amber */
  --accent2:   #b7831c;   /* logo shadow amber  */
  --sting:     #f5c842;   /* slightly brighter highlight */
  --stripe:    rgba(228,175,40,.06);

  /* Text */
  --text:      #f5edcc;
  --muted:     #887844;

  /* Semantic */
  --success:   #4ade80;
  --warning:   #fb923c;
  --danger:    #f87171;

  /* Shape — sharp, "with a sting" */
  --radius:    5px;
  --radius-sm: 3px;

  /* Layout */
  --top-h:     58px;

  font-size: 16px;
}

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  overscroll-behavior: none;
}

/* ═══════════════════════════════════════════════════════════
   TOPBAR
   ═══════════════════════════════════════════════════════════ */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--top-h);
  background: var(--bg2);
  border-bottom: 2px solid var(--accent);
  display: flex;
  align-items: center;
  padding: 0 12px;
  gap: 10px;
  z-index: 100;
  /* subtle diagonal wasp stripes */
  background-image: repeating-linear-gradient(
    -55deg, transparent, transparent 24px, var(--stripe) 24px, var(--stripe) 28px
  );
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.brand-logo {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
}
.brand-name {
  font-size: .8rem;
  font-weight: 900;
  letter-spacing: .1em;
  color: var(--accent);
  text-shadow: 0 0 12px rgba(228,175,40,.4);
  white-space: nowrap;
}

/* Top nav buttons */
.topnav {
  display: flex;
  gap: 2px;
  flex: 1;
  justify-content: center;
}
.topnav-btn {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 6px 10px;
  font-size: .8rem;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  transition: color .15s, border-color .15s;
  white-space: nowrap;
}
.topnav-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  text-shadow: 0 0 10px rgba(228,175,40,.4);
}
.topnav-btn:hover:not(.active) { color: var(--text); }

/* Hamburger */
.hamburger {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 28px;
  height: 20px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px;
  flex-shrink: 0;
}
.hamburger span {
  display: block;
  height: 2px;
  background: var(--muted);
  border-radius: 2px;
  transition: background .15s;
}
.hamburger:hover span, .hamburger[aria-expanded="true"] span { background: var(--accent); }

/* Hamburger dropdown */
.hmenu {
  position: fixed;
  top: var(--top-h);
  right: 12px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-top: 2px solid var(--accent);
  border-radius: 0 0 var(--radius) var(--radius);
  z-index: 99;
  min-width: 160px;
  overflow: hidden;
  display: none;
  box-shadow: 0 8px 24px rgba(0,0,0,.4);
}
.hmenu.open { display: block; }
.hmenu-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 13px 18px;
  background: none;
  border: none;
  color: var(--text);
  font-size: .9rem;
  cursor: pointer;
  transition: background .1s, color .1s;
}
.hmenu-item:hover, .hmenu-item.active { background: var(--bg3); color: var(--accent); }
.hmenu-item + .hmenu-item { border-top: 1px solid var(--border); }

/* ═══════════════════════════════════════════════════════════
   MAIN CONTENT
   ═══════════════════════════════════════════════════════════ */
main#view {
  margin-top: var(--top-h);
  padding: 16px 14px 32px;
  min-height: calc(100dvh - var(--top-h));
}

/* ═══════════════════════════════════════════════════════════
   CARDS
   ═══════════════════════════════════════════════════════════ */
.card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 14px;
}
.card-title {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--muted);
  margin-bottom: 14px;
}

/* ═══════════════════════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  font-size: .92rem;
  font-weight: 700;
  letter-spacing: .02em;
  transition: opacity .15s, transform .1s, box-shadow .15s;
}
.btn:active { transform: scale(.97); }
.btn-primary {
  background: var(--accent);
  color: #0a0a00;
  width: 100%;
  box-shadow: 0 0 14px rgba(228,175,40,.22);
}
.btn-primary:hover { background: var(--sting); box-shadow: 0 0 20px rgba(232,180,20,.4); }
.btn-danger  { background: var(--danger); color: #fff; width: 100%; }
.btn-ghost   { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn-sm      { padding: 5px 12px; font-size: .78rem; }
.mt-8  { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.text-muted   { color: var(--muted); }
.text-danger  { color: var(--danger); }
.text-warning { color: var(--warning); }

/* ═══════════════════════════════════════════════════════════
   ONBOARDING
   ═══════════════════════════════════════════════════════════ */
.onboard-hero {
  text-align: center;
  padding: 24px 0 20px;
}
.onboard-logo {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 14px;
  box-shadow: 0 0 0 4px var(--accent), 0 0 24px rgba(228,175,40,.3);
}
.onboard-title {
  font-size: 2rem;
  font-weight: 900;
  letter-spacing: .1em;
  color: var(--accent);
  text-shadow: 0 0 18px rgba(228,175,40,.45);
  margin-bottom: 6px;
}
.onboard-tagline {
  font-size: .88rem;
  color: var(--muted);
  font-style: italic;
}

.feature-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-bottom: 16px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.feature-list li {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
}
.feature-list li:last-child { border-bottom: none; }
.feat-ic {
  font-size: 1.3rem;
  width: 32px;
  text-align: center;
  flex-shrink: 0;
}
.feature-list li div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.feature-list strong {
  font-size: .88rem;
  font-weight: 700;
  color: var(--text);
}
.feature-list span {
  font-size: .76rem;
  color: var(--muted);
}
.onboard-form { }
.onboard-label {
  display: block;
  font-size: .85rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 10px;
}
.onboard-input {
  width: 100%;
  background: var(--bg3);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 12px 14px;
  font-size: 1.1rem;
  outline: none;
  transition: border-color .15s;
}
.onboard-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(228,175,40,.15); }

/* ═══════════════════════════════════════════════════════════
   GREETING
   ═══════════════════════════════════════════════════════════ */
.greeting {
  font-size: .95rem;
  color: var(--muted);
  margin-bottom: 12px;
  font-weight: 400;
}
.greeting strong { color: var(--accent); font-weight: 700; }

/* ═══════════════════════════════════════════════════════════
   PROGRAM SELECTOR
   ═══════════════════════════════════════════════════════════ */
.program-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}
.program-btn {
  background: var(--bg3);
  border: 2px solid transparent;
  border-radius: var(--radius-sm);
  padding: 11px 4px;
  cursor: pointer;
  color: var(--text);
  font-weight: 700;
  font-size: .85rem;
  text-align: center;
  transition: border-color .15s, background .15s;
}
.program-btn small {
  display: block;
  font-size: .62rem;
  font-weight: 400;
  color: var(--muted);
  margin-top: 2px;
}
.program-btn.selected {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(228,175,40,.08);
}
.custom-input-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.custom-input-wrap input[type=range] { flex: 1; accent-color: var(--accent); }
.custom-val { font-weight: 700; min-width: 40px; text-align: right; color: var(--accent); }

/* ═══════════════════════════════════════════════════════════
   READY STATE
   ═══════════════════════════════════════════════════════════ */
.ready-card {
  text-align: center;
  background-image: repeating-linear-gradient(
    -55deg, transparent, transparent 18px, var(--stripe) 18px, var(--stripe) 22px
  );
}
.ready-prog-badge {
  display: inline-block;
  background: rgba(228,175,40,.15);
  border: 1px solid var(--accent);
  border-radius: 99px;
  padding: 4px 16px;
  font-size: .8rem;
  font-weight: 800;
  letter-spacing: .08em;
  color: var(--accent);
  margin-bottom: 16px;
}
.ready-windows {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 8px;
}
.ready-win {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.ready-win-h {
  font-size: 2rem;
  font-weight: 900;
  color: var(--accent);
  line-height: 1;
}
.ready-win span:last-child {
  font-size: .72rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .06em;
}
.ready-sep {
  font-size: 1.5rem;
  color: var(--border);
  font-weight: 300;
  margin-top: -4px;
}
.ready-sub { font-size: .78rem; color: var(--muted); margin-bottom: 8px; }

/* ═══════════════════════════════════════════════════════════
   TIMER RING
   ═══════════════════════════════════════════════════════════ */
.timer-card { text-align: center; }
.timer-mode-label {
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .14em;
  color: var(--accent);
  margin-bottom: 16px;
}
.timer-mode-label.eating { color: var(--success); }
.timer-ring-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.timer-ring {
  position: relative;
  width: 220px;
  height: 220px;
}
.timer-ring svg { transform: rotate(-90deg); }
.ring-bg   { fill: none; stroke: var(--bg3); stroke-width: 10; }
.ring-prog {
  fill: none;
  stroke: var(--accent);
  stroke-width: 10;
  stroke-linecap: butt;
  transition: stroke-dashoffset .5s linear, stroke .3s;
  filter: drop-shadow(0 0 5px rgba(228,175,40,.45));
}
.ring-prog.overtime   { stroke: var(--warning); filter: drop-shadow(0 0 5px rgba(251,146,60,.5)); }
.ring-prog.ring-eat   { stroke: var(--success); filter: drop-shadow(0 0 5px rgba(74,222,128,.4)); }
.ring-prog.ring-eat.overtime { stroke: var(--danger); filter: drop-shadow(0 0 5px rgba(248,113,113,.5)); }
.timer-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.timer-label {
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--muted);
}
.timer-digits {
  font-size: 1.9rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.02em;
  color: var(--text);
}
.timer-digits.overtime { color: var(--warning); }
.timer-prog-name { font-size: .8rem; color: var(--muted); margin-top: 10px; }
.overtime-badge {
  display: inline-block;
  background: var(--warning);
  color: #000;
  font-size: .7rem;
  font-weight: 800;
  padding: 3px 12px;
  border-radius: 99px;
  letter-spacing: .04em;
}

/* ═══════════════════════════════════════════════════════════
   OMAD
   ═══════════════════════════════════════════════════════════ */
.omad-since {
  font-size: 2rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  text-align: center;
  padding: 18px 0 6px;
  color: var(--accent);
}
.omad-target-bar-wrap { margin: 12px 0 18px; }
.omad-bar-bg { height: 8px; background: var(--bg3); border-radius: 99px; overflow: hidden; }
.omad-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 99px;
  transition: width .4s linear;
}
.omad-bar-fill.reached { background: var(--success); }
.omad-bar-label {
  display: flex;
  justify-content: space-between;
  font-size: .7rem;
  color: var(--muted);
  margin-top: 4px;
}

/* ═══════════════════════════════════════════════════════════
   WEIGHT FORM / LIST
   ═══════════════════════════════════════════════════════════ */
.form-row { display: flex; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  min-width: 120px;
}
.form-group label { font-size: .76rem; color: var(--muted); font-weight: 600; }
.form-group input {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 10px 12px;
  font-size: 1rem;
  width: 100%;
  outline: none;
  transition: border-color .15s;
}
.form-group input:focus { border-color: var(--accent); }
.form-group input.input-error { border-color: var(--danger); }
.field-error { font-size: .72rem; color: var(--danger); min-height: 1em; }

.entry-list { list-style: none; display: flex; flex-direction: column; gap: 7px; }
.entry-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px;
  background: var(--bg3);
  border-radius: var(--radius-sm);
}
.entry-date { font-size: .78rem; color: var(--muted); }
.entry-val  { font-weight: 700; font-size: .95rem; display: flex; align-items: center; gap: 6px; }
.entry-actions { display: flex; gap: 5px; }
.entry-delta { font-size: .75rem; font-weight: 700; }
.delta-up   { color: var(--danger); }
.delta-down { color: var(--success); }

/* ═══════════════════════════════════════════════════════════
   CHART
   ═══════════════════════════════════════════════════════════ */
.chart-wrap { position: relative; height: 210px; }
.range-tabs { display: flex; gap: 5px; margin-bottom: 12px; }
.range-tab {
  padding: 4px 12px;
  border-radius: 99px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  font-size: .76rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .12s;
}
.range-tab.active { background: var(--accent); color: #0a0a00; border-color: transparent; }

/* ═══════════════════════════════════════════════════════════
   STATS
   ═══════════════════════════════════════════════════════════ */
.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.stat-box {
  background: var(--bg3);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.stat-label { font-size: .68rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.stat-val   { font-size: 1.25rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.stat-val.up      { color: var(--danger); }
.stat-val.down    { color: var(--success); }
.stat-val.neutral { color: var(--text); }

/* ═══════════════════════════════════════════════════════════
   SETTINGS
   ═══════════════════════════════════════════════════════════ */
.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.settings-row:last-child { border-bottom: none; }
.settings-row label { font-size: .88rem; }
.pill-toggle {
  display: flex;
  background: var(--bg3);
  border-radius: 99px;
  padding: 3px;
  gap: 2px;
}
.pill-btn {
  padding: 5px 14px;
  border: none;
  border-radius: 99px;
  background: transparent;
  color: var(--muted);
  font-size: .8rem;
  font-weight: 700;
  cursor: pointer;
  transition: background .12s, color .12s;
}
.pill-btn.active { background: var(--accent); color: #0a0a00; }

/* ═══════════════════════════════════════════════════════════
   PANIC BUTTON (cravings)
   ═══════════════════════════════════════════════════════════ */
.panic-card { text-align: center; }
.panic-eyebrow {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--muted);
  margin-bottom: 18px;
}
.panic-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 176px;
  height: 176px;
  /* Hexagonal clip */
  clip-path: polygon(50% 0%,93% 25%,93% 75%,50% 100%,7% 75%,7% 25%);
  border: none;
  cursor: pointer;
  margin: 0 auto 16px;
  background: var(--accent);
  box-shadow: 0 0 0 6px rgba(228,175,40,.18), 0 0 28px rgba(228,175,40,.25);
  transition: transform .1s, box-shadow .1s;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.panic-btn:active {
  transform: scale(.91);
  box-shadow: 0 0 0 3px rgba(228,175,40,.3);
}
.panic-icon  { font-size: 2.4rem; line-height: 1; }
.panic-label { font-size: .85rem; font-weight: 900; color: #0a0a00; letter-spacing: .06em; }
.panic-sub   { font-size: .75rem; color: var(--muted); margin-bottom: 8px; }
.panic-feedback {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--success);
  min-height: 1.6rem;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity .25s, transform .25s;
}
.panic-feedback.show { opacity: 1; transform: translateY(0); }

.streak-banner {
  margin-top: 14px;
  background: rgba(228,175,40,.12);
  border: 1px solid rgba(228,175,40,.35);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: .85rem;
  font-weight: 800;
  letter-spacing: .03em;
  color: var(--accent);
  text-align: center;
}

/* ═══════════════════════════════════════════════════════════
   CRAVING CALENDAR (30-day heatmap)
   ═══════════════════════════════════════════════════════════ */
.craving-calendar {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 4px;
  margin-bottom: 10px;
}
.cal-dot { aspect-ratio: 1; border-radius: 2px; cursor: default; }
.cal-dot-0 { background: var(--bg3); }
.cal-dot-1 { background: rgba(228,175,40,.25); }
.cal-dot-2 { background: rgba(228,175,40,.50); }
.cal-dot-3 { background: rgba(228,175,40,.75); }
.cal-dot-4 { background: var(--accent); }
.cal-legend { display: flex; align-items: center; gap: 4px; justify-content: flex-end; }
.cal-legend .cal-dot { width: 12px; height: 12px; }

/* ═══════════════════════════════════════════════════════════
   HISTORY LIST
   ═══════════════════════════════════════════════════════════ */
.history-list { list-style: none; display: flex; flex-direction: column; gap: 5px; max-height: 250px; overflow-y: auto; }
.history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--bg3);
  border-radius: var(--radius-sm);
  font-size: .8rem;
  gap: 8px;
}
.hist-date { color: var(--muted); flex-shrink: 0; }
.hist-prog { color: var(--muted); font-size: .72rem; }
.hist-dur  { font-weight: 700; }
.hist-ot   { color: var(--warning); font-size: .72rem; }

/* ═══════════════════════════════════════════════════════════
   MISC
   ═══════════════════════════════════════════════════════════ */
.empty-msg { color: var(--muted); text-align: center; padding: 28px 0; font-size: .88rem; }
