/* Fewer Miles web app. Brand tokens match the marketing site; a dark theme follows the OS. */
:root {
  --paper: #fcfaf4; --sand: #f6f1e7; --sand-deep: #ede4d3; --card: #ffffff;
  --ink: #1b2a2a; --ink-2: #4b5b5a; --ink-3: #566564;
  --teal: #0f4c4a; --teal-deep: #0a3534; --teal-bright: #1c7a72; --gold: #c08a3e;
  --line: rgba(27,42,42,.12); --line-2: rgba(27,42,42,.2);
  --ok: #1f7a4d; --warn: #8f5a0b; --bad: #b3261e; --info: #2c5d8f;
  --ok-bg: #e6f4ec; --warn-bg: #fbf0dc; --bad-bg: #fbe7e5; --info-bg: #e5eef8; --mute-bg: #eeebe3;
  --serif: "Fraunces", Georgia, serif;
  --sans: "Libre Franklin", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --shadow: 0 1px 2px rgba(10,53,52,.06), 0 8px 24px -16px rgba(10,53,52,.3);
  --r: 10px; --on: #ffffff; --bar: #0a3534;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0f1817; --sand: #152120; --sand-deep: #1c2b2a; --card: #172524;
    --ink: #e8e4d9; --ink-2: #b6c2c0; --ink-3: #9aa8a6;
    --teal: #7fc8bf; --teal-deep: #a6ddd6; --teal-bright: #9bd8cf; --gold: #d9a85c;
    --line: rgba(232,228,217,.12); --line-2: rgba(232,228,217,.22);
    --ok: #6fcf97; --warn: #f0b85a; --bad: #ff8a80; --info: #8ab8e8;
    --ok-bg: #173226; --warn-bg: #33280f; --bad-bg: #3a1916; --info-bg: #16283b; --mute-bg: #1f2c2b;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px -16px rgba(0,0,0,.7);
    --on: #0a1514; --bar: #0a1312;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--paper); color: var(--ink); font: 15px/1.5 var(--sans); -webkit-text-size-adjust: 100%; }
a { color: var(--teal-bright); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.2; margin: 0; text-wrap: balance; }
h1 { font-size: 1.7rem; } h2 { font-size: 1.25rem; } h3 { font-size: 1.05rem; }
@media (max-width: 860px) { h1 { font-size: min(1.7rem, 8vw); } h2 { font-size: min(1.25rem, 6vw); } }
.boot { padding: 40px; color: var(--ink-3); }

/* shell */
.shell { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.side { background: var(--teal-deep); color: #e9f1ef; padding: 20px 14px; display: flex; flex-direction: column; gap: 18px; position: sticky; top: 0; height: 100vh; }
@media (prefers-color-scheme: dark) { .side { background: var(--bar); } }
.brand { font-family: var(--serif); font-size: 1.25rem; padding: 0 8px; color: #fff; text-decoration: none; }
.brand small { display: block; font-family: var(--sans); font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: #9fc3bd; margin-top: 2px; }
.ctx select { width: 100%; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.16); color: #fff; border-radius: 8px; padding: 7px 8px; }
.ctx select option { color: #111; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { color: #cfe2de; text-decoration: none; padding: 8px 10px; border-radius: 8px; display: flex; justify-content: space-between; align-items: center; }
.nav a:hover { background: rgba(255,255,255,.07); color: #fff; }
.nav a.on { background: rgba(255,255,255,.13); color: #fff; font-weight: 600; }
.nav .count { font-size: .72rem; background: var(--bad); color: var(--on); border-radius: 99px; padding: 1px 7px; font-weight: 700; }
.side .foot { margin-top: auto; font-size: .82rem; color: #9fc3bd; padding: 0 8px; display: flex; flex-direction: column; gap: 6px; }
.side .foot button { background: none; border: 0; color: #cfe2de; text-align: left; padding: 0; cursor: pointer; text-decoration: underline; }
.main { padding: 28px 32px 60px; max-width: 1180px; width: 100%; }
.banner-imp { background: var(--gold); color: #1b1b1b; padding: 8px 32px; font-weight: 600; display: flex; justify-content: space-between; gap: 12px; }
.banner-demo { background: var(--info-bg); color: var(--info); padding: 8px 32px; font-size: .9rem; }
.topbar { display: none; }
@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; inset: 0 30% 0 0; z-index: 30; transform: translateX(-102%); transition: transform .2s; height: 100%; }
  .side.open { transform: none; box-shadow: 0 0 0 100vmax rgba(0,0,0,.35); }
  .topbar { display: flex; align-items: center; gap: 12px; padding: 12px 16px; background: var(--bar); color: #fff; position: sticky; top: 0; z-index: 20; }
  .topbar button { background: none; border: 0; color: #fff; font-size: 1.3rem; }
  .main { padding: 18px 16px 50px; min-width: 0; }
  .topbar > * { min-width: 0; }
  .topbar > strong { flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .topbar > button { flex: 0 0 auto; }
  .topbar .lang { flex: 0 1 auto; min-width: 0; }
  .topbar .lang-select { max-width: 100%; min-width: 0; text-overflow: ellipsis; }
  .banner-imp, .banner-demo { padding: 8px 16px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* page furniture */
.head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.head p { margin: 4px 0 0; color: var(--ink-2); }
.head > * { max-width: 100%; min-width: 0; }
.crumbs { font-size: .85rem; margin-bottom: 6px; color: var(--ink-3); }
.crumbs a { color: var(--ink-3); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; }
.alert-row > .grow, .stop > .grow, .fm-people .grow { min-width: 0; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); padding: 18px; }
.card > h2, .card > h3 { margin-bottom: 12px; }
.muted { color: var(--ink-3); } .small { font-size: .85rem; }
.label { font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); font-weight: 600; }
.num { font-variant-numeric: tabular-nums; }
.empty { text-align: center; padding: 36px 16px; color: var(--ink-3); }
hr { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }

/* stat tiles */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 9rem), 1fr)); gap: 12px; margin-bottom: 20px; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; text-decoration: none; color: inherit; display: block; }
a.tile:hover { border-color: var(--line-2); }
.tile .v { font-family: var(--serif); font-size: 1.9rem; line-height: 1.1; font-variant-numeric: tabular-nums; }
.tile .k { font-size: .82rem; color: var(--ink-2); margin-top: 2px; }
.tile.bad .v { color: var(--bad); } .tile.warn .v { color: var(--warn); }

/* chips */
.chip { display: inline-flex; align-items: center; gap: 5px; font-size: .74rem; font-weight: 600; padding: 2px 9px; border-radius: 99px; white-space: nowrap; background: var(--mute-bg); color: var(--ink-2); }
.chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.chip.occupied { background: var(--mute-bg); color: var(--ink-2); }
.chip.vacant { background: var(--info-bg); color: var(--info); }
.chip.turnover, .chip.maintenance, .chip.listed { background: var(--warn-bg); color: var(--warn); }
.chip.storm_check_pending { background: #ece6fb; color: #5a3fa3; }
@media (prefers-color-scheme: dark) { .chip.storm_check_pending { background: #251c3b; color: #c3b0f5; } }
.chip.issue_flagged, .chip.flag, .chip.overdue { background: var(--bad-bg); color: var(--bad); }
.chip.pass, .chip.submitted, .chip.ok { background: var(--ok-bg); color: var(--ok); }
.chip.scheduled { background: var(--mute-bg); color: var(--ink-2); }
.chip.in_progress { background: var(--info-bg); color: var(--info); }
.chip.cancelled, .chip.na { background: var(--mute-bg); color: var(--ink-3); }

/* tables → cards on phones */
.table-wrap { overflow-x: auto; }
table.list { width: 100%; border-collapse: collapse; }
table.list th { text-align: left; font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.list td { padding: 11px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.list tr.click { cursor: pointer; }
table.list tr.click:hover td { background: var(--sand); }
@media (max-width: 700px) {
  table.list thead { display: none; }
  table.list tr { display: block; border-bottom: 1px solid var(--line); padding: 10px 0; }
  table.list td { display: flex; justify-content: space-between; gap: 12px; border: 0; padding: 3px 4px; }
  table.list td[data-k]::before { content: attr(data-k); color: var(--ink-3); font-size: .82rem; }
}

/* forms */
label.f { display: flex; flex-direction: column; gap: 5px; font-size: .88rem; font-weight: 500; }
input[type=text], input[type=email], input[type=tel], input[type=url], input[type=date], input[type=number], input[type=search], select, textarea {
  background: var(--card); border: 1px solid var(--line-2); border-radius: 8px; padding: 9px 11px; min-height: 40px; width: 100%;
}
textarea { min-height: 90px; resize: vertical; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border-radius: 8px; padding: 9px 15px; min-height: 40px; border: 1px solid var(--line-2); background: var(--card); cursor: pointer; font-weight: 600; text-decoration: none; color: var(--ink); white-space: nowrap; }
.btn:hover { border-color: var(--ink-3); }
@media (max-width: 860px) { .btn { white-space: normal; text-align: center; max-width: 100%; } }
.btn.primary { background: var(--teal); border-color: var(--teal); color: var(--on); }
@media (prefers-color-scheme: dark) { .btn.primary { color: #0b1716; } }
.btn.primary:hover { background: var(--teal-bright); border-color: var(--teal-bright); }
.btn.danger { color: var(--bad); }
.btn.small { padding: 5px 10px; min-height: 32px; font-size: .85rem; }
.btn[disabled] { opacity: .55; cursor: default; }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: 8px; overflow: hidden; }
.seg button { border: 0; background: var(--card); padding: 8px 14px; cursor: pointer; font-weight: 600; min-height: 40px; }
.seg button + button { border-left: 1px solid var(--line-2); }
.seg button.on.pass { background: var(--ok); color: var(--on); }
.seg button.on.flag { background: var(--bad); color: var(--on); }
.seg button.on.na { background: var(--ink-3); color: var(--on); }
.err { color: var(--bad); font-size: .9rem; }

/* auth pages */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: var(--sand); }
.auth .card { width: 100%; max-width: 420px; padding: 28px; }
.auth .brand-dark { font-family: var(--serif); font-size: 1.4rem; color: var(--teal); margin-bottom: 18px; display: block; }
.code-input { font-size: 1.6rem; letter-spacing: .4em; text-align: center; font-variant-numeric: tabular-nums; }

/* visit / report */
.items .item { border-top: 1px solid var(--line); padding: 14px 0; display: flex; flex-direction: column; gap: 10px; }
.items .item:first-child { border-top: 0; }
.items .item.flag { box-shadow: inset 3px 0 0 var(--bad); padding-left: 12px; }
.items .sec { margin-top: 18px; }
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.photos figure { margin: 0; }
.photos img { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: 6px; display: block; background: var(--sand-deep); }
.photos figcaption { font-size: .7rem; color: var(--ink-3); margin-top: 3px; font-variant-numeric: tabular-nums; }
.upload { position: relative; overflow: hidden; }
.upload input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.bar { height: 8px; background: var(--mute-bg); border-radius: 99px; overflow: hidden; display: flex; }
.bar span { display: block; height: 100%; }
.alert-row { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-top: 1px solid var(--line); }
.alert-row:first-child { border-top: 0; }
.alert-row { flex-wrap: wrap; }
.alert-row > .grow { flex: 1 1 12rem; }

/* modal + toast */
dialog { border: 0; border-radius: 14px; padding: 0; max-width: min(560px, calc(100vw - 32px)); width: 100%; background: var(--card); color: var(--ink); box-shadow: 0 30px 80px -20px rgba(0,0,0,.5); }
dialog::backdrop { background: rgba(10,20,20,.45); }
dialog .in { padding: 22px; display: flex; flex-direction: column; gap: 14px; }
#toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); background: var(--ink); color: var(--paper); padding: 10px 18px; border-radius: 99px; font-weight: 600; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 50; max-width: calc(100vw - 32px); }
#toast.show { opacity: 1; transform: translate(-50%, 0); }

/* status chips by tone (a profile gives each status a tone) */
.chip.tone-neutral { background: var(--mute-bg); color: var(--ink-2); }
.chip.tone-info { background: var(--info-bg); color: var(--info); }
.chip.tone-ok { background: var(--ok-bg); color: var(--ok); }
.chip.tone-warn { background: var(--warn-bg); color: var(--warn); }
.chip.tone-bad { background: var(--bad-bg); color: var(--bad); }
.chip.tone-storm { background: #ece6fb; color: #5a3fa3; }
@media (prefers-color-scheme: dark) { .chip.tone-storm { background: #251c3b; color: #c3b0f5; } }
.tile.tone-bad .v { color: var(--bad); } .tile.tone-warn .v, .tile.tone-storm .v { color: var(--warn); }
.reading { font-weight: 600; font-variant-numeric: tabular-nums; }
.reading-in { display: flex; gap: 8px; align-items: center; }
.reading-in input { max-width: 140px; }
.seg.wrap { flex-wrap: wrap; }
.seg.fit { display: flex; flex-wrap: wrap; max-width: 100%; }
.seg.fit button { flex: 1 1 auto; min-width: max-content; padding: 8px 6px; font-size: .85rem; line-height: 1.2; overflow-wrap: normal; word-break: normal; }
.pick { display: flex; flex-wrap: wrap; gap: 8px; }
.pick button { border: 1px solid var(--line-2); background: var(--card); border-radius: 99px; padding: 8px 14px; min-height: 40px; font-weight: 600; cursor: pointer; }
.pick button.on { background: var(--teal); border-color: var(--teal); color: var(--on); }
.main, .fx { overflow-wrap: break-word; }
.grid2 > *, .card { min-width: 0; }
.seg button.on.choice { background: var(--teal); color: var(--on); }
.seg button.on.choice.bad { background: var(--bad); }

/* routes */
.map { height: 420px; border-radius: var(--r); border: 1px solid var(--line); overflow: hidden; background: var(--sand-deep); }
.map.small { height: 260px; }
.pin span { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: #0f4c4a; color: #fff;
  font: 700 12px/1 var(--sans); border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.35); }
.stops { display: flex; flex-direction: column; }
.stop { display: grid; grid-template-columns: 30px 1fr auto; gap: 10px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.stop:first-child { border-top: 0; }
.stop .n { width: 26px; height: 26px; border-radius: 50%; background: var(--teal); color: var(--on); display: grid; place-items: center; font-weight: 700; font-size: .8rem; }
@media (prefers-color-scheme: dark) { .stop .n { color: #0b1716; } }
.stop .acts { display: flex; gap: 4px; }
.days { display: flex; flex-wrap: wrap; gap: 6px; }
.days button { border: 1px solid var(--line-2); background: var(--card); border-radius: 99px; padding: 6px 12px; cursor: pointer; font-weight: 600; }
.days button.on { background: var(--teal); border-color: var(--teal); color: var(--on); }
.days button .c { font-weight: 400; opacity: .8; margin-left: 4px; }

/* The hidden attribute must win over the flex/grid display rules above (.stack, label.f, …). */
[hidden] { display: none !important; }

/* public savings page */
.sv { min-height: 100vh; background: var(--sand); }
.sv-embed { min-height: 0; border-radius: var(--r); overflow: hidden; }
.sv-step { max-width: 860px; margin: 0 auto; padding: 14px 16px 0; font-size: .85rem; color: var(--ink-3); font-weight: 600; }
.sv-top { display: flex; align-items: center; gap: 16px; padding: 14px 16px; max-width: 860px; margin: 0 auto; }
.sv-top .brand-dark { font-family: var(--serif); font-size: 1.35rem; color: var(--teal); text-decoration: none; margin-right: auto; }
/* At phone width the five header items only just fit (389 of 390 px), so a 1 px wider label wrapped the
   brand and step onto two lines. Keep each on one line and give them room. */
@media (max-width: 480px) {
  .sv-top { gap: 10px; }
  .sv-top > :not(.sv-stepno) { white-space: nowrap; flex-shrink: 0; }   /* on narrower phones only the step text wraps */
  .sv-top .lang-globe { display: none; }
}
/* With a long list the "Show my savings" button sits thousands of px down: keep it on screen. */
@media (max-width: 860px) {
  .sv-main > .btn.primary { position: sticky; bottom: 12px; z-index: 5; box-shadow: 0 6px 18px rgba(0, 0, 0, .18); }
}
.sv-main { max-width: 860px; margin: 0 auto; padding: 8px 16px 60px; }
.sv-main > h1 { font-size: 2rem; }
.lead { font-size: 1.05rem; color: var(--ink-2); margin: 0; }
.sv-picks { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.sv-pick { text-align: left; display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; border: 1px solid var(--line-2); border-radius: var(--r);
  background: var(--card); cursor: pointer; }
.sv-pick:hover { border-color: var(--teal-bright); }
.sv-win { border-color: var(--teal-bright); }
.sv-win h1 { font-size: 1.8rem; }
.sv-win .tiles { margin: 4px 0 0; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.sv-win .tile { padding: 10px 12px; }
.sv-win .tile .v { font-size: 1.45rem; }
.sv .stack > .err:empty { display: none; }
.sv-win ul { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
.sv-offer { margin: 0; font-weight: 600; color: var(--teal); }
.sv-offer-row { gap: 8px; margin-top: 4px; }
.sv-embed .sv-main { padding-bottom: 16px; }
.sv-keep { border: 2px solid var(--teal); }
details.card summary { cursor: pointer; font-weight: 600; }
.banner-bill { background: var(--warn-bg); color: var(--warn); padding: 8px 32px; font-weight: 600; }
.banner-bill a { color: inherit; }
@media (max-width: 860px) { .banner-bill { padding: 8px 16px; } }
.ok-note { background: var(--ok-bg); color: var(--ok); padding: 10px 14px; border-radius: 8px; font-weight: 600; max-width: 640px; }

/* ---- first run: add your clients (fm-*) ---------------------------------------------------------- */
.fm-first { min-height: 100vh; background: var(--paper); }
.fm-first-top { display: flex; align-items: center; justify-content: space-between; padding: 14px max(18px, env(safe-area-inset-right)) 0 max(18px, env(safe-area-inset-left)); max-width: 600px; margin: 0 auto; }
.fm-brand { font-family: var(--serif); font-size: 1.3rem; color: var(--teal); text-decoration: none; }
.fm-quiet { color: var(--ink-3); font-size: .95rem; text-decoration: none; min-height: 44px; display: inline-flex; align-items: center; }
.fm-first-in { max-width: 600px; margin: 0 auto; padding: 8px max(18px, env(safe-area-inset-right)) 56px max(18px, env(safe-area-inset-left)); display: flex; flex-direction: column; gap: 14px; }
.fm-first h1 { font-size: clamp(1.7rem, 7vw, 2.2rem); margin-top: 12px; }
.fm-lead { margin: 0; color: var(--ink-2); font-size: 1.05rem; }
.fm-hint { margin: 0; color: var(--ink-3); font-size: .88rem; }
.fm-lbl { font-weight: 600; margin-top: 6px; }
.fm-big { width: 100%; min-height: 54px; font-size: 1.05rem; border-radius: 12px; }
.fm-quiet-btn { background: none; border: 0; color: var(--teal-bright); font-weight: 600; min-height: 48px; text-align: left; padding: 0; cursor: pointer; }
.fm-first textarea { width: 100%; border-radius: 12px; border: 1.5px solid var(--line-2); background: var(--card); padding: 12px; font-size: 1rem; }
.fm-first input[type=text], .fm-first select { width: 100%; min-height: 48px; border-radius: 10px; border: 1.5px solid var(--line-2); background: var(--card); padding: 0 12px; font-size: 1rem; }
.fm-status { margin: 0; padding: 12px 14px; border-radius: 10px; background: var(--info-bg); color: var(--info); }
.fm-err { margin: 0; padding: 12px 14px; border-radius: 10px; background: var(--bad-bg); color: var(--bad); font-weight: 600; }
.fm-card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.fm-rows { display: flex; flex-direction: column; gap: 8px; }
.fm-row { background: var(--card); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.fm-row.skip { border-color: var(--bad); }
.fm-row-head { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; width: 100%; text-align: left; background: none; border: 0; padding: 12px 14px; min-height: 56px; cursor: pointer; }
.fm-row-t { font-weight: 600; flex-basis: 100%; }
.fm-row-s { color: var(--ink-2); font-size: .92rem; flex-basis: 100%; }
.fm-chip { font-size: .78rem; font-weight: 600; padding: 2px 9px; border-radius: 99px; background: var(--mute-bg); color: var(--ink-2); }
.fm-chip.warn { background: var(--warn-bg); color: var(--warn); }
.fm-chip.bad { background: var(--bad-bg); color: var(--bad); }
.fm-edit { padding: 0 14px 14px; display: flex; flex-direction: column; gap: 10px; }
.fm-two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.fm-actions { display: flex; gap: 10px; } .fm-actions .btn { flex: 1; min-height: 48px; }
.fm-check { width: 64px; height: 64px; border-radius: 50%; background: var(--ok-bg); color: var(--ok); font-size: 2rem; display: grid; place-items: center; margin-top: 18px; font-weight: 700; }

/* ---- phone tab bar + owner cards (fm-*) ---------------------------------------------------------- */
.fm-tabs { display: none; }
@media (max-width: 860px) {
  .fm-tabs { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; overflow: hidden; contain: layout; background: var(--card); border-top: 1px solid var(--line);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
  .fm-tabs a { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 2px; min-height: 52px; color: var(--ink-3);
    text-decoration: none; font-size: min(.72rem, 3.2vw); font-weight: 600; position: relative; border-radius: 10px; }
  .fm-tabs a span.long { font-size: min(.62rem, 2.7vw); letter-spacing: -.01em; }
  .fm-tabs a span.xl { font-size: min(.56rem, 2.4vw); letter-spacing: -.02em; }
  .fm-tabs a span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .fm-tabs a.on { color: var(--teal); background: var(--mute-bg); }
  .fm-badge { position: absolute; top: 2px; left: calc(50% + 6px); background: var(--bad); color: var(--on); border-radius: 99px; font-size: .66rem; padding: 0 5px; min-width: 16px; text-align: center; line-height: 16px; }
  .shell .main { padding-bottom: calc(86px + env(safe-area-inset-bottom)); }
  .topbar { display: flex; }
}
.fm-next { background: var(--card); border: 1.5px solid var(--gold); border-radius: 14px; padding: 16px; display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; box-shadow: var(--shadow); }
.fm-next h2 { font-size: 1.45rem; }
.fm-line { margin: 0; color: var(--ink-2); }
.fm-chip.gold { background: var(--warn-bg); color: var(--warn); }
.fm-twobtn { display: flex; gap: 10px; } .fm-half { flex: 1; min-height: 50px; }
.fm-team .fm-people { display: flex; flex-direction: column; }
.fm-person { display: grid; grid-template-columns: 38px 1fr; gap: 2px 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); text-decoration: none; color: inherit; }
.fm-person:first-child { border-top: 0; }
.fm-av { grid-row: span 2; width: 38px; height: 38px; border-radius: 50%; background: var(--teal); color: var(--paper); display: grid; place-items: center; font-weight: 700; font-size: .9rem; }
.fm-pn { display: flex; flex-direction: column; }
.fm-bar { grid-column: 2; height: 6px; background: var(--mute-bg); border-radius: 99px; overflow: hidden; }
.fm-bar i { display: block; height: 100%; background: var(--ok); border-radius: 99px; }
.fm-person .fm-chip { justify-self: start; grid-column: 2; }
.fm-flags { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.fm-flag { display: flex; flex-direction: column; text-decoration: none; color: inherit; background: var(--bad-bg); border-radius: 10px; padding: 10px 12px; }
.fm-week { display: block; text-decoration: none; color: inherit; margin-bottom: 16px; }
.fm-alert .fm-alert-t { font-weight: 600; font-size: 1.05rem; text-decoration: none; color: var(--ink); }
.fm-next .fm-quiet-btn { display: inline-flex; align-items: center; align-self: flex-start; min-height: 40px; text-decoration: none; }
.fm-next + .head { margin-top: 4px; }
@media (max-width: 860px) { .fm-next + .head .row { display: none; } }
.fm-quick { display: flex; gap: 10px; margin-bottom: 16px; } .fm-quick .btn { flex: 1; min-height: 50px; }
.fm-trend { display: flex; flex-direction: column; gap: 2px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.fm-trend:last-child { border-bottom: 0; padding-bottom: 0; }
.fm-bad { color: var(--bad); }
.fm-chart { width: 100%; height: auto; max-height: 150px; }
.fm-chart .fm-grid { stroke: var(--line); stroke-width: 1; }
.fm-chart .fm-axis { fill: var(--ink-3); font-size: 10px; font-family: var(--sans); }
.fm-chart .fm-band { fill: var(--ok); opacity: .14; }
.fm-chart .fm-line-p { fill: none; stroke: var(--teal-bright); stroke-width: 2; stroke-linejoin: round; opacity: .7; }
.fm-chart .fm-pt { fill: var(--teal-bright); } .fm-chart .fm-pt.bad { fill: var(--bad); }
.fm-tl { display: flex; flex-direction: column; } .fm-tl-i { display: flex; gap: 12px; align-items: center; padding: 11px 0; border-top: 1px solid var(--line); text-decoration: none; color: inherit; min-height: 48px; }
.fm-tl-i:first-child { border-top: 0; } .fm-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--ok); } .fm-dot.bad { background: var(--bad); }
@media (max-width: 860px) {
  .main input[type=checkbox] { width: 24px; height: 24px; flex: none; accent-color: var(--teal); }
  .main label.row { min-height: 44px; }
  .main .btn.small { min-height: 40px; padding: 7px 12px; }
}

/* ---- language picker -------------------------------------------------------------------------- */
.lang { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.lang-globe { font-size: 1rem; line-height: 1; }
.lang-select { font: inherit; font-size: .84rem; color: inherit; background: transparent; border: 1px solid color-mix(in srgb, currentColor 35%, transparent); border-radius: 8px; padding: 4px 8px; min-height: 34px; max-width: 9.5rem; }
.side .lang-select, .topbar .lang-select { color: #fff; background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .3); }
.side .lang-select option, .topbar .lang-select option { color: #17302d; background: #fff; }
.auth .lang { margin-top: 14px; justify-content: center; color: var(--ink-2); }
.sv-top .lang { color: var(--ink-2); }
.fm-first-top .lang { color: var(--ink-2); margin-left: auto; margin-right: 14px; }
@media (max-width: 860px) { .topbar .lang-select { min-height: 40px; } }
