/* Beepster "soft" look (after the Dribbble "Banking App UI" shot): light grey canvas, white borderless cards with
   big soft shadows, pastel gradients (accent, category icons, selected tabs, primary buttons, mic), thin big numbers.
   Loaded after styles.css; only restyles, no layout logic. Dark theme: deep navy with the same gradients. */

:root {
  --sx-accent: var(--tint, #ff6a2b);
  --sx-grad: var(--sx-accent);
  --sx-card: #ffffff;
  --sx-field: #f1f3f9;
  --sx-shadow: 0 14px 34px -16px rgb(76 88 140 / .30), 0 2px 6px -2px rgb(76 88 140 / .08);
  --sx-shadow-lg: 0 24px 50px -22px rgb(76 88 140 / .38);
  --sx-glow: 0 12px 26px -10px color-mix(in srgb, var(--sx-accent) 65%, transparent);
  --sx-radius: 22px;
}
@supports (color: oklch(from red l c h)) {
  :root { --sx-grad: linear-gradient(135deg, oklch(from var(--sx-accent) calc(l + .08) c calc(h - 28)), oklch(from var(--sx-accent) calc(l - .02) calc(c + .02) calc(h + 18))); }
}
:root[data-theme=light] {
  --bg: #f2f4f9;
  --header-bg: rgba(242, 244, 249, .9);
  --float-bg: rgba(255, 255, 255, .94);
  --edge: rgb(60 70 110 / .08);
  --edge-2: rgb(60 70 110 / .14);
  --muted: #8a90a6;
  --faint: #b3b8c8;
  --text: #2b2f45;
}
:root:not([data-theme=light]) {   /* after the dark version of the shot: blue-navy page, lighter slate-blue cards */
  --bg: #273251;
  --menu-bg: #374168;
  --header-bg: rgba(39, 50, 81, .92);
  --float-bg: rgba(55, 65, 104, .96);
  --sx-card: #374168;
  --sx-field: #2d3859;
  --sx-shadow: 0 16px 30px -18px rgb(8 12 30 / .75), 0 2px 6px -2px rgb(8 12 30 / .25);
  --sx-shadow-lg: 0 26px 50px -20px rgb(8 12 30 / .85);
  --text: #f3f5fb;
  --muted: #9aa3c7;
  --faint: #6f79a0;
  --edge: rgb(255 255 255 / .07);
  --edge-2: rgb(255 255 255 / .13);
}
.backdrop { background: var(--bg); }

/* ---------- header and bottom bar: same colour as the page, no lines ---------- */
.top { border-bottom: 0; background: var(--header-bg); }
.brand { font-weight: 700; font-size: 1.12rem; letter-spacing: -.02em; }
.brand .mark { border-radius: 10px; box-shadow: var(--sx-glow); }
.top-right .ghost, .menu-btn { border-radius: 50%; }
.menu-btn { background: var(--sx-card); box-shadow: var(--sx-shadow); width: 42px; height: 42px; padding: 0; }
.chip { background: var(--sx-card); border: 0; box-shadow: var(--sx-shadow); }

.tabbar { background: var(--sx-card); border-top: 0; box-shadow: 0 -10px 30px -18px rgb(76 88 140 / .35); border-radius: 26px 26px 0 0; }
.tabbar [role=tab] { color: var(--faint); }
:root .tabbar [role=tab][aria-selected=true], :root[data-bright] .tabbar [role=tab][aria-selected=true] { color: var(--sx-accent); background: none; }
.mic, .mic:hover, .mic.listening { background: var(--sx-grad); color: #fff; border: 0;
  box-shadow: 0 0 0 6px var(--bg), var(--sx-glow); }
:root[data-bright] .tabbar .mic { background: var(--sx-grad); color: #fff; }
.mic.handsfree:not(.listening) { box-shadow: 0 0 0 6px var(--bg), 0 0 0 9px color-mix(in srgb, var(--sx-accent) 40%, transparent), var(--sx-glow); }

/* ---------- headings ---------- */
h1 { font-weight: 750; letter-spacing: -.03em; }
h2 { color: var(--muted); letter-spacing: .06em; }
.muted { color: var(--muted); }

/* ---------- buttons ---------- */
button { background: var(--sx-card); border: 0; box-shadow: var(--sx-shadow); border-radius: 16px; }
button:hover { background: var(--sx-card); filter: brightness(1.03); }
button.ghost, button.ghost:hover, .sub-back, .menu-row, .tabbar [role=tab], .wiz-close, .dlg-cancel.ghost { box-shadow: none; background: transparent; }
:root button.primary, :root[data-bright] button.primary, :root button.primary:hover, :root[data-bright] button.primary:hover {
  background: var(--sx-grad); color: #fff; border: 0; box-shadow: var(--sx-glow); filter: none; }
.pill { border-radius: 999px; }
button.danger, .dlg-ok.danger, .trail-end .dlg-ok.danger { background: linear-gradient(135deg, #ff8a7a, #ff4d6d); color: #fff; box-shadow: 0 12px 26px -10px rgb(255 77 109 / .6); }

/* ---------- fields and switches ---------- */
input:not([type=checkbox]):not([type=radio]), select { background-color: var(--sx-field); border: 0; border-radius: 14px; }
input:focus, select:focus { background-color: var(--sx-field); box-shadow: 0 0 0 2px color-mix(in srgb, var(--sx-accent) 45%, transparent); }
input[type=checkbox] { border: 0; background: var(--sx-field); box-shadow: inset 0 1px 3px rgb(0 0 0 / .08); }
input[type=checkbox]::after { background: #fff; box-shadow: 0 2px 5px rgb(0 0 0 / .2); }
:root input[type=checkbox]:checked, :root[data-bright] input[type=checkbox]:checked { background: var(--sx-grad); }
:root input[type=checkbox]:checked::after, :root[data-bright] input[type=checkbox]:checked::after { background: #fff; }

/* ---------- tabs and choice groups: white pills with a soft shadow, the selected one in the gradient ---------- */
.seg > label > span, .subnav.seg [role=tab], .wiz-tab, .subnav.cats [role=tab] { border: 0; background: var(--sx-card); box-shadow: var(--sx-shadow); color: var(--muted); }
:root .seg input:checked + span, :root[data-bright] .seg input:checked + span,
:root .subnav.seg [role=tab].on, :root[data-bright] .subnav.seg [role=tab].on,
:root .wiz-tab.on, :root[data-bright] .wiz-tab.on,
:root .subnav.cats [role=tab].on, :root[data-bright] .subnav.cats [role=tab].on {
  background: var(--sx-grad); color: #fff; box-shadow: var(--sx-glow); font-weight: 650; }
.subnav.seg [role=tab] { border-radius: 16px; padding-block: 11px; }
.subnav.seg [role=tab] .count { opacity: .8; }
.trace-controls.on-map .seg > label > span { background: var(--float-bg); }

/* ---------- cards ---------- */
.wiz-type, .tile, .trail-info .ti, .menu, .trips li, .dlg, .toast, .transcript, .update-card {
  background: var(--sx-card); border: 0; box-shadow: var(--sx-shadow); }
.wiz-grid { gap: 14px; }
.wiz-type { border-radius: var(--sx-radius); padding: 16px 14px 14px; }
.wiz-type:hover, .wiz-type:focus-visible { background: var(--sx-card); transform: translateY(-1px); }
.wiz-type b { font-weight: 650; }
.dlg { border-radius: 28px; box-shadow: var(--sx-shadow-lg); }
:root[data-theme=light] .dlg, :root[data-theme=light] .sheet { background: #fff; }
.sheet { background: var(--sx-card); }
.toast { border-radius: 18px; }

/* Home: My alerts / My trails keep their colours, as soft gradient cards without an outline */
#targetsCard, #homeTrails { border: 0 !important; border-radius: 26px; padding: 18px; box-shadow: var(--sx-shadow);
  background: linear-gradient(135deg, var(--box-bg), color-mix(in srgb, var(--box-bg) 55%, var(--sx-card))); }
:root[data-theme=light] #targetsCard { --box-bg: #ffe9dc; }
:root[data-theme=light] #homeTrails { --box-bg: #dff7e9; }
:is(#targetsCard, #homeTrails) .rules-foot .pill { background: var(--sx-card); border: 0; box-shadow: var(--sx-shadow); }

/* Settings menu: one white card, round gradient icons */
.menu { border-radius: 26px; padding: 8px; gap: 0; }
.menu-row:hover, .menu-row.on { background: var(--sx-field); }
.menu-ico { border-radius: 50%; background: var(--sx-grad); color: #fff; box-shadow: var(--sx-glow); }
#settingsCard .card, #readingsCard { background: var(--sx-card); border-radius: 26px; padding: 18px 16px; box-shadow: var(--sx-shadow); margin: 10px 0; }

/* Trips: each trip its own card */
.trips li { border-radius: 20px; padding: 14px 14px; margin: 0 0 12px; border-bottom: 0 !important; list-style: none; }

/* ---------- round icons in the category colour, as a gradient ---------- */
.vz, :root[data-theme=light] .vz { border-radius: 50%; color: #fff;
  background: linear-gradient(135deg, rgb(var(--cat) / .75), rgb(var(--cat))); box-shadow: 0 8px 18px -8px rgb(var(--cat) / .8); }
@supports (color: oklch(from red l c h)) {
  .vz, :root[data-theme=light] .vz { background: linear-gradient(135deg, oklch(from rgb(var(--cat)) calc(l + .1) c calc(h - 30)), oklch(from rgb(var(--cat)) l c calc(h + 15))); }
}
.vz svg, .vz .i { color: #fff; stroke: #fff; }

/* ---------- numbers: big and thin ---------- */
.tile { border-radius: 18px; }
.tile .v { font-weight: 300; }
.tile.hero, .tile.hero.hit { background: none; box-shadow: none; }
.tile.hero .v { font-weight: 200; }
.trail-info .ti { border-radius: 18px; padding: 10px 12px; }
.trail-info .ti b { font-size: 1.3rem; font-weight: 300; letter-spacing: -.02em; }

/* ---------- map buttons: white circles ---------- */
.trace-maptheme, .trace-recenter, .trace-controls.on-map .share-btn { background: var(--sx-card); border: 0; box-shadow: var(--sx-shadow); }
.trace-maptheme:hover, .trace-recenter:hover { background: var(--sx-card); }

/* selected choice / tab in the gradient also with Bright colours on in the dark theme (beats styles.css :root[data-bright][data-theme=dark]) */
html:root[data-bright][data-theme] .seg input:checked + span, html:root[data-bright][data-theme] .subnav [role=tab].on, html:root[data-bright][data-theme] .wiz-tab.on,
html:root .seg input:checked + span, html:root .subnav [role=tab].on {
  background: var(--sx-grad); color: #fff; box-shadow: var(--sx-glow); }
/* Start / End trail popup: soft pills, no outlines */
.trail-end .end-seg span { border: 0; background: var(--sx-field); box-shadow: none; }
/* quick values (0.5 · 1 · 2 · 5) */
.picks button { border: 0; background: var(--sx-card); box-shadow: var(--sx-shadow); border-radius: 999px; }
html:root .picks button.sel, html:root[data-bright] .picks button.sel { background: var(--sx-grad); color: #fff; box-shadow: var(--sx-glow); }

/* ---------- section colours: Alerts orange, Trail green, Trips lighter green (Home and Settings keep the accent) ---------- */
:root {
  --sec-alerts: #ff6a3d; --sec-alerts-grad: linear-gradient(135deg, #ffb46b, #ff6a3d);
  --sec-trail:  #10a964; --sec-trail-grad:  linear-gradient(135deg, #4fe0a0, #10a964);
  --sec-trips:  #34c77b; --sec-trips-grad:  linear-gradient(135deg, #9ef0bd, #34c77b);
}
body[data-tab=alerts] { --sx-accent: var(--sec-alerts); --sx-grad: var(--sec-alerts-grad); }
body[data-tab=trail]  { --sx-accent: var(--sec-trail);  --sx-grad: var(--sec-trail-grad); }
body[data-tab=trips]  { --sx-accent: var(--sec-trips);  --sx-grad: var(--sec-trips-grad); }
body[data-tab=alerts], body[data-tab=trail], body[data-tab=trips] { --sx-glow: 0 12px 26px -10px color-mix(in srgb, var(--sx-accent) 65%, transparent); }
/* the mic, buttons and selected tabs follow the colour of the page you're on */

/* bottom bar: each tab in its own colour when selected */
html:root #tabAlerts[aria-selected=true] { color: var(--sec-alerts); }
html:root #tabTrail[aria-selected=true]  { color: var(--sec-trail); }
html:root #tabTrips[aria-selected=true]  { color: var(--sec-trips); }

/* Home: My alerts tab orange, My trails tab green */
html:root #homeNav [data-home=alerts].on { background: var(--sec-alerts-grad); box-shadow: 0 12px 26px -10px rgb(255 106 61 / .6); }
html:root #homeNav [data-home=trails].on { background: var(--sec-trail-grad);  box-shadow: 0 12px 26px -10px rgb(16 169 100 / .55); }
#targetsCard .rules-foot .pill { color: var(--sec-alerts); }
#homeTrails .rules-foot .pill, #homeTrails .rules .go { color: var(--sec-trail); }
#homeTrails .rules .go { background: var(--sec-trail-grad); color: #fff; }

/* header bubbles: Alerts orange dot, Trail green dot */
#status.chip::before { background: var(--sec-alerts); }
html:root .mic-fab:not(.listening), html:root[data-bright] .mic-fab:not(.listening) { background: var(--sx-grad); color: #fff; }

/* ======================= Layout pieces from the shots ======================= */
/* Section titles: bold, normal case, in the text colour ("Accounts", "Transaction History") */
h2 { text-transform: none; letter-spacing: -.01em; font-size: 1.05rem; font-weight: 700; color: var(--text); }
h2 [data-icon] { color: var(--sx-accent); opacity: 1; }

/* Greeting with a round avatar ("Willie Morales") */
.greet-row { display: flex; align-items: center; gap: 14px; }
.greet-row > div { min-width: 0; }
.avatar { flex: none; width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center;
  background: var(--sx-grad); color: #fff; font-size: 1.35rem; font-weight: 650; box-shadow: 0 0 0 4px var(--sx-card), var(--sx-glow); }
#welcome h1 { font-size: 1.45rem; font-weight: 750; }


/* Round gradient icon at the start of list rows (transactions) */
.row-ico { flex: none; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: #fff;
  background: var(--sec-trips-grad); box-shadow: 0 8px 16px -8px rgb(52 199 123 / .8); }
.row-ico .i { stroke: #fff; }
.row-ico.no-route { background: var(--sec-alerts-grad); box-shadow: 0 8px 16px -8px rgb(255 106 61 / .7); }
#homeTrails .row-ico { background: var(--sec-trail-grad); }
.trip-head { gap: 10px; }

/* Trail info: Distance as a gradient hero tile with a big thin number */
.trail-info .ti-grid > .ti:first-child, .sheet .ti-grid > .ti:first-child { grid-column: 1 / -1; background: var(--sec-trail-grad); color: #fff; padding: 14px 16px; box-shadow: 0 16px 30px -16px rgb(16 169 100 / .8); }
.trail-info .ti-grid > .ti:first-child small, .sheet .ti-grid > .ti:first-child small { color: rgb(255 255 255 / .85); }
.trail-info .ti-grid > .ti:first-child b, .sheet .ti-grid > .ti:first-child b { font-size: 2.6rem; font-weight: 200; }
.trip-main { min-width: 0; }
.trip-main b, .trip-main small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- charts: smooth gradient areas (mint → teal), the top point marked with a ring dot and a label ---------- */
.chart-box { position: relative; }
.chart-box svg { display: block; width: 100%; }
.chart-box .pline { stroke-width: 2.5; vector-effect: non-scaling-stroke; stroke-linecap: round; }
.chart-box .ch-f1 { stop-color: var(--ch-a, #43e8a5); stop-opacity: .55; }
.chart-box .ch-f2 { stop-color: var(--ch-b, #38c8e8); stop-opacity: .04; }
.chart-box .ch-s1 { stop-color: var(--ch-a, #43e8a5); }
.chart-box .ch-s2 { stop-color: var(--ch-b, #38c8e8); }
.ch-dot { position: absolute; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%; background: var(--sx-card);
  border: 3px solid var(--ch-b, #38c8e8); box-shadow: 0 3px 8px rgb(0 0 0 / .2); pointer-events: none; }
.ch-lbl { position: absolute; transform: translate(-50%, calc(-100% - 10px)); font-size: .82rem; font-weight: 650; white-space: nowrap; color: var(--text); pointer-events: none; }
.ch-lbl.end { transform: translate(-100%, calc(-100% - 10px)); }
.ch-lbl.start { transform: translate(0, calc(-100% - 10px)); }

/* Home: Activity card */

/* Trail: elevation profile in the same style */
.trail-profile { --ch-a: #4fe0a0; --ch-b: #10a964; }
.trail-profile .chart-box { margin-top: 30px; }
.trail-profile .chart-box svg { height: 80px; }
.trail-profile .profile-head { font-weight: 650; color: var(--text); font-size: .9rem; }
.trail-profile .profile-head span + span { font-weight: 400; color: var(--muted); font-size: .78rem; }

/* Alert categories (Settings → Alert categories): each row one white card, no card inside it */
.cat-order li, .card-pick li { background: var(--sx-card); box-shadow: var(--sx-shadow); border-radius: 18px; padding: 6px 8px 6px 4px; }
.cat-order { gap: 10px; }
.cat-order .cat-row, .card-pick button { background: transparent; box-shadow: none; }
.cat-order .emo { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--sx-field); font-size: 1.25rem; flex: none; }
/* Alerts page: ✎ at the end of the category chips opens the editor */
.subnav.cats .cat-edit { flex: none; width: 42px; height: 42px; padding: 0; border-radius: 50%; color: var(--muted); background: var(--sx-card); box-shadow: var(--sx-shadow); }

/* Category icons (Tabler outline icons, emoji or uploaded images) */
.emo .ci, .emo .ci-img { display: block; }
.ci-img { object-fit: contain; border-radius: 4px; }
.subnav.cats [role=tab] .emo { display: inline-grid; place-items: center; color: var(--sx-accent); }
.subnav.cats [role=tab].on .emo { color: #fff; }
.cat-order .emo { color: var(--sx-accent); }
.cat-edit .icon-prev { flex: none; width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center; font-size: 1.7rem; align-self: end;
  background: var(--sx-grad); color: #fff; box-shadow: var(--sx-glow); }
.cat-edit .icon-prev .ci-img { width: 34px; height: 34px; }
.cat-edit .icon-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(42px, 1fr)); gap: 6px; max-height: 196px; overflow-y: auto; padding: 4px 2px 8px; margin-bottom: 8px; }
.cat-edit .icon-grid .ig-head { grid-column: 1 / -1; color: var(--muted); font-weight: 600; margin: 4px 0 0; }
.cat-edit .icon-grid button { width: 100%; aspect-ratio: 1; padding: 0; border-radius: 12px; background: var(--sx-field); box-shadow: none; color: var(--text); }
.cat-edit .icon-grid button.on { background: var(--sx-grad); color: #fff; box-shadow: var(--sx-glow); }
.cat-edit .icon-tools { display: flex; align-items: flex-end; gap: 10px; margin-bottom: 12px; }
.cat-edit .icon-tools .emo-in { width: 92px; }
.cat-edit .icon-up { display: inline-flex; align-items: center; gap: 6px; padding: 10px 16px; border-radius: 999px; background: var(--sx-card); box-shadow: var(--sx-shadow); cursor: pointer; font-weight: 600; }
