/* DU PRÉ NUTRITION — a Du Pré Games mini. Brand: logo blue, black outlines, Luckiest Guy display type. */
@font-face {
  font-family: "Luckiest Guy";
  src: url("vendor/fonts/LuckiestGuy-Regular.ttf") format("truetype");
  font-display: swap;
}

/* ---------- Tokens ---------- */
:root {
  --bg: #f3f6fb;
  --surface: #ffffff;
  --surface-2: #eaeff7;
  --text: #11151c;
  --muted: #5a6475;
  --line: #dfe5ee;
  --accent: #0066ff;          /* logo blue: fills, ring, bars */
  --accent-hover: #0057db;
  --accent-press: #003f9e;    /* the "3D" edge under game-style buttons */
  --accent-soft: #e5efff;
  --accent-text: #0057d9;     /* blue that's readable as text */
  --highlight: #80b4ff;       /* the light stripe in the logo */
  --on-accent: #ffffff;
  --ink: #0a0a0a;             /* logo outline black */
  --danger: #d02f1d;
  --danger-soft: #fdecea;
  --protein: #8b5cf6;
  --carbs: #e09a00;
  --fat: #e5487f;
  --toast-action: #80b4ff;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 6px 18px rgba(16, 24, 40, .06);
  --shadow-lg: 0 10px 30px rgba(16, 24, 40, .18);
  --radius: 18px;
  --tabbar-h: 64px;
  --display: "Luckiest Guy", "Arial Black", Impact, system-ui, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0c0f15;
    --surface: #161b24;
    --surface-2: #212836;
    --text: #eef1f6;
    --muted: #9aa4b5;
    --line: #2a3242;
    --accent-hover: #1a75ff;
    --accent-soft: #0f2346;
    --accent-text: #7fb0ff;
    --danger: #f97066;
    --danger-soft: #3a1714;
    --protein: #a78bfa;
    --carbs: #f2b52c;
    --fat: #f06f9c;
    --toast-action: #0057d9;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, .5);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0c0f15; --surface: #161b24; --surface-2: #212836; --text: #eef1f6; --muted: #9aa4b5; --line: #2a3242;
  --accent-hover: #1a75ff; --accent-soft: #0f2346; --accent-text: #7fb0ff;
  --danger: #f97066; --danger-soft: #3a1714; --protein: #a78bfa; --carbs: #f2b52c; --fat: #f06f9c; --toast-action: #0057d9;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3); --shadow-lg: 0 10px 30px rgba(0, 0, 0, .5);
  color-scheme: dark;
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
body.sheet-open { overflow: hidden; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
button:disabled { cursor: default; }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 2px; border-radius: 10px; }
[hidden] { display: none !important; }
.num, b, .entry-kcal { font-variant-numeric: tabular-nums; }

.app { max-width: 560px; margin: 0 auto; min-height: 100vh; }
.view { padding: 8px 16px calc(var(--tabbar-h) + 96px + env(safe-area-inset-bottom)); }

/* ---------- Headers ---------- */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 0 12px; }
.date-title { display: flex; flex-direction: column; align-items: center; line-height: 1.2; padding: 4px 12px; border-radius: 12px; }
.date-title span { font-family: var(--display); text-transform: uppercase; font-size: 1.45rem; font-weight: 400; letter-spacing: .03em; line-height: 1.15; }
.date-title small { color: var(--muted); font-size: .85rem; }
.date-title:not(:disabled):hover { background: var(--surface-2); }
.page-head { padding: 16px 0 12px; }
.page-head h1 { margin: 0; font-family: var(--display); text-transform: uppercase; font-weight: 400; font-size: 1.9rem; letter-spacing: .03em; line-height: 1.1; }
.icon-btn { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; color: var(--text); }
.icon-btn:hover:not(:disabled) { background: var(--surface-2); }
.icon-btn:disabled { opacity: .25; }

/* ---------- Cards ---------- */
.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; margin-bottom: 12px; }
.card h2 { font-family: var(--display); text-transform: uppercase; font-weight: 400; font-size: 1.2rem; letter-spacing: .04em; margin: 0 0 12px; }

/* Summary */
.summary { display: grid; grid-template-columns: auto 1fr; gap: 16px 20px; align-items: center; padding: 20px; }
.ring { position: relative; width: 136px; height: 136px; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); stroke-width: 11; }
.ring-track { stroke: var(--surface-2); }
.ring-fill { stroke: var(--accent); transition: stroke-dashoffset .5s ease; }
.ring.over .ring-fill { stroke: var(--danger); }
.ring-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.ring-center b { font-family: var(--display); text-transform: uppercase; font-weight: 400; font-size: 1.95rem; line-height: 1; letter-spacing: .02em; padding-top: 5px; }
.ring-center span { font-size: .8rem; color: var(--muted); }
.ring.over .ring-center span { color: var(--danger); font-weight: 600; }
.summary-side { display: grid; gap: 10px; }
.stat span { display: block; font-size: .8rem; color: var(--muted); }
.stat b { font-size: 1.25rem; }
.stat small { color: var(--muted); font-size: .8rem; font-weight: 500; }
.macros { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.macro-top { display: flex; flex-direction: column; font-size: .8rem; color: var(--muted); margin-bottom: 6px; }
.macro-top b { color: var(--text); font-size: 1rem; }
.bar { height: 6px; border-radius: 4px; background: var(--surface-2); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 4px; transition: width .4s ease; }
.macro-protein .bar i, .dot-protein { background: var(--protein); }
.macro-carbs .bar i, .dot-carbs { background: var(--carbs); }
.macro-fat .bar i, .dot-fat { background: var(--fat); }

.banner { width: 100%; display: flex; align-items: center; gap: 12px; text-align: left; background: var(--accent-soft); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 12px; font-size: .9rem; }
.banner span { flex: 1; }
.banner > svg { color: var(--accent-text); }

/* Meals */
.meal { padding: 6px 0; }
.meal-head { display: flex; align-items: baseline; justify-content: space-between; padding: 10px 16px 6px; }
.meal-head h2 { margin: 0; font-family: var(--display); text-transform: uppercase; font-weight: 400; font-size: 1.2rem; letter-spacing: .04em; }
.meal-kcal { color: var(--muted); font-size: .9rem; font-weight: 600; }
.entries { list-style: none; margin: 0; padding: 0; }
.entry { width: 100%; display: flex; align-items: center; gap: 12px; padding: 10px 16px; text-align: left; }
.entry:hover { background: var(--surface-2); }
.entry-main { flex: 1; min-width: 0; }
.entry-name { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.entry-sub { display: block; font-size: .82rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.entry-kcal { font-weight: 700; text-align: right; white-space: nowrap; }
.entry-kcal small { font-weight: 500; color: var(--muted); font-size: .75rem; margin-left: 2px; }
.add-row { display: flex; align-items: center; gap: 6px; width: 100%; padding: 10px 16px 12px; color: var(--accent-text); font-weight: 650; }
.add-row svg { width: 20px; height: 20px; }
.add-row:hover { text-decoration: underline; }

/* ---------- Dock & tab bar ---------- */
.dock {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(var(--tabbar-h) + 14px + env(safe-area-inset-bottom));
  display: flex; gap: 10px; z-index: 20;
}
.fab, .fab-scan {
  height: 58px; border-radius: 18px; display: flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--accent); color: var(--on-accent); border: 3px solid var(--ink);
  font-family: var(--display); text-transform: uppercase; font-size: 1.3rem; letter-spacing: .02em;
  box-shadow: 0 5px 0 var(--ink), var(--shadow-lg);
  transition: transform .08s ease, box-shadow .08s ease, background .12s;
}
.fab { padding: 4px 26px 0 20px; white-space: nowrap; }
.fab svg { stroke-width: 3.2; margin-top: -4px; }
.fab-scan { width: 58px; padding: 0; background: #ffffff; color: var(--ink); }
.fab-scan svg { stroke-width: 2.4; }
.fab:hover { background: var(--accent-hover); }
.fab:active, .fab-scan:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--ink), var(--shadow); }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 15;
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
  display: flex; justify-content: center;
  background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
}
.tabbar button { flex: 1; max-width: 186px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--muted); font-size: .75rem; font-weight: 600; }
.tabbar button[aria-current="page"] { color: var(--accent-text); }

/* ---------- Buttons & inputs ---------- */
.primary, .secondary, .danger-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 20px; border-radius: 14px; font-weight: 700;
}
.primary { background: var(--accent); color: var(--on-accent); box-shadow: 0 4px 0 var(--accent-press); transition: transform .08s, box-shadow .08s, background .12s; }
.primary:hover:not(:disabled) { background: var(--accent-hover); }
.primary:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 1px 0 var(--accent-press); }
.primary.block { font-family: var(--display); text-transform: uppercase; font-weight: 400; font-size: 1.25rem; letter-spacing: .03em; padding-top: 4px; min-height: 54px; }
.primary:disabled { opacity: .45; }
.secondary { background: var(--surface-2); color: var(--text); }
.secondary:hover { background: var(--line); }
.danger-btn { background: var(--danger-soft); color: var(--danger); }
.block { width: 100%; }
.link { color: var(--accent-text); font-weight: 650; text-decoration: underline; text-underline-offset: 2px; }
.danger-link { display: block; margin: 14px auto 0; color: var(--danger); font-weight: 650; padding: 8px 12px; }
.row-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.row-btns > * { flex: 1 1 auto; }

.field { display: block; }
.field > span { display: block; font-size: .85rem; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.input, .input-unit {
  width: 100%; min-height: 50px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface);
}
.input { padding: 0 14px; font-size: 16px; }
.input:focus, .input-unit:focus-within { border-color: var(--accent); outline: none; }
.input-unit { display: flex; align-items: center; overflow: hidden; }
.input-unit input { flex: 1; width: 0; min-width: 0; height: 47px; border: 0; background: transparent; padding: 0 0 0 14px; font-size: 17px; font-weight: 600; outline: none; }
.input-unit em { font-style: normal; color: var(--muted); padding: 0 14px 0 6px; font-size: .9rem; }
select.input { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 20px) 50%, calc(100% - 15px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 36px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.stack { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.hint { font-size: .85rem; color: var(--muted); margin: 8px 0 0; }
.hint b { color: var(--text); }

.seg { display: flex; background: var(--surface-2); border-radius: 12px; padding: 4px; gap: 4px; }
.seg button { flex: 1; min-height: 40px; border-radius: 9px; font-weight: 650; font-size: .92rem; color: var(--muted); padding: 0 8px; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { min-height: 38px; padding: 0 14px; border-radius: 19px; border: 1.5px solid var(--line); font-weight: 600; font-size: .9rem; background: var(--surface); }
.chip:hover { border-color: var(--muted); }
.chip[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--text); }

/* ---------- Sheet ---------- */
.sheet { position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(8, 10, 14, .45); animation: fade .2s ease; }
.sheet-panel {
  position: relative; width: 100%; max-width: 560px; height: 94vh; height: 94dvh;
  background: var(--bg); border-radius: 22px 22px 0 0; box-shadow: var(--shadow-lg);
  overflow-y: auto; overscroll-behavior: contain; animation: slideup .25s cubic-bezier(.2, .8, .2, 1);
  padding-bottom: calc(24px + env(safe-area-inset-bottom));
}
@media (min-width: 640px) {
  .sheet { align-items: center; }
  .sheet-panel { height: min(820px, 90vh); border-radius: 22px; }
}
@keyframes slideup { from { transform: translateY(40px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }
.sheet-head {
  position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 4px;
  padding: 8px 8px; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.sheet-head h2 { flex: 1; margin: 0; text-align: center; font-family: var(--display); text-transform: uppercase; font-weight: 400; font-size: 1.3rem; letter-spacing: .04em; padding-top: 4px; }
.sheet-head .spacer { width: 44px; }
.sheet-content { padding: 4px 16px 8px; }
.section-label { font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 18px 0 8px; }

.search { display: flex; align-items: center; gap: 8px; min-height: 52px; padding: 0 14px; border-radius: 14px; background: var(--surface); border: 1.5px solid var(--line); margin-top: 12px; }
.search:focus-within { border-color: var(--accent); }
.search svg { color: var(--muted); }
.search input { flex: 1; min-width: 0; height: 48px; border: 0; background: transparent; outline: none; font-size: 17px; }
.search input::-webkit-search-cancel-button { display: none; }

.big-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.big-btn { display: flex; align-items: center; gap: 12px; text-align: left; min-height: 64px; padding: 10px 14px; border-radius: 14px; background: var(--surface); box-shadow: var(--shadow); font-weight: 700; }
.big-btn:hover { background: var(--surface-2); }
.big-btn small { display: block; font-weight: 500; font-size: .78rem; color: var(--muted); }
.big-btn .ico { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); flex: none; }

.list { background: var(--surface); border-radius: 14px; box-shadow: var(--shadow); overflow: hidden; }
.food-row { width: 100%; display: flex; align-items: center; gap: 12px; padding: 12px 14px; text-align: left; border-top: 1px solid var(--line); }
.food-row:first-child { border-top: 0; }
.food-row:hover { background: var(--surface-2); }
.food-main { flex: 1; min-width: 0; }
.food-name { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.food-sub { display: block; font-size: .82rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.food-row .plus { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); flex: none; }
.food-row .plus svg { width: 18px; height: 18px; stroke-width: 2.6; }
.tag { display: inline-block; font-size: .7rem; font-weight: 700; padding: 1px 6px; border-radius: 6px; background: var(--surface-2); color: var(--muted); margin-right: 4px; vertical-align: 1px; }
.empty { text-align: center; color: var(--muted); font-size: .9rem; padding: 18px 12px; }
.online-box { margin-top: 12px; }
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 3px solid var(--surface-2); border-top-color: var(--accent); animation: spin .8s linear infinite; display: inline-block; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 60px 20px; color: var(--muted); }
.loading .spinner { width: 36px; height: 36px; }

/* Food detail */
.food-hero { display: flex; align-items: center; gap: 14px; margin: 6px 0 4px; }
.food-hero img { width: 64px; height: 64px; object-fit: contain; border-radius: 12px; background: #fff; flex: none; }
.food-hero h3 { margin: 0; font-size: 1.25rem; line-height: 1.25; }
.food-hero p { margin: 2px 0 0; color: var(--muted); font-size: .9rem; }
.qty-row { display: flex; gap: 8px; align-items: stretch; }
.qty-row .input-unit { flex: 1; min-height: 56px; }
.qty-row .input-unit input { font-size: 1.5rem; text-align: center; padding: 0; }
.step { width: 56px; border-radius: 14px; background: var(--surface); border: 1.5px solid var(--line); font-size: 1.6rem; font-weight: 500; line-height: 1; }
.step:hover { background: var(--surface-2); }
.result { background: var(--surface); border-radius: 16px; box-shadow: var(--shadow); padding: 16px; margin-top: 16px; text-align: center; }
.result-kcal b { font-family: var(--display); text-transform: uppercase; font-weight: 400; font-size: 2.7rem; letter-spacing: .02em; line-height: 1; }
.result-kcal span { color: var(--muted); font-weight: 600; margin-left: 4px; }
.result-macros { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px 16px; margin-top: 10px; font-size: .9rem; color: var(--muted); }
.result-macros b { color: var(--text); }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; vertical-align: 0; }
.fineprint { font-size: .8rem; color: var(--muted); text-align: center; margin: 18px 0 0; }

/* Scanner */
.scanner { position: relative; border-radius: 18px; overflow: hidden; background: #000; aspect-ratio: 4 / 3; margin-top: 8px; }
#reader { width: 100%; height: 100%; }
#reader video { width: 100% !important; height: 100% !important; object-fit: cover; display: block; }
.scan-status { text-align: center; color: var(--muted); margin: 12px 0; min-height: 1.5em; }
.or { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: .85rem; margin: 18px 0 12px; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.inline-form { display: flex; gap: 8px; }
.inline-form .input { flex: 1; width: 0; min-width: 0; }

/* ---------- History ---------- */
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 12px; }
.tile { background: var(--surface); border-radius: 16px; box-shadow: var(--shadow); padding: 12px 14px; }
.tile span { display: block; font-size: .78rem; color: var(--muted); }
.tile b { font-family: var(--display); text-transform: uppercase; font-weight: 400; font-size: 1.5rem; letter-spacing: .03em; }
.tile small { font-size: .78rem; color: var(--muted); font-weight: 500; }
.chart-wrap { position: relative; padding-top: 8px; }
.chart { position: relative; height: 180px; display: flex; align-items: flex-end; gap: 2px; border-bottom: 1px solid var(--line); }
.chart .col { position: relative; flex: 1; height: 100%; display: flex; align-items: flex-end; justify-content: center; border-radius: 0; }
.chart .col i { display: block; width: min(70%, 28px); height: var(--h); min-height: 0; background: var(--accent); border-radius: 4px 4px 0 0; opacity: .9; transition: opacity .12s; }
.chart .col.empty i { height: 0; }
.chart:hover .col i { opacity: .55; }
.chart .col:hover i, .chart .col:focus-visible i, .chart .col.active i { opacity: 1; }
.goal-line { position: absolute; left: 0; right: 0; border-top: 2px dashed var(--muted); pointer-events: none; opacity: .7; }
.goal-line span { position: absolute; right: 0; top: -20px; font-size: .72rem; color: var(--muted); background: var(--surface); padding: 0 4px; font-weight: 600; }
.xlabels { display: flex; gap: 2px; margin-top: 6px; }
.xlabels span { flex: 1; text-align: center; font-size: .72rem; color: var(--muted); white-space: nowrap; }
.tip {
  position: absolute; z-index: 3; transform: translateX(-50%); pointer-events: none; white-space: nowrap;
  background: var(--text); color: var(--bg); border-radius: 10px; padding: 8px 10px; font-size: .8rem; line-height: 1.35; box-shadow: var(--shadow-lg);
}
.tip b { font-size: .95rem; }
.day-row { width: 100%; display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 12px 14px; text-align: left; border-top: 1px solid var(--line); }
.day-row:first-child { border-top: 0; }
.day-row:hover { background: var(--surface-2); }
.day-row .bar { grid-column: 1 / -1; }
.day-row .bar i { background: var(--accent); }
.day-row .muted { color: var(--muted); font-size: .82rem; }

/* ---------- Settings ---------- */
.calc { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.calc-result { background: var(--accent-soft); border-radius: 14px; padding: 14px; margin-top: 4px; }
.calc-result b { font-family: var(--display); text-transform: uppercase; font-weight: 400; font-size: 1.7rem; letter-spacing: .02em; }
.calc-result p { margin: 4px 0 12px; font-size: .88rem; color: var(--muted); }
.myfood { display: flex; align-items: center; gap: 8px; padding: 10px 0; border-top: 1px solid var(--line); }
.myfood:first-of-type { border-top: 0; }
.myfood .food-main { flex: 1; }
.about p { font-size: .88rem; color: var(--muted); margin: 0 0 8px; }
.about a { color: var(--accent-text); }

/* ---------- Toast & dialog ---------- */
.toast {
  position: fixed; left: 50%; transform: translateX(-50%); z-index: 80;
  bottom: calc(var(--tabbar-h) + 84px + env(safe-area-inset-bottom));
  display: flex; align-items: center; gap: 14px; max-width: calc(100% - 32px);
  background: var(--text); color: var(--bg); padding: 12px 16px; border-radius: 14px; box-shadow: var(--shadow-lg);
  font-weight: 600; font-size: .92rem; animation: slideup .2s ease;
}
.toast button { color: var(--toast-action); font-weight: 800; text-transform: uppercase; font-size: .82rem; letter-spacing: .04em; padding: 4px; }
.confirm { border: 0; border-radius: 20px; padding: 22px; max-width: 360px; width: calc(100% - 32px); background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg); }
.confirm::backdrop { background: rgba(8, 10, 14, .5); }
.confirm p { margin: 0 0 18px; font-size: 1rem; }
.confirm-btns { display: flex; gap: 10px; }
.confirm-btns button { flex: 1; }
.confirm .primary.danger { background: var(--danger); color: #fff; }

@media (max-width: 380px) {
  .summary { grid-template-columns: 1fr; justify-items: center; }
  .summary-side { grid-auto-flow: column; gap: 28px; text-align: center; }
  .big-actions { grid-template-columns: 1fr; }
  .tiles { grid-template-columns: 1fr 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Brand ---------- */
.brandbar { display: flex; align-items: center; justify-content: center; padding: 14px 0 0; }
.brandbar img { height: 34px; width: auto; display: block; }
.credit { display: flex; flex-direction: column; align-items: center; gap: 6px; margin: 24px auto 0; padding: 10px 14px; color: var(--muted); font-size: .78rem; font-weight: 600; text-decoration: none; width: max-content; border-radius: 14px; }
.credit img { height: 44px; width: auto; display: block; }
.credit:hover { background: var(--surface-2); }
.about-brand { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.about-brand img { width: 112px; height: auto; flex: none; }
.about-brand p { margin: 0; }
