﻿:root {
  --bg-a: #eefae4;
  --bg-b: #fff2d3;
  --panel: rgba(255, 255, 255, 0.88);
  --text: #11181c;
  --muted: #596268;
  --accent: #197d57;
  --accent-strong: #0f6548;
  --line: rgba(17, 24, 28, 0.11);
  --shadow: 0 18px 45px rgba(30, 45, 35, 0.14);
}

[data-theme="dashboard"] {
  --bg-a: #050a16;
  --bg-b: #103758;
  --panel: rgba(12, 22, 34, 0.88);
  --text: #f7fbff;
  --muted: #c9d7e4;
  --accent: #59bdff;
  --accent-strong: #9bd8ff;
  --line: rgba(255, 255, 255, 0.14);
  --shadow: 0 18px 55px rgba(0, 0, 0, 0.32);
}

[data-theme="coach"] {
  --bg-a: #f7ecff;
  --bg-b: #e0faff;
  --panel: rgba(255, 255, 255, 0.90);
  --text: #17121c;
  --muted: #625a68;
  --accent: #923fbe;
  --accent-strong: #6f2996;
  --line: rgba(40, 20, 55, 0.12);
  --shadow: 0 18px 45px rgba(68, 36, 88, 0.16);
}

* { box-sizing: border-box; }
html { min-height: 100%; background: linear-gradient(135deg, var(--bg-a), var(--bg-b)); }
body {
  margin: 0;
  min-height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: radial-gradient(circle at 20% 5%, rgba(255,255,255,0.35), transparent 24rem), linear-gradient(135deg, var(--bg-a), var(--bg-b));
}
button, input, textarea { font: inherit; }
button { cursor: pointer; }

.app-shell {
  width: min(100%, 820px);
  margin: 0 auto;
  padding: max(16px, env(safe-area-inset-top)) 14px max(28px, env(safe-area-inset-bottom));
}
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 8px 2px 16px;
}
.eyebrow { margin: 0 0 2px; color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: clamp(28px, 8vw, 44px); line-height: 1; }
h2 { margin-bottom: 12px; font-size: 21px; }
h3 { margin-bottom: 0; font-size: 18px; }
main { display: grid; gap: 14px; }

.panel, .metric-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}
.panel { padding: 15px; }
.version-panel { overflow: hidden; }
.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.row-actions { display: flex; gap: 10px; align-items: center; }
.danger { color: #c93636; }
.section-title h2, .section-title h3 { margin-bottom: 0; }
.section-title span { color: var(--muted); font-size: 12px; font-weight: 700; }
.compact { margin-bottom: 8px; }

.segmented {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding: 4px;
  margin-bottom: 12px;
  background: rgba(127,127,127,0.10);
  border-radius: 8px;
}
.segment {
  border: 0;
  border-radius: 7px;
  min-height: 40px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
}
.segment.active { background: var(--accent); color: white; }

.cover {
  position: relative;
  min-height: 210px;
  overflow: hidden;
  border-radius: 8px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 12%, var(--bg-a)), color-mix(in srgb, var(--accent) 28%, var(--bg-b)));
}
.cover::before, .cover::after {
  content: "";
  position: absolute;
  border: 10px solid color-mix(in srgb, var(--accent) 42%, transparent);
  border-radius: 999px;
  width: 190px;
  height: 130px;
  transform: rotate(-18deg);
}
.cover::before { right: -38px; top: 26px; }
.cover::after { left: 22px; bottom: -32px; width: 240px; height: 150px; }
.cover-copy {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 18px;
  display: grid;
  gap: 7px;
}
.cover-copy span { color: var(--muted); font-weight: 800; }
.cover-copy strong { font-size: 28px; line-height: 1.08; max-width: 11em; }

.grid { display: grid; gap: 10px; }
.metrics { grid-template-columns: repeat(2, 1fr); }
.metric-card { padding: 14px; min-height: 112px; display: grid; align-content: start; gap: 6px; }
.metric-card span { color: var(--muted); font-size: 13px; font-weight: 800; }
.metric-card strong { font-size: 31px; line-height: 1; }
.metric-card small { color: var(--muted); }

label { display: grid; gap: 7px; color: var(--muted); font-size: 13px; font-weight: 800; }
input, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  color: var(--text);
  background: rgba(255,255,255,0.72);
  outline: none;
}
[data-theme="dashboard"] input, [data-theme="dashboard"] textarea { background: rgba(255,255,255,0.10); color: var(--text); }
textarea { resize: vertical; min-height: 84px; }
.form-grid { display: grid; gap: 10px; margin-bottom: 12px; }
.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.three { grid-template-columns: 1.2fr 0.8fr 0.8fr; }
.inline-action { align-items: end; }

.primary, .secondary, .quick-buttons button, .icon-button, .text-button {
  border: 0;
  border-radius: 8px;
  min-height: 44px;
  padding: 0 14px;
  font-weight: 900;
}
.primary { width: 100%; background: var(--accent); color: white; }
.secondary { background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent-strong); border: 1px solid color-mix(in srgb, var(--accent) 26%, transparent); }
.icon-button { width: 44px; padding: 0; background: var(--accent); color: white; font-size: 22px; }
.text-button { background: transparent; color: var(--accent-strong); min-height: 34px; padding: 0 4px; }
.quick-buttons { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 12px; }
.quick-buttons button { background: var(--accent); color: white; padding: 0 8px; }

.note, .source { color: var(--muted); font-size: 13px; line-height: 1.45; }
.analysis { margin-top: 12px; padding: 13px; border: 1px solid var(--line); border-radius: 8px; background: rgba(127,127,127,0.08); }
.hidden { display: none; }
.list { display: grid; gap: 10px; }
.list.empty { color: var(--muted); font-size: 14px; }
.food-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: rgba(127,127,127,0.07); }
.food-row strong { display: block; }
.food-row small { color: var(--muted); }
.food-row .numbers { text-align: right; white-space: nowrap; }

#installDialog { width: min(92vw, 420px); border: 0; border-radius: 8px; padding: 18px; color: var(--text); background: var(--panel); }
#installDialog::backdrop { background: rgba(0,0,0,0.35); }
#installDialog li { margin-bottom: 8px; }

@media (max-width: 480px) {
  .app-shell { padding-left: 10px; padding-right: 10px; }
  .three { grid-template-columns: 1fr; }
  .quick-buttons { grid-template-columns: repeat(2, 1fr); }
  .cover { min-height: 190px; }
  .cover-copy strong { font-size: 24px; }
  .metric-card strong { font-size: 27px; }
}

