/* ==========================================================================
   Home Inventory — mobile first stylesheet
   ========================================================================== */

:root{
  --bg:#f4f6f8;
  --surface:#ffffff;
  --surface-2:#f8fafc;
  --text:#0f172a;
  --muted:#64748b;
  --line:#e5e8ec;
  --brand:#2563eb;
  --brand-dark:#1d4ed8;
  --brand-soft:#eef4ff;
  --danger:#dc2626;
  --danger-soft:#fef2f2;
  --ok:#0f9d58;
  --ok-soft:#ecfdf3;
  --warn-soft:#fff8e6;
  --radius:16px;
  --radius-sm:12px;
  --shadow:0 1px 2px rgba(15,23,42,.05), 0 4px 16px rgba(15,23,42,.05);
  --shadow-lg:0 8px 30px rgba(15,23,42,.12);
  --nav-h:64px;
  --safe-b:env(safe-area-inset-bottom, 0px);

  /* surfaces that sit over content */
  --appbar-bg:rgba(255,255,255,.9);
  --nav-bg:rgba(255,255,255,.94);
  --fade-0:rgba(244,246,248,0);
  --fade-1:rgba(244,246,248,.85);

  /* text + line detail */
  --label:#334155;
  --placeholder:#94a3b8;
  --border-strong:#cfd6e0;
  --icon-faint:#cbd5e1;
  --on-brand:#ffffff;
  --fab-shadow:rgba(37,99,235,.32);
  --select-arrow:%2364748b;

  /* status colours */
  --chip-qty-border:#dbe6ff;
  --danger-border:#fee2e2;
  --ok-text:#065f34;    --ok-border:#c6f0d8;
  --err-text:#991b1b;   --err-border:#fecaca;
  --info-text:#1e40af;  --info-border:#dbe6ff;
  --warn-text:#854d0e;  --warn-border:#fde9b5;

  --auth-grad-1:#eef2f8; --auth-grad-2:#f4f6f8;
}


/* ==========================================================================
   Dark theme
   - follows the phone's own setting by default
   - an explicit choice (Settings -> Appearance) sets data-theme and wins
   ========================================================================== */

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
  --bg:#0e1319;
  --surface:#161d26;
  --surface-2:#1d2530;
  --text:#e6ecf3;
  --muted:#9aa8b8;
  --line:#2a333f;
  --brand:#4d87f7;
  --brand-dark:#3a72e8;
  --brand-soft:#16233b;
  --danger:#f87171;
  --danger-soft:#2b1a1d;
  --ok:#34d399;
  --ok-soft:#12291f;
  --warn-soft:#2b2415;

  --shadow:0 1px 2px rgba(0,0,0,.4), 0 4px 16px rgba(0,0,0,.3);
  --shadow-lg:0 8px 30px rgba(0,0,0,.55);

  --appbar-bg:rgba(22,29,38,.9);
  --nav-bg:rgba(22,29,38,.94);
  --fade-0:rgba(14,19,25,0);
  --fade-1:rgba(14,19,25,.85);

  --label:#c3ceda;
  --placeholder:#7b8899;
  --border-strong:#3b4655;
  --icon-faint:#4b5666;
  --on-brand:#ffffff;
  --fab-shadow:rgba(0,0,0,.5);

  --chip-qty-border:#27385c;
  --danger-border:#4a2327;
  --ok-text:#6ee7b7;    --ok-border:#1f4736;
  --err-text:#fca5a5;   --err-border:#4f2529;
  --info-text:#a8c5ff;  --info-border:#27385c;
  --warn-text:#fcd34d;  --warn-border:#463a1a;

  --auth-grad-1:#131a23; --auth-grad-2:#0e1319;
  }
  :root:not([data-theme="light"]) .field select{
  background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239aa8b8' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
}
}

:root[data-theme="dark"] {
  --bg:#0e1319;
  --surface:#161d26;
  --surface-2:#1d2530;
  --text:#e6ecf3;
  --muted:#9aa8b8;
  --line:#2a333f;
  --brand:#4d87f7;
  --brand-dark:#3a72e8;
  --brand-soft:#16233b;
  --danger:#f87171;
  --danger-soft:#2b1a1d;
  --ok:#34d399;
  --ok-soft:#12291f;
  --warn-soft:#2b2415;

  --shadow:0 1px 2px rgba(0,0,0,.4), 0 4px 16px rgba(0,0,0,.3);
  --shadow-lg:0 8px 30px rgba(0,0,0,.55);

  --appbar-bg:rgba(22,29,38,.9);
  --nav-bg:rgba(22,29,38,.94);
  --fade-0:rgba(14,19,25,0);
  --fade-1:rgba(14,19,25,.85);

  --label:#c3ceda;
  --placeholder:#7b8899;
  --border-strong:#3b4655;
  --icon-faint:#4b5666;
  --on-brand:#ffffff;
  --fab-shadow:rgba(0,0,0,.5);

  --chip-qty-border:#27385c;
  --danger-border:#4a2327;
  --ok-text:#6ee7b7;    --ok-border:#1f4736;
  --err-text:#fca5a5;   --err-border:#4f2529;
  --info-text:#a8c5ff;  --info-border:#27385c;
  --warn-text:#fcd34d;  --warn-border:#463a1a;

  --auth-grad-1:#131a23; --auth-grad-2:#0e1319;
}
:root[data-theme="dark"] .field select{
  background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239aa8b8' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
}

*,*::before,*::after{box-sizing:border-box}

html{-webkit-text-size-adjust:100%}

body{
  margin:0;
  background:var(--bg);
  color:var(--text);
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;
  font-size:16px;
  line-height:1.5;
  -webkit-font-smoothing:antialiased;
  overflow-x:hidden;
}

h1,h2,h3{margin:0;line-height:1.25;letter-spacing:-.015em}
p{margin:0}
a{color:inherit;text-decoration:none}
img{max-width:100%;display:block}
svg{width:24px;height:24px;fill:none;stroke:currentColor;stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round}

/* ---------------------------------------------------------------- layout */

.page{
  max-width:760px;
  margin:0 auto;
  padding:16px 16px calc(var(--nav-h) + var(--safe-b) + 24px);
}

/* extra room so the floating Add Item button never covers the last card */
.page.has-fab{padding-bottom:calc(var(--nav-h) + var(--safe-b) + 118px)}

.section{margin-top:26px}
.section-title{
  font-size:13px;font-weight:700;letter-spacing:.06em;text-transform:uppercase;
  color:var(--muted);margin:0 0 10px 2px;
}

/* --------------------------------------------------------------- app bar */

.appbar{
  position:sticky;top:0;z-index:30;
  background:var(--appbar-bg);
  backdrop-filter:saturate(180%) blur(12px);
  border-bottom:1px solid var(--line);
  padding-top:env(safe-area-inset-top,0px);
}
.appbar-inner{
  max-width:760px;margin:0 auto;
  display:flex;align-items:center;gap:10px;
  min-height:56px;padding:0 16px;
}
.appbar-title{font-size:19px;font-weight:700;flex:1;min-width:0;
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.appbar-back{
  display:inline-flex;align-items:center;justify-content:center;
  width:40px;height:40px;margin-left:-10px;border-radius:12px;color:var(--text);
}
.appbar-back:active{background:var(--surface-2)}
.topnav{display:none}

/* ---------------------------------------------------------- bottom nav */

.bottomnav{
  position:fixed;left:0;right:0;bottom:0;z-index:40;
  display:grid;grid-template-columns:repeat(3,1fr);
  background:var(--nav-bg);
  backdrop-filter:saturate(180%) blur(12px);
  border-top:1px solid var(--line);
  padding-bottom:var(--safe-b);
}
.bottomnav a{
  display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;
  height:var(--nav-h);color:var(--muted);font-size:11.5px;font-weight:600;
  -webkit-tap-highlight-color:transparent;
}
.bottomnav a.active{color:var(--brand)}
.bottomnav svg{width:23px;height:23px}

/* ------------------------------------------------------------- surfaces */

.card{
  background:var(--surface);
  border:1px solid var(--line);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
}
.card-pad{padding:16px}

/* --------------------------------------------------------------- search */

.searchbar{position:relative;display:block}
.searchbar svg{
  position:absolute;left:16px;top:50%;transform:translateY(-50%);
  color:var(--muted);width:21px;height:21px;pointer-events:none;
}
.searchbar input{
  width:100%;height:54px;padding:0 44px 0 46px;
  font-size:16px;color:var(--text);
  background:var(--surface);
  border:1px solid var(--line);border-radius:14px;
  box-shadow:var(--shadow);
  appearance:none;
}
.searchbar input::placeholder{color:var(--placeholder)}
.searchbar input:focus{outline:none;border-color:var(--brand);box-shadow:0 0 0 4px var(--brand-soft)}
.searchbar-clear{
  position:absolute;right:8px;top:50%;transform:translateY(-50%);
  width:38px;height:38px;display:none;align-items:center;justify-content:center;
  background:none;border:0;color:var(--muted);cursor:pointer;border-radius:10px;
}
.searchbar-clear.show{display:flex}

/* ------------------------------------------------------- quick actions */

.quick-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:10px}
.quick{
  display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;
  padding:20px 8px;background:var(--surface);border:1px solid var(--line);
  border-radius:var(--radius);box-shadow:var(--shadow);
  font-size:12.5px;font-weight:700;letter-spacing:.05em;text-transform:uppercase;
  color:var(--text);transition:transform .12s ease, border-color .12s ease;
  -webkit-tap-highlight-color:transparent;
}
.quick:active{transform:scale(.97);border-color:var(--border-strong)}
.quick .emoji{font-size:26px;line-height:1}

/* --------------------------------------------------------------- stats */

.stat-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:10px}
.stat{
  background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);
  box-shadow:var(--shadow);padding:16px;
}
.stat .value{font-size:28px;font-weight:750;letter-spacing:-.03em;line-height:1.1}
.stat .label{font-size:13px;color:var(--muted);margin-top:4px;font-weight:500}

/* --------------------------------------------------------- item cards */

.item-list{display:flex;flex-direction:column;gap:10px}
.item-card{
  display:flex;gap:12px;align-items:flex-start;
  background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);
  box-shadow:var(--shadow);padding:14px;
  transition:border-color .12s ease, transform .12s ease;
  -webkit-tap-highlight-color:transparent;
}
.item-card:active{transform:scale(.995);border-color:var(--border-strong)}
.item-thumb{
  width:56px;height:56px;flex:none;border-radius:12px;object-fit:cover;
  background:var(--surface-2);border:1px solid var(--line);
}
.item-thumb-placeholder{
  display:flex;align-items:center;justify-content:center;font-size:22px;color:var(--icon-faint);
}
.item-body{min-width:0;flex:1}
.item-name{font-size:16px;font-weight:650;letter-spacing:-.01em;
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.item-sub{font-size:14px;color:var(--muted);margin-top:2px;
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.item-meta{display:flex;flex-wrap:wrap;gap:6px;margin-top:8px}
.chip{
  display:inline-flex;align-items:center;gap:4px;
  background:var(--surface-2);border:1px solid var(--line);
  border-radius:999px;padding:3px 9px;font-size:12.5px;color:var(--muted);
  max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
}
.chip-qty{background:var(--brand-soft);border-color:var(--chip-qty-border);color:var(--brand-dark);font-weight:650}

/* ------------------------------------------------------------- buttons */

.btn{
  display:inline-flex;align-items:center;justify-content:center;gap:8px;
  min-height:50px;padding:0 20px;border-radius:14px;border:1px solid transparent;
  font-size:16px;font-weight:650;font-family:inherit;cursor:pointer;
  -webkit-tap-highlight-color:transparent;transition:background .12s ease,transform .12s ease;
}
.btn:active{transform:scale(.985)}
.btn-primary{background:var(--brand);color:var(--on-brand)}
.btn-primary:hover{background:var(--brand-dark)}
.btn-ghost{background:var(--surface);border-color:var(--line);color:var(--text)}
.btn-ghost:hover{background:var(--surface-2)}
.btn-danger{background:var(--danger);color:var(--on-brand)}
.btn-danger-soft{background:var(--danger-soft);color:var(--danger);border-color:var(--danger-border)}
.btn-block{width:100%}
.btn-row{display:grid;grid-template-columns:1fr 1fr;gap:10px}

/* Floating add button. It sits in its own band above the bottom navigation,
   with a soft fade so the list scrolls away underneath instead of colliding. */
.fab-wrap{
  position:fixed;z-index:35;left:0;right:0;
  bottom:calc(var(--nav-h) + var(--safe-b));
  padding:44px 16px 20px;
  background:linear-gradient(180deg, var(--fade-0) 0%, var(--fade-1) 34%, var(--bg) 58%);
  pointer-events:none;
}
.fab{
  display:flex;align-items:center;justify-content:center;gap:9px;
  max-width:728px;margin:0 auto;
  height:56px;border-radius:16px;
  background:var(--brand);color:var(--on-brand);font-size:16.5px;font-weight:700;
  box-shadow:0 8px 24px var(--fab-shadow);
  pointer-events:auto;
}
.fab:active{background:var(--brand-dark);transform:scale(.99)}
.fab svg{width:20px;height:20px;stroke-width:2.4}

/* --------------------------------------------------------------- forms */

.form{display:flex;flex-direction:column;gap:16px}
.field label,.field .label{
  display:block;font-size:14px;font-weight:650;margin-bottom:6px;color:var(--label);
}
.field .hint{font-size:13px;color:var(--muted);margin-top:6px}
.field input[type=text],
.field input[type=number],
.field input[type=email],
.field input[type=password],
.field input[type=file],
.field select,
.field textarea{
  width:100%;font-family:inherit;font-size:16px;color:var(--text);
  background:var(--surface);border:1px solid var(--line);border-radius:12px;
  padding:14px;appearance:none;
}
.field select{
  background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat:no-repeat;background-position:right 12px center;background-size:20px;
  padding-right:42px;
}
.field textarea{min-height:110px;resize:vertical}
.field input:focus,.field select:focus,.field textarea:focus{
  outline:none;border-color:var(--brand);box-shadow:0 0 0 4px var(--brand-soft);
}
.field.has-error input,.field.has-error select,.field.has-error textarea{border-color:var(--danger)}
.field .error{color:var(--danger);font-size:13.5px;margin-top:6px;font-weight:600}
.field-row{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.required{color:var(--danger)}

.photo-preview{
  margin-top:10px;width:120px;height:120px;border-radius:14px;object-fit:cover;
  border:1px solid var(--line);
}
.file-btn{
  display:flex;align-items:center;gap:10px;padding:14px;
  border:1px dashed var(--icon-faint);border-radius:12px;background:var(--surface);
  color:var(--muted);font-size:15px;cursor:pointer;
}
.file-btn input{display:none}

/* -------------------------------------------------------------- filters */

.filters{display:flex;gap:8px;overflow-x:auto;padding:2px 0 4px;
  scrollbar-width:none;-ms-overflow-style:none}
.filters::-webkit-scrollbar{display:none}
.filter{
  flex:none;padding:9px 15px;border-radius:999px;font-size:14px;font-weight:600;
  background:var(--surface);border:1px solid var(--line);color:var(--muted);
  cursor:pointer;font-family:inherit;-webkit-tap-highlight-color:transparent;
}
.filter.active{background:var(--brand);border-color:var(--brand);color:var(--on-brand)}
a.filter{display:inline-flex;align-items:center;white-space:nowrap}

/* Chip rows scroll sideways on phones; fade the right edge so that is obvious. */
@media (max-width:819px){
  .filters{
    -webkit-mask-image:linear-gradient(90deg,#000 calc(100% - 36px),transparent);
            mask-image:linear-gradient(90deg,#000 calc(100% - 36px),transparent);
    padding-right:28px;
  }
}

/* ---------------------------------------------------------- family members */

.member-bar .filter{padding:6px 14px 6px 6px;min-height:42px}
.member-bar .avatar{
  display:inline-flex;align-items:center;justify-content:center;flex:none;
  width:28px;height:28px;margin-right:8px;border-radius:50%;
  background:var(--brand-soft);color:var(--brand-dark);font-size:13px;font-weight:700;
}
.member-bar .filter.active .avatar{background:rgba(255,255,255,.22);color:var(--on-brand)}
.member-bar .filter-add{padding:6px 14px;border-style:dashed;color:var(--brand)}
.chip-member{color:var(--brand-dark);border-color:var(--chip-qty-border)}

/* ---------------------------------------------------------- item detail */

.detail-photo{
  width:100%;max-height:340px;object-fit:cover;border-radius:var(--radius);
  border:1px solid var(--line);background:var(--surface);
}
.detail-title{font-size:24px;font-weight:750;letter-spacing:-.02em;margin-bottom:6px}
.detail-list{display:flex;flex-direction:column}
.detail-row{
  display:flex;justify-content:space-between;gap:16px;
  padding:13px 16px;border-bottom:1px solid var(--line);
}
.detail-row:last-child{border-bottom:0}
.detail-row dt{font-size:14.5px;color:var(--muted);flex:none}
.detail-row dd{margin:0;font-size:15.5px;font-weight:600;text-align:right;
  word-break:break-word;min-width:0}
.detail-row.stacked{flex-direction:column;gap:4px}
.detail-row.stacked dd{text-align:left;font-weight:500}

/* ---------------------------------------------------------------- list */

.link-list{overflow:hidden}
.link-row{
  display:flex;align-items:center;gap:12px;padding:15px 16px;
  border-bottom:1px solid var(--line);color:var(--text);
  -webkit-tap-highlight-color:transparent;
}
.link-row:last-child{border-bottom:0}
.link-row:active{background:var(--surface-2)}
.link-row .emoji{font-size:20px;width:26px;text-align:center;flex:none}
.link-row .rl-body{flex:1;min-width:0}
.link-row .rl-title{display:block;font-size:15.5px;font-weight:600;line-height:1.35}
.link-row .rl-sub{display:block;font-size:13.5px;color:var(--muted);line-height:1.35;margin-top:1px}
.link-row .rl-count{font-size:14px;color:var(--muted);font-variant-numeric:tabular-nums}
.link-row .chev{color:var(--icon-faint);width:20px;height:20px;flex:none}

/* ------------------------------------------------- manage / brand rows */

.manage-row{
  display:grid;gap:10px;grid-template-columns:1fr;
  padding:14px 16px;border-bottom:1px solid var(--line);
}
.manage-row:last-child{border-bottom:0}
.manage-edit{display:flex;gap:8px;min-width:0}
.manage-edit input{
  flex:1;min-width:0;font-family:inherit;font-size:16px;color:var(--text);
  background:var(--surface);border:1px solid var(--line);border-radius:11px;padding:12px;
}
.manage-edit input:focus{outline:none;border-color:var(--brand);box-shadow:0 0 0 3px var(--brand-soft)}
.manage-actions{display:flex;align-items:center;gap:10px}
.manage-count{font-size:13.5px;color:var(--muted);margin-right:auto}
a.manage-count{text-decoration:underline;text-underline-offset:3px}
.btn-sm{min-height:42px;padding:0 16px;font-size:14.5px;border-radius:11px}

@media (min-width:520px){
  .manage-row{grid-template-columns:1fr auto;align-items:center}
}

/* ------------------------------------------------ segmented control */

.seg{
  display:grid;grid-template-columns:repeat(3,1fr);gap:4px;padding:4px;
  background:var(--surface-2);border:1px solid var(--line);border-radius:14px;
}
.seg-btn{
  display:flex;align-items:center;justify-content:center;gap:7px;
  min-height:44px;border:0;border-radius:10px;background:transparent;
  color:var(--muted);font-family:inherit;font-size:15px;font-weight:600;
  cursor:pointer;-webkit-tap-highlight-color:transparent;
}
.seg-btn[aria-pressed="true"]{background:var(--surface);color:var(--text);box-shadow:var(--shadow)}
.seg-btn svg{width:18px;height:18px}

/* --------------------------------------------------------- empty/alerts */

.empty{
  text-align:center;padding:44px 20px;background:var(--surface);
  border:1px solid var(--line);border-radius:var(--radius);box-shadow:var(--shadow);
}
.empty .emoji{font-size:40px;line-height:1}
.empty h2{font-size:18px;font-weight:700;margin:14px 0 6px}
.empty p{color:var(--muted);font-size:15px}
.empty .btn{margin-top:18px}

.alert{
  padding:13px 15px;border-radius:12px;font-size:15px;font-weight:550;
  margin-bottom:14px;border:1px solid transparent;
}
.alert-success{background:var(--ok-soft);color:var(--ok-text);border-color:var(--ok-border)}
.alert-error{background:var(--danger-soft);color:var(--err-text);border-color:var(--err-border)}
.alert-info{background:var(--brand-soft);color:var(--info-text);border-color:var(--info-border)}
.alert-warning{background:var(--warn-soft);color:var(--warn-text);border-color:var(--warn-border)}

.muted{color:var(--muted)}
.count-note{font-size:14px;color:var(--muted);margin:0 0 10px 2px}

/* --------------------------------------------------------------- modal */

.modal-backdrop{
  position:fixed;inset:0;z-index:60;background:rgba(15,23,42,.45);
  display:flex;align-items:center;justify-content:center;padding:20px;
}
.modal-backdrop[hidden]{display:none}
.modal{
  background:var(--surface);border-radius:20px;box-shadow:var(--shadow-lg);
  padding:24px;width:100%;max-width:380px;
}
.modal h2{font-size:18px;font-weight:700;margin-bottom:8px}
.modal p{color:var(--muted);font-size:15px}
.modal-actions{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-top:20px}

/* ---------------------------------------------------------------- auth */

body.is-auth{
  background:linear-gradient(180deg,var(--auth-grad-1) 0%,var(--auth-grad-2) 60%);
  min-height:100dvh;display:flex;align-items:center;justify-content:center;padding:20px;
}
body.is-auth .page{padding:0;width:100%;max-width:420px}
.auth-card{
  background:var(--surface);border:1px solid var(--line);border-radius:22px;
  box-shadow:var(--shadow-lg);padding:28px 24px;
}
.auth-logo{
  width:56px;height:56px;border-radius:16px;background:var(--brand);color:var(--on-brand);
  display:flex;align-items:center;justify-content:center;margin:0 auto 16px;font-size:26px;
}
.auth-title{font-size:22px;font-weight:750;text-align:center}
.auth-sub{text-align:center;color:var(--muted);font-size:15px;margin:6px 0 22px}
.check{display:flex;align-items:center;gap:10px;font-size:15px;color:var(--label);cursor:pointer}
.check input{width:20px;height:20px;accent-color:var(--brand)}

/* --------------------------------------------------------------- steps */
.steps{counter-reset:step;display:flex;flex-direction:column;gap:12px;margin:0;padding:0;list-style:none}
.steps li{position:relative;padding-left:38px;font-size:15px;color:var(--label)}
.steps li::before{
  counter-increment:step;content:counter(step);
  position:absolute;left:0;top:-1px;width:26px;height:26px;border-radius:50%;
  background:var(--brand-soft);color:var(--brand-dark);font-size:13px;font-weight:700;
  display:flex;align-items:center;justify-content:center;
}
code{
  font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:13.5px;
  background:var(--surface-2);border:1px solid var(--line);border-radius:6px;padding:1px 5px;
}

/* ------------------------------------------------------------- desktop */

@media (min-width:820px){
  .bottomnav{display:none}
  .topnav{display:flex;gap:4px}
  .topnav a{
    padding:9px 16px;border-radius:10px;font-size:15px;font-weight:600;color:var(--muted);
  }
  .topnav a:hover{background:var(--surface-2);color:var(--text)}
  .topnav a.active{background:var(--brand-soft);color:var(--brand-dark)}
  .page,.page.has-fab{padding:26px 20px 60px;max-width:860px}
  .appbar-inner{max-width:860px;min-height:64px;padding:0 20px}
  .stat-grid{grid-template-columns:repeat(4,1fr)}
  .fab-wrap{
    position:static;padding:0;background:none;pointer-events:auto;
    display:flex;justify-content:flex-end;margin-bottom:18px;
  }
  .fab{
    margin:0;width:auto;max-width:none;padding:0 24px;
    box-shadow:none;height:52px;
  }
  .field-row-3{grid-template-columns:repeat(3,1fr)}
}

@media (prefers-reduced-motion:reduce){
  *{transition:none !important;animation:none !important}
}
