/*! Rapport design kit — derived from the Rapport CRM kit © 2026 Hasib (OVERSHOOT), licensed to advirasoftware@gmail.com. Private: use inside products, never publish this file on its own. */
/* Tokens first, then base, shell, page head, cards, controls, data, charts,
   overlays, responsive. Theme switches with <html data-theme="dark">. */

:root {
  --font: 'Urbanist', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;

  /* paper + panes */
  --bg: #ebe8e1;
  --mesh-a: #f2d3bd; --mesh-b: #cfdfcd; --mesh-c: #f1e4bf;
  --glass: rgba(255, 255, 255, .46);
  --glass-2: rgba(255, 255, 255, .64);
  --glass-3: rgba(255, 255, 255, .82);
  --solid: #f6f4ef;
  --float: #fdfcf9;               /* opaque: anything above the page */
  --well: rgba(23, 25, 26, .06);  /* recessed fills, hover tint */
  --line: rgba(23, 25, 26, .09);
  --line-2: rgba(23, 25, 26, .16);
  --rim: rgba(255, 255, 255, .78);
  --shadow: 0 1px 0 rgba(255, 255, 255, .7) inset, 0 24px 48px -30px rgba(70, 50, 30, .28);
  --shadow-pop: 0 24px 60px -18px rgba(40, 30, 20, .32), 0 2px 6px rgba(40, 30, 20, .08);

  /* type */
  --text: #17191a; --muted: #676a66; --faint: #8e918c; --cream: #fbf8f2;

  /* tones: colour = status */
  --butter: #f2c94c; --on-butter: #17191a;
  --pine: #2f5c50;   --on-pine: #fbf8f2;
  --tomato: #c8431f; --on-tomato: #fbf8f2;
  --ink: #17191a;    --on-ink: #fbf8f2;
  --plain: rgba(255, 255, 255, .58); --on-plain: #17191a;
  --good: #2f7a52; --bad: #c8431f;
  --dock: #17191a; --on-dock: #fbf8f2;
  --pill: #17191a; --on-pill: #fbf8f2;

  --r-card: 26px; --r-tile: 22px; --r-ctl: 999px;
  --gap: 16px;
  --dock-x: 20px; --dock-w: 60px;
  --gutter: clamp(16px, 1.6vw, 28px);
  --app-max: 1840px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #111412;
  --mesh-a: rgba(200, 67, 31, .28); --mesh-b: rgba(47, 92, 80, .5); --mesh-c: rgba(242, 201, 76, .1);
  --glass: rgba(255, 255, 255, .05); --glass-2: rgba(255, 255, 255, .085); --glass-3: #222624;
  --solid: #1c201e; --float: #242927;
  --well: rgba(255, 255, 255, .06); --line: rgba(255, 255, 255, .08); --line-2: rgba(255, 255, 255, .16);
  --rim: rgba(255, 255, 255, .07);
  --shadow: 0 1px 0 rgba(255, 255, 255, .05) inset, 0 24px 48px -30px rgba(0, 0, 0, .7);
  --shadow-pop: 0 24px 60px -18px rgba(0, 0, 0, .7), 0 0 0 1px rgba(255, 255, 255, .08);
  --text: #f1eee8; --muted: #a3a6a0; --faint: #7d807b;
  --ink: #f1eee8; --on-ink: #17191a;   /* ink inverts so the boldest block stays boldest */
  --tomato: #d8532d;
  --plain: rgba(255, 255, 255, .07); --on-plain: #f1eee8;
  --good: #6cc59a; --bad: #f08a68;
  --dock: rgba(255, 255, 255, .08); --on-dock: #f1eee8;
  --pill: #f1eee8; --on-pill: #17191a;
  color-scheme: dark;
}

/* ── Base ─────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100dvh; background: var(--bg); color: var(--text);
  font: 500 14px/1.45 var(--font); -webkit-font-smoothing: antialiased;
  overflow-x: hidden; overflow-wrap: break-word;
}
img, svg { display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p, dl, dd, ul, ol { margin: 0; padding: 0; }
ul, ol { list-style: none; }
[hidden] { display: none !important; }
.num, [data-count] { font-variant-numeric: tabular-nums; }
.ico { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: fixed; left: 12px; top: -60px; z-index: 100; padding: 10px 16px; border-radius: 12px; background: var(--pill); color: var(--on-pill); }
.skip:focus { top: 12px; }
::selection { background: var(--butter); color: #17191a; }

/* the mesh: three soft fields, drifted by motion.js breathe() */
.mesh { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.mesh i { position: absolute; border-radius: 50%; filter: blur(60px); opacity: .95; will-change: transform; }
.mesh i:nth-child(1) { width: 62vmax; height: 62vmax; left: -18vmax; top: -24vmax; background: radial-gradient(closest-side, var(--mesh-a), transparent); }
.mesh i:nth-child(2) { width: 70vmax; height: 70vmax; right: -24vmax; bottom: -30vmax; background: radial-gradient(closest-side, var(--mesh-b), transparent); }
.mesh i:nth-child(3) { width: 46vmax; height: 46vmax; right: 8vmax; top: -16vmax; background: radial-gradient(closest-side, var(--mesh-c), transparent); }

/* load gate: hidden until the entrance plays; the failsafe class shows it anyway */
html.js:not(.failsafe):not(.is-ready) .app { visibility: hidden; }

/* ── Shell ────────────────────────────────────────────────────────────── */
.app {
  overflow-x: hidden; overflow-x: clip;   /* clip: nothing widens the page, sticky still works */
  max-width: var(--app-max); margin: 0 auto;
  padding: 22px var(--gutter) 48px calc(var(--dock-x) + var(--dock-w) + var(--gutter));
}
.top { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 20px; margin-bottom: 26px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 21px; letter-spacing: -.02em; }
.brand__mark { width: 38px; height: 38px; border-radius: 12px; background: var(--pill); color: var(--on-pill); display: grid; place-items: center; }
.top__tools { display: flex; align-items: center; gap: 10px; }

/* pill tabs: .tabs__pill holds a copy of the labels in --on-pill and is clipped to the current tab */
.tabs { justify-self: center; min-width: 0; max-width: 100%; overflow-x: auto; scrollbar-width: none; border-radius: 999px; }
.tabs::-webkit-scrollbar { display: none; }
.tabs__track { position: relative; display: flex; gap: 2px; padding: 4px; width: max-content; }
.tab { position: relative; z-index: 1; padding: 10px 17px; border-radius: 999px; font-weight: 600; font-size: 13.5px; white-space: nowrap; }
.tab:hover { background: var(--well); }
.tab[aria-current="page"]:hover { background: none; }
.tabs__pill { position: absolute; inset: 0; z-index: 2; background: var(--pill); pointer-events: none; opacity: 0; display: flex; gap: 2px; padding: 4px; }
.tabs__pill span { padding: 10px 17px; color: var(--on-pill); font-weight: 600; font-size: 13.5px; white-space: nowrap; }

/* the dock: dark pill floating at the left, centred with auto margins (GSAP owns its transform) */
.dock {
  position: fixed; z-index: 30; left: max(var(--dock-x), calc((100vw - var(--app-max)) / 2 + var(--dock-x)));
  top: 0; bottom: 0; margin: auto 0; height: fit-content;
  display: flex; flex-direction: column; gap: 4px; padding: 8px; border-radius: 999px;
  background: var(--dock); color: var(--on-dock); box-shadow: 0 20px 40px -18px rgba(0, 0, 0, .45);
}
:root[data-theme="dark"] .dock { backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); border: 1px solid var(--line); }
.dock__btn { position: relative; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; opacity: .74; }
.dock__btn:hover, .dock__btn:focus-visible, .dock__btn[aria-expanded="true"], .dock__btn[aria-current="page"] { opacity: 1; background: rgba(255, 255, 255, .12); }
.dock__btn:focus-visible { outline-color: var(--on-dock); }
.dock__btn[aria-current="page"]::after { content: ''; position: absolute; right: 3px; top: 50%; width: 5px; height: 5px; margin-top: -2.5px; border-radius: 50%; background: var(--butter); }
.dock__sep { height: 1px; margin: 4px 10px; background: rgba(255, 255, 255, .14); }
.dock__tip {
  position: absolute; left: calc(100% + 14px); top: 0; bottom: 0; margin: auto 0; height: fit-content;
  padding: 6px 10px; border-radius: 10px; background: var(--float); color: var(--text); box-shadow: var(--shadow-pop);
  font-size: 12.5px; font-weight: 600; white-space: nowrap; pointer-events: none; opacity: 0; transition: opacity .18s var(--ease);
}
.dock__btn:hover .dock__tip, .dock__btn:focus-visible .dock__tip { opacity: 1; }

/* ── Page head: title, stats grouped near it, actions at the far edge ── */
.head { display: flex; align-items: center; flex-wrap: wrap; gap: 18px clamp(28px, 4vw, 72px); margin-bottom: 24px; }
.head__title { font-size: clamp(28px, 2.6vw, 38px); line-height: 1.04; font-weight: 600; letter-spacing: -.025em; }
.head__title:focus { outline: none; }
.head__title .word { display: inline-block; overflow: hidden; padding-bottom: .08em; margin-bottom: -.08em; vertical-align: top; }
.head__title .ch { display: inline-block; }
.head__stats { display: flex; flex-wrap: wrap; gap: 14px clamp(24px, 3.2vw, 56px); }
.stat { display: flex; align-items: center; gap: 12px; }
.stat__ico { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: var(--glass-2); border: 1px solid var(--rim); }
.stat__value { display: flex; align-items: center; gap: 10px; font-size: 21px; font-weight: 600; letter-spacing: -.01em; }
.stat__label { color: var(--muted); font-size: 12.5px; line-height: 1.3; max-width: 150px; }
.head__actions { display: flex; gap: 10px; align-items: center; margin-left: auto; }

/* ── Cards, tiles, bento ──────────────────────────────────────────────── */
.bento { display: grid; gap: var(--gap); grid-template-columns: repeat(12, minmax(0, 1fr)); }
.card {
  position: relative; min-width: 0; padding: 18px; border-radius: var(--r-card);
  background: var(--glass); border: 1px solid var(--rim); box-shadow: var(--shadow);
  display: flex; flex-direction: column;
}
.card__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; min-height: 40px; }
.card__title { font-size: 15px; font-weight: 600; letter-spacing: -.005em; }
.card__sub { color: var(--muted); font-size: 12.5px; }
.card__tools { display: flex; align-items: center; gap: 8px; }
.card__big { font-size: clamp(30px, 3vw, 42px); font-weight: 600; letter-spacing: -.03em; line-height: 1; }
/* the page's one bold block */
.card--bold { background: var(--pine); color: var(--on-pine); border-color: transparent; }
.card--bold .card__sub { color: inherit; opacity: .7; }
.card--bold .ibtn { color: inherit; border-color: color-mix(in srgb, currentColor 26%, transparent); }
.card--bold :focus-visible { outline-color: currentColor; }

/* solid colour tile: its colour IS its status */
.tile {
  --tile: var(--plain); --on-tile: var(--on-plain);
  position: relative; display: flex; flex-direction: column; min-width: 0; min-height: 168px; padding: 14px 14px 14px 16px;
  border-radius: var(--r-tile); background: var(--tile); color: var(--on-tile); --stack-ring: var(--tile);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .18) inset, 0 18px 30px -22px rgba(40, 30, 20, .45);
}
.tile--butter { --tile: var(--butter); --on-tile: var(--on-butter); }
.tile--pine { --tile: var(--pine); --on-tile: var(--on-pine); }
.tile--tomato { --tile: var(--tomato); --on-tile: var(--on-tomato); }
.tile--ink { --tile: var(--ink); --on-tile: var(--on-ink); }
.tile__meta { font-size: 12px; font-weight: 600; opacity: .78; }
.tile__title { margin-top: 8px; font-size: 19px; font-weight: 600; line-height: 1.14; letter-spacing: -.015em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tile__foot { margin-top: auto; padding-top: 12px; display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; }
.tile__amt { font-size: 21px; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; }
.tile .ibtn { color: inherit; border-color: color-mix(in srgb, currentColor 28%, transparent); }
.tile .ibtn:hover { background: color-mix(in srgb, currentColor 14%, transparent); }

/* ── Controls ─────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 42px; padding: 0 18px;
  border-radius: 999px; font-weight: 600; font-size: 13.5px; white-space: nowrap; border: 1px solid transparent;
}
.btn .ico { width: 17px; height: 17px; }
.btn--ink { background: var(--pill); color: var(--on-pill); }
.btn--ink:hover { filter: brightness(1.15); }
:root[data-theme="dark"] .btn--ink:hover { filter: brightness(.92); }
.btn--ghost { border-color: var(--line-2); background: var(--glass); }
.btn--ghost:hover { background: var(--glass-2); }
.btn--danger { background: var(--tomato); color: var(--on-tomato); }
.btn--sm { height: 34px; padding: 0 14px; font-size: 12.5px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

.ibtn { position: relative; width: 40px; height: 40px; flex: none; border-radius: 50%; display: inline-grid; place-items: center; border: 1px solid var(--line-2); color: var(--text); }
.ibtn:hover { background: var(--glass-2); }
.ibtn--glass { background: var(--glass-2); border-color: var(--rim); }
.ibtn--sm { width: 32px; height: 32px; }
.ibtn[aria-pressed="true"] { background: var(--pill); color: var(--on-pill); border-color: transparent; }
.dot-badge { position: absolute; top: 9px; right: 10px; width: 8px; height: 8px; border-radius: 50%; background: var(--tomato); box-shadow: 0 0 0 2px var(--bg); }

.seg { position: relative; display: inline-flex; padding: 3px; border-radius: 999px; background: var(--well); }
.seg__pill { position: absolute; inset: 0; background: var(--glass-3); box-shadow: 0 2px 8px rgba(0, 0, 0, .08); opacity: 0; pointer-events: none; }
:root[data-theme="dark"] .seg__pill { background: rgba(255, 255, 255, .14); }
.seg__btn { position: relative; z-index: 1; padding: 8px 14px; border-radius: 999px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.seg__btn[aria-pressed="true"] { color: var(--text); }

.chip { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: 999px; background: var(--glass-2); border: 1px solid var(--line); font-size: 12.5px; font-weight: 600; }
.chip[aria-pressed="true"] { background: var(--pill); color: var(--on-pill); border-color: transparent; }
.input, .search { height: 42px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--glass-2); padding: 0 16px; outline: none; min-width: 0; }
.input:focus, .search:focus-within { border-color: var(--text); }
.search { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); }
.search input { border: 0; background: none; outline: none; height: 100%; width: 100%; color: var(--text); }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 16px; }
.check { appearance: none; width: 20px; height: 20px; flex: none; margin: 0; border-radius: 7px; border: 1.5px solid var(--line-2); display: inline-grid; place-items: center; cursor: pointer; }
.check:checked { background: var(--pill); border-color: transparent; }
.check:checked::after { content: ''; width: 10px; height: 5px; border-left: 2px solid var(--on-pill); border-bottom: 2px solid var(--on-pill); transform: rotate(-45deg) translate(1px, -1px); }
.switch { position: relative; width: 44px; height: 26px; flex: none; border-radius: 999px; background: var(--line-2); }
.switch::after { content: ''; position: absolute; left: 3px; top: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); transition: transform .3s var(--ease); }
.switch[aria-checked="true"] { background: var(--pine); }
.switch[aria-checked="true"]::after { transform: translateX(18px); }

/* ── Data bits ────────────────────────────────────────────────────────── */
.badge { display: inline-flex; align-items: center; padding: 3px 9px; border-radius: 999px; font-size: 11px; font-weight: 700; }
.badge--butter { background: var(--butter); color: var(--on-butter); }
.badge--pine { background: var(--pine); color: var(--on-pine); }
.badge--tomato { background: var(--tomato); color: var(--on-tomato); }
/* status pill: neutral body, the dot carries the tone */
.status { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--well); white-space: nowrap; }
.status::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--dot, var(--faint)); }
.status--good { --dot: var(--good); } .status--wait { --dot: var(--butter); } .status--info { --dot: var(--pine); }
.status--bad { --dot: var(--tomato); color: var(--bad); }
.meter { display: block; height: 8px; border-radius: 999px; background: var(--well); overflow: hidden; }
.meter__fill { display: block; height: 100%; width: 100%; border-radius: inherit; background: var(--text); transform-origin: 0 50%; }   /* set scaleX, never width */
.av { flex: none; width: 28px; height: 28px; border-radius: 50%; object-fit: cover; background: var(--well); display: inline-grid; place-items: center; font-size: 11px; font-weight: 700; color: #17191a; }
.av--md { width: 36px; height: 36px; font-size: 12.5px; }
.av--t0 { background: #f3d9a3; } .av--t1 { background: #cfe0d2; } .av--t2 { background: #f2c6b4; } .av--t3 { background: #d9d4ec; }
.av-stack { display: inline-flex; }
.av-stack .av { box-shadow: 0 0 0 2px var(--stack-ring, var(--cream)); }
.av-stack .av + .av { margin-left: -8px; }

.table-wrap { overflow-x: auto; margin: 0 -6px; }
.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
.table th { text-align: left; font-weight: 600; font-size: 12px; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background-color .15s; }
.table tbody tr:hover { background: var(--well); }
.table .r { text-align: right; }
.cell-person { display: flex; align-items: center; gap: 10px; min-width: 0; }
.cell-person small { display: block; color: var(--muted); font-size: 12px; }

.feed__item { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.feed__item:last-child { border-bottom: 0; }
.feed__item small { display: block; color: var(--muted); font-size: 11.5px; margin-top: 2px; }
.empty { display: grid; justify-items: center; gap: 6px; padding: 36px 16px; text-align: center; color: var(--muted); }
.empty .ico { width: 28px; height: 28px; opacity: .7; }
.empty__title { color: var(--text); font-weight: 600; }
.empty__text { font-size: 13px; max-width: 300px; }
.legend { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: 12.5px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 9px; height: 9px; border-radius: 50%; }

/* ── Charts (plain SVG) ───────────────────────────────────────────────── */
.chart { position: relative; }
.chart svg { width: 100%; height: 100%; overflow: visible; }
.chart__grid line { stroke: var(--line); stroke-dasharray: 3 4; }
.chart__grid text, .chart__x text { fill: var(--muted); font-size: 11px; font-weight: 500; }
.chart__line { fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.chart__line.is-dashed { stroke-dasharray: 5 6; stroke-width: 2; }
.chart__tip { position: absolute; pointer-events: none; padding: 8px 10px; border-radius: 12px; background: var(--float); border: 1px solid var(--line); box-shadow: var(--shadow-pop); font-size: 12px; white-space: nowrap; }
.bars { display: flex; align-items: stretch; gap: 8px; height: 180px; }
.bars__col { flex: 1; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.bars__track { flex: 1; display: flex; align-items: flex-end; border-radius: 12px; background: var(--well); overflow: hidden; }
.bars__bar { display: block; width: 100%; border-radius: 12px; min-height: 4px; background: var(--ink); opacity: .82; transform-origin: 50% 100%; }
.bars__col.is-hi .bars__bar { opacity: 1; background: var(--tomato); }
.bars__lab { text-align: center; font-size: 11px; color: var(--muted); }
.ring { position: relative; width: min(100%, 168px); aspect-ratio: 1; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring__track { fill: none; stroke: color-mix(in srgb, currentColor 13%, transparent); stroke-width: 15; }
.ring__arc { fill: none; stroke: var(--arc, var(--butter)); stroke-width: 15; stroke-linecap: round; }
.ring__mid { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.ring__mid b { font-size: 38px; font-weight: 600; letter-spacing: -.03em; line-height: 1; }

/* ── Overlays ─────────────────────────────────────────────────────────── */
.pop { position: fixed; z-index: 80; min-width: 200px; max-width: min(360px, calc(100vw - 24px)); padding: 6px; border-radius: 18px; background: var(--float); box-shadow: var(--shadow-pop); border: 1px solid var(--line); }
.menu__item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 12px; border-radius: 12px; text-align: left; font-weight: 600; font-size: 13.5px; }
.menu__item:hover, .menu__item:focus-visible { background: var(--well); outline: none; }
.menu__item.is-danger { color: var(--bad); }
dialog { color: var(--text); }
dialog::backdrop { background: rgba(20, 18, 16, .26); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
:root[data-theme="dark"] dialog::backdrop { background: rgba(0, 0, 0, .6); }
.modal { width: min(560px, calc(100vw - 24px)); padding: 22px; border: 1px solid var(--rim); border-radius: 26px; background: #f7f5f0; box-shadow: var(--shadow-pop); }
:root[data-theme="dark"] .modal, :root[data-theme="dark"] .drawer { background: var(--glass-3); }
.drawer { position: fixed; margin: 0 0 0 auto; inset: 12px 12px 12px auto; height: auto; max-height: none; width: min(460px, calc(100vw - 24px)); padding: 24px; border: 1px solid var(--rim); border-radius: 28px; background: #f7f5f0; box-shadow: var(--shadow-pop); }
.field { display: grid; gap: 6px; min-width: 0; }
.field__label { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.field input, .field select, .field textarea { width: 100%; min-height: 44px; border-radius: 14px; border: 1px solid var(--line-2); background: var(--glass-2); padding: 10px 14px; outline: none; }
.field :is(input, select, textarea):focus { border-color: var(--text); }
.toast {
  position: fixed; z-index: 95; left: 0; right: 0; bottom: 24px; margin: 0 auto; width: fit-content; max-width: calc(100vw - 24px);
  display: flex; align-items: center; gap: 10px; padding: 10px 12px 10px 14px; border-radius: 999px;
  background: var(--pill); color: var(--on-pill); box-shadow: var(--shadow-pop); visibility: hidden; font-weight: 600; font-size: 13.5px;
}
.toast__undo { padding: 6px 12px; border-radius: 999px; background: var(--butter); color: #17191a; font-weight: 700; }

/* ── Touch, responsive, reduced motion ────────────────────────────────── */
@media (hover: none) {   /* iOS keeps :hover on the last tapped element */
  .tab:hover, .ibtn:hover, .table tbody tr:hover, .menu__item:hover { background: none; }
  .btn--ink:hover { filter: none; }
}
@media (pointer: coarse) {
  .ibtn, .ibtn--sm { width: 44px; height: 44px; }
  .seg__btn { min-width: 44px; padding: 13px 14px; }
  .tab, .tabs__pill span { padding-top: 13px; padding-bottom: 13px; }
  .btn--sm, button.chip { min-height: 44px; }
  .menu__item { min-height: 44px; }
}
@media (max-width: 1180px) {
  :root { --dock-x: 14px; }
  .top { grid-template-columns: auto 1fr; }
  .tabs { grid-column: 1 / -1; grid-row: 2; justify-self: start; }
  .top__tools { grid-column: 2; grid-row: 1; justify-self: end; }
  .bento { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .app { padding: 14px max(14px, env(safe-area-inset-right)) calc(96px + env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left)); }
  .top { gap: 12px; margin-bottom: 18px; }
  .tabs { margin: 0 -14px; padding: 0 10px; border-radius: 0; width: calc(100% + 28px); max-width: none;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 14px, #000 calc(100% - 14px), transparent); mask-image: linear-gradient(90deg, transparent, #000 14px, #000 calc(100% - 14px), transparent); }
  .dock { left: 0; right: 0; top: auto; bottom: calc(12px + env(safe-area-inset-bottom)); margin: 0 auto; width: fit-content; height: auto; flex-direction: row; padding: 6px; }
  .dock__tip, .dock__sep, .dock [data-desktop] { display: none; }
  .dock__btn[aria-current="page"]::after { right: auto; left: 50%; top: auto; bottom: 3px; margin: 0 0 0 -2.5px; }
  .head__stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; width: 100%; }
  .stat__ico { width: 40px; height: 40px; }
  .stat__value { font-size: 18px; flex-wrap: wrap; }
  /* phones: one column in source order, whatever areas the page defined */
  .bento { grid-template-columns: minmax(0, 1fr); grid-template-areas: none !important; }
  .bento > * { grid-area: auto !important; }
  .toast { bottom: calc(84px + env(safe-area-inset-bottom)); }
  input, select, textarea { font-size: 16px; }   /* iOS never zooms on focus */
  /* modals and drawers become bottom sheets */
  .modal, .drawer { inset: auto 0 0 0; width: 100%; max-width: none; margin: auto 0 0; max-height: 92dvh; overflow: auto; border-radius: 28px 28px 0 0; border-bottom: 0; padding-bottom: calc(22px + env(safe-area-inset-bottom)); }
}
@media (max-width: 480px) { .stat__ico { display: none; } .head__actions { margin-left: 0; width: 100%; } }
@media (prefers-reduced-motion: reduce) {
  .mesh i { will-change: auto; }
  *, *::before, *::after { transition-duration: 0s !important; animation-duration: 0s !important; }
}
