/* Coffee — daily caffeine tracker with pharmacokinetic curve
 * Palette: espresso-roast + caramel + crema-cream
 * © אופיר ברנס (Ofir Baranes) 2026 - כל הזכויות שמורות
 */

* { margin:0; padding:0; box-sizing:border-box; -webkit-tap-highlight-color: transparent; }

:root {
  --bg-1: #0f0905;
  --bg-2: #1a0f08;
  --bg-3: #2a1a0e;
  --espresso: #1a0f08;
  --mocha: #3d2817;
  --caramel-300: #e6c79a;
  --caramel-400: #d4a574;
  --caramel-500: #b8865a;
  --caramel-600: #95684a;
  --crema-100: #fef9f0;
  --crema-200: #fef3e2;
  --crema-300: #fde4c4;
  --amber-400: #fbbf24;
  --amber-500: #f59e0b;
  --amber-600: #d97706;
  --paprika: #dc2626;
  --paprika-soft: rgba(220,38,38,0.18);
  --green: #84cc16;
  --text-primary: #fef3e2;
  --text-secondary: rgba(254,243,226,0.72);
  --text-muted: rgba(254,243,226,0.42);
  --surface: rgba(254,243,226,0.05);
  --surface-strong: rgba(254,243,226,0.09);
  --surface-input: rgba(15,9,5,0.55);
  --border: rgba(212,165,116,0.18);
  --border-strong: rgba(212,165,116,0.32);
  --shadow-glass: 0 30px 60px -25px rgba(5,3,2,0.85);
  --shadow-warm: 0 10px 30px rgba(184,134,90,0.30);
  --bezier: cubic-bezier(.34,1.56,.64,1);
  --bezier-soft: cubic-bezier(.4,0,.2,1);
}

html, body {
  background: var(--bg-1);
  color: var(--text-primary);
  font-family: 'Heebo', system-ui, sans-serif;
  font-weight: 400;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

body {
  background:
    radial-gradient(ellipse 700px 800px at 80% -10%, rgba(184,134,90,0.20), transparent 60%),
    radial-gradient(ellipse 500px 600px at -10% 60%, rgba(245,158,11,0.10), transparent 65%),
    radial-gradient(ellipse 800px 1000px at 50% 110%, rgba(61,40,23,0.45), transparent 70%),
    linear-gradient(180deg, #0f0905 0%, #160d07 60%, #1f140a 110%);
  background-attachment: fixed;
  position: relative;
  padding-bottom: 84px;
}

.mono { font-family: 'IBM Plex Mono', monospace; font-variant-numeric: tabular-nums; }

/* ===== Ambient ===== */
.ambient-bg {
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.orb-blur {
  position: absolute;
  border-radius: 50%;
  filter: blur(95px);
  opacity: 0.40;
}
.orb-blur.o1 { width: 440px; height: 440px; top: -130px; right: -120px; background: radial-gradient(circle, #b8865a 0%, transparent 70%); animation: drift1 28s ease-in-out infinite; }
.orb-blur.o2 { width: 340px; height: 340px; bottom: 5%; left: -100px; background: radial-gradient(circle, #f59e0b 0%, transparent 70%); opacity: 0.20; animation: drift2 34s ease-in-out infinite; }
.orb-blur.o3 { width: 280px; height: 280px; top: 38%; right: 28%; background: radial-gradient(circle, #d4a574 0%, transparent 70%); opacity: 0.22; animation: drift3 40s ease-in-out infinite; }
@keyframes drift1 { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(-30px,40px) scale(1.1); } }
@keyframes drift2 { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(40px,-30px) scale(1.08); } }
@keyframes drift3 { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(-25px,-35px) scale(1.12); } }

/* Steam wisps */
.steam {
  position: absolute;
  top: 8%;
  right: 12%;
  width: 100px;
  height: 200px;
  pointer-events: none;
  opacity: 0.18;
}
.wisp {
  position: absolute;
  bottom: 0;
  width: 24px;
  height: 80px;
  background: linear-gradient(180deg, rgba(254,243,226,0) 0%, rgba(254,243,226,0.6) 60%, rgba(254,243,226,0) 100%);
  border-radius: 50%;
  filter: blur(8px);
  animation: rise 6s ease-in-out infinite;
}
.wisp.w1 { left: 0; animation-delay: 0s; }
.wisp.w2 { left: 32px; animation-delay: 1.2s; height: 100px; }
.wisp.w3 { left: 64px; animation-delay: 2.4s; height: 70px; }
@keyframes rise {
  0% { transform: translateY(0) translateX(0) scale(1); opacity: 0; }
  20% { opacity: 0.55; }
  100% { transform: translateY(-180px) translateX(20px) scale(1.6); opacity: 0; }
}

/* ===== Topbar ===== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  padding-top: max(14px, env(safe-area-inset-top));
  background: linear-gradient(180deg, rgba(15,9,5,0.92) 0%, rgba(15,9,5,0.55) 100%);
  backdrop-filter: blur(22px) saturate(160%);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
  border-bottom: 1px solid var(--border);
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  font-weight: 700;
  color: var(--crema-100);
  letter-spacing: -0.01em;
}
.mark {
  width: 32px; height: 32px;
  display: grid; place-items: center;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--caramel-400), var(--amber-500));
  color: var(--espresso);
  box-shadow: 0 0 22px rgba(212,165,116,0.50);
}
.mark svg { width: 18px; height: 18px; }
.header-actions { display: flex; gap: 8px; }
.icon-btn, .install-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 14px;
  border-radius: 12px;
  padding: 7px 12px;
  cursor: pointer;
  transition: all 0.2s var(--bezier-soft);
  backdrop-filter: blur(10px);
}
.icon-btn { padding: 7px 9px; font-size: 16px; }
.icon-btn:hover, .install-btn:hover {
  background: var(--surface-strong);
  border-color: var(--border-strong);
  transform: translateY(-1px);
}
.install-btn {
  background: linear-gradient(135deg, var(--caramel-400), var(--amber-500));
  border: none;
  color: var(--espresso);
  font-weight: 700;
}

main {
  position: relative;
  z-index: 1;
  padding: 22px 18px;
  max-width: 720px;
  margin: 0 auto;
}
.hidden { display: none !important; }

/* ===== Hero card ===== */
.hero-card {
  background: linear-gradient(135deg, rgba(184,134,90,0.20) 0%, rgba(245,158,11,0.10) 100%);
  border: 1px solid var(--border-strong);
  border-radius: 24px;
  padding: 22px 22px 18px;
  margin-bottom: 22px;
  backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  box-shadow: var(--shadow-glass);
  position: relative;
  overflow: hidden;
  text-align: center;
}
.hero-card::before {
  content:'';
  position: absolute;
  top: -50px; right: -50px;
  width: 160px; height: 160px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(212,165,116,0.30) 0%, transparent 65%);
  pointer-events: none;
}
.hc-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  position: relative;
}
.hc-kicker {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--caramel-300);
}
.hc-status-pill {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  padding: 5px 12px;
  border-radius: 100px;
  background: rgba(132,204,22,0.16);
  color: var(--green);
  border: 1px solid rgba(132,204,22,0.28);
}
.hc-status-pill.moderate {
  background: rgba(245,158,11,0.16);
  color: var(--amber-400);
  border-color: rgba(245,158,11,0.32);
}
.hc-status-pill.high {
  background: rgba(220,38,38,0.16);
  color: var(--paprika);
  border-color: rgba(220,38,38,0.32);
}
.hc-main {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 8px;
  margin-bottom: 6px;
}
.hc-amount {
  font-size: clamp(48px, 11vw, 64px);
  font-weight: 700;
  color: var(--crema-100);
  letter-spacing: -0.03em;
  line-height: 1;
  background: linear-gradient(135deg, var(--crema-100) 0%, var(--caramel-300) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hc-unit {
  font-size: 14px;
  color: var(--text-secondary);
  font-family: 'IBM Plex Mono', monospace;
  letter-spacing: 0.02em;
}
.hc-meta {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 14px;
  line-height: 1.5;
}
.hc-meta .mono { color: var(--caramel-300); font-weight: 500; }
.hc-cta {
  display: inline-block;
  padding: 11px 22px;
  background: linear-gradient(135deg, var(--caramel-500), var(--mocha));
  color: var(--crema-100);
  border: none;
  border-radius: 12px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(184,134,90,0.40);
  transition: all 0.25s var(--bezier);
}
.hc-cta:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(184,134,90,0.55); }

/* ===== Curve card ===== */
.curve-card {
  background: var(--surface);
  backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 20px;
  box-shadow: var(--shadow-glass);
  margin-bottom: 22px;
}
.curve-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 14px;
}
.curve-title {
  font-family: 'Frank Ruhl Libre', 'Heebo', serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--crema-100);
  letter-spacing: -0.015em;
}
.curve-meta {
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}
.curve-wrap {
  position: relative;
  margin-bottom: 14px;
}
#curveSvg {
  width: 100%;
  height: 220px;
  overflow: visible;
}
.curve-x-labels {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  font-size: 10px;
  color: var(--text-muted);
  text-align: center;
  margin-top: 4px;
}
.curve-legend {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 14px;
  padding-top: 12px;
  border-top: 1px dashed var(--border);
  font-size: 11px;
  color: var(--text-secondary);
}
.leg-item { display: inline-flex; align-items: center; gap: 6px; }
.leg-dot { width: 8px; height: 8px; border-radius: 50%; }
.leg-line { width: 14px; height: 2px; border-radius: 2px; }
.leg-line.dashed { background: repeating-linear-gradient(90deg, var(--amber-500) 0 4px, transparent 4px 7px); }

/* SVG curve styles */
.curve-area-fill { fill: url(#curveGrad); opacity: 0.55; }
.curve-line { fill: none; stroke: #d4a574; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.threshold-line {
  stroke: #dc2626;
  stroke-width: 1.5;
  stroke-dasharray: 4 4;
  opacity: 0.6;
}
.now-marker {
  stroke: #f59e0b;
  stroke-width: 1.5;
  stroke-dasharray: 3 3;
  opacity: 0.75;
}
.cup-marker {
  fill: var(--crema-200);
  stroke: var(--mocha);
  stroke-width: 1.5;
  cursor: pointer;
  transition: all 0.2s var(--bezier);
}
.cup-marker:hover { fill: var(--amber-400); transform: scale(1.4); transform-origin: center; }
.curve-axis-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 9px;
  fill: var(--text-muted);
}

/* ===== Stats row ===== */
.stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 22px;
}
.stat {
  background: var(--surface);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 14px 10px;
  text-align: center;
  transition: all 0.3s var(--bezier-soft);
  position: relative;
  overflow: hidden;
}
.stat:hover { transform: translateY(-2px); border-color: var(--border-strong); }
.stat-num {
  font-size: 26px;
  font-weight: 600;
  color: var(--crema-100);
  margin-bottom: 4px;
  line-height: 1;
}
.stat-num.accent {
  background: linear-gradient(135deg, var(--caramel-300), var(--amber-400));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.stat-unit {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 400;
  margin-right: 3px;
}
.stat-label {
  font-size: 11px;
  color: var(--text-secondary);
  font-weight: 500;
}
.stat-bar {
  margin-top: 8px;
  height: 4px;
  background: rgba(254,243,226,0.10);
  border-radius: 4px;
  overflow: hidden;
}
.stat-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--caramel-400), var(--amber-500));
  border-radius: 4px;
  transition: width 0.4s var(--bezier-soft);
  width: 0;
}
.stat-bar-fill.over { background: linear-gradient(90deg, var(--amber-500), var(--paprika)); }

/* ===== Cup section ===== */
.cup-section {
  margin-bottom: 22px;
}
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 14px;
}
.section-title {
  font-family: 'Frank Ruhl Libre', 'Heebo', serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--crema-100);
  letter-spacing: -0.015em;
}
.section-link, .section-meta {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  color: var(--caramel-300);
  background: none;
  border: none;
  cursor: pointer;
  letter-spacing: 0.05em;
  font-weight: 500;
}
.section-link:hover { color: var(--amber-400); }
.section-meta { color: var(--text-muted); cursor: default; }

.cup-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.cup-btn {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 18px;
  padding: 14px 8px 12px;
  cursor: pointer;
  transition: all 0.25s var(--bezier);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font-family: inherit;
  position: relative;
  overflow: hidden;
}
.cup-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(212,165,116,0.18), transparent);
  opacity: 0;
  transition: opacity 0.3s;
}
.cup-btn:hover {
  transform: translateY(-3px);
  border-color: var(--caramel-400);
  box-shadow: var(--shadow-warm);
}
.cup-btn:hover::before { opacity: 1; }
.cup-btn:active { transform: translateY(0) scale(0.97); }
.cup-icon {
  width: 38px;
  height: 38px;
  position: relative;
  z-index: 1;
}
.cup-icon svg { width: 100%; height: 100%; }
.cup-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--crema-100);
  position: relative;
  z-index: 1;
}
.cup-mg {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  color: var(--caramel-300);
  position: relative;
  z-index: 1;
  font-variant-numeric: tabular-nums;
}

/* ===== Timeline card ===== */
.timeline-card {
  background: var(--surface);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 20px;
  margin-bottom: 22px;
  box-shadow: var(--shadow-glass);
}
.timeline-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.tl-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  background: rgba(254,243,226,0.04);
  border: 1px solid var(--border);
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.2s;
}
.tl-row:hover { background: rgba(254,243,226,0.08); border-color: var(--border-strong); }
.tl-icon {
  width: 38px; height: 38px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--caramel-500), var(--mocha));
  border-radius: 12px;
}
.tl-icon svg { width: 22px; height: 22px; }
.tl-body { flex: 1; min-width: 0; }
.tl-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--crema-100);
  margin-bottom: 2px;
}
.tl-meta {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
.tl-mg {
  text-align: left;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 14px;
  font-weight: 600;
  color: var(--caramel-300);
  flex-shrink: 0;
}
.tl-mg small { display: block; font-size: 10px; font-weight: 400; color: var(--text-muted); }
.tl-empty {
  text-align: center;
  padding: 30px 18px;
  color: var(--text-muted);
  font-size: 13px;
}

/* ===== Suggestion card ===== */
.suggestion-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: linear-gradient(135deg, rgba(245,158,11,0.16) 0%, rgba(212,165,116,0.10) 100%);
  border: 1px solid var(--border-strong);
  border-radius: 20px;
  padding: 16px 18px;
  margin-bottom: 22px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
.sg-icon {
  width: 46px; height: 46px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--amber-500), var(--caramel-500));
  border-radius: 14px;
  font-size: 24px;
  flex-shrink: 0;
  box-shadow: 0 6px 18px rgba(245,158,11,0.30);
}
.sg-body { flex: 1; min-width: 0; }
.sg-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--amber-400);
  margin-bottom: 4px;
}
.sg-text {
  font-size: 14px;
  color: var(--text-primary);
  line-height: 1.45;
  font-weight: 500;
}
.sg-text .mono { color: var(--amber-400); font-weight: 600; }
.sg-text .danger { color: var(--paprika); font-weight: 600; }

/* ===== FAB ===== */
.fab {
  position: fixed;
  bottom: max(22px, env(safe-area-inset-bottom));
  left: 22px;
  width: 58px; height: 58px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--caramel-400), var(--amber-500) 70%, var(--amber-600));
  border: none;
  color: var(--espresso);
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 14px 32px rgba(184,134,90,0.50), 0 0 24px rgba(245,158,11,0.30);
  transition: all 0.3s var(--bezier);
  z-index: 90;
}
.fab svg { width: 24px; height: 24px; }
.fab:hover { transform: translateY(-3px) scale(1.05); }
.fab:active { transform: translateY(0) scale(0.96); }

/* ===== Modal ===== */
.modal {
  position: fixed; inset: 0;
  background: rgba(5,3,2,0.72);
  backdrop-filter: blur(8px);
  z-index: 100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  animation: modal-fade 0.25s var(--bezier-soft);
}
@keyframes modal-fade { from { opacity: 0; } to { opacity: 1; } }
.modal-card {
  width: 100%;
  max-width: 540px;
  background: linear-gradient(180deg, #2a1a0e 0%, #160d07 100%);
  border: 1px solid var(--border-strong);
  border-bottom: none;
  border-radius: 28px 28px 0 0;
  padding: 20px 22px 32px;
  padding-bottom: max(32px, env(safe-area-inset-bottom));
  animation: modal-slide 0.4s var(--bezier);
  max-height: 92vh;
  overflow-y: auto;
}
@keyframes modal-slide {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}
.handle {
  width: 38px; height: 4px;
  background: var(--border-strong);
  border-radius: 4px;
  margin: 0 auto 16px;
}
.modal-card h3 {
  font-family: 'Frank Ruhl Libre', 'Heebo', serif;
  color: var(--crema-100);
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 18px;
  letter-spacing: -0.01em;
}
.modal-card p {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.65;
  margin-bottom: 14px;
}
.mark-big {
  width: 64px; height: 64px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--caramel-400), var(--amber-500));
  border-radius: 18px;
  color: var(--espresso);
  margin: 4px auto 14px;
  box-shadow: 0 0 30px rgba(245,158,11,0.40);
}
.mark-big svg { width: 32px; height: 32px; }

.form-label {
  display: block;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--caramel-300);
  margin: 4px 0 8px;
  padding-right: 4px;
}
.modal-input {
  width: 100%;
  padding: 13px 16px;
  background: var(--surface-input);
  border: 1px solid var(--border);
  border-radius: 14px;
  color: var(--crema-100);
  font-family: 'Heebo', sans-serif;
  font-size: 15px;
  margin-bottom: 12px;
  transition: all 0.2s;
  text-align: right;
  direction: rtl;
}
.modal-input.mono { font-family: 'IBM Plex Mono', monospace; font-variant-numeric: tabular-nums; }
.modal-input:focus {
  outline: none;
  border-color: var(--caramel-400);
  background: rgba(15,9,5,0.7);
  box-shadow: 0 0 0 3px rgba(212,165,116,0.14);
}
.modal-input::placeholder { color: var(--text-muted); }
input[type="time"], input[type="date"], input[type="number"] {
  color-scheme: dark;
}

/* Cup picker (modal) */
.cup-picker {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}
.cup-pick {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 14px;
  padding: 10px 4px 8px;
  cursor: pointer;
  transition: all 0.2s var(--bezier);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-family: inherit;
}
.cup-pick:hover {
  border-color: var(--caramel-400);
  background: var(--surface-strong);
}
.cup-pick.active {
  border-color: var(--caramel-400);
  background: color-mix(in srgb, var(--caramel-400) 15%, transparent);
  box-shadow: 0 8px 20px rgba(212,165,116,0.30);
}
.cup-pick .cup-icon { width: 28px; height: 28px; }
.cup-pick .cup-name { font-size: 11px; font-weight: 600; }
.cup-pick .cup-mg { font-size: 9px; }

/* Form row */
.form-row.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 8px;
}
.form-col .form-label { margin-top: 0; }

/* Time row */
.time-row {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
  align-items: center;
}
.tt-btn {
  padding: 9px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 100px;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s var(--bezier-soft);
}
.tt-btn:hover { background: var(--surface-strong); color: var(--crema-100); }
.tt-btn.active {
  background: linear-gradient(135deg, var(--caramel-500), var(--mocha));
  border-color: transparent;
  color: var(--crema-100);
  font-weight: 600;
  box-shadow: 0 4px 14px rgba(184,134,90,0.30);
}

/* Impact preview */
.impact-preview {
  background: linear-gradient(135deg, rgba(212,165,116,0.08), rgba(245,158,11,0.04));
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 16px;
  margin: 8px 0 14px;
}
.ip-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  padding: 4px 0;
}
.ip-row + .ip-row { border-top: 1px dashed var(--border); }
.ip-label { color: var(--text-secondary); }
.ip-value { color: var(--caramel-300); font-weight: 600; font-size: 14px; }
.ip-value.warn { color: var(--amber-400); }
.ip-value.danger { color: var(--paprika); }

/* Modal actions */
.modal-actions {
  display: flex;
  gap: 8px;
  margin-top: 14px;
  align-items: stretch;
}
.btn-primary, .btn-secondary, .btn-mini {
  padding: 13px 18px;
  border-radius: 14px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s var(--bezier);
  border: none;
}
.btn-primary {
  flex: 1;
  background: linear-gradient(135deg, var(--caramel-400), var(--amber-500));
  color: var(--espresso);
  font-weight: 700;
  box-shadow: 0 8px 24px rgba(212,165,116,0.40);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(212,165,116,0.55); }
.btn-secondary {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--crema-100);
}
.btn-secondary:hover { background: var(--surface-strong); }
.btn-mini {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 12px 14px;
  font-size: 13px;
  font-weight: 500;
}
.btn-mini:hover { background: var(--surface-strong); color: var(--crema-100); }
.btn-mini.danger {
  color: var(--paprika);
  border-color: rgba(220,38,38,0.30);
}
.btn-mini.danger:hover { background: rgba(220,38,38,0.12); }

/* History modal extras */
.hist-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 18px;
}
.hs-item {
  text-align: center;
  padding: 14px 6px;
  background: rgba(254,243,226,0.04);
  border: 1px solid var(--border);
  border-radius: 14px;
}
.hs-num {
  font-size: 20px;
  font-weight: 600;
  color: var(--caramel-300);
}
.hs-label { font-size: 10px; color: var(--text-secondary); margin-top: 4px; }

.week-bars-wrap {
  position: relative;
  margin-top: 10px;
}
#weekBarsSvg {
  width: 100%;
  height: 130px;
}
.week-x-labels {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  font-size: 10px;
  color: var(--text-muted);
  text-align: center;
  margin-top: 4px;
}
.week-x-labels span.today { color: var(--caramel-300); font-weight: 600; }
.bar-rect-week { fill: url(#weekBarGrad); transition: opacity 0.3s; }
.bar-rect-week.empty { fill: rgba(212,165,116,0.10); }

/* Settings */
.settings-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin: -6px 0 14px !important;
  line-height: 1.5;
}

/* About */
#aboutModal p { font-size: 14px; line-height: 1.7; }
#aboutModal strong { color: var(--caramel-300); font-weight: 700; }
#aboutModal em { color: var(--amber-400); font-style: normal; font-weight: 600; }

/* Responsive */
@media (max-width: 380px) {
  main { padding: 18px 14px; }
  .hero-card { padding: 18px 18px 14px; }
  .stat { padding: 12px 6px; }
  .stat-num { font-size: 22px; }
  .cup-grid { gap: 8px; }
  .cup-btn { padding: 12px 6px 10px; }
}
