/* Voice Console: design system.
   Pattern: soft pastel gradient page, floating frosted-glass cards with large rounded corners, a dark pill
   navigation, a dark floating icon rail with a yellow primary button, soft pills and tags, smooth charts.
   Light and dark themes. */
@font-face { font-family: "Plus Jakarta Sans Variable"; src: url("/static/ui/fonts/plus-jakarta-sans-latin-wght-normal.woff2") format("woff2");
  font-weight: 200 800; font-display: swap; }

:root {
  --bg-a: #d9f1ec; --bg-b: #dce9fb; --bg-c: #f4efe6; --bg-d: #fbe9dc;
  --ink: #14181b; --muted: #66727a; --faint: #9aa5ac;
  --glass: rgba(255, 255, 255, .66); --glass-strong: rgba(255, 255, 255, .92); --glass-line: rgba(255, 255, 255, .85);
  --line: rgba(20, 24, 27, .08); --line-strong: rgba(20, 24, 27, .16);
  --dark: #14181b; --dark-2: #1f2a2c; --on-dark: #fff;
  --green: #0e7c61; --green-soft: #d6efe6; --green-ink: #0a5c47;
  --yellow: #f4b63f; --yellow-soft: #fbecc7; --yellow-ink: #8a5a00;
  --red: #e5484d; --red-soft: #fbdcdd; --red-ink: #a8282c;
  --blue: #3b82f6; --blue-soft: #dbe7fd;
  --shadow: 0 18px 50px rgba(33, 70, 70, .08); --shadow-sm: 0 6px 18px rgba(33, 70, 70, .07);
  --r-lg: 30px; --r-md: 22px; --r-sm: 16px;
  --font: "Plus Jakarta Sans Variable", "Plus Jakarta Sans", "Nirmala UI", "Noto Sans Devanagari", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --ease: cubic-bezier(.2, .7, .2, 1);
}
[data-theme="dark"] {
  --bg-a: #0f2a2a; --bg-b: #121c33; --bg-c: #101417; --bg-d: #1a1512;
  --ink: #eef2f2; --muted: #9aa8ad; --faint: #6c7a80;
  --glass: rgba(255, 255, 255, .055); --glass-strong: rgba(255, 255, 255, .1); --glass-line: rgba(255, 255, 255, .09);
  --line: rgba(255, 255, 255, .09); --line-strong: rgba(255, 255, 255, .2);
  --dark: #0a0d0e; --dark-2: #1b2527; --on-dark: #fff;
  --green: #2cb58d; --green-soft: rgba(44, 181, 141, .18); --green-ink: #6fdcb9;
  --yellow-soft: rgba(244, 182, 63, .18); --yellow-ink: #f4c668;
  --red-soft: rgba(229, 72, 77, .2); --red-ink: #ff9a9d; --blue-soft: rgba(59, 130, 246, .2);
  --shadow: 0 18px 50px rgba(0, 0, 0, .35); --shadow-sm: 0 6px 18px rgba(0, 0, 0, .3);
}
* { box-sizing: border-box; }
html { color-scheme: light; } [data-theme="dark"] { color-scheme: dark; }
body { margin: 0; min-height: 100vh; color: var(--ink); font: 500 15px/1.55 var(--font); -webkit-font-smoothing: antialiased;
  background:
    radial-gradient(900px 520px at 6% -8%, var(--bg-a), transparent 62%),
    radial-gradient(900px 520px at 96% -6%, var(--bg-b), transparent 60%),
    radial-gradient(900px 600px at 80% 112%, var(--bg-d), transparent 60%),
    var(--bg-c);
  background-attachment: fixed; }
a { color: inherit; text-decoration: none; } a:hover { color: var(--green); }
h1, h2, h3 { margin: 0; line-height: 1.1; letter-spacing: -.035em; font-weight: 600; }
h1 { font-size: clamp(2.1rem, 1.6rem + 2.2vw, 3.1rem); font-weight: 500; letter-spacing: -.045em; }
h2 { font-size: 1.5rem; } h3 { font-size: 1.1rem; font-weight: 600; letter-spacing: -.02em; }
.muted { color: var(--muted); } .small { font-size: 13px; } .mono { font-family: var(--mono); font-size: .92em; }
.label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.accent { color: var(--green); } .bad { color: var(--red); }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--green) 55%, transparent); outline-offset: 2px; border-radius: 12px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
svg.i { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- page frame ---------- */
.app { max-width: 1500px; margin: 0 auto; padding: 22px 32px 80px 132px; }
.topbar { display: flex; align-items: center; gap: 14px; margin-bottom: 28px; }
.logo { display: flex; align-items: center; gap: 12px; font-weight: 700; font-size: 22px; letter-spacing: -.04em; }
.logo small { display: block; font-size: 12px; font-weight: 500; letter-spacing: 0; color: var(--muted); margin-top: 1px; line-height: 1.1; }
.page__head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px 24px; margin-bottom: 26px; }
.page__head p { margin: 8px 0 0; color: var(--muted); max-width: 62ch; }
.page__head .label { display: block; margin-bottom: 8px; }
.logo .mark { width: 50px; height: 50px; border-radius: 17px; background: var(--dark); color: #fff; display: grid; place-items: center; }
.logo .mark svg { width: 26px; height: 26px; stroke-width: 2.2; }
.pills { display: flex; gap: 4px; flex: 1; margin-left: 22px; overflow-x: auto; scrollbar-width: none; padding: 2px; }
.pills::-webkit-scrollbar { display: none; }
.pill-link { display: inline-flex; align-items: center; gap: 8px; padding: 12px 20px; border-radius: 999px; font-weight: 600; white-space: nowrap; color: var(--ink); transition: background .15s var(--ease); }
.pill-link:hover { background: var(--glass); color: var(--ink); }
.pill-link[aria-current="page"] { background: var(--dark); color: #fff; }
[data-theme="dark"] .pill-link[aria-current="page"] { background: #fff; color: #14181b; }
.badge { min-width: 22px; height: 22px; padding: 0 7px; border-radius: 999px; background: var(--yellow); color: #14181b; font-size: 12px; font-weight: 800; display: inline-grid; place-items: center; }
.badge--red { background: var(--red); color: #fff; }
.chip { display: inline-flex; align-items: center; gap: 10px; padding: 6px 16px 6px 7px; border-radius: 999px; background: var(--glass); border: 1px solid var(--glass-line); box-shadow: var(--shadow-sm); font-weight: 600; cursor: default; }
.chip .ic { width: 34px; height: 34px; border-radius: 50%; background: var(--dark); color: #fff; display: grid; place-items: center; }
.chip .ic svg { width: 17px; height: 17px; }
button.chip { font: inherit; color: inherit; cursor: pointer; }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: linear-gradient(135deg, #f6c453, #ef8a4b); color: #14181b; font-weight: 800; display: grid; place-items: center; flex: none; font-size: 14px; }
.who { line-height: 1.15; text-align: left; } .who b { display: block; font-size: 14px; } .who small { color: var(--muted); font-size: 12px; font-weight: 500; }
.iconbtn { width: 48px; height: 48px; border-radius: 50%; background: var(--glass); border: 1px solid var(--glass-line); box-shadow: var(--shadow-sm); display: grid; place-items: center; color: var(--ink); position: relative; cursor: pointer; }
.iconbtn:hover { background: var(--glass-strong); color: var(--ink); }
.dot { position: absolute; top: 11px; right: 12px; width: 10px; height: 10px; border-radius: 50%; background: var(--red); border: 2px solid var(--bg-c); }
.menu { position: relative; } .menu__panel { display: none; position: absolute; right: 0; top: calc(100% + 8px); min-width: 220px; padding: 8px; border-radius: 22px; background: var(--glass-strong); border: 1px solid var(--glass-line); box-shadow: var(--shadow); backdrop-filter: blur(20px); z-index: 40; }
.menu.open .menu__panel { display: block; }
.menu__panel a, .menu__panel button { display: flex; width: 100%; align-items: center; gap: 10px; padding: 11px 14px; border-radius: 14px; background: none; border: 0; font: 600 14px var(--font); color: var(--ink); cursor: pointer; text-align: left; }
.menu__panel a:hover, .menu__panel button:hover { background: var(--glass); color: var(--ink); }
.menu__panel .hd { padding: 10px 14px 6px; font-size: 12px; color: var(--muted); } .menu__panel .hd b { display: block; color: var(--ink); font-size: 14px; }
.menu-btn { display: none; }

/* floating icon rail */
.rail { position: fixed; left: 26px; top: 50%; transform: translateY(-44%); width: 80px; padding: 18px 0; background: var(--dark); border-radius: 42px; display: flex; flex-direction: column; align-items: center; gap: 12px; z-index: 30; box-shadow: 0 24px 50px rgba(0, 0, 0, .22); }
.rail a, .rail button { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; color: #d6dcdf; background: transparent; border: 0; cursor: pointer; position: relative; transition: background .15s var(--ease); }
.rail a:hover, .rail button:hover { background: rgba(255, 255, 255, .12); color: #fff; }
.rail .primary { width: 64px; height: 64px; background: var(--yellow); color: #14181b; margin: 4px 0; box-shadow: 0 8px 20px rgba(244, 182, 63, .4); } .rail .primary:hover { background: #ffc552; color: #14181b; }
.rail .primary svg { width: 26px; height: 26px; stroke-width: 2.4; }
.rail .sep { width: 34px; height: 1px; background: rgba(255, 255, 255, .15); }
.rail .rdot::after { content: ""; position: absolute; top: 8px; right: 9px; width: 9px; height: 9px; border-radius: 50%; background: var(--red); }
.rail [aria-current="page"] { background: rgba(255, 255, 255, .16); color: #fff; }

/* title row with inline stats */
.titlebar { display: flex; align-items: center; flex-wrap: wrap; gap: 18px 34px; margin-bottom: 28px; }
.titlebar .grow { flex: 1; }
.titlebar p { margin: 8px 0 0; color: var(--muted); max-width: 58ch; font-weight: 500; }
.stat { display: flex; align-items: center; gap: 14px; }
.stat .ic { width: 52px; height: 52px; border-radius: 50%; background: var(--glass-strong); display: grid; place-items: center; box-shadow: var(--shadow-sm); color: var(--ink); }
.stat b { font-size: 26px; font-weight: 600; letter-spacing: -.035em; line-height: 1.1; display: inline-flex; gap: 8px; align-items: center; }
.stat small { display: block; color: var(--muted); font-size: 13px; line-height: 1.3; max-width: 170px; font-weight: 500; }
.delta { display: inline-block; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: var(--green-soft); color: var(--green-ink); letter-spacing: 0; }
.delta--down { background: var(--red-soft); color: var(--red-ink); }

/* ---------- buttons, tags, forms ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 9px; height: 46px; padding: 0 24px; border-radius: 999px; font: 600 14.5px/1 var(--font); border: 1px solid var(--glass-line); background: var(--glass-strong); color: var(--ink); cursor: pointer; box-shadow: var(--shadow-sm); transition: transform .15s var(--ease), box-shadow .15s var(--ease), background .15s; white-space: nowrap; }
.btn:hover { color: var(--ink); transform: translateY(-1px); box-shadow: 0 10px 24px rgba(33, 70, 70, .12); }
.btn:active { transform: none; }
.btn--ink { background: var(--dark); color: #fff; border-color: var(--dark); } .btn--ink:hover { color: #fff; background: #000; }
[data-theme="dark"] .btn--ink { background: #fff; color: #14181b; border-color: #fff; } [data-theme="dark"] .btn--ink:hover { background: #e8eeee; color: #14181b; }
.btn--accent { background: var(--green); color: #fff; border-color: var(--green); } .btn--accent:hover { color: #fff; background: var(--green-ink); }
[data-theme="dark"] .btn--accent { color: #06241b; } [data-theme="dark"] .btn--accent:hover { color: #06241b; background: #44c9a1; }
.btn--sm { height: 36px; padding: 0 16px; font-size: 13px; }
.btn--danger { color: var(--red-ink); } .btn--danger:hover { color: var(--red-ink); background: var(--red-soft); }
.btn[disabled] { opacity: .45; pointer-events: none; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.tag { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 999px; font: 700 12px/1.4 var(--font); background: var(--glass-strong); color: var(--muted); border: 1px solid var(--line); white-space: nowrap; }
.tag--ink { background: var(--dark); color: #fff; border-color: var(--dark); } .tag--line { background: transparent; }
.tag--good { background: var(--green-soft); color: var(--green-ink); border-color: transparent; }
.tag--bad { background: var(--red-soft); color: var(--red-ink); border-color: transparent; }
.tag--warn { background: var(--yellow-soft); color: var(--yellow-ink); border-color: transparent; }
.tag--blue { background: var(--blue-soft); color: var(--blue); border-color: transparent; }
.field { display: grid; gap: 7px; margin-bottom: 16px; } .field > label, .field > .label { font-weight: 600; font-size: 13px; color: var(--muted); }
input:not([type]), input[type=text], input[type=email], input[type=password], input[type=search], input[type=date], input[type=datetime-local], input[type=time], input[type=tel], input[type=url], input[type=number], input[type=file], select, textarea {
  width: 100%; min-width: 0; max-width: 100%; box-sizing: border-box; height: 46px; padding: 0 16px; font: 500 15px var(--font); color: var(--ink); background: var(--glass-strong); border: 1px solid var(--line-strong); border-radius: var(--r-sm); }
select { padding-right: 34px; } textarea { height: auto; min-height: 110px; padding: 12px 16px; resize: vertical; line-height: 1.5; }
input[type=file] { padding: 10px 14px; height: auto; }
input::placeholder, textarea::placeholder { color: var(--faint); }
input:focus, select:focus, textarea:focus { outline: 3px solid color-mix(in srgb, var(--green) 40%, transparent); outline-offset: 0; border-color: var(--green); }
.help { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 500; } .check input { width: 18px; height: 18px; margin-top: 3px; accent-color: var(--green); }
.filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px 14px; align-items: end; margin-bottom: 22px; padding: 18px 22px; border-radius: var(--r-lg); background: var(--glass); border: 1px solid var(--glass-line); box-shadow: var(--shadow); backdrop-filter: blur(18px); }
.filters .field { margin: 0; }
.seg { display: inline-flex; padding: 4px; border-radius: 999px; background: var(--glass); border: 1px solid var(--glass-line); }
.seg a { padding: 8px 16px; border-radius: 999px; font-weight: 700; font-size: 13px; color: var(--muted); } .seg a:hover { color: var(--ink); }
.seg a.on { background: var(--glass-strong); color: var(--ink); box-shadow: var(--shadow-sm); }
.flash { padding: 14px 20px; border-radius: var(--r-md); margin-bottom: 20px; font-weight: 600; background: var(--glass-strong); box-shadow: var(--shadow-sm); border-left: 8px solid var(--faint); }
.flash--ok { border-left-color: var(--green); } .flash--err { border-left-color: var(--red); } .flash--warn { border-left-color: var(--yellow); }

/* ---------- cards ---------- */
.panel, .card { border-radius: var(--r-lg); background: var(--glass); border: 1px solid var(--glass-line); box-shadow: var(--shadow); backdrop-filter: blur(18px); margin-bottom: 22px; overflow: hidden; }
.panel__head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 22px 26px 6px; }
.panel__head h3 { font-size: 1.15rem; font-weight: 500; letter-spacing: -.025em; }
.panel__body { padding: 12px 26px 26px; }
.round-link { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: var(--glass-strong); border: 1px solid var(--line); color: var(--ink); } .round-link:hover { background: var(--dark); color: #fff; }
.grid { display: grid; gap: 22px; } .grid-2 { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); } .grid-3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid > .panel { margin-bottom: 0; }
.cols { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 22px; align-items: start; margin-bottom: 22px; } .cols > .panel { margin-bottom: 0; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 22px; }
.kpi { padding: 20px 22px; border-radius: var(--r-md); background: var(--glass); border: 1px solid var(--glass-line); box-shadow: var(--shadow-sm); backdrop-filter: blur(14px); }
.kpi b { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: clamp(1.7rem, 1.4rem + 1.1vw, 2.3rem); line-height: 1.1; letter-spacing: -.04em; font-weight: 600; margin-top: 6px; }
.kpi b small { font-size: .5em; font-weight: 600; color: var(--muted); letter-spacing: 0; }
.kpi .note { font-size: 12.5px; color: var(--muted); margin-top: 6px; font-weight: 500; }
.kpi--accent { background: var(--dark); border-color: var(--dark); color: #fff; } .kpi--accent .label, .kpi--accent .note { color: rgba(255, 255, 255, .7); }
.kpi--accent b { color: var(--yellow); }
[data-theme="dark"] .kpi--accent { background: var(--dark-2); border-color: var(--glass-line); }

/* hero "up next" card */
.hero { margin: 8px 0 18px; padding: 26px; border-radius: 26px; color: #fff; background: radial-gradient(500px 240px at 100% 0, rgba(44, 181, 141, .25), transparent 60%), linear-gradient(135deg, #12181a, #1d2a2c); display: grid; grid-template-columns: 1fr auto; gap: 14px 20px; align-items: end; position: relative; }
.hero .who-line { display: flex; align-items: center; gap: 12px; font-weight: 600; }
.initials { width: 40px; height: 40px; border-radius: 13px; background: var(--red); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 14px; flex: none; }
.initials--sm { width: 38px; height: 38px; border-radius: 12px; font-size: 13px; }
.initials--green { background: var(--green); } .initials--yellow { background: var(--yellow); color: #14181b; } .initials--blue { background: var(--blue); } .initials--dark { background: #2a3538; }
.hero .when { font-size: 13px; color: rgba(255, 255, 255, .62); margin: 20px 0 2px; }
.hero .big { font-size: clamp(2rem, 1.5rem + 2.2vw, 3rem); font-weight: 500; letter-spacing: -.045em; line-height: 1.05; }
.hero .at { display: flex; gap: 8px; align-items: center; color: rgba(255, 255, 255, .75); margin: 10px 0 14px; font-weight: 500; }
.hero .text { color: rgba(255, 255, 255, .9); max-width: 60ch; font-size: 15.5px; line-height: 1.5; }
.hero .round-link { background: transparent; border-color: rgba(255, 255, 255, .25); color: #fff; width: 48px; height: 48px; } .hero .round-link:hover { background: #fff; color: #14181b; }
.hero .tag { position: absolute; top: 24px; right: 24px; background: var(--yellow); color: #14181b; border: 0; }
.upcoming { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 8px 22px; }
.up { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 8px 4px; border-radius: 16px; } .up:hover { background: var(--glass); }
.up b { display: block; font-weight: 600; font-size: 14.5px; } .up small { color: var(--muted); font-size: 12.5px; }
.needs { display: grid; gap: 14px; }
.need { padding: 14px 16px; border-radius: 22px; background: var(--glass-strong); box-shadow: var(--shadow-sm); display: grid; grid-template-columns: auto 1fr; gap: 14px; }
.need b { display: block; font-weight: 600; line-height: 1.3; } .need small { color: var(--muted); font-size: 12.5px; } .need .btn-row { margin-top: 10px; }
.need--alert .initials { background: var(--red-soft); color: var(--red-ink); }
.countdot { min-width: 26px; height: 26px; padding: 0 8px; border-radius: 999px; background: var(--red); color: #fff; font-size: 13px; font-weight: 800; display: inline-grid; place-items: center; }

/* ---------- tables, lists ---------- */
table.t { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.t th { text-align: left; padding: 14px 22px 12px; font-size: 11.5px; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; color: var(--muted); white-space: nowrap; border-bottom: 1px solid var(--line); }
.t td { padding: 15px 22px; border-bottom: 1px solid var(--line); vertical-align: top; }
.t tbody tr:hover td { background: rgba(255, 255, 255, .45); } [data-theme="dark"] .t tbody tr:hover td { background: rgba(255, 255, 255, .04); }
.t tr:last-child td { border-bottom: 0; }
.t a.row { font-weight: 700; } .t a.row:hover { color: var(--green); }
.t .num { text-align: right; font-variant-numeric: tabular-nums; }
.tablewrap { overflow-x: auto; }
.pager { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 14px 22px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.empty { padding: 46px 22px; text-align: center; color: var(--muted); }
.empty b { display: block; font-size: 1.2rem; color: var(--ink); letter-spacing: -.02em; margin-bottom: 4px; font-weight: 600; }
dl.kv { display: grid; grid-template-columns: minmax(120px, 36%) 1fr; margin: 0; } dl.kv dt, dl.kv dd { margin: 0; padding: 11px 0; border-bottom: 1px solid var(--line); }
dl.kv dt { color: var(--muted); font-size: 13px; font-weight: 600; } dl.kv > :nth-last-child(-n+2) { border-bottom: 0; }
.timeline { list-style: none; margin: 0; padding: 0; } .timeline li { display: grid; grid-template-columns: 10px 1fr; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.timeline li:last-child { border-bottom: 0; } .timeline li::before { content: ""; width: 10px; height: 10px; margin-top: 6px; border-radius: 50%; background: var(--green); }
.chat { display: grid; gap: 10px; } .msg { max-width: 86%; padding: 11px 16px; border-radius: 20px 20px 20px 6px; line-height: 1.5; background: var(--glass-strong); box-shadow: var(--shadow-sm); }
.msg--user { background: var(--dark); color: #fff; margin-left: auto; border-radius: 20px 20px 6px 20px; } [data-theme="dark"] .msg--user { background: var(--green); color: #06241b; }
.msg small { display: block; opacity: .6; font-size: 11px; text-transform: uppercase; letter-spacing: .07em; font-weight: 700; margin-bottom: 2px; }
.chartbox { position: relative; height: 270px; } .chartbox--sm { height: 230px; }
.bignum { display: flex; align-items: baseline; flex-wrap: wrap; gap: 10px 12px; margin: 2px 0 14px; } .bignum b { font-size: 2.3rem; letter-spacing: -.045em; font-weight: 500; } .bignum span { color: var(--muted); font-size: 13px; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; color: var(--muted); font-size: 12.5px; margin-bottom: 8px; } .legend i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; } .legend .dash { width: 16px; height: 0; border-radius: 0; border-top: 2px dashed var(--faint); background: none; vertical-align: middle; }
.def { columns: 2 320px; column-gap: 30px; } .def p { break-inside: avoid; margin: 0 0 12px; }
.perm-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 8px 20px; }
details.panel > summary { list-style: none; cursor: pointer; } details.panel > summary::-webkit-details-marker { display: none; }

/* ---------- login ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login__card { width: min(460px, 100%); padding: 38px; border-radius: 36px; background: var(--glass); border: 1px solid var(--glass-line); box-shadow: var(--shadow); backdrop-filter: blur(24px); }
.login__brand { display: flex; align-items: center; gap: 12px; margin-bottom: 26px; font-weight: 700; font-size: 20px; letter-spacing: -.03em; }
.login__brand .mark { width: 48px; height: 48px; border-radius: 16px; background: var(--dark); color: #fff; display: grid; place-items: center; }
.login h1 { font-size: 2.3rem; margin-bottom: 6px; } .login .sub { color: var(--muted); margin: 0 0 24px; }
.login form .btn { width: 100%; height: 50px; }

/* ---------- small screens ---------- */
@media (max-width: 1100px) { .cols { grid-template-columns: 1fr; } .who, .pills { display: none; } .menu-btn { display: grid; } .pills.open { display: flex; position: absolute; left: 14px; right: 14px; top: 84px; flex-direction: column; padding: 10px; border-radius: 26px; background: var(--glass-strong); box-shadow: var(--shadow); backdrop-filter: blur(20px); z-index: 45; margin: 0; } }
@media (max-width: 900px) {
  .app { padding: 14px 14px 110px; } .topbar { margin-bottom: 20px; position: relative; } .logo { font-size: 19px; } .logo .mark { width: 44px; height: 44px; border-radius: 15px; }
  .topbar .grow-sp { flex: 1; } .chip.org { display: none; }
  .rail { left: 50%; top: auto; bottom: 14px; transform: translateX(-50%); width: auto; padding: 10px 16px; border-radius: 34px; flex-direction: row; gap: 4px; max-width: calc(100vw - 24px); }
  .rail .sep { width: 1px; height: 26px; } .rail .primary { width: 54px; height: 54px; margin: -22px 6px 0; } .rail a, .rail button { width: 42px; height: 42px; }
  .titlebar { gap: 16px 22px; } .stat .ic { width: 44px; height: 44px; } .stat b { font-size: 22px; }
  .panel__head { padding: 18px 18px 4px; } .panel__body { padding: 10px 18px 20px; } .t th, .t td { padding-left: 14px; padding-right: 14px; }
  .hero { grid-template-columns: 1fr; } .hero .tag { position: static; justify-self: start; } .login__card { padding: 28px 22px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
@media print { .rail, .topbar { display: none !important; } .app { padding: 0; } body { background: #fff; } }

/* the hidden attribute must always win over component display rules */
[hidden] { display: none !important; }

/* =====================================================================================================================
   RESPONSIVE LAYER (phones, tablets, desktop). Written last so it wins over the rules above.
   Rules of thumb: nothing may be wider than the screen; tables become labelled cards on phones; every tap target is at least
   40px; inputs are 16px so phones do not zoom in; the bottom bar never covers content.
   ===================================================================================================================== */
html { -webkit-text-size-adjust: 100%; } body { min-height: 100dvh; overflow-x: hidden; -webkit-tap-highlight-color: transparent; }
img, svg, canvas, video { max-width: 100%; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(min(340px, 100%), 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); }
.kpis { grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr)); }
.upcoming { grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); }
.perm-grid { grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); }
.filters { grid-template-columns: repeat(auto-fit, minmax(min(150px, 100%), 1fr)); }
.panel, .card, .kpi, .need, .hero { min-width: 0; } .page__head > * { min-width: 0; }
.pill-ic, .pill-sep, .pill-extra { display: none; }
pre, code { overflow-wrap: anywhere; } .mono { overflow-wrap: anywhere; }
.tablewrap { -webkit-overflow-scrolling: touch; }

/* tablets and small laptops: the top menu folds into a sheet */
@media (max-width: 1100px) {
  .app { padding-left: 120px; }
  .pills.open { position: fixed; left: 14px; right: 14px; top: calc(76px + env(safe-area-inset-top)); bottom: auto; max-height: calc(100dvh - 190px); overflow-y: auto; gap: 2px; padding: 10px; border-radius: 28px; z-index: 60; }
  .pills.open .pill-link { padding: 0 18px; min-height: 52px; font-size: 16px; border-radius: 18px; justify-content: flex-start; }
  .pills.open .pill-link .badge { margin-left: auto; }
  .pills.open .pill-ic { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 12px; background: var(--glass); }
  .pills.open .pill-link[aria-current="page"] .pill-ic { background: rgba(255, 255, 255, .16); }
  .pills.open .pill-sep { display: block; height: 1px; margin: 8px 12px; background: var(--line-strong); }
  .pills.open .pill-extra { display: inline-flex; }
  body.menu-open::after { content: ""; position: fixed; inset: 0; background: rgba(10, 14, 16, .35); backdrop-filter: blur(3px); z-index: 50; }
  .topbar { position: relative; z-index: 55; }
}

/* phones and small tablets */
@media (max-width: 900px) {
  .app { padding: calc(12px + env(safe-area-inset-top)) 14px calc(112px + env(safe-area-inset-bottom)); }
  .topbar { gap: 8px; margin-bottom: 18px; }
  .logo { font-size: 17px; gap: 10px; min-width: 0; flex: 1 1 auto; } .logo > span { min-width: 0; white-space: nowrap; }
  .logo small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 46vw; font-size: 11.5px; }
  .logo .mark { width: 40px; height: 40px; border-radius: 14px; flex: none; } .logo .mark svg { width: 22px; height: 22px; }
  .topbar .grow-sp { display: none; }
  .iconbtn { width: 42px; height: 42px; flex: none; } .dot { top: 8px; right: 9px; }
  .chip { padding: 4px; } .avatar { width: 34px; height: 34px; font-size: 13px; }
  .menu__panel { position: fixed; right: 12px; left: auto; top: calc(66px + env(safe-area-inset-top)); width: min(290px, calc(100vw - 24px)); z-index: 70; }
  .menu__panel a, .menu__panel button { min-height: 46px; font-size: 15px; }
  .rail { bottom: calc(12px + env(safe-area-inset-bottom)); max-width: calc(100vw - 20px); justify-content: space-between; gap: 0; padding: 9px 12px; box-shadow: 0 16px 36px rgba(0, 0, 0, .28); }
  .rail a, .rail button { width: 44px; height: 44px; flex: none; } .rail .primary { width: 56px; height: 56px; margin: -22px 4px 0; }

  h1 { font-size: clamp(1.9rem, 1.5rem + 3vw, 2.4rem); }
  .page__head { gap: 12px; margin-bottom: 18px; align-items: flex-start; } .page__head p { font-size: 14.5px; }
  .page__head > .btn-row { width: 100%; gap: 8px; } .page__head > .btn-row > .btn, .page__head > .btn-row > form { flex: 1 1 calc(50% - 8px); min-width: 0; } .page__head > .btn-row > .btn--accent { flex-basis: 100%; } .page__head > .btn-row > form .btn { width: 100%; }
  .btn { height: 46px; } .btn--sm { height: 42px; padding: 0 16px; font-size: 14px; }
  input:not([type]), input[type=text], input[type=email], input[type=password], input[type=search], input[type=date], input[type=datetime-local], input[type=time], input[type=number], input[type=tel], input[type=url], select, textarea { font-size: 16px; min-height: 46px; }
  input[type=checkbox], input[type=radio] { width: 20px; height: 20px; accent-color: var(--green); }
  label.small, .btn-row > label { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; }
  .panel, .card { border-radius: 26px; margin-bottom: 16px; } .panel__head { padding: 16px 18px 4px; flex-wrap: wrap; } .panel__body { padding: 10px 18px 20px; }
  .grid, .cols { gap: 16px; } .kpis { gap: 12px; } .kpi { padding: 16px 16px; border-radius: 20px; }
  .kpi b { font-size: clamp(1.5rem, 1.2rem + 2vw, 1.9rem); } .kpi .note { font-size: 12px; }
  .chartbox { height: 220px; } .chartbox--sm { height: 190px; }
  .titlebar { gap: 14px 18px; } .stat small { max-width: none; }
  .pager { padding: 12px 16px; } .pager .btn-row { width: 100%; justify-content: space-between; }
  .flash { padding: 12px 16px; border-radius: 18px; }
  .hero { padding: 20px; border-radius: 22px; } .hero .big { font-size: clamp(1.8rem, 1.3rem + 3vw, 2.4rem); }
  .login { padding: 16px; } .login__card { padding: 26px 20px; border-radius: 28px; } .login h1 { font-size: 2rem; }
  dl.kv { grid-template-columns: 1fr; } dl.kv dt { border-bottom: 0; padding: 10px 0 0; } dl.kv dd { padding: 2px 0 10px; } dl.kv > :nth-last-child(-n+2) { border-bottom: 0; }
  /* forms with fixed inline columns: never wider than the screen */
  [style*="grid-template-columns"].filters { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .filters { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 14px; gap: 10px; border-radius: 24px; }
  .filters .field { min-width: 0; } .filters .field:has(input[type=search]), .filters > .btn, .filters .field[style*="grid-column"] { grid-column: 1 / -1 !important; }
  .filters > .btn { width: 100%; }
  [style*="sticky"][style*="bottom"] { bottom: calc(96px + env(safe-area-inset-bottom)) !important; }
  [style*="max-width:340px"], [style*="min-width:140px"], [style*="min-width:120px"] { max-width: 100% !important; min-width: 0 !important; }
  [style*="grid-auto-columns"] { grid-auto-columns: 82vw !important; scroll-snap-type: x mandatory; scroll-padding: 14px; }
  [style*="grid-auto-columns"] > section { scroll-snap-align: start; }
  .msg { max-width: 94%; }
  /* filter forms fold away behind one button (see app.js) */
  .filters-toggle { display: flex; width: 100%; justify-content: space-between; margin-bottom: 10px; }
  form.filters.is-collapsed .field:not(:first-child), form.filters.is-collapsed > .btn { display: none; }
}
@media (min-width: 901px) { .filters-toggle { display: none; } }

/* phones: narrower grids */
@media (max-width: 700px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-2, .grid-3, .upcoming, .perm-grid { grid-template-columns: minmax(0, 1fr); }
  .def { columns: 1; }
  .up { grid-template-columns: auto minmax(0, 1fr) auto; }
}
@media (max-width: 400px) {
  .app { padding-left: 10px; padding-right: 10px; } .btn { padding: 0 18px; } .kpi b { font-size: 1.45rem; }
  .logo small { max-width: 38vw; } .stat b { font-size: 20px; }
  .rail a, .rail button { width: 40px; height: 40px; } .rail .primary { width: 52px; height: 52px; }
}
/* landscape phones: a fixed bottom bar would hide too much */
@media (max-height: 480px) and (max-width: 900px) { .rail { position: static; transform: none; margin: 16px auto 0; } .app { padding-bottom: 24px; } }

/* =====================================================================================================================
   TABLES: on phones and tablets every table swipes sideways and never wraps its text. The edges fade where there is more.
   ===================================================================================================================== */
@media (max-width: 1100px) {
  .tablewrap { overflow-x: auto; overflow-y: hidden; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; touch-action: pan-x pan-y; scrollbar-width: none; }
  .tablewrap::-webkit-scrollbar { display: none; }
  .tablewrap.can-right:not(.can-left) { -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 44px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 44px), transparent); }
  .tablewrap.can-left:not(.can-right) { -webkit-mask-image: linear-gradient(270deg, #000 calc(100% - 44px), transparent); mask-image: linear-gradient(270deg, #000 calc(100% - 44px), transparent); }
  .tablewrap.can-left.can-right { -webkit-mask-image: linear-gradient(90deg, transparent, #000 44px, #000 calc(100% - 44px), transparent); mask-image: linear-gradient(90deg, transparent, #000 44px, #000 calc(100% - 44px), transparent); }
  table.t { width: max-content; min-width: 100%; }
  .t th, .t td { white-space: nowrap !important; padding: 13px 16px; }
  .t td[style*="max-width"], .t td.clip { max-width: 320px !important; overflow: hidden; text-overflow: ellipsis; }
  .t td .btn-row { flex-wrap: nowrap; } .t td .tag { white-space: nowrap; }
  .t td details { display: inline-block; }
  .swipe-hint { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 8px 12px 0; font-size: 12px; font-weight: 700; letter-spacing: .04em; color: var(--muted); animation: swipe-nudge 1.6s ease-in-out infinite; }
  .swipe-hint svg { width: 16px; height: 16px; }
}
@media (min-width: 1101px) { .swipe-hint { display: none; } }
@keyframes swipe-nudge { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(6px); } }

/* =====================================================================================================================
   THE ICON BAR AND ITS LIQUID INDICATOR. The yellow bubble sits on the page you are on. When you choose another option it flows
   there: two blobs travel at different speeds and a "goo" filter joins them into one stretching drop.
   ===================================================================================================================== */
.rail { --bub: 58px; }
.rail-goo { position: absolute; inset: -14px; pointer-events: none; z-index: 0; filter: url(#rail-goo); }
.rail-goo i { position: absolute; left: 0; top: 0; width: var(--bub); height: var(--bub); border-radius: 50%; background: var(--yellow);
  transform: translate(calc(var(--x, 0px) - var(--bub) / 2), calc(var(--y, 0px) - var(--bub) / 2)); transition: opacity .25s, transform .62s cubic-bezier(.3, 1.25, .45, 1); }
.rail-goo .b1 { transition: opacity .25s, transform .42s cubic-bezier(.34, 1.45, .5, 1); }
.rail-goo .b2 { transition: opacity .25s, transform .78s cubic-bezier(.25, .9, .4, 1) .05s; width: calc(var(--bub) * .84); height: calc(var(--bub) * .84); margin: calc(var(--bub) * .08) 0 0 calc(var(--bub) * .08); }
.rail-goo.no-anim i { transition: none !important; }
.rail-goo.off i { opacity: 0; }
.rail a, .rail button { position: relative; z-index: 1; transition: color .25s var(--ease), background .15s var(--ease); }
.rail a.on, .rail button.on { color: #14181b; background: transparent !important; }
.rail a.on svg { transform: scale(1.08); } .rail a svg { transition: transform .3s var(--ease); }
.rail .quick { background: rgba(255, 255, 255, .1); }
.rail .rail-more { display: none; }
@media (max-width: 900px) {
  .rail { --bub: 52px; }
  .rail .rail-more { display: grid; } .rail [data-theme-toggle], .rail .sep { display: none; }
  .rail a, .rail button { width: 44px; height: 44px; margin: 0; }
}
@media (max-width: 400px) { .rail { --bub: 48px; } .rail a, .rail button { width: 41px; height: 41px; } }
@media (prefers-reduced-motion: reduce) { .rail-goo i { transition: none !important; } .swipe-hint { animation: none; } }

/* very small phones: forms with inline columns use a single column so nothing touches the edge */
@media (max-width: 480px) { [style*="grid-template-columns"].filters { grid-template-columns: minmax(0, 1fr) !important; } }

@media (max-width: 1100px) { body.menu-open .rail { z-index: 58; } }

/* no table ever wraps its text, on any screen: it scrolls sideways instead; long plain text is cut with an ellipsis */
.t th, .t td { white-space: nowrap !important; }
.t td.clip { max-width: 360px; overflow: hidden; text-overflow: ellipsis; }
.t td .btn-row { flex-wrap: nowrap; }

/* ---- CHECKLIST (settings: phone line) ---- */
.checklist { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.checklist li { line-height: 1.45; overflow-wrap: anywhere; }
details > summary { cursor: pointer; }
input[readonly] { font-family: ui-monospace, Consolas, monospace; font-size: 16px; }

/* ---- REPORTS (tabs, funnel, comparison cells) ---- */
.tabs { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 10px; margin: 0 0 6px; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { flex: none; padding: 9px 16px; min-height: 40px; display: inline-flex; align-items: center; border-radius: 999px; font-weight: 600; font-size: 14px;
  background: var(--glass, rgba(255,255,255,.6)); color: var(--ink, inherit); text-decoration: none; border: 1px solid transparent; }
.tab--on { background: var(--dark, #1c1f24); color: #fff; }
.funnel { display: grid; gap: 10px; }
.funnel__row { display: grid; grid-template-columns: minmax(80px, 1.2fr) 2fr auto auto; gap: 10px; align-items: center; padding: 4px 0; }
.funnel__row > span { overflow-wrap: anywhere; }
.funnel__row > b { text-align: right; font-variant-numeric: tabular-nums; }
.funnel__row > small { color: var(--muted, #777); min-width: 36px; text-align: right; }
.funnel__bar { height: 12px; border-radius: 999px; background: rgba(128,128,128,.18); overflow: hidden; }
.funnel__bar i { display: block; height: 100%; border-radius: 999px; background: var(--green, #2e9d6a); }
.panel__body .funnel__row:only-child:not(:has(.funnel__bar)) { grid-template-columns: 1fr auto; }
.funnel__row:not(:has(.funnel__bar)) { grid-template-columns: 1fr auto; }
.t tfoot td { border-top: 2px solid rgba(128,128,128,.35); }
.t td.best { background: var(--green-soft, #dff3e8); color: var(--green-ink, #14683f); font-weight: 700; }
.flash--info { border-left-color: var(--blue); }

/* SMALL FORMS INSIDE A PANEL (new task, quick forms): title on its own full row, the other boxes in a tidy grid, button below. */
.formgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(190px, 100%), 1fr)); gap: 14px 16px; align-items: end; margin-top: 14px; }
.formgrid > .field { margin: 0; min-width: 0; }
.formgrid > .field--wide { grid-column: 1 / -1; }
.formgrid > .formgrid__actions { grid-column: 1 / -1; display: flex; gap: 10px; flex-wrap: wrap; }
input[type=datetime-local] { min-width: 0; }
@media (max-width: 600px) { .formgrid { grid-template-columns: minmax(0, 1fr); } .formgrid > .formgrid__actions .btn { width: 100%; } }
