/* Myron web portal (app.myron.app) — design system, ADR-0058 Phase 1.
   Tokens follow docs/brand/README.md; dark only (brand decision). */

/* ---------- Tokens ---------------------------------------------------- */
/* Colours, radii, shadows and type live in tokens.css, shared with the coach
   web workspace (ADR-0068); the layouts link it before this file. */
:root {
  --sidebar-w: 236px; --rail-w: 76px; --content-max: 900px; --tabbar-h: 62px;
  --gutter: 40px;
}

/* ---------- Base + browser surfaces ----------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scrollbar-color: var(--surface-3) transparent; }
body.dashboard {
  background: var(--base); color: var(--ivory);
  font-family: var(--font-ui); font-size: 15px; line-height: 1.5;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  min-height: 100vh; min-height: 100dvh;
  caret-color: var(--brass);
}
::selection { background: rgba(192, 138, 75, 0.35); color: var(--ivory); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 999px; border: 3px solid var(--base); }
::-webkit-scrollbar-track { background: transparent; }
:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; border-radius: 6px; }
a { color: var(--brass); text-decoration: none; text-underline-offset: 3px; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; }
img, svg { display: block; }
h1, h2, h3 { font-weight: 400; text-wrap: balance; }
h1 { font-family: var(--font-display); font-size: 30px; line-height: 1.15; letter-spacing: -0.005em; }
h2 { font-family: var(--font-display); font-size: 20px; line-height: 1.2; }
h3 { font-size: 13px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--faint); }
.num, .tabular { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.hidden, [hidden] { display: none !important; }
.icon { width: 18px; height: 18px; flex-shrink: 0; }
.icon-sm { width: 15px; height: 15px; }
.icon-lg { width: 22px; height: 22px; }
turbo-frame { display: block; }
turbo-frame[busy] { opacity: 0.7; transition: opacity 0.2s; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ---------- App shell -------------------------------------------------- */
.app { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100dvh;
  background: linear-gradient(90deg, var(--surface) 0 var(--sidebar-w), var(--base) var(--sidebar-w)); }
.sidebar {
  position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column; gap: 22px;
  padding: 26px 16px 18px; background: var(--surface); border-right: 1px solid var(--line);
}
.brand { display: flex; align-items: center; padding: 0 10px; color: var(--ivory); }
.brand:hover { text-decoration: none; }
.brand .wordmark { height: 26px; width: auto; }
.brand .mark { display: none; height: 28px; width: auto; }
.nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav-item {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--radius-s);
  color: var(--muted); font-size: 14.5px; font-weight: 500; transition: background 0.15s var(--ease), color 0.15s;
}
.nav-item:hover { color: var(--ivory); background: var(--surface-2); text-decoration: none; }
.nav-item[aria-current="page"] { color: var(--brass); background: var(--bronze-soft); }
.nav-item .icon { width: 20px; height: 20px; }
.sidebar-foot { display: flex; flex-direction: column; gap: 10px; }
.user-chip {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--radius-s);
  color: var(--faint); font-size: 13.5px; overflow: hidden;
}
.user-chip:hover { background: var(--surface-2); color: var(--ivory); text-decoration: none; }
.user-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-chip .avatar {
  width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0; display: grid; place-items: center;
  background: var(--bronze-soft); color: var(--brass); font-family: var(--font-display); font-size: 14px;
}

.content { padding: 36px var(--gutter) 96px; max-width: calc(var(--content-max) + 2 * var(--gutter)); width: 100%; }
.tabbar { display: none; }

/* ---------- Page head + subnav ---------------------------------------- */
.page-head { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head .page-title { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.page-meta { color: var(--faint); font-size: 13.5px; }
.page-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; flex-wrap: wrap; }
.page-head form { margin: 0; }
.subnav { display: flex; gap: 4px; margin: -4px 0 24px; overflow-x: auto; scrollbar-width: none; }
.subnav::-webkit-scrollbar { display: none; }
.subnav a {
  padding: 7px 14px; border-radius: 999px; color: var(--muted); font-size: 13.5px; font-weight: 500; white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}
.subnav a:hover { color: var(--ivory); background: var(--surface-2); text-decoration: none; }
.subnav a[aria-current="page"] { color: var(--base); background: var(--brass); }

/* Day / week navigation: chevrons flank the title, like the apps */
.title-row { display: flex; align-items: center; gap: 4px; margin-left: -10px; }
.title-row .btn-icon { color: var(--muted); }
.title-row h1 { min-width: 0; }
.page-meta a.jump { color: var(--brass); }
.myron-submit .icon { display: none; }

/* ---------- Buttons ---------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; border-radius: 999px; font-size: 14px; font-weight: 600; line-height: 1.2;
  border: 1px solid transparent; white-space: nowrap; transition: transform 0.12s var(--ease), background 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s;
  text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn-primary { background: linear-gradient(180deg, var(--brass), var(--bronze)); color: var(--base); box-shadow: 0 1px 0 rgba(255, 255, 255, 0.15) inset, var(--shadow-1); }
.btn-primary:hover { filter: brightness(1.06); }
.btn-secondary { background: var(--surface-2); color: var(--ivory); border-color: var(--line-strong); }
.btn-secondary:hover { background: var(--surface-3); }
.btn-ghost { background: transparent; color: var(--muted); }
.btn-ghost:hover { color: var(--ivory); background: var(--surface-2); }
.btn-danger { background: transparent; color: var(--rust); border-color: rgba(201, 123, 107, 0.35); }
.btn-danger:hover { background: var(--rust-soft); }
.btn-sm { padding: 7px 13px; font-size: 13px; }
.btn-lg { padding: 13px 24px; font-size: 15px; }
.btn-block { width: 100%; }
.btn-icon {
  display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px;
  border-radius: 9px; color: var(--faint); transition: background 0.15s, color 0.15s;
}
.btn-icon:hover { color: var(--ivory); background: var(--surface-3); text-decoration: none; }
.btn-icon.danger:hover { color: var(--rust); background: var(--rust-soft); }
.btn-icon.accent { color: var(--bronze); }
.btn-icon .icon { width: 17px; height: 17px; }
.link-button { background: none; border: 0; color: var(--faint); font-size: 13px; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; padding: 0; }
.link-button:hover { color: var(--brass); }
form.inline { display: inline; }
form[data-turbo-submits-with] .btn[disabled] { opacity: 0.7; }

/* ---------- Inputs ----------------------------------------------------- */
.input, .select, .textarea,
input[type="text"], input[type="number"], input[type="date"], input[type="search"], input[type="url"], input[type="email"], textarea, select {
  background: var(--surface-2); border: 1px solid var(--line-strong); border-radius: var(--radius-s);
  padding: 9px 12px; color: var(--ivory); font-size: 14.5px; outline: none; min-height: 40px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
input::placeholder, textarea::placeholder { color: var(--faint); }
input:focus, textarea:focus, select:focus { border-color: var(--bronze); box-shadow: 0 0 0 3px var(--bronze-soft); }
input:focus-visible, textarea:focus-visible, select:focus-visible { outline: none; }
input[type="number"] { text-align: right; font-variant-numeric: tabular-nums; }
input[type="date"] { color-scheme: dark; }
input:disabled, select:disabled { opacity: 0.55; cursor: not-allowed; }
select {
  appearance: none; -webkit-appearance: none; padding-right: 32px; cursor: pointer;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23F2EBE0' stroke-opacity='0.5' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='m6 9 6 6 6-6'/></svg>");
  background-repeat: no-repeat; background-position: right 10px center;
}
select.select-sm { min-height: 32px; padding: 5px 28px 5px 10px; font-size: 13px; }
textarea { resize: vertical; min-height: 80px; line-height: 1.5; }
input[type="checkbox"]:not(.switch) { accent-color: var(--bronze); width: 17px; height: 17px; cursor: pointer; }
input[type="file"] { color: var(--faint); font-size: 13.5px; }
input[type="file"]::file-selector-button {
  background: var(--surface-3); color: var(--ivory); border: 1px solid var(--line-strong); border-radius: 999px;
  padding: 6px 12px; margin-right: 10px; font: inherit; font-size: 13px; cursor: pointer;
}
.search-field { position: relative; }
.search-field .icon { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--faint); pointer-events: none; }
.search-field input { width: 100%; padding-left: 40px; border-radius: 999px; }

.field { display: grid; grid-template-columns: minmax(140px, 200px) 1fr; align-items: center; gap: 10px 20px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.field:last-of-type { border-bottom: 0; }
.field > label { color: var(--muted); font-size: 14px; }
.field .field-hint { grid-column: 2; color: var(--faint); font-size: 12.5px; margin-top: -4px; }
.field-unit { display: flex; align-items: center; gap: 8px; }
.field-unit input { width: 150px; }
.field-unit > span { color: var(--faint); font-size: 13.5px; white-space: nowrap; }
.field-group { margin-top: 22px; }
.field-group h3 { padding: 0 0 6px; }
.form-actions { display: flex; align-items: center; gap: 12px; padding-top: 18px; }
.form-hint { color: var(--faint); font-size: 13px; line-height: 1.5; margin: 8px 0 0; }
.toggle { display: flex; align-items: center; gap: 12px; padding: 12px 0; font-size: 14.5px; cursor: pointer; border-top: 1px solid var(--line); }
.inline-form { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.inline-form input[type="number"] { width: 92px; }
.inline-form .input, .inline-form input[type="text"] { min-width: 180px; flex: 1; }
.inline-label { color: var(--faint); font-size: 13.5px; }
.kbd {
  color: var(--faint); font-size: 11px; font-family: var(--font-ui); border: 1px solid var(--line-strong);
  border-bottom-width: 2px; border-radius: 6px; padding: 2px 7px; line-height: 1.4; white-space: nowrap;
}

/* ---------- Cards, sections, lists ------------------------------------ */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l); padding: 22px 24px; margin-bottom: 20px; }
.card-tight { padding: 8px; }
.card-title { font-family: var(--font-display); font-size: 19px; margin-bottom: 12px; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.card-head .card-title { margin: 0; }
.section { margin-bottom: 26px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 0 4px 10px; }
.section-head h2 { font-size: 19px; }
.section-head .section-meta { color: var(--faint); font-size: 13px; white-space: nowrap; }
.section-meta strong { color: var(--brass); font-weight: 500; }
.list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); overflow: hidden; }
.list:has(details.menu[open]), .card:has(details.menu[open]) { overflow: visible; }
.list > .row:first-child { border-radius: var(--radius-m) var(--radius-m) 0 0; }
.list > .row:last-child { border-radius: 0 0 var(--radius-m) var(--radius-m); }
.row { display: flex; align-items: center; gap: 14px; padding: 13px 18px; border-bottom: 1px solid var(--line); min-height: 58px; color: var(--ivory); }
.row:last-child { border-bottom: 0; }
a.row:hover, button.row:hover { background: var(--surface-2); text-decoration: none; }
button.row { width: 100%; text-align: left; }
.row-main { flex: 1; min-width: 0; }
.row-title { font-size: 14.5px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: flex; align-items: center; gap: 8px; }
.row-sub { font-size: 12.5px; color: var(--faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-value { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.row-value .main { font-size: 14.5px; font-weight: 500; }
.row-value .sub { display: block; font-size: 12px; color: var(--faint); }
.row-actions { display: flex; align-items: center; gap: 2px; opacity: 0; transition: opacity 0.15s; }
.row:hover .row-actions, .row:focus-within .row-actions { opacity: 1; }
.row-actions form { display: contents; }
.row-chevron { color: var(--ghost); }
.row .avatar-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--bronze); }
.list-foot { padding: 6px 8px; border-top: 1px solid var(--line); }
.add-link { display: flex; align-items: center; gap: 8px; color: var(--faint); font-size: 13.5px; padding: 9px 10px; border-radius: var(--radius-s); }
.add-link:hover { color: var(--brass); background: var(--surface-2); text-decoration: none; }
.empty { padding: 28px 20px; text-align: center; color: var(--faint); font-size: 14px; line-height: 1.55; }
.empty .icon { width: 28px; height: 28px; margin: 0 auto 10px; color: var(--ghost); }
.empty strong { display: block; color: var(--muted); font-weight: 500; margin-bottom: 2px; }
.empty .btn { margin-top: 14px; }
.inset { background: var(--surface-2); border-radius: var(--radius-m); padding: 12px; margin: 6px 8px 8px; }

/* Badges & chips */
.badge { display: inline-flex; align-items: center; gap: 4px; border-radius: 999px; font-size: 11px; font-weight: 600; letter-spacing: 0.02em; padding: 2px 8px; vertical-align: 1px; background: var(--surface-3); color: var(--muted); }
.badge-bronze { background: var(--bronze-soft); color: var(--brass); }
.badge-patina { background: var(--patina-soft); color: #8FB8A8; }
.badge-rust { background: var(--rust-soft); color: var(--rust); }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line-strong); color: var(--muted); font-size: 13px; }
.chip:hover { color: var(--ivory); border-color: var(--bronze-line); text-decoration: none; }
.chip.active { background: var(--bronze-soft); border-color: var(--bronze-line); color: var(--brass); }

/* Tables */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; color: var(--faint); font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; padding: 10px 12px 8px; }
.table td { padding: 11px 12px; border-top: 1px solid var(--line); }
.table .num { text-align: right; }
.table th.num { text-align: right; }
.table td a { color: var(--ivory); }
.table td a:hover { color: var(--brass); text-decoration: none; }
.table .date-sub { color: var(--faint); font-size: 12px; margin-left: 4px; }
.table .today-row td { background: rgba(192, 138, 75, 0.07); }
.table .future td { opacity: 0.4; }
.table td.empty-cell { color: var(--ghost); }
.table tfoot td { border-top: 2px solid var(--line-strong); color: var(--muted); font-weight: 500; }
.table-wrap { overflow-x: auto; margin: 0 -8px; padding: 0 8px; }
.dev-ok { color: var(--patina-text); }
.dev-over { color: var(--rust); }
.dev-under { color: var(--faint); }

/* Status lines */
.status-line { font-size: 14px; color: var(--muted); margin: 4px 0 10px; }
.status-line.on-track { color: var(--patina-text); }
.status-line.off-track { color: var(--muted); }
.status-line strong { color: var(--ivory); font-weight: 500; }
.hero-number { font-family: var(--font-display); font-size: 40px; line-height: 1; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.hero-number small { font-family: var(--font-ui); font-size: 14px; color: var(--faint); margin-left: 8px; letter-spacing: 0; }

/* ---------- Toasts ------------------------------------------------------ */
.toasts { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 50; width: min(520px, calc(100vw - 32px)); pointer-events: none; }
.toast {
  pointer-events: auto; display: flex; align-items: center; gap: 12px; padding: 12px 14px 12px 16px;
  background: var(--surface-3); color: var(--ivory); border: 1px solid var(--line-strong); border-radius: var(--radius-m);
  box-shadow: var(--shadow-2); font-size: 14px; animation: toast-in 0.35s var(--ease) both;
}
.toast .icon { color: var(--brass); }
.toast.ok .icon { color: var(--patina); }
.toast.alert .icon { color: var(--rust); }
.toast span { flex: 1; }
.toast.leaving { animation: toast-out 0.25s var(--ease) both; }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px) scale(0.98); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateY(8px); } }

/* ---------- Sheets (dialog) -------------------------------------------- */
dialog.sheet {
  background: var(--surface); color: var(--ivory); border: 1px solid var(--line-strong); border-radius: var(--radius-xl);
  padding: 0; width: min(520px, calc(100vw - 32px)); box-shadow: var(--shadow-2); margin: auto;
  animation: sheet-in 0.3s var(--ease) both;
}
dialog.sheet::backdrop { background: rgba(0, 0, 0, 0.55); backdrop-filter: blur(6px); animation: fade-in 0.25s both; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px 20px 0 24px; }
.sheet-head h2 { font-size: 20px; }
.sheet-body { padding: 16px 24px 24px; display: flex; flex-direction: column; gap: 14px; }
.sheet-body .form-actions { padding-top: 6px; }
@keyframes sheet-in { from { opacity: 0; transform: translateY(16px) scale(0.98); } to { opacity: 1; transform: none; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

/* ---------- Charts ------------------------------------------------------ */
.chart { position: relative; height: 220px; margin: 14px 0 4px; }
.chart.chart-sm { height: 160px; }
.chart canvas { width: 100% !important; height: 100% !important; }
.chart-legend { display: flex; gap: 16px; flex-wrap: wrap; color: var(--faint); font-size: 12px; margin-top: 8px; }
.chart-legend i { display: inline-block; width: 14px; height: 3px; border-radius: 2px; vertical-align: middle; margin-right: 6px; }
.chart-legend i.dashed { background: repeating-linear-gradient(90deg, currentColor 0 4px, transparent 4px 7px); height: 2px; }

/* ---------- Heute: summary, meals, Myron-Zeile ------------------------- */
.summary { display: grid; grid-template-columns: auto 1fr; gap: 24px 32px; align-items: center; padding: 24px 28px; }
.ring { position: relative; width: 150px; height: 150px; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring .track { stroke: var(--surface-3); }
.ring .progress { stroke: url(#ring-gradient); transition: stroke-dashoffset 0.6s var(--ease); }
.ring .progress.over { stroke: var(--rust); }
.ring-label { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }
.ring-label strong { font-family: var(--font-display); font-size: 32px; font-weight: 400; line-height: 1; font-variant-numeric: tabular-nums; }
.ring-label span { font-size: 12px; color: var(--faint); }
.ring-label .remaining { font-size: 13px; color: var(--brass); font-weight: 500; }
.summary-facts { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.kcal-line { font-size: 15px; color: var(--muted); }
.kcal-line strong { color: var(--ivory); font-weight: 500; }
.macros { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.macro { background: var(--surface-2); border-radius: var(--radius-m); padding: 12px 14px; min-width: 0; }
.macro .label { font-size: 12px; color: var(--faint); margin-bottom: 4px; }
.macro .value { font-size: 16px; font-weight: 500; font-variant-numeric: tabular-nums; white-space: nowrap; }
.macro .value small { color: var(--faint); font-weight: 400; font-size: 12.5px; }
.macro .bar { height: 4px; border-radius: 2px; background: var(--surface-3); margin-top: 9px; overflow: hidden; }
.macro .bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--bronze), var(--brass)); border-radius: 2px; transition: width 0.6s var(--ease); }

.meal-section { margin-bottom: 18px; }
.meal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 6px 8px; }
.meal-head h2 { font-family: var(--font-ui); font-size: 12.5px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.meal-head .meal-kcal { font-size: 12.5px; font-weight: 600; letter-spacing: 0.04em; color: var(--brass); font-variant-numeric: tabular-nums; }

.myron-line { margin-bottom: 22px; }
.myron-line-form { display: flex; align-items: center; gap: 10px; }
.myron-line-form .search-field { flex: 1; }
.myron-line-form .search-field .icon { color: var(--bronze); }
.myron-line-form input[type="text"] { width: 100%; padding: 12px 18px 12px 42px; border-radius: 999px; background: var(--surface); border-color: var(--bronze-line); font-size: 15px; min-height: 48px; }
.myron-line-form input[type="text"]:focus { box-shadow: 0 0 0 4px var(--bronze-soft); }
.myron-line-form .kbd { display: none; }
.myron-error { color: var(--muted); font-size: 13.5px; padding: 10px 6px 0; }
.myron-quota { color: var(--faint); font-size: 12.5px; padding: 8px 6px 0; }
.proposals { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); margin-top: 10px; padding: 6px; }
.proposal { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--radius-s); cursor: pointer; font-size: 14px; }
.proposal:hover { background: var(--surface-2); }
.proposal-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.proposal-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.proposal-detail { color: var(--faint); font-size: 12.5px; }
.proposal select { min-height: 32px; padding: 4px 28px 4px 10px; font-size: 13px; }
.proposal.unmatched { opacity: 0.55; cursor: default; }
.proposal-actions { display: flex; align-items: center; gap: 12px; padding: 10px 12px 8px; }

/* Food search + amount form */
.food-search { padding: 8px; }
.food-results { margin-top: 6px; }
.group-label { font-size: 11.5px; color: var(--faint); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; padding: 10px 10px 4px; }
.food-result { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; padding: 10px 12px; border-radius: var(--radius-s); color: var(--ivory); font-size: 14px; width: 100%; text-align: left; }
.food-result:hover { background: var(--surface-2); text-decoration: none; }
.food-result .brand { color: var(--faint); font-size: 12.5px; margin-left: 4px; }
.food-result .kcal { color: var(--muted); font-size: 13px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.no-results { padding: 12px 10px; color: var(--faint); font-size: 13.5px; }
.amount-form { display: flex; align-items: center; gap: 10px; padding: 10px 12px; flex-wrap: wrap; }
.amount-form .food-title { flex-basis: 100%; font-size: 14px; font-weight: 500; }
.amount-form input[type="number"] { width: 92px; }
.kcal-preview { color: var(--muted); font-size: 13.5px; min-width: 80px; font-variant-numeric: tabular-nums; }
.cancel-link { color: var(--faint); font-size: 13.5px; padding: 8px 6px; }
.cancel-link:hover { color: var(--ivory); text-decoration: none; }

/* ---------- Training ----------------------------------------------------- */
.folder { margin-bottom: 16px; }
.folder-head { display: flex; align-items: center; gap: 6px; padding: 0 4px 6px; }
.folder-toggle { display: flex; align-items: center; gap: 8px; color: var(--faint); font-size: 12.5px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; padding: 6px 4px; border-radius: 8px; }
.folder-toggle:hover { color: var(--ivory); }
.folder-toggle .icon { transition: transform 0.2s var(--ease); }
.folder[data-collapsed="true"] .folder-toggle .icon { transform: rotate(-90deg); }
.folder[data-collapsed="true"] .folder-body { display: none; }
.folder-tools { display: inline-flex; opacity: 0; transition: opacity 0.15s; margin-left: 2px; }
.folder-head:hover .folder-tools, .folder-head:focus-within .folder-tools { opacity: 1; }
.exercise-card { padding: 18px 22px; margin-bottom: 12px; }
.exercise-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 8px; }
.exercise-head a.exercise-name { color: var(--ivory); font-weight: 500; font-size: 15px; }
.exercise-head a.exercise-name:hover { color: var(--brass); text-decoration: none; }
/* Exercise thumbnail (apps: ExerciseThumbnail) — the picture is the affordance for the detail page. */
.exercise-thumb { --thumb-size: 40px; flex: none; width: var(--thumb-size); height: var(--thumb-size); border-radius: calc(var(--thumb-size) / 4); background: #fff; object-fit: cover; display: inline-block; vertical-align: middle; }
.exercise-thumb--empty { display: inline-flex; align-items: center; justify-content: center; background: rgba(192, 138, 75, 0.14); color: var(--bronze); }
.exercise-thumb--empty svg { width: 50%; height: 50%; }
.exercise-head .exercise-title-row { display: flex; align-items: center; gap: 10px; min-width: 0; }
.food-result.with-thumb { align-items: center; }
.food-result.with-thumb > span:first-child { display: flex; align-items: center; gap: 12px; min-width: 0; }
.exercise-meta { color: var(--faint); font-size: 12.5px; }
.exercise-tools { display: flex; align-items: center; gap: 4px; }
.exercise-tools form { display: contents; }
.exercise-tools select { width: 104px; min-height: 34px; padding: 5px 28px 5px 10px; font-size: 13px; margin-right: 6px; }
.sets-table { border-collapse: collapse; font-size: 14px; width: auto; min-width: 320px; }
.sets-table.editable { width: 100%; }
.sets-table:not(.editable) td.num { padding-right: 28px; }
.sets-table td { padding: 5px 12px 5px 0; vertical-align: middle; }
.sets-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.sets-table .e1rm { color: var(--faint); font-size: 12.5px; }
.sets-table .skipped { opacity: 0.4; }
.set-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 30px; height: 26px; padding: 0 6px; border-radius: 8px; background: var(--surface-2); color: var(--faint); font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.set-badge.warmup, .badge-btn.warmup { color: var(--brass); }
.set-badge.failure, .badge-btn.failure { color: var(--rust); }
.set-badge.dropset, .badge-btn.dropset { color: var(--patina); }
.badge-btn { display: inline-flex; align-items: center; justify-content: center; min-width: 30px; height: 28px; padding: 0 6px; background: var(--surface-2); border: 1px solid var(--line-strong); border-radius: 8px; color: var(--faint); font-size: 12px; font-weight: 600; cursor: pointer; }
.badge-btn:hover { border-color: var(--bronze); color: var(--ivory); }
.set-form { display: flex; align-items: center; gap: 8px; }
.set-form input { width: 78px; min-height: 34px; padding: 5px 10px; font-size: 13.5px; }
.set-x { color: var(--faint); font-size: 12.5px; white-space: nowrap; }
.add-set-btn { color: var(--faint); font-size: 13px; padding: 10px 2px 0; display: inline-flex; align-items: center; gap: 6px; }
.add-set-btn:hover { color: var(--brass); }
.swap-title { padding: 8px 10px 10px; font-size: 14px; }
.coach-suggest-link { display: flex; align-items: center; gap: 8px; color: var(--bronze); font-size: 13.5px; padding: 9px 10px; margin-bottom: 8px; border-radius: var(--radius-s); }
.coach-suggest-link:hover { background: var(--surface-2); text-decoration: none; }
turbo-frame[busy] .coach-suggest-link { opacity: 0.6; pointer-events: none; }
turbo-frame[busy] .coach-suggest-link::after { content: " — Myron denkt nach …"; }
.coach-suggestions { margin-bottom: 10px; }
.coach-suggestions .food-result span:first-child { display: flex; flex-direction: column; gap: 2px; }
.swap-confirm p { font-size: 14px; margin-bottom: 12px; }
.swap-confirm-actions { display: flex; align-items: center; gap: 14px; }

/* ---------- Recipes ------------------------------------------------------ */
.ingredient-row .amount-form { padding: 0; flex-wrap: nowrap; }
.ingredient-row .amount-form input[type="number"] { width: 78px; min-height: 34px; padding: 5px 10px; font-size: 13.5px; }
.ingredient-row .amount-form select { min-height: 34px; padding: 5px 28px 5px 10px; font-size: 13.5px; }
.ingredient-row .row-value { min-width: 70px; }
.recipe-totals .totals-line { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: 14px; color: var(--muted); padding: 5px 0; }
.recipe-totals .totals-line .label { color: var(--faint); }
.recipe-totals .per-portion { font-size: 15px; color: var(--ivory); border-top: 1px solid var(--line); margin-top: 6px; padding-top: 10px; }
.recipe-totals .per-portion strong { color: var(--brass); font-family: var(--font-display); font-weight: 400; font-size: 20px; }
.recipe-totals .totals-hint { color: var(--faint); font-size: 12.5px; margin: 10px 0 0; }
.import-form { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.import-form .input, .import-form textarea { width: 100%; }
.file-row { display: flex; align-items: center; gap: 12px; font-size: 14px; color: var(--muted); flex-wrap: wrap; }

/* ---------- Coach -------------------------------------------------------- */
.coach-report { padding: 22px 26px; }
.coach-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 10px; }
.coach-kind { font-family: var(--font-display); font-size: 19px; color: var(--brass); }
.coach-date { color: var(--faint); font-size: 12.5px; white-space: nowrap; }
.coach-summary { font-size: 14.5px; color: var(--muted); line-height: 1.6; }
.coach-summary p { margin-bottom: 8px; }
.coach-lists { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 16px 0; }
.coach-lists h3 { margin-bottom: 6px; }
.wins-title { color: var(--patina-text); }
.concerns-title { color: var(--brass); }
.coach-lists ul { list-style: none; }
.coach-lists li { font-size: 13.5px; color: var(--muted); padding: 3px 0 3px 14px; position: relative; }
.coach-lists li::before { content: ""; position: absolute; left: 0; top: 11px; width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: 0.5; }
.recommendation { display: flex; align-items: center; gap: 14px; background: var(--surface-2); border-radius: var(--radius-m); padding: 12px 16px; margin-top: 10px; flex-wrap: wrap; }
.rec-main { flex: 1; min-width: 200px; }
.rec-title { font-size: 14px; font-weight: 500; }
.rec-reason { font-size: 12.5px; color: var(--faint); }
.rec-actions { display: flex; gap: 8px; }
.rec-actions form { display: contents; }
.coach-note { font-size: 15px; font-style: italic; color: var(--ivory); line-height: 1.6; margin: 0 0 8px; }
.suggestion-line { font-size: 15px; color: var(--muted); margin-bottom: 14px; }
.suggestion-line strong { color: var(--ivory); font-size: 18px; font-weight: 500; }
.suggestion-sub { display: block; font-size: 12.5px; color: var(--faint); margin-top: 2px; }

/* ---------- Health ------------------------------------------------------- */
.weight-form { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.weight-form input[type="date"] { min-width: 150px; }
.weight-detail { color: var(--faint); font-size: 12.5px; font-weight: 400; margin-left: 6px; }

/* ---------- Check-ins ---------------------------------------------------- */
.compare-form { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.compare-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.compare-date { color: var(--faint); font-size: 12.5px; margin-bottom: 8px; }
.photo-row { display: flex; gap: 14px; flex-wrap: wrap; }
.photo-row figure { margin: 0; }
.photo-row img { width: 220px; border-radius: var(--radius-m); border: 1px solid var(--line); }
.compare-grid .photo-row img { width: 100%; max-width: 260px; }
.photo-row figcaption { color: var(--faint); font-size: 12px; text-align: center; margin-top: 6px; }

/* ---------- Account hub -------------------------------------------------- */
.account-head { display: flex; align-items: center; gap: 16px; padding: 22px 24px; }
.account-head .avatar { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; background: var(--bronze-soft); color: var(--brass); font-family: var(--font-display); font-size: 24px; flex-shrink: 0; }
.account-head .name { font-size: 17px; font-weight: 500; }
.account-head .email { color: var(--faint); font-size: 13.5px; }
.premium-pill { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; font-size: 12.5px; font-weight: 600; background: var(--bronze-soft); color: var(--brass); margin-left: auto; white-space: nowrap; }
.premium-pill.free { background: var(--surface-3); color: var(--muted); }
.data-credits { color: var(--faint); font-size: 12px; line-height: 1.6; }
.data-credits a { color: inherit; text-decoration: underline; }
.row .icon-lead { color: var(--bronze); }

/* ---------- Login -------------------------------------------------------- */
body.portal-login { background: var(--base); color: var(--ivory); font-family: var(--font-ui); min-height: 100dvh; display: flex; flex-direction: column; -webkit-font-smoothing: antialiased; }
.login-wrap { max-width: 440px; margin: 0 auto; padding: 0 24px; width: 100%; flex: 1; display: flex; flex-direction: column; }
.login-wrap header { padding: 36px 0 20px; display: flex; justify-content: center; }
.login-wrap header .wordmark { height: 34px; width: auto; }
.login-wrap main { flex: 1; display: flex; align-items: center; padding: 10px 0 70px; }
.login-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-xl); padding: 40px 32px 32px; width: 100%; text-align: center; box-shadow: var(--shadow-2); }
.login-card h1 { font-size: 34px; }
.login-card .sub { color: var(--muted); font-size: 15px; margin-top: 12px; line-height: 1.55; }
.login-card .notice { margin: 0 0 18px; padding: 12px 16px; border-radius: var(--radius-s); background: var(--rust-soft); border: 1px solid rgba(201, 123, 107, 0.4); font-size: 14px; text-align: left; }
.sso-btn { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 12px; border-radius: 999px; padding: 14px 24px; font-size: 15px; font-weight: 500; border: 1px solid rgba(242, 235, 224, 0.18); transition: border-color 0.15s, transform 0.12s var(--ease); }
.sso-btn:first-of-type { margin-top: 30px; }
.sso-btn:hover { border-color: rgba(242, 235, 224, 0.45); text-decoration: none; }
.sso-btn:active { transform: translateY(1px); }
.sso-btn svg { width: 18px; height: 18px; }
.apple-btn { background: #000; color: #fff; }
.apple-btn svg { fill: #fff; }
.google-btn { background: #fff; color: #1f1f1f; }
.login-foot { color: var(--faint); font-size: 12.5px; line-height: 1.6; margin-top: 24px; }
.login-foot a { color: var(--muted); }

/* ---------- Responsive --------------------------------------------------- */
@media (max-width: 1023px) {
  :root { --gutter: 28px; }
  .app { grid-template-columns: var(--rail-w) minmax(0, 1fr); background: linear-gradient(90deg, var(--surface) 0 var(--rail-w), var(--base) var(--rail-w)); }
  .sidebar { padding: 22px 12px 16px; gap: 18px; }
  .brand { justify-content: center; padding: 0; }
  .brand .wordmark { display: none; }
  .brand .mark { display: block; }
  .nav-item { justify-content: center; padding: 11px 0; }
  .nav-item span, .user-chip span:not(.avatar), .nav-item .nav-kbd { display: none; }
  .user-chip { justify-content: center; padding: 8px 0; }
}
@media (max-width: 767px) {
  :root { --gutter: 16px; }
  .app { grid-template-columns: minmax(0, 1fr); background: var(--base); }
  .sidebar { display: none; }
  .content { padding: 22px var(--gutter) calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 32px); }
  .tabbar {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    height: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
    background: rgba(33, 28, 23, 0.92); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-top: 1px solid var(--line-strong);
  }
  .tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--faint); font-size: 11px; font-weight: 500; letter-spacing: 0.01em; }
  .tabbar a:hover { text-decoration: none; }
  .tabbar a[aria-current="page"] { color: var(--brass); }
  .tabbar .icon { width: 22px; height: 22px; }
  .toasts { bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 12px); }
  h1 { font-size: 26px; }
  .page-head { margin-bottom: 14px; }
  .page-actions { width: 100%; margin-left: 0; }
  .summary { grid-template-columns: 1fr; justify-items: center; text-align: center; padding: 22px 18px; gap: 18px; }
  .summary-facts { width: 100%; }
  .macros { gap: 8px; }
  .macro { padding: 10px 10px; }
  .macro .value { font-size: 14px; }
  .row { padding: 12px 14px; gap: 10px; }
  .row-actions { opacity: 1; }
  /* Rows with actions wrap: title line first, value + actions on the second */
  .row:has(.row-actions) { flex-wrap: wrap; row-gap: 4px; }
  .row:has(.row-actions) .row-main { flex-basis: 100%; }
  .row:has(.row-actions) .row-value { margin-left: auto; }
  .row:has(.row-actions) .row-actions { order: 3; }
  .row:has(.row-actions) .row-value .sub { display: inline; margin-left: 6px; }
  .folder-tools { opacity: 1; }
  .card { padding: 18px 16px; border-radius: var(--radius-m); }
  .field { grid-template-columns: 1fr; gap: 6px; }
  .field .field-hint { grid-column: 1; }
  .coach-lists, .compare-grid { grid-template-columns: 1fr; }
  .exercise-card { padding: 14px 14px; }
  .set-form input { width: 64px; }
  .myron-line-form input[type="text"] { font-size: 16px; } /* iOS: no zoom on focus */
  .myron-submit { width: 48px; height: 48px; padding: 0; flex-shrink: 0; }
  .myron-submit span { display: none; }
  .myron-submit .icon { display: block; width: 20px; height: 20px; }
  .kcal-line { display: none; }
  input, select, textarea { font-size: 16px; }
  dialog.sheet { margin: auto auto 0; width: 100vw; max-width: 100vw; border-radius: var(--radius-xl) var(--radius-xl) 0 0; border-bottom: 0; max-height: 92dvh; }
  .sheet-body { padding-bottom: calc(24px + env(safe-area-inset-bottom)); }
  .table th, .table td { padding-left: 8px; padding-right: 8px; }
}
@media (min-width: 1024px) {
  .myron-line-form .kbd { display: inline-block; position: absolute; right: 16px; top: 50%; transform: translateY(-50%); }
  .myron-line-form .search-field { position: relative; }
  .myron-line-form input[type="text"] { padding-right: 64px; }
}

/* ---------- Menus (details popover) -------------------------------------- */
details.menu { position: relative; }
details.menu > summary { list-style: none; cursor: pointer; }
details.menu > summary::-webkit-details-marker { display: none; }
details.menu[open] > summary { color: var(--ivory); background: var(--surface-3); }
.menu-list {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; min-width: 240px;
  background: var(--surface-3); border: 1px solid var(--line-strong); border-radius: var(--radius-m);
  box-shadow: var(--shadow-2); padding: 6px; display: flex; flex-direction: column; gap: 2px;
  animation: sheet-in 0.18s var(--ease) both;
}
.menu-list a, .menu-list button {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 9px 12px;
  border-radius: var(--radius-s); color: var(--ivory); font-size: 14px; text-decoration: none; white-space: nowrap;
}
.menu-list a:hover, .menu-list button:hover { background: var(--surface-2); text-decoration: none; }
.menu-list .icon { color: var(--faint); width: 17px; height: 17px; }
.menu-list form { display: contents; }
.menu-sep { height: 1px; background: var(--line); margin: 4px 6px; }

/* ---------- Heute: water + supplements ---------------------------------- */
.ring-link { display: inline-flex; align-items: center; gap: 4px; margin-top: 4px; color: var(--brass); font-size: 13px; }
.ring-link:hover { text-decoration: none; color: var(--ivory); }
.water-card { padding: 16px 20px; }
.water-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.water-head .water-title { display: flex; align-items: center; gap: 8px; font-weight: 500; font-size: 14.5px; }
.water-head .water-title .icon { color: var(--patina); }
.water-head .water-total { display: inline-flex; align-items: center; gap: 4px; font-variant-numeric: tabular-nums; font-size: 14px; color: var(--muted); padding: 4px 6px; border-radius: 8px; }
button.water-total:hover { background: var(--surface-2); color: var(--ivory); }
.water-head .water-total strong { color: var(--ivory); font-weight: 500; }
.water-bar { height: 6px; border-radius: 3px; background: var(--surface-3); margin: 12px 0; overflow: hidden; }
.water-bar i { display: block; height: 100%; background: var(--patina); border-radius: 3px; transition: width 0.5s var(--ease); }
.chips-row { display: flex; gap: 8px; flex-wrap: wrap; }
.chips-row form { display: contents; }
.chip.patina { background: var(--patina-soft); border-color: rgba(94, 140, 123, 0.4); color: #8FB8A8; }
.chip.patina:hover { color: var(--ivory); }
.supp-row { display: flex; align-items: center; gap: 12px; padding: 8px 0; }
.supp-row form { display: contents; }
.supp-check { width: 26px; height: 26px; border-radius: 50%; border: 1.5px solid var(--line-strong); display: inline-flex; align-items: center; justify-content: center; color: var(--base); flex-shrink: 0; transition: background 0.15s, border-color 0.15s; }
.supp-check .icon { width: 15px; height: 15px; opacity: 0; }
.supp-check:hover { border-color: var(--bronze); }
.supp-row.taken .supp-check { background: var(--bronze); border-color: var(--bronze); }
.supp-row.taken .supp-check .icon { opacity: 1; }
.supp-row .supp-name { flex: 1; font-size: 14.5px; }
.supp-row.taken .supp-name { text-decoration: line-through; color: var(--faint); }
.supp-row .supp-dose { color: var(--faint); font-size: 13px; font-variant-numeric: tabular-nums; }
.day-empty { display: flex; align-items: center; gap: 10px; color: var(--faint); font-size: 13.5px; padding: 2px 6px 14px; }
.day-empty .icon { color: var(--ghost); }
.meal-head .meal-tools { display: flex; align-items: center; gap: 8px; }
.meal-head h2 a { color: inherit; }
.meal-head h2 a:hover { color: var(--brass); text-decoration: none; }
.row-time { color: var(--ghost); }

/* History search */
.history-hits .group-label { padding-top: 12px; }
.hit { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: var(--radius-s); color: var(--ivory); font-size: 14px; }
.hit:hover { background: var(--surface-2); text-decoration: none; }
.hit .hit-main { flex: 1; min-width: 0; }
.hit .hit-sub { display: block; color: var(--faint); font-size: 12.5px; }
.hit .hit-kcal { color: var(--muted); font-size: 13px; white-space: nowrap; font-variant-numeric: tabular-nums; }

/* ---------- Tagesbilanz --------------------------------------------------- */
.balance-kcal { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.balance-kcal .hero-number { font-size: 46px; }
.balance-kcal .balance-meta { color: var(--muted); font-size: 14px; }
.balance-kcal .balance-meta strong { color: var(--brass); font-weight: 500; }
.macro-bar { display: flex; height: 12px; border-radius: 6px; overflow: hidden; background: var(--surface-3); gap: 2px; }
.macro-bar i { display: block; height: 100%; transition: width 0.5s var(--ease); }
.macro-bar.mini { height: 6px; border-radius: 3px; margin: 8px 0 6px; }
.macro-legend { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 14px; }
.macro-legend .ml-name { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--faint); }
.macro-legend .ml-name i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.macro-legend .ml-grams { font-family: var(--font-display); font-size: 26px; line-height: 1.1; margin-top: 4px; font-variant-numeric: tabular-nums; }
.macro-legend .ml-grams small { font-family: var(--font-ui); font-size: 13px; color: var(--faint); margin-left: 2px; }
.macro-legend .ml-sub { font-size: 12.5px; color: var(--faint); margin-top: 2px; }
.macro-legend .bar { height: 3px; border-radius: 2px; background: var(--surface-3); margin-top: 8px; overflow: hidden; }
.macro-legend .bar i { display: block; height: 100%; border-radius: 2px; }
.balance-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.balance-card { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 16px 18px; color: var(--ivory); transition: background 0.15s; }
.balance-card:hover { background: var(--surface-2); text-decoration: none; }
.balance-card .bc-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.balance-card .bc-name { font-weight: 500; font-size: 14.5px; }
.balance-card .bc-kcal { font-weight: 600; font-size: 14px; font-variant-numeric: tabular-nums; color: var(--brass); }
.balance-card .bc-macros { font-size: 12.5px; color: var(--faint); display: flex; justify-content: space-between; }
.balance-foot { text-align: center; color: var(--faint); font-size: 12px; letter-spacing: 0.3em; text-transform: lowercase; margin-top: 32px; }
.balance-share { color: var(--faint); font-size: 14px; }
@media (max-width: 767px) {
  .macro-legend .ml-grams { font-size: 22px; }
  .menu-list { right: 0; min-width: 220px; }
}

/* ---------- Myron-Zeile: voice + camera + barcode ------------------------ */
.myron-line-form .line-tools { display: flex; gap: 4px; }
.myron-line-form .line-tools .btn-icon { width: 44px; height: 44px; border-radius: 50%; background: var(--surface); border: 1px solid var(--line-strong); color: var(--muted); }
.myron-line-form .line-tools .btn-icon:hover { color: var(--ivory); border-color: var(--bronze-line); }
.myron-line-form .mic-btn[aria-pressed="true"], .myron-line-form.listening .mic-btn { color: var(--base); background: var(--patina); border-color: var(--patina); animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(94, 140, 123, 0.45); } 50% { box-shadow: 0 0 0 8px rgba(94, 140, 123, 0); } }
.proposal.estimate .proposal-name::after { content: "✦"; color: var(--brass); margin-left: 6px; font-size: 12px; }
.proposal-note { color: var(--faint); font-size: 12.5px; padding: 6px 12px 0; }

/* ---------- Food form / barcode / photo --------------------------------- */
.macro-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.macro-grid label { display: flex; flex-direction: column; gap: 4px; color: var(--faint); font-size: 12.5px; }
.macro-grid input { width: 100%; }
.portion-rows { display: flex; flex-direction: column; gap: 8px; }
.portion-row { display: flex; align-items: center; gap: 8px; }
.portion-row input[type="text"] { flex: 1; }
.portion-row input[type="number"] { width: 100px; }
.atwater-hint { color: var(--brass); font-size: 13px; padding: 8px 12px; background: var(--bronze-soft); border-radius: var(--radius-s); }
.estimate-note { display: flex; gap: 8px; align-items: flex-start; color: var(--muted); font-size: 13.5px; padding: 10px 12px; background: var(--surface-2); border-radius: var(--radius-s); }
.estimate-note .icon { color: var(--bronze); flex-shrink: 0; margin-top: 2px; }
.ai-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.ai-actions form { display: contents; }
.file-btn { position: relative; overflow: hidden; }
.file-btn input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.scanner { position: relative; border-radius: var(--radius-m); overflow: hidden; background: #000; aspect-ratio: 4 / 3; margin-bottom: 14px; }
.scanner video { width: 100%; height: 100%; object-fit: cover; display: block; }
.scanner .frame { position: absolute; inset: 18% 12%; border: 2px solid rgba(232, 199, 154, 0.85); border-radius: 14px; box-shadow: 0 0 0 999px rgba(0, 0, 0, 0.35); pointer-events: none; }
.scanner .scan-line { position: absolute; left: 14%; right: 14%; top: 50%; height: 2px; background: var(--brass); opacity: 0.8; animation: scan 1.6s ease-in-out infinite; }
@keyframes scan { 0%, 100% { transform: translateY(-40px); } 50% { transform: translateY(40px); } }
.deadend { text-align: center; padding: 10px 0 4px; }
.deadend > .icon { width: 34px; height: 34px; margin: 0 auto 12px; color: var(--ghost); }
.deadend .deadend-title { font-family: var(--font-display); font-size: 22px; margin-bottom: 6px; }
.deadend .deadend-sub { color: var(--muted); font-size: 14px; margin-bottom: 18px; }
.deadend .form-actions { justify-content: center; flex-wrap: wrap; }
.photo-drop { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; min-height: 220px; border: 1.5px dashed var(--line-strong); border-radius: var(--radius-l); background: var(--surface-2); color: var(--muted); cursor: pointer; position: relative; transition: border-color 0.15s, background 0.15s; text-align: center; padding: 20px; }
.photo-drop:hover { border-color: var(--bronze-line); background: var(--surface-3); }
.photo-drop .icon { width: 30px; height: 30px; color: var(--bronze); }
.photo-drop input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.photo-drop img { max-height: 260px; max-width: 100%; border-radius: var(--radius-m); }
.photo-status { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 14px; margin-top: 12px; }
.spinner { width: 18px; height: 18px; border: 2px solid var(--line-strong); border-top-color: var(--brass); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.food-result .flags { display: inline-flex; gap: 6px; margin-left: 6px; vertical-align: 1px; }
.create-link { display: flex; align-items: center; gap: 8px; color: var(--brass); font-size: 13.5px; padding: 10px 12px; border-radius: var(--radius-s); }
.create-link:hover { background: var(--surface-2); text-decoration: none; }
@media (max-width: 767px) {
  .macro-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .myron-line-form .line-tools .btn-icon { width: 40px; height: 40px; }
}


/* ---------- Recipes: pins ------------------------------------------------- */
#recipes_list { display: block; margin-top: 22px; }
.pin-btn { color: var(--ghost); }
.pin-btn[aria-pressed="true"] { color: var(--brass); }
.pin-btn[aria-pressed="true"] .icon { fill: var(--brass); }
.row.pinned .row-title a { color: var(--ivory); }

/* ---------- Training (Phase 3) ------------------------------------------- */
.resume-banner { display: flex; align-items: center; gap: 14px; padding: 14px 18px; margin-bottom: 20px; background: var(--patina-soft); border: 1px solid rgba(94, 140, 123, 0.45); border-radius: var(--radius-m); color: var(--ivory); }
.resume-banner:hover { text-decoration: none; background: rgba(94, 140, 123, 0.26); }
.resume-banner .resume-main { flex: 1; display: flex; flex-direction: column; }
.resume-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--patina); box-shadow: 0 0 0 0 rgba(94, 140, 123, 0.5); animation: pulse 1.6s ease-in-out infinite; }
.routine-row .btn { flex-shrink: 0; }
.exercise-card .exercise-head .badge { margin-left: 8px; }
.notes-form { margin: -2px 0 10px; }
.notes-input { width: 100%; min-height: 34px; padding: 5px 10px; font-size: 13px; background: transparent; border-color: transparent; }
.notes-input:hover, .notes-input:focus { background: var(--surface-2); border-color: var(--line-strong); }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 16px; }
.stat { background: var(--surface-2); border-radius: var(--radius-m); padding: 12px 14px; }
.stat-label { display: block; font-size: 12px; color: var(--faint); }
.stat-value { display: block; font-family: var(--font-display); font-size: 22px; margin-top: 2px; font-variant-numeric: tabular-nums; }
.exercise-howto { display: grid; grid-template-columns: 260px 1fr; gap: 20px; align-items: start; }
.exercise-images { position: relative; aspect-ratio: 1; border-radius: var(--radius-m); overflow: hidden; background: #fff; }
.exercise-images img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.exercise-images img.alt { animation: frames 2.4s steps(1) infinite; }
@keyframes frames { 0%, 49% { opacity: 0; } 50%, 100% { opacity: 1; } }
.steps-list { padding-left: 20px; color: var(--muted); font-size: 14px; line-height: 1.6; display: flex; flex-direction: column; gap: 6px; }
.steps-list li::marker { color: var(--bronze); font-weight: 600; }
.pr-card { border-color: var(--bronze-line); }
.color-swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.color-swatches label { width: 28px; height: 28px; border-radius: 50%; cursor: pointer; border: 2px solid transparent; display: inline-block; }
.color-swatches input { display: none; }
.color-swatches input:checked + span { border-color: var(--ivory); }
.color-swatches span { display: block; width: 100%; height: 100%; border-radius: 50%; border: 2px solid transparent; }
@media (max-width: 767px) {
  .detail-grid, .exercise-howto { grid-template-columns: 1fr; }
  .stat-row { grid-template-columns: repeat(2, 1fr); }
  .exercise-images { max-width: 260px; }
}

/* ---------- Live session (Vue island) ---------------------------------- */
[v-cloak] { display: none; }
.session-head .page-title h1 { font-size: 26px; }
.session-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-variant-numeric: tabular-nums; }
.session-elapsed { color: var(--brass); font-weight: 500; }
.session-saving { color: var(--ghost); font-size: 12px; }
.session-error { color: var(--rust); font-size: 12px; }
.session-mic.listening { color: var(--rust); background: var(--rust-soft); animation: mic-pulse 1.2s ease-in-out infinite; }
@keyframes mic-pulse { 50% { box-shadow: 0 0 0 6px rgba(201, 123, 107, 0.18); } }

.rest-bar { position: sticky; top: 0; z-index: 8; margin: 0 0 16px; border: 1px solid var(--line); border-radius: var(--radius-m); background: var(--surface); overflow: hidden; }
.rest-bar.active { border-color: var(--bronze-line); box-shadow: var(--shadow-1); }
.rest-fill { position: absolute; inset: 0; background: linear-gradient(90deg, var(--bronze-soft), rgba(192, 138, 75, 0.3)); transform-origin: left; transition: transform 0.25s linear; }
.rest-content { position: relative; display: flex; align-items: center; gap: 12px; padding: 10px 14px; min-height: 48px; font-size: 14px; }
.rest-label { color: var(--faint); font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; }
.rest-time { font-family: var(--font-display); font-size: 24px; line-height: 1; color: var(--brass); font-variant-numeric: tabular-nums; min-width: 64px; }
.rest-next { flex: 1; min-width: 0; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rest-next a { color: var(--ivory); }
.rest-idle .rest-next { color: var(--muted); }
.rest-actions { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.session-done { color: var(--patina-text); display: inline-flex; align-items: center; gap: 6px; }
.session-done .icon { width: 16px; height: 16px; }

.session-exercise { transition: box-shadow 0.4s var(--ease), border-color 0.4s var(--ease); }
.session-exercise.focused { border-color: var(--bronze-line); box-shadow: 0 0 0 3px var(--bronze-soft); }
.session-exercise.grouped { border-left: 3px solid var(--group-color, var(--bronze)); }
.session-exercise .exercise-head { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 10px; }
.session-exercise .exercise-title { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.session-exercise .exercise-name { font-size: 16px; font-weight: 500; color: var(--ivory); }
.session-exercise .exercise-sub { font-size: 12.5px; color: var(--faint); }
.group-pill { display: inline-flex; align-items: center; width: fit-content; padding: 1px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; letter-spacing: 0.04em; color: var(--base); background: var(--group-color, var(--bronze)); margin-bottom: 2px; }
.exercise-note { margin: 0 0 10px; font-size: 13.5px; }
.menu-field { display: flex; align-items: center; gap: 10px; padding: 8px 12px; font-size: 14px; color: var(--ivory); }
.menu-field span { flex: 1; }
.menu-field .select { width: 110px; padding: 5px 8px; font-size: 13px; }
.menu-list button:disabled { opacity: 0.4; cursor: default; }
.menu-list .danger { color: var(--rust); }
.menu-list .set-badge { min-width: 24px; height: 22px; font-size: 11px; }

.set-grid { display: grid; grid-template-columns: 44px minmax(90px, 1.4fr) minmax(72px, 1fr) minmax(64px, 1fr) 44px; gap: 6px 10px; align-items: center; }
.set-grid-head { display: contents; }
.set-grid-head span { font-size: 11px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--ghost); padding-bottom: 2px; }
.set-grid-head span:nth-child(3), .set-grid-head span:nth-child(4) { text-align: center; }
.set-row { display: contents; }
.set-row .set-prev { font-size: 13px; color: var(--faint); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.set-row .set-range { color: var(--ghost); }
.set-row .set-input { text-align: center; padding: 8px 6px; font-variant-numeric: tabular-nums; font-size: 15px; min-width: 0; }
.set-row.done .set-input { color: var(--muted); background: transparent; border-color: transparent; }
.set-row.done .set-prev { opacity: 0.6; }
.set-row.next .set-badge { box-shadow: 0 0 0 2px var(--bronze-line); }
.set-type-menu > summary.set-badge { cursor: pointer; }
.set-check { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 36px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--surface-2); color: var(--ghost); cursor: pointer; transition: background 0.15s, color 0.15s, transform 0.1s; }
.set-check:hover { color: var(--ivory); border-color: var(--bronze); }
.set-check:active { transform: scale(0.94); }
.set-check.on { background: var(--patina); border-color: var(--patina); color: var(--base); }
.set-check .icon { width: 18px; height: 18px; }
.exercise-foot { margin-top: 10px; display: flex; }
.session-add { margin: 4px 0 20px; }
.session-notes { display: flex; flex-direction: column; gap: 8px; }
.session-notes label { font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600; }
.session-footer { display: flex; justify-content: center; padding: 8px 0 24px; }

.island-overlay { position: fixed; inset: 0; z-index: 45; background: rgba(0, 0, 0, 0.55); backdrop-filter: blur(6px); display: flex; align-items: flex-end; justify-content: center; animation: fade-in 0.2s both; }
.island-sheet { width: min(560px, 100%); max-height: 88vh; overflow: auto; background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-xl) var(--radius-xl) 0 0; box-shadow: var(--shadow-2); animation: sheet-in 0.3s var(--ease) both; }
@keyframes sheet-in { from { transform: translateY(24px); opacity: 0; } }
.picker-list { max-height: 50vh; overflow: auto; }
.picker-list .row { width: 100%; text-align: left; background: none; border: 0; border-bottom: 1px solid var(--line); cursor: pointer; font: inherit; }
.picker-list .row:hover { background: var(--surface-2); }
.picker-list .row .icon { color: var(--faint); }
.finish-summary { font-size: 15px; color: var(--muted); }
.finish-save { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.diff-list { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.diff-list li { display: flex; flex-direction: column; gap: 2px; font-size: 13.5px; color: var(--muted); padding: 8px 12px; background: var(--surface-2); border-radius: var(--radius-s); }
.diff-list li strong { color: var(--ivory); font-weight: 500; }
.island-toast { pointer-events: auto; }
.island-toast .btn { margin-left: auto; }

@media (min-width: 768px) {
  .island-overlay { align-items: center; padding: 24px; }
  .island-sheet { border-radius: var(--radius-xl); }
}
@media (max-width: 767px) {
  .rest-bar { top: 0; }
  .session-head .page-actions .btn { padding: 8px 12px; font-size: 13.5px; }
  .set-grid { grid-template-columns: 44px minmax(60px, 1.2fr) minmax(58px, 1fr) minmax(52px, 1fr) 44px; gap: 6px; }
  .set-row .set-input { padding: 8px 4px; font-size: 16px; } /* 16 px: iOS zooms smaller fields */
  .set-check { width: 44px; height: 44px; }
  .set-type-menu > summary.set-badge { min-width: 44px; height: 40px; }
  .session-head .page-actions .btn, .session-head .page-actions .btn-icon { min-height: 44px; }
  .rest-content { flex-wrap: wrap; row-gap: 4px; }
  .rest-bar.active .rest-next { flex-basis: 100%; order: 10; font-size: 13px; }
  .set-row .set-range { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .session-mic.listening { animation: none; }
  .rest-fill { transition: none; }
}

/* ---------- Share card ------------------------------------------------- */
.share-layout { display: grid; grid-template-columns: minmax(180px, 260px) 1fr; gap: 24px; align-items: center; }
.share-preview { aspect-ratio: 9 / 16; border-radius: var(--radius-m); overflow: hidden; border: 1px solid var(--line-strong); box-shadow: var(--shadow-2); background: var(--base); }
.share-preview canvas { display: block; width: 100%; height: 100%; }
.share-hero { border-color: var(--bronze-line); background: radial-gradient(ellipse at 20% 0%, var(--bronze-soft), transparent 60%), var(--surface); }
.share-hero .share-layout { grid-template-columns: minmax(200px, 300px) 1fr; }
.share-lead { font-family: var(--font-display); font-size: 22px; color: var(--ivory); margin-bottom: 14px; line-height: 1.3; }
.share-controls { display: flex; flex-direction: column; gap: 14px; }
.share-toggle { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); }
.share-actions { display: flex; flex-wrap: wrap; gap: 8px; }
@media (max-width: 767px) {
  .share-layout, .share-hero .share-layout { grid-template-columns: 1fr; }
  .share-preview { max-width: 240px; margin: 0 auto; }
  .share-controls { align-items: center; text-align: center; }
}

/* ---------- Gesundheit (Phase 4a) ----------------------------------- */
.range-chips { margin: 14px 0 6px; }
.range-chips .chip { padding: 4px 11px; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.consent-card { border-color: var(--bronze-line); }
.consent-card .form-actions { margin-top: 12px; }
.consent-card .form-actions form { display: contents; }
.checkin-photo { position: relative; }
.checkin-photo figcaption { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12.5px; color: var(--faint); margin-top: 4px; }
.checkin-photo figcaption form { display: contents; }
.checkin-pick { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.checkin-pick input[type="file"] { max-width: 100%; font-size: 13px; color: var(--muted); }
.checkin-preview { width: 72px; height: 96px; object-fit: cover; border-radius: var(--radius-s); border: 1px solid var(--line-strong); }
/* ---------- Coach: activation, locked teaser, wizard, settings ---------- */
.coach-mark { height: 56px; width: auto; display: block; margin: 0 auto 14px; opacity: 0.95; }
.coach-empty { padding: 40px 20px; }
.coach-activation { text-align: center; padding: 36px 28px; border-color: var(--bronze-line); background: radial-gradient(ellipse at 50% 0%, var(--bronze-soft), transparent 60%), var(--surface); }
.coach-activation h2 { font-size: 26px; margin-bottom: 8px; }
.coach-pitch { color: var(--muted); font-size: 15px; max-width: 480px; margin: 0 auto 22px; line-height: 1.55; }
.coach-benefits { list-style: none; display: grid; grid-template-columns: 1fr 1fr; gap: 14px 22px; text-align: left; max-width: 640px; margin: 0 auto 26px; padding: 18px 20px; background: var(--surface-2); border-radius: var(--radius-m); }
.coach-benefits li { display: flex; gap: 12px; align-items: flex-start; }
.coach-benefits .icon { color: var(--bronze); flex: 0 0 20px; width: 20px; height: 20px; margin-top: 2px; }
.coach-benefits span { display: flex; flex-direction: column; gap: 2px; font-size: 12.5px; color: var(--faint); line-height: 1.4; }
.coach-benefits strong { font-size: 14px; font-weight: 500; color: var(--ivory); }
.coach-apps-hint { color: var(--muted); font-size: 13.5px; max-width: 460px; margin: 0 auto 14px; line-height: 1.5; }
.coach-locked { border-color: var(--bronze-line); }
.coach-preview { color: var(--ivory); }
.coach-blur { display: flex; flex-direction: column; gap: 8px; margin: 12px 0 16px; filter: blur(5px); opacity: 0.55; pointer-events: none; user-select: none; }
.coach-blur span { display: block; height: 12px; border-radius: 6px; background: linear-gradient(90deg, var(--surface-3), var(--line-strong)); }
.coach-blur span.short { width: 60%; }
.coach-locked-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.coach-event { display: flex; gap: 14px; align-items: flex-start; padding: 16px 20px; }
.coach-event-icon { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 50%; background: var(--bronze-soft); color: var(--brass); flex: 0 0 36px; }
.coach-event-icon .icon { width: 18px; height: 18px; }
.coach-event-main { flex: 1; min-width: 0; }
.coach-event-main .coach-summary p { margin-bottom: 4px; }
.coach-visual { margin: 14px 0 4px; padding: 12px 16px; border-radius: var(--radius-m); background: var(--surface-2); }
.coach-visual h3 { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; color: var(--brass); }
.coach-visual p { font-size: 13.5px; color: var(--muted); line-height: 1.55; }
.coach-sources { margin: 6px 0 24px; font-size: 13.5px; }
.coach-sources a { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); }
.coach-sources a:hover { color: var(--brass); }

.wizard-steps { list-style: none; display: flex; gap: 6px; margin: -6px 0 18px; }
.wizard-steps li { flex: 1; font-size: 12px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ghost); padding-top: 8px; border-top: 2px solid var(--line-strong); }
.wizard-steps li.done { color: var(--patina-text); border-top-color: var(--patina); }
.wizard-steps li.current { color: var(--brass); border-top-color: var(--bronze); }
.wizard-card { padding: 28px 30px; }
.wizard-card h2 { font-size: 24px; margin-bottom: 6px; }
.wizard-sub { color: var(--muted); font-size: 14px; margin-bottom: 20px; line-height: 1.5; }
.wizard-card .field { grid-template-columns: minmax(140px, 180px) 1fr; }
.wizard-card .form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.wizard-card .form-actions form { margin: 0; }
.choice-list { display: flex; flex-direction: column; gap: 10px; }
.choice-list.choice-grid { display: grid; grid-template-columns: 1fr 1fr; }
.choice { display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px; border: 1px solid var(--line-strong); border-radius: var(--radius-m); background: var(--surface-2); cursor: pointer; transition: border-color 0.15s, background 0.15s; }
.choice:hover { border-color: var(--bronze-line); }
.choice:has(input:checked) { border-color: var(--bronze); background: var(--bronze-soft); }
.choice input { margin-top: 3px; accent-color: var(--bronze); }
.choice span { display: flex; flex-direction: column; gap: 2px; font-size: 12.5px; color: var(--faint); line-height: 1.4; }
.choice strong { font-size: 14.5px; font-weight: 500; color: var(--ivory); }
.segmented { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 999px; padding: 3px; background: var(--surface-2); }
.segmented label { position: relative; }
.segmented input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.segmented span { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; padding: 7px 14px; border-radius: 999px; font-size: 14px; color: var(--muted); }
.segmented input:checked + span { background: var(--bronze); color: var(--base); font-weight: 600; }
.segmented input:focus-visible + span { outline: 2px solid var(--brass); outline-offset: 1px; }
.targets-hero { padding: 18px 20px; border-radius: var(--radius-m); background: var(--surface-2); margin-bottom: 8px; }
.targets-macros { display: flex; gap: 22px; margin: 12px 0 8px; flex-wrap: wrap; }
.targets-macros span { display: flex; flex-direction: column; font-size: 12.5px; color: var(--faint); }
.targets-macros strong { font-size: 16px; font-weight: 500; color: var(--ivory); }
.wizard-done { text-align: center; }
.wizard-done .list { text-align: left; margin: 18px 0; }
.wizard-done .form-actions { justify-content: center; }
label.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14px; color: var(--muted); }
label.switch input[type="checkbox"] { appearance: none; width: 42px; height: 24px; border-radius: 999px; background: var(--surface-3); position: relative; transition: background 0.2s; cursor: pointer; margin: 0; }
label.switch input[type="checkbox"]::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--ivory); transition: transform 0.2s var(--ease); }
label.switch input[type="checkbox"]:checked { background: var(--patina); }
label.switch input[type="checkbox"]:checked::after { transform: translateX(18px); }
@media (max-width: 767px) {
  .coach-benefits, .choice-list.choice-grid { grid-template-columns: 1fr; }
  .wizard-card { padding: 20px 16px; }
  .wizard-card .field { grid-template-columns: 1fr; }
  .wizard-steps li { font-size: 10.5px; }
}

/* ---------- Konto / Onboarding / Paywall / Quellen (Phase 4c) -------- */
.account-logins { margin-top: 2px; }
label.row { cursor: pointer; }
input.switch { appearance: none; width: 42px; height: 24px; border-radius: 999px; background: var(--surface-3); position: relative; cursor: pointer; transition: background 0.2s; flex-shrink: 0; margin: 0; }
input.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--ivory); transition: transform 0.2s var(--ease); }
input.switch:checked { background: var(--patina); }
input.switch:checked::after { transform: translateX(18px); }
.danger-row .row-title { color: var(--rust); }
.danger-row .icon-lead { color: var(--rust); }
.export-status .status-line { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.spinner { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--line-strong); border-top-color: var(--bronze); animation: spin 0.9s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.macro-mode { margin: 8px 0 4px; }
.pct-grams { color: var(--faint); font-size: 13px; min-width: 48px; }
.pct-sum.off { color: var(--brass); }
.pace-preview { color: var(--brass) !important; }

.paywall { border-color: var(--bronze-line); background: radial-gradient(ellipse at 10% 0%, var(--bronze-soft), transparent 55%), var(--surface); }
.paywall-head { display: flex; gap: 14px; align-items: flex-start; }
.paywall-mark { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--bronze-soft); color: var(--brass); flex-shrink: 0; }
.paywall-line { color: var(--muted); font-size: 14px; margin-top: 4px; }
.paywall-features { list-style: none; display: grid; gap: 6px; margin: 14px 0; }
.paywall-features li { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ivory); }
.paywall-features .icon { color: var(--patina); }
.paywall-apps { color: var(--muted); font-size: 13.5px; }
.paywall-stores { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 12px; }
.paywall-compact { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--bronze-line); border-radius: var(--radius-m); background: var(--bronze-soft); font-size: 13.5px; margin: 10px 0; }
.paywall-compact .icon { color: var(--brass); flex-shrink: 0; margin-top: 2px; }
.paywall-compact strong { display: block; color: var(--ivory); font-weight: 500; }
.paywall-compact .paywall-line { display: block; margin-top: 2px; }
.paywall-compact .paywall-apps { display: block; margin-top: 4px; }

.source-topic .source-explanation { color: var(--muted); font-size: 14px; line-height: 1.55; margin-bottom: 12px; }
.source-list { list-style: none; display: grid; gap: 6px; }
.source-list a { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 10px 12px; border-radius: var(--radius-s); background: var(--surface-2); color: var(--ivory); }
.source-list a:hover { background: var(--surface-3); text-decoration: none; }
.source-claim { font-size: 14px; font-weight: 500; }
.source-citation { grid-column: 1; font-size: 12.5px; color: var(--faint); }
.source-list a .icon { grid-column: 2; grid-row: 1 / span 2; align-self: center; color: var(--faint); }
.source-disclaimer { margin: 8px 0 24px; }

.onboarding { max-width: 560px; margin: 0 auto; padding: 8px 0 40px; }
.portal-login .login-wrap:has(.onboarding) { max-width: 640px; }
.onboarding h1 { font-size: 26px; margin-bottom: 8px; }
.onboarding-sub { color: var(--muted); font-size: 15px; line-height: 1.5; margin-bottom: 22px; }
.onboarding-dots { list-style: none; display: flex; gap: 8px; margin: 10px 0 26px; }
.onboarding-dots li { width: 28px; height: 4px; border-radius: 999px; background: var(--surface-3); }
.onboarding-dots li.done { background: var(--bronze); }
.onboarding-alert { color: var(--rust); background: var(--rust-soft); border-radius: var(--radius-s); padding: 10px 14px; margin-bottom: 16px; font-size: 14px; }
.onboarding-form .field { grid-template-columns: minmax(120px, 160px) 1fr; }
.onboarding-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 22px; }
.onboarding-actions form { display: contents; }
.template-grid { display: grid; gap: 10px; }
.template-card { display: grid; gap: 3px; padding: 14px 16px; border: 1px solid var(--line-strong); border-radius: var(--radius-m); background: var(--surface); cursor: pointer; position: relative; }
.template-card input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.template-card:has(input:checked) { border-color: var(--bronze); box-shadow: 0 0 0 3px var(--bronze-soft); }
.template-card:has(input:focus-visible) { outline: 2px solid var(--brass); outline-offset: 2px; }
.template-name { font-weight: 500; color: var(--ivory); }
.template-desc { font-size: 13.5px; color: var(--muted); }
.template-cats { font-size: 12.5px; color: var(--faint); }
.onboarding-log { padding: 18px; }
@media (max-width: 767px) {
  .onboarding-form .field { grid-template-columns: 1fr; gap: 6px; }
  .onboarding-actions { flex-direction: column-reverse; }
  .onboarding-actions .btn { width: 100%; }
  .paywall-stores .btn { flex: 1; }
}

/* ---------- Leftovers: coach-waiting card ------------------------------- */
.coach-waiting { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-color: var(--bronze-line); background: radial-gradient(ellipse at 0% 50%, var(--bronze-soft), transparent 60%), var(--surface); }
.coach-waiting-link { display: flex; align-items: center; gap: 14px; flex: 1; min-width: 0; color: var(--ivory); }
.coach-waiting-link:hover { text-decoration: none; }
.coach-waiting-link .icon { color: var(--bronze); margin-left: auto; flex-shrink: 0; }
.coach-waiting-mark { height: 30px; width: auto; flex-shrink: 0; }
.coach-waiting-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.coach-waiting-text strong { font-weight: 600; font-size: 15px; }
.coach-waiting-text span { font-size: 12.5px; color: var(--muted); }

/* ---------- Polish 1: session finish, overlays above the tab bar ------- */
.finish-hero { display: flex; align-items: baseline; gap: 10px; margin-bottom: 4px; }
.finish-hero strong { font-family: var(--font-display); font-size: 44px; line-height: 1; font-weight: 400; color: var(--ivory); font-variant-numeric: tabular-nums; }
.finish-hero span { color: var(--muted); font-size: 15px; }
.finish-meta { color: var(--faint); font-size: 13.5px; margin-bottom: 10px; }
.finish-open { color: var(--brass); font-size: 14px; margin: 4px 0 8px; }
.island-confirm .sheet-body p { color: var(--muted); }
@media (max-width: 767px) {
  .island-overlay { padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); }
  .island-sheet { max-height: calc(100dvh - var(--tabbar-h) - env(safe-area-inset-bottom) - 12px); }
}

/* ---------- Polish 2: week cards on phones, activity table, empty states -- */
.week-cards { display: none; }
.week-day { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-bottom: 1px solid var(--line); }
.week-day:last-child { border-bottom: 0; }
.week-day.today-row { background: var(--bronze-soft); }
.week-day.future { opacity: 0.45; }
.week-day-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; color: var(--ivory); }
.week-day-main:hover { text-decoration: none; }
.week-day-name { font-size: 14.5px; font-weight: 500; }
.week-day-macros { font-size: 12px; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.week-day-kcal { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; font-variant-numeric: tabular-nums; font-size: 12.5px; }
.week-day-kcal strong { font-size: 15px; color: var(--ivory); font-weight: 500; }
.week-avg { background: var(--surface-2); }
.week-avg .week-day-name { color: var(--muted); }
.kcal-line.no-goal a { color: var(--brass); }
.weigh-list .row { flex-wrap: nowrap; }
.weigh-list .row-title { white-space: normal; }
.empty .btn { margin-top: 14px; }
@media (max-width: 767px) {
  .week-table { display: none; }
  .week-cards { display: block; }
  .activity-table th:nth-child(3), .activity-table td:nth-child(3) { display: none; }
}
@media (max-width: 767px) { .kcal-line.no-goal { display: block; font-size: 13.5px; text-align: center; } }

/* ---------- Web Push (ADR-0059) ------------------------------------- */
.push-row .link-button { font-size: 12.5px; margin-left: 6px; }

/* ---------- Polish 3: focus, day tools, first log, menus, week chart ---- */
input[type="checkbox"]:focus-visible, label.switch input[type="checkbox"]:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; }
h2.coach-kind { margin: 0; }
h2.group-title { font-family: var(--font-ui); font-size: 13px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--faint); padding: 0 0 6px; }
.menu.up .menu-list { top: auto; bottom: calc(100% + 6px); }
.day-tools { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 20px; }
.day-tools .card { margin-bottom: 0; padding: 14px 18px; }
.day-tools .chips-row { margin-top: 10px; }
.day-tools .chip { padding: 5px 11px; font-size: 12.5px; }
.day-tools .water-head { margin-bottom: 6px; }
.supps-compact > summary { list-style: none; cursor: pointer; }
.supps-compact > summary::-webkit-details-marker { display: none; }
.supps-compact .supps-names { font-size: 12.5px; color: var(--faint); margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.supps-compact[open] .supps-names { display: none; }
.first-log { text-align: center; padding: 34px 24px; border-color: var(--bronze-line); background: radial-gradient(ellipse at 50% 0%, var(--bronze-soft), transparent 60%), var(--surface); }
.first-log h2 { font-size: 24px; margin: 10px 0 6px; }
.first-log p { color: var(--muted); max-width: 46ch; margin: 0 auto 16px; }
.first-log .icon { width: 32px; height: 32px; color: var(--bronze); }
.week-chart { padding: 18px 22px; }
.week-chart .chart { height: 180px; }
@media (max-width: 767px) {
  .day-tools { grid-template-columns: 1fr; gap: 10px; }
  .hero-number small { display: block; margin: 4px 0 0; }
  .week-chart .chart { height: 150px; }
}

/* ---------- Polish 4 --------------------------------------------------- */
/* Menus: keyboard focus looks like hover; group labels inside menus */
.menu-list a:focus-visible, .menu-list button:focus-visible { background: var(--surface-2); outline: 2px solid var(--bronze-line); outline-offset: -2px; }
.menu-list .group-label { padding: 8px 12px 2px; }
.menu-list .group-label:first-child { padding-top: 4px; }
.meal-tools details.menu + details.menu { margin-left: -4px; }

/* ⌘K command palette */
.palette-open { margin-top: -10px; border: 0; background: none; cursor: pointer; width: 100%; font-family: inherit; }
.palette-open .nav-kbd { margin-left: auto; }
.kbd-btn { background: none; cursor: pointer; }
.kbd-btn:hover { color: var(--ivory); border-color: var(--bronze-line); }
dialog.palette {
  background: var(--surface); color: var(--ivory); border: 1px solid var(--line-strong); border-radius: var(--radius-xl);
  padding: 0; width: min(620px, calc(100vw - 32px)); margin: 12vh auto auto; box-shadow: var(--shadow-2);
  overflow: hidden; animation: sheet-in 0.2s var(--ease) both;
}
dialog.palette::backdrop { background: rgba(0, 0, 0, 0.5); backdrop-filter: blur(6px); animation: fade-in 0.2s both; }
.palette-field { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.palette-field .icon { color: var(--bronze); flex-shrink: 0; }
.palette-field input { flex: 1; background: none; border: 0; padding: 4px 0; font-size: 17px; color: var(--ivory); box-shadow: none; outline: none; }
.palette-field input:focus { box-shadow: none; outline: none; }
.palette-results { max-height: min(420px, 56vh); overflow-y: auto; padding: 6px 8px 8px; overscroll-behavior: contain; }
.palette-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--radius-s); cursor: pointer; font-size: 14.5px; }
.palette-item .icon { width: 18px; height: 18px; color: var(--faint); flex-shrink: 0; }
.palette-item[aria-selected="true"] { background: var(--bronze-soft); color: var(--ivory); }
.palette-item[aria-selected="true"] .icon { color: var(--brass); }
.palette-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.palette-hint { color: var(--faint); font-size: 12.5px; }
.palette-empty { color: var(--faint); padding: 18px 12px; font-size: 14px; }
.palette-foot { display: flex; gap: 18px; flex-wrap: wrap; padding: 10px 18px; border-top: 1px solid var(--line); color: var(--faint); font-size: 12px; }
.palette-foot .kbd { margin-right: 2px; padding: 0 5px; }
@media (max-width: 767px) {
  dialog.palette { margin: 8px auto auto; width: calc(100vw - 16px); }
  .palette-foot { display: none; }
  .palette-field input { font-size: 16px; }
}
@media (hover: none) { .kbd-btn { display: none; } }

/* Training history: filters + month groups */
.history-filters { display: flex; flex-direction: column; gap: 12px; margin-bottom: 18px; }
.history-filters .search-field { max-width: 420px; }
turbo-frame#history-results { display: block; }
turbo-frame#history-results > .chips-row { margin-bottom: 18px; }
.history-month + .history-month { margin-top: 20px; }
.history-month .group-label { padding: 0 4px 8px; }
turbo-frame#history-results[busy] { opacity: 0.6; transition: opacity 0.15s; }

/* Session focus mode: the workout owns the screen — no subnav, the sidebar
   shrinks to the icon rail, and on phones the tab bar steps aside (Später
   leaves the session). */
body:has(.session-page) .subnav { display: none; }
@media (min-width: 1024px) {
  body:has(.session-page) .app { grid-template-columns: var(--rail-w) minmax(0, 1fr); background: linear-gradient(90deg, var(--surface) 0 var(--rail-w), var(--base) var(--rail-w)); }
  body:has(.session-page) .sidebar { padding: 22px 12px 16px; gap: 18px; }
  body:has(.session-page) .brand { justify-content: center; padding: 0; }
  body:has(.session-page) .brand .wordmark { display: none; }
  body:has(.session-page) .brand .mark { display: block; }
  body:has(.session-page) .nav-item { justify-content: center; padding: 11px 0; }
  body:has(.session-page) .nav-item span, body:has(.session-page) .user-chip span:not(.avatar), body:has(.session-page) .nav-item .nav-kbd { display: none; }
  body:has(.session-page) .user-chip { justify-content: center; padding: 8px 0; }
}
@media (max-width: 767px) {
  body:has(.session-page) .tabbar { display: none; }
  body:has(.session-page) .content { padding-bottom: calc(env(safe-area-inset-bottom) + 32px); }
  body:has(.session-page) .toasts { bottom: calc(env(safe-area-inset-bottom) + 12px); }
  body:has(.session-page) .island-overlay { padding-bottom: 0; }
  body:has(.session-page) .island-sheet { max-height: calc(100dvh - env(safe-area-inset-bottom) - 12px); }
}

/* Date fields in the page language (localdate_controller) */
.localdate { position: relative; display: inline-flex; }
.localdate > input { width: 100%; }
.localdate-label { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); pointer-events: none; color: var(--ivory); font-size: 14.5px; white-space: nowrap; display: none; }
.localdate.filled:not(:focus-within) > input { color: transparent; }
.localdate.filled:not(:focus-within) > input::-webkit-datetime-edit { color: transparent; }
.localdate.filled:not(:focus-within) .localdate-label { display: block; }
body:has(.session-page) .content { margin-inline: auto; }
#weigh-in { scroll-margin-top: 96px; }
