/* Muster — design tokens taken from the Gleap dashboard:
   stone canvas, #fafaf8 side panel, white main panel, navy ink #060d25,
   system font at weight 500, 32/600 page titles, 10px nav pills, 16px cards,
   grey segmented tabs, black pill buttons, outlined chips, pastel avatars.
   No gradients, glows or bouncy motion. */
:root {
  --canvas: #f6f6f4;
  --side: #fafaf8;
  --panel: #ffffff;
  --ink: #060d25;
  --text: #1a1d24;
  --body: #2b2f37;
  --sub: #55585f;
  --muted: #737373;
  --muted-2: #65656d;
  --faint: #8a8d94;
  --line: #ebebeb;
  --line-2: #e7e7e4;
  --hair: #f0f0ee;
  --soft: #f2f2f0;
  --soft-hover: #e9e9e6;
  --row-hover: #f4f4f2;
  --seg: #eff0ee;
  --tile: #ececea;
  --tile-ink: #4b4f58;
  --icon-btn: rgba(6, 13, 37, .05);
  --icon-btn-hover: rgba(6, 13, 37, .09);
  --black: #171717;
  --black-hover: #2a3042;
  --on-black: #fafafa;
  --focus-ring: rgba(181, 181, 181, .5);
  --badge: #1a73e8;
  --link: #1a6ad8;

  /* status palette (Gleap inbox) */
  --ok: #1e7a3c;     --ok-bg: #e6f4ea;   --ok-ring: #c6e6cf;
  --bad: #b42318;    --bad-bg: #fdeceb;  --bad-ring: #f6cdc9;
  --warn: #8a5300;   --warn-bg: #fdf0d5; --warn-ring: #f3dca8;
  --info: #0b4a8a;   --info-bg: #e8f1fd; --info-ring: #cadcfa;
  --violet: #4c1d95; --violet-bg: #efeafe; --violet-ring: #ddd6fe;
  --teal: #0f5e57;   --teal-bg: #e3f6f3; --teal-ring: #bfe8e2;
  --grey: #55585f;   --grey-bg: #efefed; --grey-ring: #e0e0dc;
  --tile-violet: #efeafe; --tile-violet-ink: #6d4fd8;

  --av-ink: #1a1d24;
  --av-0: #a8e6bd; --av-1: #c9bdf9; --av-2: #fbc9a3; --av-3: #b9d6fb; --av-4: #a6e5df; --av-5: #f7bcd5; --av-6: #f6df85;

  --shadow-panel: 0 0 0 1px var(--line-2), 0 2px 12px rgba(6, 13, 37, .05);
  --shadow-pill: 0 0 0 1px #eff0ee, 0 1px 6px rgba(0, 0, 0, .05);
  --shadow-seg: 0 1px 3px rgba(0, 0, 0, .08);
  --shadow-card: 0 1px 2px rgba(6, 13, 37, .04), 0 6px 18px rgba(6, 13, 37, .05);
  --shadow-menu: 0 10px 28px rgba(6, 13, 37, .12);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
  --ease: cubic-bezier(.2, .7, .3, 1);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --canvas: #0e0f11; --side: #141518; --panel: #18191c;
    --ink: #f2f3f5; --text: #e8e9ec; --body: #d5d7db; --sub: #b0b3b9; --muted: #9a9ca3; --muted-2: #9a9ca3; --faint: #7d8087;
    --line: #2a2b30; --line-2: #2a2b30; --hair: #222327; --soft: #222327; --soft-hover: #2a2b30; --row-hover: #1f2023;
    --seg: #222327; --tile: #26272b; --tile-ink: #c9cbd1; --icon-btn: rgba(255,255,255,.06); --icon-btn-hover: rgba(255,255,255,.1);
    --black: #f2f3f5; --black-hover: #ffffff; --on-black: #111214; --focus-ring: rgba(120,120,120,.5); --link: #6aa8f5;
    --ok: #6fd394; --ok-bg: #12291b; --ok-ring: #1d4a2d;
    --bad: #f2877e; --bad-bg: #2d1513; --bad-ring: #5a2621;
    --warn: #f0c060; --warn-bg: #2b2210; --warn-ring: #574319;
    --info: #8cbcf7; --info-bg: #13233a; --info-ring: #22406a;
    --violet: #c4b5fd; --violet-bg: #211a36; --violet-ring: #3b2f63;
    --teal: #7fdcd0; --teal-bg: #10292a; --teal-ring: #1d4a46;
    --grey: #c9cbd1; --grey-bg: #26272b; --grey-ring: #34353a;
    --tile-violet: #2a2245; --tile-violet-ink: #b9a6f7;
    --shadow-panel: 0 0 0 1px var(--line); --shadow-pill: 0 0 0 1px var(--line); --shadow-seg: 0 0 0 1px var(--line);
    --shadow-card: 0 0 0 1px var(--line); --shadow-menu: 0 10px 28px rgba(0,0,0,.5);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--canvas); color: var(--text); font: 500 15px/normal var(--font);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; -webkit-tap-highlight-color: transparent; }
button, input, select, textarea { font: inherit; color: inherit; }
button { touch-action: manipulation; }
a { color: inherit; }
:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--focus-ring); }
/* Font Awesome solid glyphs, as used by Gleap */
svg.i { width: 15px; height: 15px; flex: none; fill: currentColor; }
.boot { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; }
.boot img { border-radius: 12px; opacity: .9; }
[data-mt] { margin-top: 14px; }
.inactive { opacity: .5; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }

/* ================================================================ frame: side panel + main panel */
.frame { display: grid; grid-template-columns: 248px minmax(0, 1fr); gap: 8px; padding: 8px; min-height: 100vh; min-height: 100dvh; }
.side { position: sticky; top: 8px; height: calc(100vh - 16px); height: calc(100dvh - 16px); display: flex; flex-direction: column;
  background: var(--side); border-radius: 16px; box-shadow: var(--shadow-panel); padding: 10px; }
.brand { display: flex; align-items: center; gap: 10px; padding: 6px 4px 14px 6px; }
.logo { width: 28px; height: 28px; border-radius: 8px; flex: none; display: block; }
.logo.lg { width: 40px; height: 40px; border-radius: 11px; }
.brand b { display: block; font-size: 16px; font-weight: 700; letter-spacing: -0.06px; color: var(--ink); line-height: 1.25; }
.brand small { display: block; font-size: 12px; color: var(--muted-2); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 170px; }
.side-label { font-size: 13px; font-weight: 600; color: var(--muted-2); padding: 14px 12px 6px; }
.side nav a { display: flex; align-items: center; gap: 10px; min-height: 36px; padding: 8px 12px; border-radius: 10px; text-decoration: none;
  font-size: 14px; font-weight: 400; color: var(--ink); transition: background .12s; }
.side nav a:hover { background: var(--row-hover); }
.side nav a.on { background: var(--panel); font-weight: 600; box-shadow: var(--shadow-pill); }
.side nav a svg.i { color: var(--ink); opacity: .85; }
.side .fill { flex: 1; }
.me { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 12px; background: var(--panel); box-shadow: var(--shadow-pill); }
.me a { flex: 1; min-width: 0; text-decoration: none; }
.me b { display: block; font-size: 13.5px; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me small { font-size: 12px; color: var(--muted); }
.icon-btn { width: 32px; height: 32px; border-radius: 999px; border: 0; background: var(--icon-btn); color: var(--ink); display: inline-grid; place-items: center;
  cursor: pointer; flex: none; transition: background .12s; text-decoration: none; }
.icon-btn:hover { background: var(--icon-btn-hover); }
.icon-btn.plain { background: transparent; }
.icon-btn.plain:hover { background: var(--icon-btn); }
.icon-btn:disabled { opacity: .35; cursor: default; }

.panel { background: var(--panel); border-radius: 16px; box-shadow: var(--shadow-panel); min-width: 0; min-height: calc(100dvh - 16px); position: relative; }
.page { max-width: 1000px; margin: 0 auto; padding: 56px 40px 120px; }
.page.enter, .inspect.enter { animation: fade-in .18s var(--ease) both; }
@keyframes fade-in { from { opacity: 0; } }

.tabbar { display: none; }
@media (max-width: 899px) {
  .frame { grid-template-columns: 1fr; padding: 0; gap: 0; }
  .side { display: none; }
  .panel { border-radius: 0; box-shadow: none; min-height: 100dvh; }
  .page { padding: calc(28px + env(safe-area-inset-top)) 20px calc(110px + env(safe-area-inset-bottom)); }
  .tabbar { display: flex; position: fixed; z-index: 40; left: 0; right: 0; bottom: 0; justify-content: space-around;
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); background: var(--side); border-top: 1px solid var(--line-2); }
  .tabbar a { display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 64px; padding: 6px 10px; border-radius: 10px;
    text-decoration: none; color: var(--muted); font-size: 11.5px; font-weight: 600; }
  .tabbar a svg.i { width: 20px; height: 20px; }
  .tabbar a.on { color: var(--ink); background: var(--panel); box-shadow: var(--shadow-pill); }
}
.focus-mode .tabbar { display: none; }

/* ================================================================ type */
.page-head { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 28px; flex-wrap: wrap; }
.page-head .grow { min-width: 220px; }
h1 { font-size: 32px; line-height: 40px; font-weight: 600; letter-spacing: -0.64px; color: var(--ink); margin: 0; }
.sub { font-size: 14px; line-height: 20px; color: var(--muted); margin: 6px 0 0; max-width: 560px; }
h2 { font-size: 16px; line-height: 22px; font-weight: 600; color: var(--ink); margin: 32px 0 12px; display: flex; align-items: center; gap: 8px; }
.section-head { display: flex; align-items: center; gap: 10px; margin: 32px 0 12px; flex-wrap: wrap; }
.section-head h2 { margin: 0; flex: 1; }
@media (max-width: 899px) { h1 { font-size: 28px; line-height: 34px; } }

/* ================================================================ controls */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 36px; padding: 0 14px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--panel); color: var(--ink); font-size: 13.5px; font-weight: 600; cursor: pointer; text-decoration: none;
  white-space: nowrap; position: relative; transition: background .12s, border-color .12s, opacity .12s; }
.btn:hover { background: var(--row-hover); }
.btn.primary { background: var(--black); border-color: transparent; color: var(--on-black); }
.btn.primary:hover { background: var(--black-hover); }
.btn.danger { color: var(--bad); }
.btn.danger-solid { background: #d92d20; border-color: transparent; color: #fff; }
.btn.danger-solid:hover { background: #b42318; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--icon-btn); }
.btn.soft { border-color: transparent; background: var(--icon-btn); }
.btn.soft:hover { background: var(--icon-btn-hover); }
.btn.small { height: 30px; padding: 0 11px; font-size: 13px; }
.btn.lg { height: 44px; font-size: 14.5px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .4; cursor: default; }
.btn.loading { color: transparent !important; pointer-events: none; }
.btn.loading::after { content: ""; position: absolute; width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--on-black); border-right-color: transparent; animation: spin .7s linear infinite; }
.btn:not(.primary).loading::after { border-color: var(--ink); border-right-color: transparent; }
@keyframes spin { to { transform: rotate(360deg); } }

label.field { display: block; }
label.field > span, .field-label { display: block; font-size: 13px; font-weight: 600; color: var(--ink); margin-bottom: 6px; }
input[type=text], input[type=password], input[type=date], input[type=search], select, textarea {
  width: 100%; height: 40px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); color: var(--text);
  font-size: 14px; font-weight: 500; transition: box-shadow .12s, border-color .12s; -webkit-appearance: none; appearance: none; }
input::placeholder, textarea::placeholder { color: var(--faint); }
textarea { height: auto; min-height: 80px; padding: 10px 12px; resize: vertical; line-height: 1.45; }
select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23737373' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; }
input:focus, select:focus, textarea:focus { outline: none; box-shadow: 0 0 0 3px var(--focus-ring); }
.with-icon { position: relative; display: block; }
.with-icon > svg.i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--faint); pointer-events: none; }
.with-icon > input { padding-left: 36px; height: 42px; }
.with-icon > .icon-btn { position: absolute; right: 5px; top: 50%; transform: translateY(-50%); }
.with-icon.trail > input { padding-right: 44px; }
.search { position: relative; }
.search svg.i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--faint); pointer-events: none; width: 15px; height: 15px; }
.search input { padding-left: 34px; height: 36px; }

.toggle { display: flex; align-items: center; gap: 12px; min-height: 44px; cursor: pointer; font-size: 14px; font-weight: 600; color: var(--ink); }
.toggle .grow small { display: block; color: var(--muted); font-weight: 500; font-size: 13px; }
.toggle input { position: absolute; opacity: 0; pointer-events: none; }
.toggle .track { width: 36px; height: 20px; border-radius: 999px; background: #d4d4d0; position: relative; transition: background .15s; flex: none; }
.toggle .track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: transform .15s var(--ease); }
.toggle input:checked + .track { background: var(--black); }
.toggle input:checked + .track::after { transform: translateX(16px); }
.toggle input:focus-visible + .track { box-shadow: 0 0 0 3px var(--focus-ring); }

/* segmented tabs */
.seg { display: inline-flex; gap: 2px; padding: 3px; border-radius: 999px; background: var(--seg); max-width: 100%; overflow-x: auto; scrollbar-width: none; flex: none; }
.seg::-webkit-scrollbar { display: none; }
.seg a, .seg button { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 14px; border: 0; border-radius: 999px; background: transparent;
  font-size: 12.5px; font-weight: 500; color: var(--ink); cursor: pointer; text-decoration: none; white-space: nowrap; flex: none; transition: background .12s; }
.seg a:hover, .seg button:hover { background: rgba(255,255,255,.55); }
.seg .on, .seg .on:hover { background: var(--panel); box-shadow: var(--shadow-seg); }
.seg .n { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.seg .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--c); }
.seg.lg a, .seg.lg button { height: 32px; font-size: 13px; }

/* chips & badges */
.chip { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 9px; border-radius: 999px; border: 1px solid var(--line);
  font-size: 12.5px; font-weight: 500; color: var(--text); background: transparent; white-space: nowrap; }
.chip svg.i { width: 12px; height: 12px; }
.chip.dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--c, var(--faint)); }
.chip[class*="c-"] { color: var(--c); background: var(--cb); border-color: var(--cr); }
.chip[class*="c-"].dot { background: transparent; border-color: var(--line); color: var(--text); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.badge { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--badge); color: #fff; font-size: 11px; font-weight: 600; line-height: 1; }
.badge.grey { background: transparent; color: var(--muted); font-size: 12px; font-weight: 500; }

.c-green  { --c: var(--ok);     --cb: var(--ok-bg);     --cr: var(--ok-ring); }
.c-red    { --c: var(--bad);    --cb: var(--bad-bg);    --cr: var(--bad-ring); }
.c-amber  { --c: var(--warn);   --cb: var(--warn-bg);   --cr: var(--warn-ring); }
.c-blue   { --c: var(--info);   --cb: var(--info-bg);   --cr: var(--info-ring); }
.c-purple { --c: var(--violet); --cb: var(--violet-bg); --cr: var(--violet-ring); }
.c-teal   { --c: var(--teal);   --cb: var(--teal-bg);   --cr: var(--teal-ring); }
.c-grey   { --c: var(--grey);   --cb: var(--grey-bg);   --cr: var(--grey-ring); }
.seg .c-green .dot, .seg .c-green.dot { --c: #22a05a; } .seg .c-red { --c: #e5484d; } .seg .c-amber { --c: #f59e0b; }
.seg .c-blue { --c: #3b82f6; } .seg .c-purple { --c: #8b5cf6; } .seg .c-teal { --c: #14b8a6; } .seg .c-grey { --c: #9ca3af; }

/* avatars (pastel, like Gleap) */
.avatar { width: 32px; height: 32px; border-radius: 999px; display: grid; place-items: center; flex: none; border: 0; padding: 0;
  font-size: 12px; font-weight: 600; color: var(--av-ink); background: var(--av-3); letter-spacing: .01em; position: relative; }
.avatar.lg { width: 40px; height: 40px; font-size: 13.5px; }
.avatar.xl { width: 56px; height: 56px; font-size: 18px; }
.av-0 { background: var(--av-0); } .av-1 { background: var(--av-1); } .av-2 { background: var(--av-2); } .av-3 { background: var(--av-3); }
.av-4 { background: var(--av-4); } .av-5 { background: var(--av-5); } .av-6 { background: var(--av-6); }
button.avatar { cursor: pointer; }
.avatar .st { position: absolute; right: -2px; bottom: -2px; width: 12px; height: 12px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 2px var(--panel); }

/* tiles (settings-card icon squares) */
.tile { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; flex: none; background: var(--tile-violet); color: var(--tile-violet-ink); font-size: 13.5px; font-weight: 600; }
.tile svg.i { width: 18px; height: 18px; }
.tile.sm { width: 32px; height: 32px; border-radius: 9px; font-size: 12px; }
.tile.neutral { background: var(--tile); color: var(--tile-ink); }
.tile[class*="c-"] { background: var(--cb); color: var(--c); }

/* ================================================================ cards, lists */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 640px) { .grid-2 { grid-template-columns: 1fr; } }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 18px; }
.stack > * + * { margin-top: 14px; }
.link-card { display: flex; align-items: center; gap: 14px; width: 100%; padding: 18px; border-radius: 16px; border: 1px solid var(--line); background: var(--panel);
  text-align: left; cursor: pointer; text-decoration: none; color: inherit; transition: box-shadow .15s, border-color .15s; }
.link-card:hover { box-shadow: var(--shadow-card); }
.link-card .grow > b { display: block; font-size: 14.5px; line-height: 20px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.link-card .grow > small { display: block; font-size: 13px; line-height: 19px; color: var(--muted); }
.link-card .meta-row { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.link-card .meter { flex: 1; height: 4px; border-radius: 99px; background: var(--soft); overflow: hidden; }
.link-card .meter i { display: block; height: 100%; width: 0; background: #22a05a; border-radius: inherit; transition: width .4s var(--ease); }
.link-card.loading { opacity: .6; pointer-events: none; }

.list { border-top: 1px solid var(--hair); }
.list-row { display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 10px 8px; border-bottom: 1px solid var(--hair); text-decoration: none; color: inherit; }
a.list-row { border-radius: 10px; transition: background .12s; }
a.list-row:hover { background: var(--row-hover); }
.list-row .grow > b { display: block; font-size: 14px; line-height: 20px; font-weight: 500; color: var(--text); }
.list-row .grow > small { display: block; font-size: 13px; line-height: 18px; color: var(--muted); }
.list-foot { font-size: 13px; color: var(--muted); padding: 12px 8px; }
.empty { padding: 48px 20px; text-align: center; font-size: 14px; color: var(--muted-2); }
.empty .tile { margin: 0 auto 14px; }
.empty b { display: block; color: var(--ink); font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.error { color: var(--bad); font-weight: 500; font-size: 13.5px; }
.error:empty { display: none; }

.sk { border-radius: 8px; background: var(--soft); animation: pulse 1.4s ease-in-out infinite; }
.sk.h1 { height: 36px; width: 40%; margin-bottom: 10px; }
.sk.line { height: 14px; width: 26%; margin-bottom: 32px; }
.sk.row { height: 52px; margin-bottom: 10px; }
@keyframes pulse { 50% { opacity: .55; } }

/* ================================================================ liquid hero (Gleap dashboard banner) */
.hero { position: relative; isolation: isolate; overflow: hidden; border-radius: 18px; min-height: 260px; display: flex; align-items: center; padding: 32px; background: #cc85de; }
.liquid-bg { position: absolute; inset: 0; z-index: -1; overflow: hidden; background: #cc85de; }
.liquid-bg::before { content: ""; position: absolute; inset: -30%; filter: blur(30px) saturate(1.2);
  background:
    radial-gradient(38% 46% at 18% 30%, #f26b1f 0%, transparent 70%),
    radial-gradient(34% 44% at 70% 22%, #f6c2fb 0%, transparent 70%),
    radial-gradient(44% 54% at 58% 82%, #a35ce1 0%, transparent 70%),
    radial-gradient(30% 40% at 12% 88%, #ffb98a 0%, transparent 70%),
    radial-gradient(40% 50% at 92% 66%, #ee8fe0 0%, transparent 70%),
    linear-gradient(120deg, #ffc39a, #e7c8fb); }
.liquid-bg canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; opacity: 0; transition: opacity .7s ease-out; }
.liquid-bg canvas.on { opacity: 1; }
.hero-in { display: flex; flex-direction: column; gap: 24px; max-width: 640px; }
.hero .date { font-size: 15px; line-height: 20px; font-weight: 500; color: rgba(255,255,255,.85); text-shadow: 0 1px 10px rgba(60, 20, 80, .35); }
.hero .hi { font-size: 52px; line-height: 1.04; font-weight: 800; letter-spacing: -0.04em; padding: 6px 0 12px; margin: -6px 0 -12px;
  background: linear-gradient(#fff 42%, rgba(255,255,255,.76)); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 2px 16px rgba(60, 20, 80, .16)); }
.hero-text { display: flex; flex-direction: column; gap: 6px; }
.glass { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 14px; border-radius: 999px; border: 0; cursor: pointer; text-decoration: none;
  background: rgba(255,255,255,.62); box-shadow: inset 0 0 0 1px rgba(255,255,255,.7); color: #191919; font-size: 13px; font-weight: 500;
  -webkit-backdrop-filter: blur(14px) saturate(1.3); backdrop-filter: blur(14px) saturate(1.3); transition: background .15s; }
.glass:hover { background: rgba(255,255,255,.8); }
.glass svg.i { width: 15px; height: 15px; }
.glass .sep { width: 3px; height: 3px; border-radius: 50%; background: currentColor; opacity: .45; }
.hero-actions { display: flex; gap: 8px; flex-wrap: wrap; }
@media (max-width: 640px) { .hero { min-height: 220px; padding: 24px; } .hero .hi { font-size: 38px; } }

/* org header + grey pills (Billing / Team / Settings) */
.org-head { display: flex; align-items: flex-end; gap: 8px; margin: 34px 2px 14px; flex-wrap: wrap; }
.org-head .grow b { display: block; font-size: 17px; line-height: 24px; font-weight: 500; color: var(--ink); }
.org-head .grow small { display: block; font-size: 13px; color: var(--muted); }
.pill { display: inline-flex; align-items: center; gap: 4px; height: 26px; padding: 0 11px; border-radius: 999px; border: 0; background: #f5f5f5; color: #171717;
  font-size: 12px; font-weight: 500; cursor: pointer; text-decoration: none; transition: background .12s; }
.pill:hover { background: #ebebeb; }

/* app-style cards (Gleap project cards) */
.app-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.app-card { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 72px; padding: 14px; border-radius: 14px; border: 1px solid var(--line);
  background: var(--panel); text-align: left; cursor: pointer; color: inherit; text-decoration: none; transition: background .12s; }
.app-card:hover { background: #f7f7f7; }
.app-card .grow > b { display: block; font-size: 15px; line-height: 20px; font-weight: 500; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app-card .grow > small { display: block; font-size: 13px; line-height: 18px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app-card.loading { opacity: .6; pointer-events: none; }
.app-icon { width: 40px; height: 40px; border-radius: 12px; flex: none; display: grid; place-items: center; color: #fff; font-size: 14px; font-weight: 700; letter-spacing: -0.02em;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.14), 0 1px 2px rgba(6,13,37,.08); }
.app-icon svg.i { width: 18px; height: 18px; }
.app-icon.sm { width: 32px; height: 32px; border-radius: 10px; font-size: 12px; }
.app-icon.lg { width: 48px; height: 48px; border-radius: 14px; font-size: 16px; }
/* Gleap's no-logo tile: light grey square with one dark letter */
.app-icon.plain { background: #f2f2f0; color: #171717; font-size: 17px; font-weight: 500; box-shadow: none; letter-spacing: 0; }
.app-icon.plain.sm { font-size: 14px; }
.app-icon.plain.lg { font-size: 20px; }
img.app-icon { object-fit: cover; background: #fff; box-shadow: 0 0 0 1px rgba(6, 13, 37, .06); padding: 0; }
.logo-pick { position: relative; cursor: pointer; flex: none; border-radius: 12px; }
.logo-pick input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; }
.logo-pick::after { content: "Edit"; position: absolute; inset: 0; border-radius: 12px; display: grid; place-items: center; font-size: 11px; font-weight: 600; color: #fff;
  background: rgba(6, 13, 37, .55); opacity: 0; transition: opacity .12s; pointer-events: none; }
.logo-pick:hover::after { opacity: 1; }
.app-card .grow > b { font-size: 15px; }
.g-0 { background: linear-gradient(135deg, #ff5c8a, #ff8a3d); }
.g-1 { background: linear-gradient(135deg, #8b5cf6, #4f46e5); }
.g-2 { background: linear-gradient(135deg, #2dd4bf, #16a34a); }
.g-3 { background: linear-gradient(135deg, #fbbf24, #f97316); }
.g-4 { background: linear-gradient(135deg, #38bdf8, #6366f1); }
.g-5 { background: linear-gradient(135deg, #f472b6, #a855f7); }
.g-6 { background: #171717; }
.badge.green { background: #16a34a; }
.badge.lg { min-width: 20px; height: 20px; padding: 0 7px; font-size: 12px; }
.badge svg.i { width: 10px; height: 10px; }

/* option pill (date / activity / uniform) */
.opt-pill { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px 0 14px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--panel); font-size: 13.5px; font-weight: 500; color: var(--ink); cursor: pointer; transition: background .12s; }
.opt-pill:hover { background: var(--row-hover); }
.opt-pill .sep { width: 3px; height: 3px; border-radius: 50%; background: var(--faint); }
.opt-pill svg.i { color: var(--muted); }

/* ================================================================ sign in (Gleap split layout) */
.signin { display: grid; grid-template-columns: minmax(380px, 38%) 1fr; min-height: 100vh; min-height: 100dvh; background: #fff; padding: 10px; gap: 10px; }
.signin-side { position: relative; display: flex; flex-direction: column; justify-content: center; padding: 72px 56px; }
.signin-logo { position: absolute; top: 22px; left: 22px; }
.signin-logo .logo { width: 30px; height: 30px; border-radius: 8px; }
.signin-form { width: 100%; max-width: 360px; }
.signin-form h1 { font-size: 28px; line-height: 34px; font-weight: 600; letter-spacing: -0.42px; color: #171717; }
.signin-form .sub { font-size: 14px; line-height: 22px; margin: 4px 0 28px; }
.signin-fields { display: flex; flex-direction: column; gap: 12px; }
.signin-fields .btn { height: 40px; margin-top: 6px; font-size: 14px; }
.signin-fields .with-icon > input { padding-left: 12px; height: 40px; }
.signin-foot { font-size: 13px; line-height: 18px; color: var(--muted); margin: 22px 0 0; }
.signin-foot b { color: #171717; font-weight: 500; }
.signin-legal { position: absolute; left: 56px; bottom: 26px; margin: 0; display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--faint); }
.signin-legal svg.i { width: 12px; height: 12px; }
.signin-art { position: relative; isolation: isolate; overflow: hidden; border-radius: 24px; background: #e3c6ef; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 22px; min-height: 280px; }
.signin-art .liquid-bg::after { content: ""; position: absolute; inset: 0; background: radial-gradient(70% 60% at 50% 50%, rgba(255,255,255,.18), rgba(255,255,255,0) 70%); }
.signin-word { font-size: clamp(64px, 11vw, 150px); line-height: .9; font-weight: 800; letter-spacing: -0.045em; color: rgba(255,255,255,.6);
  text-shadow: 0 1px 0 rgba(255,255,255,.25), 0 10px 40px rgba(90, 30, 110, .12); -webkit-user-select: none; user-select: none; }
.signin-art .glass { pointer-events: none; }
@media (max-width: 899px) {
  .signin { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .signin-art { order: -1; min-height: 34vh; border-radius: 20px; }
  .signin-side { padding: 36px 28px 64px; align-items: center; }
  .signin-logo { display: none; }
  .signin-legal { left: 0; right: 0; justify-content: center; }
}

/* ================================================================ login */
.auth { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px; position: relative; isolation: isolate; overflow: hidden; }
.auth > .liquid-bg { position: fixed; }
.auth-card { width: 100%; max-width: 400px; background: var(--panel); border-radius: 18px; padding: 32px;
  box-shadow: 0 0 0 1px rgba(255,255,255,.6), 0 30px 80px -20px rgba(60, 20, 80, .45); }
.auth-card .brand-row { display: flex; align-items: center; gap: 12px; margin-bottom: 28px; }
.auth-card .brand-row b { display: block; font-size: 16px; font-weight: 700; color: var(--ink); letter-spacing: -0.06px; }
.auth-card .brand-row small { font-size: 13px; color: var(--muted-2); }
.auth-card h1 { font-size: 24px; line-height: 30px; letter-spacing: -0.4px; }
.auth-card .sub { margin-bottom: 22px; }
.auth-card .stack > * + * { margin-top: 10px; }
.auth-card .fine { display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 12.5px; color: var(--muted); margin: 20px 0 0; }
.auth-card .fine svg.i { width: 13px; height: 13px; }
.shake { animation: shake .3s ease; }
@keyframes shake { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }

/* ================================================================ roll screen */
.roll-top { position: sticky; top: 0; z-index: 15; background: var(--panel); margin: -56px -40px 0; padding: 20px 40px 14px; border-radius: 16px 16px 0 0;
  border-bottom: 1px solid transparent; transition: border-color .15s; }
.roll-top.stuck { border-bottom-color: var(--line); border-radius: 0; }
@media (max-width: 899px) { .roll-top { margin: calc(-28px - env(safe-area-inset-top)) -20px 0; padding: calc(14px + env(safe-area-inset-top)) 20px 12px; border-radius: 0; } }
.roll-head { display: flex; align-items: center; gap: 12px; }
.roll-head h1 { font-size: 26px; line-height: 32px; letter-spacing: -0.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.roll-head .meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 2px; font-size: 13px; color: var(--muted); }
.head-actions { display: flex; align-items: center; gap: 8px; flex: none; }
.roll-top .toolbar { margin-top: 16px; }
.tally { font-size: 13px; color: var(--muted); white-space: nowrap; }
.toolbar .search { flex: 1; min-width: 160px; max-width: 280px; margin-left: auto; }
.sync:empty { display: none; }
.who .alert-note { color: #b42318; }
.who .alert-note svg.i, .who .flag svg.i { width: 11px; height: 11px; vertical-align: -1px; }
@media (max-width: 760px) {
  .roll-head { flex-wrap: wrap; }
  .head-actions { width: 100%; }
  .head-actions .btn.primary { flex: 1; }
  .tally { display: none; }
  .toolbar .search { max-width: none; }
}
/* popover menu */
.menu { position: absolute; z-index: 70; min-width: 200px; padding: 6px; border-radius: 12px; background: var(--panel); box-shadow: 0 0 0 1px var(--line), var(--shadow-menu);
  animation: fade-in .12s var(--ease) both; }
.menu a, .menu button { display: flex; align-items: center; gap: 10px; width: 100%; height: 36px; padding: 0 10px; border: 0; border-radius: 8px; background: transparent;
  font-size: 14px; font-weight: 500; color: var(--ink); text-decoration: none; cursor: pointer; text-align: left; }
.menu a:hover, .menu button:hover { background: var(--row-hover); }
.menu svg.i { width: 14px; height: 14px; color: var(--muted); }
.menu .danger, .menu .danger svg.i { color: #b42318; }
.title-row { display: flex; align-items: center; gap: 12px; }
.title-row h1 { font-size: 26px; line-height: 32px; letter-spacing: -0.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.title-row .meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 2px; font-size: 13px; color: var(--muted); }
.count-box { text-align: right; flex: none; }
.count-box b { display: block; font-size: 22px; line-height: 26px; font-weight: 600; color: var(--ink); letter-spacing: -0.4px; font-variant-numeric: tabular-nums; }
.count-box small { font-size: 12px; color: var(--muted); }
.progress { height: 4px; border-radius: 99px; background: var(--soft); overflow: hidden; margin: 14px 0; display: flex; gap: 2px; }
.progress i { display: block; height: 100%; width: 0; background: var(--c); transition: width .35s var(--ease); }
.progress i.c-green { --c: #22a05a; } .progress i.c-red { --c: #e5484d; } .progress i.c-amber { --c: #f59e0b; } .progress i.c-blue { --c: #3b82f6; }
.progress i.c-purple { --c: #8b5cf6; } .progress i.c-teal { --c: #14b8a6; } .progress i.c-grey { --c: #9ca3af; }
.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.toolbar .search { flex: 1; min-width: 180px; }
.sync { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.sync::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #22c55e; }
.sync.busy::before { background: #f5b400; }
.sync.off { color: var(--bad); }
.sync.off::before { background: #e5484d; }

.banner { display: flex; align-items: center; gap: 10px; margin-top: 12px; padding: 8px 8px 8px 14px; border-radius: 12px; font-size: 13.5px; font-weight: 500; border: 1px solid; }
.banner.done { background: var(--ok-bg); color: var(--ok); border-color: var(--ok-ring); }
.banner.lock { background: var(--warn-bg); color: var(--warn); border-color: var(--warn-ring); }

.cadets { margin-top: 6px; container-type: inline-size; }
.cadet { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; gap: 12px; align-items: center; min-height: 68px; padding: 10px 8px;
  border-bottom: 1px solid var(--hair); border-radius: 10px; transition: background .12s; }
.cadet:hover { background: #fbfbfa; }
.who { min-width: 0; cursor: pointer; }
.who b { display: block; font-size: 14px; line-height: 20px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who small { display: block; font-size: 13px; line-height: 18px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who small .flag { color: var(--link); }
.codes { display: inline-flex; gap: 2px; padding: 3px; border-radius: 12px; background: var(--seg); }
.code-btn { min-width: 48px; height: 40px; padding: 0 12px; border: 1px solid transparent; border-radius: 9px; background: transparent; cursor: pointer;
  font-size: 14px; font-weight: 600; color: var(--sub); transition: background .12s, color .12s, border-color .12s; }
.code-btn span { display: none; }
.code-btn:hover { background: rgba(255,255,255,.6); color: var(--ink); }
.code-btn.on { background: var(--cb); color: var(--c); border-color: var(--cr); box-shadow: var(--shadow-seg); }
.code-btn:disabled { cursor: default; opacity: .55; }
@container (min-width: 800px) {
  .code-btn { min-width: 84px; font-size: 13px; }
  .code-btn b { display: none; }
  .code-btn span { display: inline; }
}
.uni-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 32px; min-width: 96px; padding: 0 12px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--panel); font-size: 13px; font-weight: 500; color: var(--sub); cursor: pointer; white-space: nowrap; }
.uni-btn:hover { background: var(--row-hover); }
.uni-btn.ok { color: var(--ok); background: var(--ok-bg); border-color: var(--ok-ring); }
.uni-btn.bad { color: var(--bad); background: var(--bad-bg); border-color: var(--bad-ring); }
.uni-btn.part { color: var(--warn); background: var(--warn-bg); border-color: var(--warn-ring); }
@container (max-width: 600px) {
  .cadet { grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "av who uni" "codes codes codes"; row-gap: 10px; }
  .cadet > .avatar { grid-area: av; }
  .cadet > .who { grid-area: who; }
  .cadet > .uni-btn { grid-area: uni; min-width: 0; }
  .cadet > .codes { grid-area: codes; display: flex; }
  .cadet .codes .code-btn { flex: 1; }
}
.foot-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 28px; }

/* ================================================================ inspection */
.inspect { max-width: 720px; margin: 0 auto; padding: 24px 32px 130px; touch-action: pan-y; }
.inspect-top { display: flex; align-items: center; gap: 12px; }
.inspect-top .grow { text-align: center; font-size: 13.5px; font-weight: 600; color: var(--ink); }
.dots { display: flex; gap: 3px; margin: 14px 0 28px; }
.dots i { flex: 1; height: 4px; border-radius: 99px; background: var(--soft); }
.dots i.ok { background: #22a05a; }
.dots i.bad { background: #e5484d; }
.dots i.cur { background: var(--ink); }
.inspect-card { animation: fade-in .15s var(--ease) both; }
.who-xl { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; }
.who-xl h1 { font-size: 26px; line-height: 32px; letter-spacing: -0.5px; }
.who-xl .meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 4px; font-size: 13px; color: var(--muted); }
.items { border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.item { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 8px 8px 8px 16px; border-bottom: 1px solid var(--hair); }
.item:last-child { border-bottom: 0; }
.item .grow { font-size: 14px; font-weight: 500; color: var(--text); }
.pf { display: inline-flex; gap: 2px; padding: 3px; border-radius: 12px; background: var(--seg); flex: none; }
.pf button { display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 14px; border: 1px solid transparent; border-radius: 9px; background: transparent;
  font-size: 13.5px; font-weight: 600; color: var(--sub); cursor: pointer; transition: background .12s, color .12s; }
.pf button svg.i { width: 13px; height: 13px; }
.pf button:hover { background: rgba(255,255,255,.6); }
.pf button.pass.on { background: var(--ok-bg); color: var(--ok); border-color: var(--ok-ring); box-shadow: var(--shadow-seg); }
.pf button.fail.on { background: var(--bad-bg); color: var(--bad); border-color: var(--bad-ring); box-shadow: var(--shadow-seg); }
.dock { position: fixed; z-index: 30; left: 50%; transform: translateX(-50%); bottom: calc(20px + env(safe-area-inset-bottom)); display: flex; gap: 6px; align-items: center;
  padding: 6px; border-radius: 999px; background: var(--panel); box-shadow: 0 0 0 1px var(--line), var(--shadow-menu); }
.dock .btn { height: 44px; padding: 0 18px; }
@media (min-width: 900px) { .dock { left: calc(50% + 128px); } }
.summary-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 22px 0; }
.big-stat { border: 1px solid var(--line); border-radius: 16px; padding: 18px; }
.big-stat b { display: block; font-size: 30px; line-height: 36px; font-weight: 600; letter-spacing: -0.6px; color: var(--c, var(--ink)); }
.big-stat span { font-size: 13px; color: var(--muted); }

/* ================================================================ sheets */
.modal-backdrop { position: fixed; inset: 0; z-index: 60; background: rgba(6, 13, 37, .28); display: flex; align-items: center; justify-content: center; padding: 20px;
  animation: fade-in .15s var(--ease) both; }
.modal { width: 100%; max-width: 560px; max-height: calc(100dvh - 40px); overflow: auto; background: var(--panel); border-radius: 16px; padding: 22px;
  box-shadow: 0 0 0 1px var(--line), var(--shadow-menu); animation: rise .18s var(--ease) both; overscroll-behavior: contain; }
.modal.narrow { max-width: 420px; }
.modal-backdrop.closing { animation: fade-out .14s var(--ease) both; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }
@keyframes fade-out { to { opacity: 0; } }
@media (max-width: 720px) {
  .modal-backdrop { align-items: flex-end; padding: 0; }
  .modal, .modal.narrow { max-width: none; border-radius: 16px 16px 0 0; max-height: 94dvh; padding-bottom: calc(22px + env(safe-area-inset-bottom)); }
}
.modal-head { display: flex; gap: 12px; align-items: center; margin-bottom: 6px; }
.modal-head h3 { margin: 0; font-size: 17px; line-height: 24px; font-weight: 600; color: var(--ink); }
.modal-head small { display: block; font-size: 13px; color: var(--muted); }
.modal p { margin: 4px 0 0; font-size: 14px; line-height: 20px; color: var(--body); }
.modal h4 { margin: 20px 0 8px; font-size: 13px; font-weight: 600; color: var(--muted-2); display: flex; align-items: center; gap: 8px; }
.modal h4 .grow { flex: 1; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 20px; flex-wrap: wrap; }
.modal .item { min-height: 50px; padding-left: 14px; }
.modal .pf button { height: 34px; padding: 0 12px; }

/* ================================================================ tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 16px; }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--hair); white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
thead th { font-size: 12.5px; font-weight: 600; color: var(--muted-2); background: var(--side); border-bottom-color: var(--line); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tr.click { cursor: pointer; }
tr.click:hover td { background: #fafaf9; }
.person { display: flex; align-items: center; gap: 10px; }
.person b { font-weight: 600; color: var(--text); }
.pct { display: inline-flex; align-items: center; gap: 8px; font-variant-numeric: tabular-nums; }
.pct .bar { width: 60px; height: 4px; border-radius: 99px; background: var(--soft); overflow: hidden; }
.pct .bar i { display: block; height: 100%; width: 0; background: #22a05a; }
.pct.low { color: var(--bad); }
.pct.low .bar i { background: #e5484d; }
.stats { display: flex; gap: 8px; flex-wrap: wrap; }
.stat { display: inline-flex; align-items: baseline; gap: 6px; height: 30px; padding: 0 12px; align-items: center; border-radius: 999px; border: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.stat b { font-size: 13.5px; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.stat[class*="c-"] { background: var(--cb); border-color: var(--cr); color: var(--c); }
.stat[class*="c-"] b { color: var(--c); }

.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatch { width: 32px; height: 32px; border-radius: 999px; border: 1px solid var(--cr); background: var(--cb); cursor: pointer; position: relative; }
.swatch::after { content: ""; position: absolute; inset: 9px; border-radius: 50%; background: var(--c); }
.swatch.on { box-shadow: 0 0 0 2px var(--panel), 0 0 0 4px var(--ink); }

.share-url { color: var(--ink); font-weight: 500; user-select: all; -webkit-user-select: all; word-break: break-all; }
.drop { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; padding: 32px 20px; border-radius: 16px;
  border: 1px dashed #d4d4d0; background: var(--side); cursor: pointer; transition: background .12s, border-color .12s; }
.drop:hover, .drop.over { background: var(--row-hover); border-color: var(--faint); }
.drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.drop b { font-size: 14.5px; font-weight: 600; color: var(--ink); margin-top: 6px; }
.drop small { font-size: 13px; line-height: 19px; color: var(--muted); max-width: 460px; }

/* ================================================================ toast */
#toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); z-index: 90; transform: translate(-50%, 8px);
  display: inline-flex; align-items: center; gap: 10px; min-height: 40px; padding: 6px 6px 6px 14px; border-radius: 999px; background: var(--black); color: var(--on-black);
  font-size: 13.5px; font-weight: 500; box-shadow: var(--shadow-menu); opacity: 0; pointer-events: none; transition: opacity .15s, transform .15s var(--ease); max-width: calc(100% - 32px); }
#toast.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
#toast.err { background: #b42318; color: #fff; }
#toast > span { padding-right: 8px; }
#toast button { height: 28px; border: 0; border-radius: 999px; padding: 0 12px; font-size: 13px; font-weight: 600; cursor: pointer; background: rgba(255,255,255,.14); color: inherit; display: inline-flex; gap: 6px; align-items: center; }
@media (max-width: 899px) { #toast { bottom: calc(84px + env(safe-area-inset-bottom)); } .focus-mode #toast { bottom: calc(90px + env(safe-area-inset-bottom)); } }

/* ================================================================ "Reveille has been updated" bar */
/* iOS notification-banner glass */
.update-bar { position: fixed; z-index: 88; left: 50%; top: calc(10px + env(safe-area-inset-top)); transform: translateX(-50%);
  display: flex; align-items: center; width: min(400px, calc(100% - 20px)); border-radius: 24px;
  background: rgba(250, 250, 252, .62); -webkit-backdrop-filter: blur(28px) saturate(1.8); backdrop-filter: blur(28px) saturate(1.8);
  box-shadow: inset 0 0 0 .5px rgba(255, 255, 255, .75), 0 0 0 .5px rgba(0, 0, 0, .06), 0 12px 40px -8px rgba(15, 20, 40, .28);
  animation: banner-in .5s cubic-bezier(.2, 1.2, .3, 1) both; }
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) { .update-bar { background: rgba(250, 250, 252, .96); } }
.update-bar.leaving { animation: banner-out .22s ease-in both; }
.upd-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; padding: 12px 6px 12px 12px; border: 0; background: none; cursor: pointer; text-align: left; color: inherit; border-radius: 24px 0 0 24px; }
.upd-main:active { transform: scale(.985); }
.update-bar .upd-icon { width: 38px; height: 38px; border-radius: 9px; flex: none; box-shadow: 0 1px 3px rgba(0,0,0,.15); }
.upd-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.upd-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.upd-top b { font-size: 14px; line-height: 18px; font-weight: 600; color: #111; letter-spacing: -0.01em; }
.upd-top small { font-size: 12.5px; color: rgba(60, 60, 67, .6); }
.upd-msg { font-size: 14px; line-height: 19px; color: #1c1c1e; letter-spacing: -0.01em; }
.upd-close { width: 30px; height: 30px; margin: 0 12px 0 4px; flex: none; border: 0; border-radius: 50%; display: grid; place-items: center; cursor: pointer;
  background: rgba(120, 120, 128, .16); color: rgba(60, 60, 67, .75); }
.upd-close svg.i { width: 11px; height: 11px; }
.update-bar.working .upd-msg { color: rgba(60, 60, 67, .7); }
@keyframes banner-in { from { opacity: 0; transform: translate(-50%, -24px) scale(.96); } }
@keyframes banner-out { to { opacity: 0; transform: translate(-50%, -20px) scale(.97); } }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .update-bar { background: rgba(40, 40, 44, .6); box-shadow: inset 0 0 0 .5px rgba(255,255,255,.12), 0 12px 40px -8px rgba(0,0,0,.6); }
  :root:not([data-theme="light"]) .upd-top b, :root:not([data-theme="light"]) .upd-msg { color: #f2f2f7; }
  :root:not([data-theme="light"]) .upd-top small, :root:not([data-theme="light"]) .upd-close { color: rgba(235,235,245,.6); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
@media print {
  .side, .tabbar, .toolbar, .foot-actions, #toast, .dock { display: none !important; }
  .frame { display: block; padding: 0; } .panel { box-shadow: none; } .page { padding: 0; }
  .roll-top { position: static; margin: 0; padding: 0; }
}
