[hidden] { display: none !important; }
:root {
  --bg: #fbf7f4;
  --card: #ffffff;
  --ink: #2a1a20;
  --muted: #7d6b72;
  --line: #eadfe2;
  --brand: #b3133a;
  --brand-2: #e8365a;
  --brand-soft: #fde6ea;
  --leaf: #3f8f46;
  --protein: #3b7dd8;
  --carbs: #e0a020;
  --fat: #e8365a;
  --tl-low: #2e9e4f;
  --tl-med: #e8a317;
  --tl-high: #d7263d;
  --shadow: 0 1px 2px rgba(60, 20, 35, .06), 0 4px 16px rgba(60, 20, 35, .06);
  --radius: 16px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #17110f;
    --card: #231a1d;
    --ink: #f4eaee;
    --muted: #b49ea7;
    --line: #3a2b31;
    --brand: #ff6b85;
    --brand-2: #ff97a8;
    --brand-soft: #3d1a22;
    --leaf: #7bc47f;
    --protein: #6ea6f0;
    --carbs: #f0bd4e;
    --fat: #ff97a8;
    --shadow: none;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, system-ui, sans-serif;
  padding-bottom: calc(96px + env(safe-area-inset-bottom));
  overscroll-behavior-y: none;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
a { color: var(--brand); }

.top {
  position: sticky; top: 0; z-index: 5;
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 8px;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 20px; color: var(--brand); letter-spacing: -.02em; }
.brand img { width: 28px; height: 28px; border-radius: 8px; }
.datenav { display: flex; justify-content: center; align-items: center; gap: 2px; }
.datenav button { background: none; border: 0; padding: 6px 10px; border-radius: 10px; font-size: 18px; }
.datenav .datelabel { font-size: 15px; font-weight: 600; min-width: 96px; }
.datenav button:active { background: var(--brand-soft); }
.iconbtn { background: none; border: 0; width: 40px; height: 40px; border-radius: 12px; font-size: 20px; }
.iconbtn:active { background: var(--brand-soft); }

main { max-width: 560px; margin: 0 auto; padding: 12px 16px; }
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--line); padding: 16px; margin-bottom: 12px; }

/* Summary */
.summary .row { display: flex; align-items: center; gap: 16px; }
.ring { position: relative; width: 118px; height: 118px; flex: none; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring .track { stroke: var(--line); }
.ring .val { stroke: var(--brand-2); transition: stroke-dashoffset .5s; }
.ring.over .val { stroke: var(--tl-high); }
.ring .label { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.ring .big { font-size: 26px; font-weight: 800; letter-spacing: -.02em; line-height: 1; }
.ring .small { font-size: 12px; color: var(--muted); margin-top: 2px; }
.macros { flex: 1; display: grid; gap: 10px; }
.macro .top-line { display: flex; justify-content: space-between; font-size: 13px; }
.macro .top-line b { font-weight: 600; }
.macro .top-line span { color: var(--muted); }
.bar { height: 7px; border-radius: 4px; background: var(--line); overflow: hidden; margin-top: 4px; }
.bar i { display: block; height: 100%; border-radius: 4px; transition: width .5s; }
.minis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.mini { text-align: center; font-size: 12px; color: var(--muted); }
.mini b { display: block; font-size: 15px; color: var(--ink); }
.mini.warn b { color: var(--tl-high); }

/* Meals */
.meal { padding: 0; overflow: hidden; }
.meal-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; }
.meal-head h3 { margin: 0; font-size: 16px; }
.meal-head .kcal { color: var(--muted); font-size: 14px; margin-left: 8px; font-weight: 400; }
.addbtn { border: 0; background: var(--brand-soft); color: var(--brand); font-weight: 600; border-radius: 999px; padding: 6px 14px; font-size: 14px; }
.entry { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; background: none; border: 0; border-top: 1px solid var(--line); padding: 10px 16px; }
.entry:active, .item:active { background: var(--brand-soft); }
.thumb { width: 40px; height: 40px; border-radius: 10px; background: var(--brand-soft); flex: none; object-fit: cover; display: grid; place-content: center; font-size: 18px; }
.entry .txt, .item .txt { flex: 1; min-width: 0; }
.entry .name, .item .name { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.entry .meta, .item .meta { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.entry .cal, .item .cal { font-weight: 600; font-size: 15px; white-space: nowrap; }
.empty { padding: 0 16px 14px; color: var(--muted); font-size: 14px; margin: 0; }
.foot { text-align: center; color: var(--muted); font-size: 12px; margin: 20px 0; }

.fab {
  position: fixed; right: 20px; bottom: calc(20px + env(safe-area-inset-bottom)); z-index: 6;
  width: 60px; height: 60px; border-radius: 50%; border: 0; font-size: 30px; line-height: 1;
  background: var(--brand); color: #fff; box-shadow: 0 6px 20px rgba(179, 19, 58, .35);
}
@media (prefers-color-scheme: dark) { .fab { color: #17110f; } }
.fab:active { transform: scale(.95); }

/* Sheets */
.sheet {
  position: fixed; inset: 0; z-index: 20; background: var(--bg);
  display: flex; flex-direction: column;
  animation: up .22s ease-out;
}
.sheet[hidden] { display: none; }
@keyframes up { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.sheet-head {
  display: grid; grid-template-columns: 40px 1fr 40px; align-items: center; gap: 8px;
  padding: calc(8px + env(safe-area-inset-top)) 12px 8px; border-bottom: 1px solid var(--line);
}
.sheet-head h2 { margin: 0; font-size: 17px; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sheet-head select { border: 0; background: var(--brand-soft); color: var(--brand); font-weight: 700; border-radius: 8px; padding: 2px 6px; }
.sheet-body { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 14px 16px calc(24px + env(safe-area-inset-bottom)); max-width: 560px; width: 100%; margin: 0 auto; }

.tabs { display: flex; gap: 4px; padding: 8px 12px; overflow-x: auto; border-bottom: 1px solid var(--line); scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { flex: 1; border: 0; background: none; padding: 8px 10px; border-radius: 999px; font-size: 14px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.tabs button.on { background: var(--brand); color: #fff; }
@media (prefers-color-scheme: dark) { .tabs button.on { color: #17110f; } }

.searchbar { display: flex; gap: 8px; margin-bottom: 12px; }
.searchbar input { flex: 1; min-width: 0; }
input, select { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 11px 12px; font-size: 16px; }
input:focus, select:focus { outline: 2px solid var(--brand-2); outline-offset: -1px; }
.searchbar button, .primary, .secondary, .danger { border: 0; border-radius: 12px; padding: 11px 16px; font-weight: 600; }
.searchbar button, .primary { background: var(--brand); color: #fff; }
@media (prefers-color-scheme: dark) { .searchbar button, .primary { color: #17110f; } }
.secondary { background: var(--brand-soft); color: var(--brand); }
.danger { background: none; color: var(--tl-high); border: 1px solid var(--line); }
.wide { display: block; width: 100%; margin-top: 10px; }
.filebtn { display: block; text-align: center; }

.list { display: grid; gap: 0; background: var(--card); border-radius: var(--radius); border: 1px solid var(--line); overflow: hidden; }
.list:empty { display: none; }
.item { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; background: none; border: 0; border-bottom: 1px solid var(--line); padding: 10px 12px; }
.item:last-child { border-bottom: 0; }
.tag { display: inline-block; font-size: 10px; font-weight: 700; padding: 1px 5px; border-radius: 4px; background: var(--brand-soft); color: var(--brand); margin-right: 4px; vertical-align: 1px; }
.status { color: var(--muted); font-size: 14px; text-align: center; padding: 16px 8px; }
.status:empty { display: none; }
.status.err { color: var(--tl-high); }
.hint { color: var(--muted); font-size: 14px; margin: 0 0 12px; }
.sub { font-size: 14px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin: 22px 0 8px; }

.scanopts { display: grid; gap: 10px; }
.scanopts .searchbar { margin: 6px 0 0; }
.live { position: relative; border-radius: var(--radius); overflow: hidden; background: #000; margin-bottom: 12px; }
.live video { width: 100%; display: block; aspect-ratio: 4/3; object-fit: cover; }
.live .reticle { position: absolute; left: 12%; right: 12%; top: 35%; bottom: 35%; border: 3px solid rgba(255,255,255,.85); border-radius: 12px; box-shadow: 0 0 0 999px rgba(0,0,0,.35); }
.live #stopLive { position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%); }

.quick { display: grid; gap: 12px; }
.quick label { display: grid; gap: 4px; font-size: 13px; color: var(--muted); font-weight: 600; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* Food detail */
.hero { display: flex; gap: 14px; align-items: center; margin-bottom: 14px; }
.hero img, .hero .thumb { width: 72px; height: 72px; border-radius: 14px; object-fit: cover; background: var(--brand-soft); }
.hero h3 { margin: 0 0 2px; font-size: 18px; }
.hero p { margin: 0; color: var(--muted); font-size: 13px; }
.amount { display: grid; grid-template-columns: 1fr 1.3fr; gap: 8px; margin-bottom: 8px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.chips button { border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 5px 12px; font-size: 13px; }
.bigcal { text-align: center; margin: 6px 0 14px; }
.bigcal b { font-size: 38px; letter-spacing: -.03em; }
.bigcal span { color: var(--muted); }
.nt { width: 100%; border-collapse: collapse; font-size: 15px; }
.nt td { padding: 9px 4px; border-bottom: 1px solid var(--line); }
.nt td:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.nt tr.subrow td:first-child { padding-left: 18px; color: var(--muted); }
.tl { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 14px 0 4px; }
.tl div { border-radius: 12px; padding: 8px 4px; text-align: center; font-size: 11px; font-weight: 600; color: #fff; }
.tl div b { display: block; font-size: 14px; }
.tl .low { background: var(--tl-low); } .tl .med { background: var(--tl-med); color: #2a1a00; } .tl .high { background: var(--tl-high); } .tl .na { background: var(--line); color: var(--muted); }
.tlnote { font-size: 11px; color: var(--muted); text-align: center; margin: 0 0 14px; }
.actions { display: grid; gap: 8px; margin-top: 18px; }

.toast {
  position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 999px; font-size: 14px; z-index: 50;
  box-shadow: var(--shadow); max-width: calc(100% - 32px); text-align: center;
}
.spinner { width: 22px; height: 22px; border: 3px solid var(--line); border-top-color: var(--brand-2); border-radius: 50%; animation: spin .8s linear infinite; margin: 0 auto; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Account */
.banner { display: flex; align-items: center; gap: 12px; background: var(--brand-soft); border-radius: var(--radius); padding: 10px 6px 10px 14px; margin-bottom: 12px; cursor: pointer; }
.banner p { margin: 0; flex: 1; font-size: 13px; }
.banner > span { font-size: 22px; }
.iconbtn.avatar { background: var(--brand); color: #fff; font-weight: 700; font-size: 16px; border-radius: 50%; width: 34px; height: 34px; }
@media (prefers-color-scheme: dark) { .iconbtn.avatar { color: #17110f; } }
.acct { display: flex; gap: 12px; align-items: center; margin-bottom: 10px; }
.avatar.big { width: 48px; height: 48px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-content: center; font-size: 22px; font-weight: 700; }
.acct .meta { font-size: 13px; color: var(--muted); }
details.link { margin-top: 14px; }
details.link summary { font-size: 14px; color: var(--brand); font-weight: 600; cursor: pointer; margin-bottom: 10px; }
.code { font-size: 36px; font-weight: 800; letter-spacing: .12em; text-align: center; margin: 14px 0 4px; font-variant-numeric: tabular-nums; }
.quick input, .grid2 > * { min-width: 0; width: 100%; }
.usericon { color: var(--brand); display: grid; place-content: center; }
.usericon:not(.avatar) { background: var(--brand-soft); border-radius: 50%; width: 36px; height: 36px; }
.banner .cloud { color: var(--brand); flex: none; }

/* Gousto */
.weeks { display: flex; gap: 6px; margin-bottom: 10px; }
.weeks button { flex: 1; border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 7px 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
.weeks button.on { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); }
#goustoFilter { width: 100%; margin-bottom: 4px; }
.item[role="button"] { cursor: pointer; }
.star { flex: none; border: 0; background: none; width: 36px; height: 36px; margin-right: -6px; border-radius: 50%; display: grid; place-content: center; }
.star svg { fill: none; stroke: var(--muted); stroke-width: 1.8; stroke-linejoin: round; }
.star.on svg { fill: var(--brand); stroke: var(--brand); }
.star:active { background: var(--brand-soft); }
.item.more { justify-content: center; color: var(--brand); font-weight: 600; font-size: 14px; }
.list > * { min-width: 0; }
#goustoMenu .name, #goustoSaved .name, #goustoCookbook .name { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.25; }
.item.loading { opacity: .5; pointer-events: none; }

/* Backup status dot on the avatar */
#openSettings { position: relative; }
#openSettings .dot { position: absolute; right: -1px; bottom: -1px; width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--bg); background: var(--tl-low); }
#openSettings[data-sync="busy"] .dot { background: var(--tl-med); }
#openSettings[data-sync="error"] .dot, #openSettings[data-sync="offline"] .dot { background: var(--muted); }
#openSettings[data-sync="error"] .dot { background: var(--tl-high); }

/* ---------- Tab bar ---------- */
body { padding-bottom: calc(150px + env(safe-area-inset-bottom)); }
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 7;
  display: flex; justify-content: center; gap: 8px;
  padding: 6px 16px calc(6px + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
}
.tabbar button { flex: 0 1 140px; border: 0; background: none; display: grid; justify-items: center; gap: 2px; padding: 4px 0; font-size: 11px; font-weight: 600; color: var(--muted); border-radius: 12px; }
.tabbar button.on { color: var(--brand); }
.fab { bottom: calc(76px + env(safe-area-inset-bottom)); }
.toast { bottom: calc(150px + env(safe-area-inset-bottom)); }
.viewtitle { margin: 0; text-align: center; font-size: 17px; }

/* ---------- Progress ---------- */
#progressView { max-width: 560px; margin: 0 auto; padding: 12px 16px; }
.ranges { margin-bottom: 12px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); text-align: center; }
.stats div { display: grid; gap: 2px; }
.stats b { font-size: 26px; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; }
.stats b small { font-size: 14px; color: var(--muted); font-weight: 600; }
.stats span { font-size: 12px; color: var(--muted); }
.statnote { margin: 12px 0 0; padding-top: 10px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); text-align: center; }
.ctitle { margin: 0 0 10px; font-size: 15px; }
.chartwrap { position: relative; }
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart .bar { fill: var(--brand-2); transition: opacity .15s; }
.chart .bar.over { fill: var(--brand); }
.chart .nolog { fill: var(--line); }
.chart .dim { opacity: .35; }
.chart .base { stroke: var(--line); stroke-width: 1; }
.chart .goal { stroke: var(--ink); stroke-width: 1.5; stroke-dasharray: 4 3; opacity: .55; }
.chart text { font-size: 10px; fill: var(--muted); }
.chart .goallabel { font-weight: 600; }
.chart .hit { fill: transparent; cursor: pointer; }
.tip { position: absolute; top: -6px; transform: translate(-50%, -100%); background: var(--ink); color: var(--bg); font-size: 12px; line-height: 1.45; padding: 8px 10px; border-radius: 10px; white-space: nowrap; z-index: 2; box-shadow: var(--shadow); text-align: center; }
.tiplink { border: 0; background: none; color: inherit; font: inherit; font-weight: 700; text-decoration: underline; padding: 4px 0 0; }
.chartnote { margin: 8px 0 0; font-size: 11px; color: var(--muted); }
.nrow { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.nrow:last-child { border-bottom: 0; }
.nlabel { display: flex; gap: 8px; align-items: baseline; font-size: 14px; }
.nlabel span { color: var(--ink); font-variant-numeric: tabular-nums; }
.nlabel i { color: var(--muted); font-style: normal; font-size: 12px; }
.nbar { grid-column: 1 / -1; position: relative; height: 7px; border-radius: 4px; background: var(--line); }
.nbar i { display: block; height: 100%; border-radius: 4px; background: var(--brand-2); }
.nbar em { position: absolute; top: -3px; bottom: -3px; width: 2px; margin-left: -1px; background: var(--ink); opacity: .5; border-radius: 1px; }
.nstatus { grid-row: 1; grid-column: 2; font-size: 12px; font-weight: 600; }
.nstatus .ok { color: var(--tl-low); } .nstatus .low, .nstatus .high { color: var(--tl-high); } .nstatus .muted { color: var(--muted); font-weight: 500; }
.mrow { display: grid; grid-template-columns: 78px 1fr 44px 34px; gap: 8px; align-items: center; font-size: 14px; padding: 5px 0; }
.mrow b { text-align: right; font-variant-numeric: tabular-nums; }
.mrow em { font-style: normal; color: var(--muted); font-size: 12px; text-align: right; }
.mbar { height: 7px; border-radius: 4px; background: var(--line); overflow: hidden; }
.mbar i { display: block; height: 100%; background: var(--brand-2); border-radius: 4px; }
.frow { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.frow:last-child { border-bottom: 0; }
.frow .txt { flex: 1; min-width: 0; }
.frow .name { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.frow .meta { font-size: 12px; color: var(--muted); }
.empty-progress { text-align: center; }
.empty-progress p { margin: 6px 0 0; }
.weekcard { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 12px 16px; }
.weekcard div { flex: 1; display: grid; gap: 2px; }
.weekcard b { font-size: 14px; }
.weekcard div span { font-size: 13px; color: var(--muted); }
.weekcard .chev { font-size: 22px; color: var(--brand); }

/* Everyday foods & combos */
#searchResults .sub:first-child, #recentList .sub:first-child { margin-top: 0; }
.parts { margin: 0 0 6px; }
.part { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.part .txt { flex: 1; min-width: 0; }
.part .name { font-size: 14px; }
.part .meta { font-size: 12px; color: var(--muted); }
.part.off .name { text-decoration: line-through; color: var(--muted); }
.stepper { display: flex; align-items: center; gap: 2px; background: var(--brand-soft); border-radius: 999px; padding: 2px; }
.stepper button { width: 32px; height: 32px; border: 0; border-radius: 50%; background: var(--card); color: var(--brand); font-size: 18px; font-weight: 700; line-height: 1; }
.stepper b { min-width: 26px; text-align: center; font-size: 14px; font-variant-numeric: tabular-nums; }
.saveusual { display: block; width: 100%; border: 0; border-top: 1px solid var(--line); background: none; color: var(--brand); font-weight: 600; font-size: 13px; padding: 10px 16px; text-align: left; }

/* Header: icon left, controls truly centred, account right */
.top { grid-template-columns: 1fr auto 1fr; }
.top .brand { justify-self: start; }
.top .brand img { width: 32px; height: 32px; border-radius: 9px; }
.top .datenav, .top .viewtitle { grid-column: 2; }
.top #openSettings { justify-self: end; grid-column: 3; }

/* iOS: solid bars. See-through (frosted) bars make iOS draw its own fade under the status bar. */
.top, .tabbar { background: var(--bg); backdrop-filter: none; -webkit-backdrop-filter: none; }
html { background: var(--bg); }

/* Home-screen app on iOS: the system dims and blurs a band just below the status bar.
   Sit the header controls below it so only plain header background is under the effect. */
@media (display-mode: standalone) {
  .top { padding-top: calc(env(safe-area-inset-top) + 24px); }
  .sheet-head { padding-top: calc(env(safe-area-inset-top) + 22px); }
}

/* Avatar: initials on the colour you picked */
.iconbtn.avatar, .avatar.big { background: var(--avatar, #b3133a); color: #fff; }
@media (prefers-color-scheme: dark) { .iconbtn.avatar { color: #fff; } }
.iconbtn.avatar .ini { font-size: 15px; font-weight: 700; line-height: 1; }
.iconbtn.avatar .ini.two { font-size: 13px; letter-spacing: -.02em; }
.avatar.big { font-size: 19px; letter-spacing: -.02em; }
#nameForm { margin: 4px 0 12px; }
.swatches { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 14px; }
.swatches button { width: 32px; height: 32px; border-radius: 50%; border: 0; padding: 0; box-shadow: 0 0 0 2px var(--bg), 0 0 0 3px transparent; }
.swatches button[aria-checked="true"] { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--ink); }
.swatches { gap: 7px; flex-wrap: nowrap; justify-content: space-between; }
.swatches button { width: 30px; height: 30px; flex: none; }

/* Avatar dot: only shown when backups are failing. */
#openSettings .dot { display: none; }
#openSettings[data-sync="error"] .dot { display: block; background: var(--tl-high); }

/* Add button in the tab bar (replaces the floating one) */
.fab { display: none !important; }
body { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
.toast { bottom: calc(96px + env(safe-area-inset-bottom)); }
.tabbar { align-items: end; }
.tabbar .addtab { color: var(--brand); }
.tabbar .addtab i { display: grid; place-content: center; width: 48px; height: 48px; margin-top: -18px; border-radius: 50%;
  background: var(--brand); color: #fff; box-shadow: 0 4px 14px rgba(179, 19, 58, .3); border: 3px solid var(--bg); }
@media (prefers-color-scheme: dark) { .tabbar .addtab i { color: #17110f; } }
.tabbar .addtab:active i { transform: scale(.94); }

/* Reminder settings */
.remrow { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.remrow:last-of-type { border-bottom: 0; }
.remrow b { font-size: 15px; }
.remrow input[type="time"] { padding: 7px 10px; min-width: 104px; }
.remrow input[type="time"]:disabled { opacity: .45; }
.switch { position: relative; width: 46px; height: 28px; flex: none; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: var(--line); transition: background .15s; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .15s; }
.switch input:checked + span { background: var(--brand); }
.switch input:checked + span::after { transform: translateX(18px); }
.switch input:focus-visible + span { outline: 2px solid var(--brand-2); outline-offset: 2px; }
.remon { color: var(--tl-low); font-weight: 600; margin: 10px 0 0; }
