/* Boss HQ demo shell and shared UI kit. Written from scratch; values (colors, sizes) are measured from the real product, which the client owns. */
:root {
  --bg: #f5f5f5;
  --card: #ffffff;
  --sunk: #f8f8f8;
  --tint: #e9e8e4;
  --hair: #d6d5d2;
  --input: #cdd2d4;
  --neutral: #e0e4e4;
  --text: #1b2226;
  --muted: #57636a;
  --faint: #88939c;
  --accent: #6d92a5;
  --link: #6d92a5;
  --info-fg: #3f6274;
  --info-bg: rgba(109, 146, 165, 0.16);
  --btn: #3c4950;
  --btn-h: #1b2226;
  --btn-t: #f5f5f5;
  --on-accent: #10171a;
  --ok: #3f6b4f;
  --ok-bg: rgba(63, 107, 79, 0.12);
  --warn: #8a6a2b;
  --warn-bg: rgba(138, 106, 43, 0.14);
  --risk: #9a3b32;
  --risk-bg: rgba(154, 59, 50, 0.12);
  --on-tone: #fff;
  --side: #1b2226;
  --topbar: rgba(245, 245, 245, 0.88);
  --scrim: rgba(27, 34, 38, 0.34);
  --shadow: 0 12px 32px -16px rgba(27, 34, 38, 0.18);
  --f: 'Hanken Grotesk', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  color-scheme: light;
}
:root[data-theme='dark'] {
  --bg: #12171a;
  --card: #1b2226;
  --sunk: #171d21;
  --tint: #232c31;
  --hair: #2b353b;
  --input: #38444b;
  --neutral: #2b353b;
  --text: #e8edef;
  --muted: #a2aeb4;
  --faint: #717e86;
  --accent: #8fb6c9;
  --link: #8fb6c9;
  --info-fg: #a8c9d8;
  --info-bg: rgba(143, 182, 201, 0.16);
  --btn: #3c4950;
  --btn-h: #4a5960;
  --btn-t: #f2f5f6;
  --ok: #86c79b;
  --ok-bg: rgba(134, 199, 155, 0.14);
  --warn: #ddb877;
  --warn-bg: rgba(221, 184, 119, 0.15);
  --risk: #e89b92;
  --risk-bg: rgba(232, 155, 146, 0.15);
  --on-tone: #10171a;
  --side: #0c1113;
  --topbar: rgba(18, 23, 26, 0.88);
  --scrim: rgba(6, 9, 10, 0.62);
  --shadow: 0 12px 32px -16px rgba(0, 0, 0, 0.6);
  color-scheme: dark;
}
* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--f);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
h1,
h2,
h3,
h4 {
  margin: 0;
  font-family: var(--f);
  color: var(--text);
  letter-spacing: -0.01em;
}
p {
  margin: 0 0 8px;
}
a {
  color: var(--link);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}
button {
  font-family: var(--f);
  cursor: pointer;
}
input,
select,
textarea {
  font-family: var(--f);
  color: var(--text);
}
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
/* F12A: a dialog or drawer container takes programmatic focus (tabindex -1, demo-app.js:642) so the keyboard lands inside; it is not a control, so it gets no ring. Controls inside keep theirs. */
[role='dialog']:focus-visible,
[role='alertdialog']:focus-visible,
.modal:focus-visible,
.drawer:focus-visible {
  outline: none;
}
::-webkit-scrollbar {
  width: 9px;
  height: 9px;
}
::-webkit-scrollbar-thumb {
  background: var(--input);
  border-radius: 5px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
.ms {
  font-family: 'Material Symbols Outlined';
  font-weight: 400;
  font-style: normal;
  font-size: 20px;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  direction: ltr;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: 'liga';
  vertical-align: middle;
  user-select: none;
}
.muted {
  color: var(--muted);
}
.faint {
  color: var(--faint);
}
.tiny {
  font-size: 11.5px;
}
.small {
  font-size: 12.5px;
}
.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.mono {
  font-family: var(--mono);
  font-size: 12px;
}
.mask {
  color: var(--faint);
  letter-spacing: 0.08em;
}
.neg {
  color: var(--risk);
}
.pos {
  color: var(--ok);
}
.err {
  color: var(--risk);
  font-size: 12.5px;
  font-weight: 600;
  margin-top: 4px;
}

/* ---------- shell ---------- */
.app {
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
  min-height: 100vh;
}
.side {
  background: var(--side);
  color: #f5f5f5;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 20px 0 12px;
}
:root[data-theme='dark'] .side {
  border-right: 1px solid var(--hair);
}
.side-brand {
  padding: 0 18px 18px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.side-brand .mark {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
}
.side-brand .hq {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  line-height: 1;
}
.side-nav {
  flex: 1 1 0;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 4px 10px 16px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.22) transparent;
}
.side-nav::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.14);
}
.nav-group-label {
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: rgba(245, 245, 245, 0.42);
  padding: 16px 10px 6px;
  line-height: 1.6;
}
.nav-gap {
  height: 10px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  width: 100%;
  padding: 8px 10px;
  background: transparent;
  border: 0;
  border-left: 2px solid transparent;
  border-radius: 3px;
  color: rgba(245, 245, 245, 0.74);
  font-size: 13.5px;
  font-weight: 400;
  text-align: left;
  line-height: 1.2;
  transition:
    background 0.2s ease,
    color 0.2s ease;
}
.nav-item:hover {
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
}
.nav-item.active {
  background: rgba(109, 146, 165, 0.2);
  border-left-color: #6d92a5;
  color: #fff;
  font-weight: 600;
}
.nav-ico {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0.9;
  flex-shrink: 0;
  color: #8fb6c9;
}
.nav-ico .ms {
  font-size: 20px;
}
.nav-t-money .nav-ico {
  color: #86c79b;
}
.nav-t-field .nav-ico {
  color: #ddb877;
}
.nav-t-people .nav-ico {
  color: #c0a5c3;
}
.nav-t-insight .nav-ico {
  color: #d19271;
}
.nav-count {
  margin-left: auto;
  font-size: 10.5px;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  padding: 1px 7px;
  border-radius: 9px;
  line-height: 1.5;
}
:root[data-theme='dark'] .nav-count {
  background: rgba(255, 255, 255, 0.16);
}
.nav-item.active .nav-count {
  background: #6d92a5;
}
:root[data-theme='dark'] .nav-item.active .nav-count {
  background: #8fb6c9;
  color: #10171a;
}
.nav-count.alert {
  background: #9a3b32;
}
:root[data-theme='dark'] .nav-count.alert {
  background: #e89b92;
  color: #10171a;
}
.side-foot {
  padding: 12px 16px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}
.who {
  display: flex;
  align-items: center;
  gap: 10px;
}
.who-id {
  flex: 1;
  min-width: 0;
}
.who-av {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #6d92a5;
  color: #1b2226;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  line-height: 1;
}
:root[data-theme='dark'] .who-av {
  color: #10171a;
  background: #8fb6c9;
}
.who-name {
  font-size: 12.5px;
  font-weight: 600;
  color: #fff;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.who-role {
  font-size: 11px;
  color: rgba(245, 245, 245, 0.55);
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.theme-btn {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 4px;
  color: rgba(245, 245, 245, 0.85);
  padding: 0;
}
.theme-btn:hover {
  border-color: #6d92a5;
  color: #fff;
}
.side-report-issue {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  margin-top: 8px;
  padding: 7px 8px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 3px;
  color: rgba(245, 245, 245, 0.8);
  font-size: 12.5px;
  font-weight: 500;
  text-align: left;
}
.side-report-issue:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}
.side-report-issue .ms {
  font-size: 18px;
}
.side .side-m {
  display: none;
}
.side-report-issue:disabled {
  opacity: 0.4;
}
@media (max-width: 768px) {
  .side .nav-item.side-m {
    display: flex;
  }
  .side .nav-group-label.side-m {
    display: block;
  }
}
.who-switch {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 8px 0 4px;
  width: 100%;
  background: var(--accent);
  border: 1px solid transparent;
  color: var(--on-accent);
  font-size: 12px;
  padding: 7px 10px;
  border-radius: 4px;
  text-align: left;
}
.who-switch b {
  font-weight: 600;
  color: var(--on-accent);
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.who-switch:hover {
  background: #5a7e90;
}
:root[data-theme='dark'] .who-switch:hover {
  background: #a8c9d8;
}

.main {
  min-width: 0;
  padding-bottom: 64px;
}
.scrim {
  display: none;
}
.strip {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 28px;
  min-height: 34px;
  font-size: 12px;
  line-height: 1.4;
}
/* one slim slate line, styled like the real app's Viewing-as bar, carrying the demo actions */
.strip.demo {
  background: #3c4950;
  color: #f5f5f5;
  font-weight: 500;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.strip.view {
  background: #3c4950;
  color: #f5f5f5;
  border-bottom: 2px solid var(--accent);
}
.strip.view b {
  font-weight: 700;
}
.strip.view span:not(.ms) {
  flex: 1;
  min-width: 0;
}
.strip-r {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.strip a {
  color: inherit;
  text-decoration: underline;
  font-weight: 600;
}
.strip-short {
  display: none;
}
.strip a.strip-cta {
  background: var(--accent);
  color: #10171a;
  text-decoration: none;
  border-radius: 3px;
  padding: 3px 12px;
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
}
.strip a.strip-cta:hover {
  filter: brightness(1.08);
}
.strip-btn {
  background: transparent;
  border: 1px solid currentColor;
  color: inherit;
  border-radius: 3px;
  padding: 1px 9px;
  font-size: 11px;
  font-weight: 600;
}
.strip-btn:hover {
  background: rgba(255, 255, 255, 0.14);
}
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 28px;
  height: 58px;
  background: var(--topbar);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--hair);
}
.crumbs {
  display: flex;
  align-items: baseline;
  gap: 7px;
  min-width: 0;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
  white-space: nowrap;
  max-width: 56%;
  flex-shrink: 1;
  overflow: hidden;
}
.crumb-cur {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.crumb-l {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  font-weight: 400;
  color: var(--muted);
  max-width: 24ch;
  flex-shrink: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  border-bottom: 1px solid transparent;
}
.crumb-l:hover {
  color: var(--text);
  border-bottom-color: var(--accent);
}
.crumb-l-cur {
  color: var(--text);
  font-weight: 600;
  border-bottom-color: var(--input);
}
.crumb-sep {
  color: var(--faint);
  font-weight: 300;
  font-size: 15px;
  flex-shrink: 0;
}
.tb-back {
  background: none;
  border: 0;
  color: var(--text);
  padding: 0;
  display: none;
  margin-right: -4px;
}
@media (max-width: 768px) {
  .tb-back {
    display: inline-flex;
  }
}
.tb-search {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 20px;
  padding: 7px 13px;
  background: var(--card);
  border: 1px solid var(--input);
  border-radius: 4px;
  color: var(--text);
  font-size: 13px;
  text-align: left;
  transition: border-color 0.2s ease;
}
.tb-search:hover {
  border-color: var(--accent);
}
.tb-search .ms {
  font-size: 16px;
  color: var(--faint);
}
.tb-search span:not(.ms) {
  color: var(--muted);
}
.tb-search kbd {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--faint);
  border: 1px solid var(--input);
  border-radius: 3px;
  padding: 1px 5px;
}
.topbar-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}
.poll {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--info-fg);
  background: var(--info-bg);
  padding: 4px 9px;
  border-radius: 3px;
  white-space: nowrap;
}
.tb-ico {
  position: relative;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--card);
  border: 1px solid var(--hair);
  border-radius: 4px;
  color: var(--muted);
  padding: 0;
}
.tb-ico:hover {
  background: var(--sunk);
  color: var(--text);
}
.tb-ico .dot {
  position: absolute;
  top: 5px;
  right: 6px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--risk);
  border: 2px solid var(--bg);
  box-sizing: content-box;
  margin: -2px -2px 0 0;
}
.tb-m {
  display: none;
}
.undo-split {
  display: inline-flex;
  align-items: stretch;
}
.undo-split .btn {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}
.undo-split .undo-caret {
  padding: 5px 6px;
  margin-left: -1px;
  border-radius: 0 4px 4px 0;
}
.ask-btn {
  font-weight: 500;
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.2;
  background: var(--btn);
  color: var(--btn-t);
  border: 1px solid transparent;
  border-radius: 4px;
  padding: 8px 15px;
  white-space: nowrap;
  transition: background 0.2s ease;
  text-decoration: none;
}
.btn:hover {
  background: var(--btn-h);
  text-decoration: none;
}
.btn .ms {
  font-size: 16px;
}
.btn:disabled,
.btn[disabled] {
  background: var(--input);
  border-color: transparent;
  color: var(--faint);
  cursor: not-allowed;
}
.btn-primary {
  background: var(--btn);
}
.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--input);
}
.btn-ghost:hover {
  background: var(--sunk);
  color: var(--text);
}
.btn-ghost:disabled {
  background: transparent;
  color: var(--faint);
  opacity: 0.7;
  border-color: var(--input);
}
:root[data-theme='dark'] .btn:disabled,
:root[data-theme='dark'] .btn[disabled],
:root[data-theme='dark'] .btn-accent:disabled,
:root[data-theme='dark'] .btn-primary:disabled {
  background: var(--input);
  border-color: var(--input);
  color: var(--muted);
}
:root[data-theme='dark'] .btn-ghost:disabled {
  background: transparent;
  border-color: var(--input);
  color: var(--faint);
  opacity: 0.7;
}
.btn-accent {
  background: var(--accent);
  color: var(--on-accent);
}
.btn-accent:hover {
  background: #5a7e90;
}
:root[data-theme='dark'] .btn-accent:hover {
  background: #a8c9d8;
}
.btn-sm {
  padding: 5px 11px;
  font-size: 12px;
}
.btn-cancel {
  color: var(--warn);
  border-color: var(--warn);
}
.btn-cancel:hover {
  background: var(--warn-bg);
  color: var(--warn);
}
.btn-danger {
  background: var(--risk);
  color: var(--on-tone);
}
.btn-danger:hover {
  background: var(--risk);
  filter: brightness(0.92);
}
.btn-ok {
  background: var(--ok);
  color: var(--on-tone);
}
.btn-ok:hover {
  background: var(--ok);
  filter: brightness(0.92);
}
.btn-danger:disabled {
  background: var(--input);
  color: var(--faint);
  filter: none;
}
.btn.x {
  padding: 4px 6px;
  margin-left: auto;
}

/* ---------- page ---------- */
.wrap {
  padding: 24px 28px 0;
}
.sec {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.17em;
  color: var(--muted);
  margin: 4px 0 12px;
  line-height: 1.6;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.card {
  background: var(--card);
  border: 1px solid var(--hair);
  border-radius: 4px;
  margin-bottom: 20px;
  min-width: 0;
}
.card-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 10px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--hair);
}
.card-head h2 {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.01em;
}
.card-head .sub {
  font-size: 12px;
  color: var(--muted);
}
.card-head .right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.card-body {
  padding: 18px;
}
.card-body.flush {
  padding: 0;
}
.empty {
  text-align: center;
  color: var(--faint);
  font-size: 13.5px;
  line-height: 1.6;
  padding: 34px;
}
.empty .tiny {
  margin-top: 4px;
}
td.empty {
  padding: 34px;
}

/* ---------- tables ---------- */
.tbl-wrap {
  overflow-x: auto;
}
.tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.tbl th {
  text-align: left;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--muted);
  background: var(--sunk);
  border-bottom: 1px solid var(--hair);
  padding: 9px 14px;
  white-space: nowrap;
}
.tbl th.sortable {
  cursor: pointer;
  user-select: none;
}
.tbl th.sortable:hover {
  color: var(--text);
}
.tbl th .ms {
  font-size: 12px;
  margin-left: 3px;
  vertical-align: -1px;
}
.tbl td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--hair);
  vertical-align: middle;
}
.tbl tbody tr:last-child td {
  border-bottom: 0;
}
@media (hover: hover) and (min-width: 769px) {
  .tbl tbody tr:hover td {
    background: var(--sunk);
  }
}
.tbl tr[data-go],
.tbl tr[data-act],
.tbl tr.click {
  cursor: pointer;
}
.tbl th.num,
.tbl td.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* ---------- pill, bar, tabs, kpi, meta-row, feed, field ---------- */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1;
  padding: 4px 9px;
  border-radius: 3px;
  background: var(--neutral);
  color: var(--muted);
  white-space: nowrap;
}
.pill .ms {
  font-size: 13px;
}
.pill.ok {
  background: var(--ok-bg);
  color: var(--ok);
}
.pill.warn {
  background: var(--warn-bg);
  color: var(--warn);
}
.pill.risk {
  background: var(--risk-bg);
  color: var(--risk);
}
.pill.info,
.pill.accent {
  background: var(--info-bg);
  color: var(--info-fg);
}
.pill.dark {
  background: var(--btn);
  color: #fff;
}
.pill.plain {
  background: transparent;
  border: 1px solid var(--hair);
  color: var(--muted);
}
.bar {
  display: inline-block;
  width: 100%;
  height: 6px;
  background: var(--neutral);
  border-radius: 3px;
  overflow: hidden;
  vertical-align: middle;
}
.bar i {
  display: block;
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
}
.bar i.ok {
  background: var(--ok);
}
.bar i.warn {
  background: var(--warn);
}
.bar i.risk {
  background: var(--risk);
}
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--hair);
  margin-bottom: 18px;
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar {
  display: none;
}
/* scroll cue: an edge fade shows on whichever side has more to scroll to (the local covers hide it at the ends) */
@media (max-width: 768px) {
  .tabs {
    scroll-snap-type: x proximity;
    scroll-padding: 0 28px;
    /* a tab running past the right edge fades out instead of ending mid-letter; the end spacer keeps the last tab clear of the fade */
    -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 30px), transparent);
    mask-image: linear-gradient(to right, #000 calc(100% - 30px), transparent);
    background:
      linear-gradient(to right, var(--bg) 70%, transparent) left center / 28px 100% no-repeat local,
      linear-gradient(to left, var(--bg) 70%, transparent) right center / 28px 100% no-repeat local,
      linear-gradient(to right, rgba(110, 125, 135, 0.35), transparent) left center / 14px calc(100% - 4px) no-repeat scroll,
      linear-gradient(to left, rgba(110, 125, 135, 0.35), transparent) right center / 14px calc(100% - 4px) no-repeat scroll;
  }
}
.tabs .tab,
.tabs button,
.tabs a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  line-height: 16px;
  min-height: 34px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 4px;
  margin-bottom: 0;
  font-size: 13px;
  font-weight: 400;
  color: var(--muted);
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  scroll-snap-align: start;
  transition:
    background 0.12s ease,
    border-color 0.12s ease,
    color 0.12s ease;
}
@media (max-width: 768px) {
  .tabs::after {
    content: '';
    flex: 0 0 30px;
  }
}
/* phones: the tasks job chips wrap into rows, so no chip is ever cut mid-letter at rest */
@media (max-width: 560px) {
  .tk-top .tk-chips {
    flex-wrap: wrap;
    overflow: visible;
  }
}
.tabs .tab:hover,
.tabs button:hover,
.tabs a:hover {
  color: var(--text);
  border-color: var(--accent);
  text-decoration: none;
}
/* the selected tab is a filled slate pill with dark text in both themes (app.css:748-755), never an underline */
.tabs .on,
.tabs .active,
.tabs [aria-selected='true'] {
  color: #10171a;
  font-weight: 600;
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.2);
}
.tabs .n,
.tabs .count,
.tabs .tc {
  font-size: 10.5px;
  font-weight: 600;
  background: var(--neutral);
  color: var(--muted);
  border-radius: 9px;
  padding: 1px 7px;
}
.tabs .on .n,
.tabs .active .n,
.tabs .on .count,
.tabs .on .tc {
  background: rgba(255, 255, 255, 0.28);
  color: inherit;
}
.kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}
.kpi {
  background: var(--card);
  border: 1px solid var(--hair);
  border-radius: 4px;
  padding: 14px 18px;
  min-width: 0;
}
.kpi .k,
.kpi small,
.kpi .kpi-l {
  display: block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--muted);
}
.kpi .v,
.kpi b,
.kpi .kpi-v {
  display: block;
  font-size: 26px;
  font-weight: 600;
  line-height: 1.2;
  margin-top: 4px;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}
.kpi .s,
.kpi .kpi-s {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}
.meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 16px;
  font-size: 12.5px;
  color: var(--muted);
}
.meta-row b {
  color: var(--text);
  font-weight: 600;
}
.feed {
  list-style: none;
  margin: 0;
  padding: 0;
}
.feed > li,
.feed .feed-row {
  display: flex;
  gap: 12px;
  padding: 11px 18px;
  border-bottom: 1px solid var(--hair);
  font-size: 13px;
  align-items: flex-start;
}
.feed > li:last-child,
.feed .feed-row:last-child {
  border-bottom: 0;
}
/* Changelog (A1C-16): flush release panes, plain-case group labels, and each change a full row with the check box icon, as the real app lays it out */
.ad-wrap:has(.ad-rel) {
  max-width: none;
}
.ad-wrap .card.ad-rel {
  border-radius: 0;
  border-left-width: 0;
  border-right-width: 0;
  box-shadow: none;
}
.ad-wrap .ad-rel .ad-grp {
  padding: 14px 18px 8px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  color: var(--muted);
}
.ad-wrap .ad-rel .feed {
  margin-bottom: 0;
}
.ad-wrap .ad-rel .feed > li {
  align-items: center;
  gap: 14px;
  padding: 12px 18px;
  font-size: 14px;
  line-height: 1.45;
  border-bottom: 1px solid var(--hair);
}
.ad-wrap .ad-rel .feed > li:last-child {
  border-bottom: 0;
}
.ad-wrap .ad-rel .feed > li::before {
  content: 'check';
  font-family: 'Material Symbols Outlined';
  font-feature-settings: 'liga';
  font-size: 16px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  margin-top: 0;
  border-radius: 4px;
  border: 1px solid var(--hair);
  background: var(--sunk);
  color: var(--muted);
}
.feed .t,
.feed .when {
  margin-left: auto;
  font-size: 11.5px;
  color: var(--faint);
  white-space: nowrap;
}
.field {
  margin-bottom: 14px;
}
.field label {
  display: block;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.02em;
  margin-bottom: 5px;
}
.mini,
.field input,
.field select,
.field textarea {
  width: 100%;
  font-size: 13.5px;
  padding: 8px 10px;
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--input);
  border-radius: 4px;
  line-height: 1.4;
}
.mini:focus,
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--info-bg);
}
.mini:disabled {
  background: var(--sunk);
  color: var(--faint);
}
textarea.mini {
  resize: vertical;
  min-height: 80px;
}
input.mini,
select.mini {
  width: auto;
  min-width: 0;
}
.field .mini {
  width: 100%;
}

/* ---------- overlays ---------- */
.ov {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: var(--scrim);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  overflow-y: auto;
  padding: 64px 16px;
}
.modal,
.drawer {
  background: var(--card);
  border: 1px solid var(--hair);
  border-radius: 4px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  width: 520px;
  max-width: 100%;
  max-height: calc(100vh - 128px);
  color: var(--text);
}
.modal.wide {
  width: min(920px, 100%);
}
.modal-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 15px 18px;
  border-bottom: 1px solid var(--hair);
  flex-shrink: 0;
}
.modal-head h2 {
  font-size: 15px;
  font-weight: 600;
}
.modal-body {
  padding: 18px;
  overflow-y: auto;
  flex: 1 1 auto;
  min-height: 0;
  overscroll-behavior: contain;
}
.modal-body.flush {
  padding: 0;
}
.modal-foot {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  padding: 14px 18px;
  border-top: 1px solid var(--hair);
  background: var(--sunk);
  border-radius: 0 0 4px 4px;
  flex-shrink: 0;
}
.cf-body {
  font-size: 14px;
  margin-bottom: 14px;
}
.drawer-ov {
  justify-content: flex-end;
  padding: 0;
  align-items: stretch;
}
.drawer {
  width: 460px;
  max-height: none;
  height: 100%;
  border-width: 0 0 0 1px;
  border-radius: 0;
  animation: dr 0.22s ease-out;
}
.drawer.wide {
  width: min(720px, 100%);
}
.drawer .modal-foot {
  border-radius: 0;
}
@keyframes dr {
  from {
    transform: translateX(24px);
    opacity: 0;
  }
}
body.has-ov {
  overflow: hidden;
}
.pal {
  width: 600px;
}
.pal-in {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--input);
  border-radius: 4px;
  padding: 8px 12px;
  margin-bottom: 10px;
  color: var(--faint);
}
.pal-in input {
  flex: 1;
  border: 0;
  background: transparent;
  font-size: 15px;
  outline: none;
}
.pal-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  background: none;
  border: 0;
  border-radius: 3px;
  padding: 9px 10px;
  font-size: 13.5px;
  color: var(--text);
}
.pal-row:hover,
.pal-row.sel {
  background: var(--sunk);
}
.pal-hint {
  color: var(--faint);
  font-size: 13px;
  padding: 14px 6px;
}
/* Report an issue (A1C-8): two numbered steps, a segmented issue type, and the pick-on-page bar */
.rpt-page {
  margin-bottom: 10px;
}
.rpt-step {
  padding-bottom: 14px;
}
.rpt-step + .rpt-step {
  border-top: 1px solid var(--hair);
  padding-top: 14px;
}
.rpt-h {
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 4px;
}
.rpt-note {
  display: block;
  margin: 4px 0 8px;
}
.rpt-pick {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.rpt-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}
.rpt-chip {
  gap: 6px;
  max-width: 100%;
}
.rpt-x {
  display: inline-flex;
  border: 0;
  background: none;
  color: inherit;
  padding: 0;
}
.rpt-kinds {
  display: inline-flex;
  margin: 6px 0 12px;
  border: 1px solid var(--hair);
  border-radius: 4px;
  overflow: hidden;
}
.rpt-kinds button {
  border: 0;
  background: var(--card);
  color: var(--muted);
  font-size: 12.5px;
  padding: 8px 14px;
}
.rpt-kinds button + button {
  border-left: 1px solid var(--hair);
}
.rpt-kinds button.on {
  background: #3b4a53;
  color: #fff;
  font-weight: 600;
}
#rp-text {
  width: 100%;
  box-sizing: border-box;
}
.rpt-bar {
  position: fixed;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  display: flex;
  align-items: center;
  gap: 12px;
  background: #1a262c;
  color: #fff;
  padding: 8px 12px;
  border-radius: 4px;
  box-shadow: var(--shadow);
  font-size: 13px;
  max-width: calc(100vw - 24px);
}
.rpt-picking,
.rpt-picking * {
  cursor: crosshair !important;
}
.rpt-hl {
  outline: 2px solid var(--accent) !important;
  outline-offset: 1px;
  background-color: rgba(109, 146, 165, 0.14) !important;
}
@media (max-width: 768px) {
  .rpt-pick .btn {
    min-height: 44px;
  }
  .rpt-kinds button {
    min-height: 44px;
  }
}
/* Search palette (A1C-7): wide sheet, no title bar on desktop, grouped filter chips, a kind pill and a sub line on every result */
.modal.pal {
  width: min(660px, 100%);
}
.pal-esc {
  font-family: inherit;
  font-size: 10.5px;
  color: var(--muted);
  border: 1px solid var(--hair);
  border-radius: 3px;
  padding: 2px 5px;
}
.pal-src {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0 0 10px;
  padding: 8px 10px;
  background: var(--sunk);
  border-radius: 4px;
}
.pal-src-top,
.pal-src-g {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
}
.pal-src-g {
  padding-left: 10px;
  border-left: 2px solid var(--hair);
}
.pal-chip {
  border: 1px solid var(--hair);
  background: var(--card);
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1;
  padding: 5px 10px;
  border-radius: 999px;
}
.pal-chip.on {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}
.pal-chip.pal-kchip.on {
  background: var(--info-bg);
  border-color: transparent;
  color: var(--text);
}
.pal-chip.pal-gchip {
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 10.5px;
  color: var(--text);
}
.pal-chip.pal-gchip.on {
  color: var(--on-accent);
}
.pal-row .pal-kind {
  flex: none;
  min-width: 112px;
  justify-content: center;
}
.pal-row .pal-t {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pal-row .pal-sub {
  flex: none;
  max-width: 40%;
  color: var(--faint);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
@media (min-width: 769px) {
  .modal.pal .modal-head {
    display: none;
  }
}
@media (max-width: 768px) {
  .pal-chip {
    min-height: 36px;
  }
  .pal-src {
    max-height: 150px;
    overflow-y: auto;
    scroll-snap-type: y mandatory;
    scroll-padding: 4px 0;
  }
  .pal-src > * {
    scroll-snap-align: start;
  }
  .pal-src > :first-child {
    scroll-margin-top: 8px;
  }
  .pal-row {
    flex-wrap: wrap;
    min-height: 44px;
  }
  .pal-row .pal-sub {
    flex-basis: 100%;
    max-width: none;
    padding-left: 122px;
    margin-top: -4px;
  }
}
.ask {
  font-size: 14px;
}
.ask-ico {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--info-bg);
  color: var(--info-fg);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}
.ask-q {
  padding-left: 18px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.8;
}
.ask-in {
  display: flex;
  gap: 8px;
  margin: 14px 0 6px;
}
.ask-in .mini {
  flex: 1;
}

/* ---------- popovers, toasts ---------- */
#menu-root {
  position: relative;
  z-index: 95;
}
.pop {
  position: fixed;
  z-index: 95;
  width: 320px;
  max-height: 62vh;
  overflow-y: auto;
  background: var(--card);
  border: 1px solid var(--hair);
  border-radius: 4px;
  box-shadow: var(--shadow);
  padding: 4px;
  text-align: left;
}
.pop-un {
  width: 380px;
}
.pop-mnav-w {
  width: 240px;
  max-width: calc(100vw - 16px);
}
.pop-mnav .pop-row {
  min-height: 44px;
  font-size: 14px;
}
.pop-mnav .pop-row.pop-row > span.ms,
.pop-mnav .pop-row.pop-row > span.nav-count {
  flex: none;
}
.pop-mnav .pop-row.pop-row > span.nav-count {
  margin-left: auto;
}
.pop-mnav .pop-row[disabled] {
  opacity: 0.45;
}
.ask-pre {
  display: inline;
}
.pop-bell {
  width: 360px;
}
.pop-va {
  width: 280px;
}
.pop-h {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  padding: 8px 9px 7px;
  border-bottom: 1px solid var(--hair);
  margin-bottom: 3px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.pop-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  background: none;
  border: 0;
  border-radius: 3px;
  padding: 8px 9px;
  text-align: left;
  font-size: 12.5px;
  color: var(--text);
  line-height: 1.35;
}
.pop-row:hover {
  background: var(--sunk);
}
/* a hidden control stays hidden even when its class sets display (Activity's Clear filters) */
[hidden] {
  display: none !important;
}
.pop-row[hidden] {
  display: none;
}
/* View as (A1C-17): a type-to-filter box over single-line name and role rows */
.pop-va {
  padding: 8px;
}
.pop-va .va-q {
  width: 100%;
  margin-bottom: 6px;
}
.pop-va .va-list .pop-row {
  padding: 6px 8px;
  font-size: 13px;
}
.pop-va .va-list .pop-row b,
.pop-va .va-list .pop-row .muted {
  display: inline;
}
.pop-va .va-list .pop-row .muted {
  margin-left: 4px;
}
.pop-row.on {
  background: var(--info-bg);
}
.pop-row > span:not(.who-av):not(.nt) {
  flex: 1;
  min-width: 0;
}
.pop-row b {
  display: block;
  font-weight: 600;
}
.pop-row .muted {
  display: block;
}
.pop-row .who-av {
  width: 28px;
  height: 28px;
}
/* a menu row's icon keeps its own width, so the label sits next to it (every other row span is flex: 1) */
.pop .pop-row > span.ms {
  flex: 0 0 auto;
}
.pop-f {
  font-size: 11.5px;
  color: var(--muted);
  padding: 10px 9px;
}
.nt {
  display: inline-flex;
  flex-shrink: 0;
}
.nt.risk {
  color: var(--risk);
}
.nt.warn {
  color: var(--warn);
}
.toasts {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 100;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: end;
  width: 340px;
  max-width: calc(100vw - 32px);
}
/* F18C: a pile. The newest toast shows in full; up to two older ones peek out 8px each behind it, slightly narrower (demo-app.js toastStack sets --i, 0 for the newest). Hover, focus or a tap on the pile fans it out (.fan: a column, oldest on top) so every toast and its Undo can be reached; it folds back when the pointer or focus leaves or after a tap outside. */
.toasts > .toast {
  grid-area: 1 / 1;
  align-self: end;
  transform-origin: 50% 100%;
  transform: translateY(calc(var(--i, 0) * -8px)) scaleX(calc(1 - var(--i, 0) * 0.05));
  z-index: calc(10 - var(--i, 0));
}
.toasts:not(.fan) > .toast.is-far {
  visibility: hidden;
}
.toasts.fan {
  display: flex;
  flex-direction: column;
  gap: 6px;
  pointer-events: auto;
}
.toasts.fan > .toast {
  transform: none;
  visibility: visible;
  pointer-events: auto;
  z-index: auto;
}
/* a folded pile: the newest toast takes the tap that fans it out (when it has company); older ones behind it are not targets */
.toasts:not(.fan) > .toast:last-child:not(:only-child) {
  pointer-events: auto;
}
.toasts:not(.fan) > .toast:not(:last-child) button {
  pointer-events: none;
}
/* F18A S1: a toast's text never blocks a click on the control under it (the next Mark done step); its Undo and dismiss buttons stay clickable at every width (the real app's toast box has no such rule, app.css:771; mobile.css:645-650 only sets its phone position) */
.toasts,
.toasts .toast {
  pointer-events: none;
}
.toasts .toast button {
  pointer-events: auto;
}
.toast {
  position: relative;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  background: var(--side);
  color: #f5f5f5;
  border-radius: 4px;
  /* F18C: one row, message left, Undo and dismiss right; the accent edge is an inset strip, so it lines up with the body at every width */
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  column-gap: 6px;
  align-items: center;
  padding: 8px 4px 8px 17px;
  min-height: 44px;
  font-size: 13px;
  box-shadow: var(--shadow);
  overflow: hidden;
  animation: tin 0.22s ease-out;
  --tk: var(--accent);
}
.toast::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--tk);
}
:root[data-theme='dark'] .toast {
  background: #232c31;
  box-shadow:
    inset 0 0 0 1px var(--hair),
    var(--shadow);
}
.toast.ok {
  --tk: var(--ok);
}
.toast.warn {
  --tk: var(--warn);
}
.toast.risk {
  --tk: var(--risk);
}
.toast .t-txt {
  min-width: 0;
}
.toast .t-title {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.toast .t-sub {
  color: rgba(245, 245, 245, 0.66);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.toast .t-undo {
  grid-column: 2;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #fff;
  border-radius: 3px;
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 600;
}
.toast .t-undo:hover {
  background: rgba(255, 255, 255, 0.12);
}
.toast .t-undo .ms {
  font-size: 14px;
}
.toast .t-x {
  grid-column: 3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  min-height: 28px;
  background: none;
  border: 0;
  color: rgba(245, 245, 245, 0.6);
  padding: 2px;
}
@media (prefers-reduced-motion: reduce) {
  .toast {
    animation: none;
  }
}
.toast .t-x:hover {
  color: #fff;
}
.toast .t-prog {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
}
.toast .t-prog i {
  display: block;
  height: 100%;
  background: var(--accent);
  animation: tprog linear forwards;
}
.toast.warn .t-prog i {
  background: var(--warn);
}
.toast.ok .t-prog i {
  background: var(--ok);
}
.toast.risk .t-prog i {
  background: var(--risk);
}
@keyframes tprog {
  from {
    width: 100%;
  }
  to {
    width: 0;
  }
}
@keyframes tin {
  from {
    transform: translateY(8px);
    opacity: 0;
  }
}

/* ---------- mobile ---------- */
.m-tabbar {
  display: none;
}
@media (max-width: 1100px) {
  .tb-search span:not(.ms),
  .tb-search kbd {
    display: none;
  }
  .tb-search {
    margin-left: 8px;
    padding: 7px 10px;
  }
  .poll {
    display: none;
  }
}
/* 769 to 860: the real app keeps its desktop screens and folds the rail into a top strip of tabs (app.css:1025-1050 there); the phone shell starts at 768 */
@media (min-width: 769px) and (max-width: 860px) {
  .app {
    grid-template-columns: minmax(0, 1fr);
  }
  .side {
    position: static;
    height: auto;
    flex-direction: row;
    align-items: center;
    padding: 10px 14px;
    gap: 12px;
    overflow: hidden;
  }
  .side-brand {
    padding: 0;
    flex-shrink: 0;
  }
  .side-brand .hq {
    display: none;
  }
  .side-nav {
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0;
    gap: 4px;
    flex: 1 1 0;
    min-width: 0;
    touch-action: pan-x;
  }
  .side-nav::-webkit-scrollbar {
    height: 0;
  }
  .side .nav-group-label {
    display: none;
  }
  .side .nav-item {
    white-space: nowrap;
    flex: 0 0 auto;
    width: auto;
    border-left: none;
    border-bottom: 2px solid transparent;
  }
  .side .nav-item.active {
    border-left: none;
    border-bottom-color: var(--accent);
  }
  .side .nav-ico,
  .side-foot {
    display: none;
  }
}
@media (min-width: 861px) and (max-height: 940px) {
  /* sidebar rail only; at 769 to 860 the shell is the top strip */
  .side {
    padding-top: 14px;
  }
  .side-brand {
    padding-bottom: 10px;
  }
  .side .nav-item {
    padding-top: 5px;
    padding-bottom: 5px;
  }
  .side .nav-group-label {
    padding-top: 9px;
    padding-bottom: 4px;
  }
}
@media (max-width: 768px) {
  .app {
    display: block;
  }
  .side {
    position: fixed;
    z-index: 80;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(82vw, 320px);
    padding-top: 14px;
    padding-bottom: calc(10px + env(safe-area-inset-bottom));
    transform: translateX(-102%);
    transition: transform 0.22s ease;
  }
  .side-brand {
    padding-bottom: 10px;
  }
  /* one scroll column; a fade and a hairline shadow show on whichever end has more to scroll to */
  .side-nav {
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    background:
      linear-gradient(var(--side) 30%, rgba(27, 34, 38, 0)) center top / 100% 26px no-repeat local,
      linear-gradient(rgba(27, 34, 38, 0), var(--side) 70%) center bottom / 100% 26px no-repeat local,
      radial-gradient(farthest-side at 50% 0, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0)) center top / 100% 10px no-repeat scroll,
      radial-gradient(farthest-side at 50% 100%, rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0)) center bottom / 100% 12px no-repeat scroll;
  }
  .side .nav-item {
    padding: 6px 10px;
    min-height: 44px;
  }
  .nav-group-label {
    padding-top: 10px;
    padding-bottom: 4px;
  }
  .side-foot {
    padding: 10px 14px 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
  }
  .foot-row {
    display: flex;
    gap: 8px;
  }
  .foot-row > * {
    flex: 1 1 0;
    min-width: 0;
    margin: 0;
    min-height: 44px;
  }
  .foot-row .side-report-issue {
    border-color: rgba(255, 255, 255, 0.14);
    padding: 0 10px;
    width: auto;
  }
  .foot-row .who-switch {
    padding: 0 10px;
    width: auto;
  }
  body.side-open .side {
    transform: none;
    box-shadow: 8px 0 30px rgba(0, 0, 0, 0.45);
  }
  .scrim {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 70;
    background: var(--scrim);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
  }
  body.side-open .scrim {
    opacity: 1;
    pointer-events: auto;
  }
  .main {
    padding-bottom: 84px;
  }
  .strip {
    padding: 4px 14px;
    font-size: 11px;
    gap: 8px;
  }
  .strip-full,
  .strip .strip-lnk,
  .strip .strip-reset,
  .strip .strip-btn[data-kt='relaunch'] {
    display: none;
  }
  .strip-short {
    display: inline;
  }
  /* F9A1: the strip text is a 44px tap target; the extra height is padding offset by a negative margin, so the strip looks the same */
  .strip .strip-t {
    display: flex;
    align-items: center;
    min-height: 44px;
    margin-top: -4px;
    margin-bottom: -4px;
  }
  .strip-r {
    gap: 8px;
  }
  .strip a.strip-cta {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    margin: -4px 0;
    padding: 0 14px;
    font-size: 12px;
    position: relative;
  }
  /* F12A: the CTA is a real 44 px box; the negative margin offsets the strip padding so the strip keeps its height */
  .strip a.strip-cta::after {
    content: none;
  }
  /* F10B3: the Time page's "Labor rates" fold button (screens/time.js:592) is a 44 px hit area on phones, same look */
  .tc-rates .tc-fold {
    position: relative;
  }
  .tc-rates .tc-fold::after {
    content: '';
    position: absolute;
    inset: -11px 0;
  }
  .topbar {
    padding: 0 12px;
    gap: 6px;
    height: 54px;
  }
  .crumbs {
    max-width: none;
    flex: 1;
    font-size: 16px;
  }
  /* F10B1: Schedule on a phone reads the route word, as the real app does; the job stays in the page body (its chip row) */
  .tb-back[data-r='schedule'],
  .crumbs[data-r='schedule'] .crumb-sep,
  .crumbs[data-r='schedule'] .crumb-cur,
  .crumbs[data-r='schedule'] .crumb-l-cur {
    display: none;
  }
  .tb-back + .crumbs[data-r='schedule'] .crumb-l:not(.crumb-l-cur) {
    display: inline;
    font-weight: 700;
    pointer-events: none;
  }
  /* A1M-36: a drilled page on a phone shows the back arrow and one title (the page's own name), never "Projects / name" cut off */
  .tb-back + .crumbs .crumb-l:not(.crumb-l-cur),
  .tb-back + .crumbs .crumb-sep {
    display: none;
  }
  .tb-back + .crumbs .crumb-cur,
  .tb-back + .crumbs .crumb-l-cur {
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .tb-d {
    display: none !important;
  }
  .tb-m {
    display: inline-flex;
    background: none;
    border-color: transparent;
    color: var(--text);
  }
  .tb-m .dot {
    top: 8px;
    right: 8px;
  }
  .tb-search {
    display: none;
  }
  .topbar-right {
    gap: 6px;
  }
  .ask-btn {
    padding: 7px 12px;
  }
  .wrap {
    padding: 16px 14px 0;
  }
  .card-head,
  .card-body {
    padding-left: 14px;
    padding-right: 14px;
  }
  .kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .m-tabbar {
    display: flex;
    position: fixed;
    z-index: 60;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--topbar);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-top: 1px solid var(--hair);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  }
  /* the real app's glass bar: muted labels, the active one in the accent with a short tick on top */
  .m-tab {
    position: relative;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    background: none;
    border: 0;
    color: var(--muted);
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: 0.02em;
    padding: 4px 0;
  }
  .m-tab.on {
    color: var(--accent);
  }
  .m-tab.on::after {
    content: '';
    position: absolute;
    top: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 32px;
    height: 3px;
    background: var(--accent);
  }
  .m-tab .dot {
    position: absolute;
    top: 3px;
    left: calc(50% + 6px);
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--risk);
  }
  .toasts {
    left: 12px;
    right: 12px;
    bottom: 82px;
    width: auto;
  }
  .ov {
    padding: 0;
    align-items: flex-end;
  }
  .modal {
    width: 100%;
    max-width: 100%;
    max-height: 92vh;
    border-radius: 10px 10px 0 0;
    border-width: 1px 0 0;
  }
  .modal.pal {
    border-radius: 0;
    height: 100%;
    max-height: none;
  }
  .modal-foot {
    border-radius: 0;
    padding-bottom: calc(14px + env(safe-area-inset-bottom));
  }
  .drawer {
    width: 100%;
  }
  .pop.sheet {
    left: 0 !important;
    right: 0;
    top: auto !important;
    bottom: 0;
    width: 100%;
    max-height: 70vh;
    border-radius: 10px 10px 0 0;
    padding: 6px 6px calc(10px + env(safe-area-inset-bottom));
    z-index: 96;
  }
  .pop {
    max-width: calc(100vw - 16px);
  }
  .tbl th,
  .tbl td {
    padding: 9px 10px;
  }
}

/* designed select and date */
.sel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  min-width: 0;
  font: inherit;
  font-size: 13.5px;
  padding: 8px 10px;
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--input);
  border-radius: 4px;
  line-height: 1.4;
  text-align: left;
  cursor: pointer;
}
.sel:focus-visible,
.sel[aria-expanded='true'] {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--info-bg);
}
.sel .sel-l {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sel .ms {
  color: var(--muted);
  flex: none;
}
.sel.empty .sel-l {
  color: var(--faint);
}
.sel.mini,
.sel.btn-sm {
  width: auto;
}
td .sel,
.tbl .sel {
  width: auto;
  min-width: 120px;
}
.pop-sel {
  width: auto;
  min-width: 200px;
  max-width: 360px;
}
.sel-o {
  cursor: pointer;
}
.sel-o span {
  flex: 1;
}
.sel-o .ms {
  color: var(--accent);
}
.pop-cal {
  width: 280px;
  padding: 8px;
}
.cal-h {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 0 6px;
  font-size: 13px;
}
.cal-n {
  display: flex;
  background: none;
  border: 0;
  border-radius: 3px;
  padding: 4px;
  color: var(--muted);
  cursor: pointer;
}
.cal-n:hover,
.cal-d:hover {
  background: var(--sunk);
  color: var(--text);
}
.cal-g {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  text-align: center;
}
.cal-w span {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--faint);
  padding: 4px 0;
}
.cal-d {
  background: none;
  border: 1px solid transparent;
  border-radius: 3px;
  height: 34px;
  font-size: 12.5px;
  color: var(--text);
  cursor: pointer;
}
.cal-d.today {
  border-color: var(--accent);
  color: var(--info-fg);
  font-weight: 700;
}
.cal-d.on,
.cal-d.on:hover {
  background: var(--accent);
  color: var(--card);
  border-color: var(--accent);
  font-weight: 700;
}
.cal-f {
  border-top: 1px solid var(--hair);
  margin-top: 6px;
  padding-top: 6px;
}
.cal-clear {
  background: none;
  border: 0;
  color: var(--link);
  font-size: 12.5px;
  cursor: pointer;
  padding: 4px 6px;
}
.pop.sheet.pop-cal {
  padding: 10px 14px calc(14px + env(safe-area-inset-bottom));
}

/* ---------- phone bar (m0): tap targets, iOS zoom, sheets ---------- */
@media (max-width: 768px) {
  .btn,
  .tb-ico,
  .theme-btn,
  .strip-btn {
    min-height: 44px;
  }
  .tb-ico,
  .theme-btn {
    min-width: 44px;
  }
  .btn-sm {
    min-height: 44px;
    padding: 8px 14px;
  }
  .pill[data-act],
  .pill[data-go],
  button.pill {
    min-height: 44px;
    padding: 0 12px;
  }
  .tabs .tab,
  .tabs button,
  .tabs a {
    min-height: 44px;
  }
  .tabs {
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
  }
  .mini,
  .field input,
  .field select,
  .field textarea,
  .sel,
  .pal-in input,
  textarea.mini {
    font-size: 16px;
    min-height: 44px;
  }
  .pop-row,
  .pal-row,
  .nav-item {
    min-height: 44px;
  }
  .cal-d {
    height: 44px;
    font-size: 14px;
  }
  .tbl-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
  }
  .toasts {
    bottom: calc(82px + env(safe-area-inset-bottom));
    z-index: 85;
  }
  .toast {
    padding-top: 5px;
    padding-bottom: 5px;
  }
  .toast .t-undo {
    min-height: 44px;
    padding: 0 12px;
  }
  .toast .t-x {
    min-width: 44px;
    min-height: 44px;
  }
  /* a toast's text never blocks a tap on the control under it (Close Draw straight after Add invoice, Submit today's log); its Undo and dismiss buttons stay tappable */
  .toasts,
  .toasts .toast {
    pointer-events: none;
  }
  .toasts .toast button {
    pointer-events: auto;
  }
  .topbar {
    padding-top: env(safe-area-inset-top);
    height: calc(54px + env(safe-area-inset-top));
  }
  .ov {
    height: 100%;
  }
  .modal {
    max-height: 100%;
    height: 100%;
    border-radius: 0;
    border-width: 0;
  }
  .modal.pal {
    height: 100%;
  }
  .modal-head {
    padding-top: calc(15px + env(safe-area-inset-top));
  }
  .modal-foot {
    padding-left: 14px;
    padding-right: 14px;
  }
  .modal-foot .btn {
    flex: 1;
  }
  .main {
    padding-bottom: max(calc(84px + env(safe-area-inset-bottom)), var(--toast-pad, 0px));
  }
  .strip.demo {
    flex-wrap: nowrap;
  }
  .strip.demo > .strip-t {
    flex: 1 1 0;
    min-width: 0;
    line-height: 1.3;
  }
  .pop.sheet.pop-sel,
  .pop.sheet.pop-cal,
  .pop.sheet {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    left: 0;
    right: 0;
  }
}

/* ---------- phone tables: HQ.ui.table({cards:true}) stacks rows as cards; {sticky1:true} pins the first column ---------- */
@media (max-width: 768px) {
  .tbl-wrap:has(.tbl-cards) {
    overflow: visible;
  }
  .tbl-cards thead {
    display: none;
  }
  .tbl-cards,
  .tbl-cards tbody,
  .tbl-cards tr,
  .tbl-cards td {
    display: block;
    width: 100%;
  }
  .tbl-ct tr {
    display: flex;
    flex-direction: column;
  }
  .tbl-cards tr {
    border: 1px solid var(--hair);
    border-radius: 6px;
    background: var(--card);
    margin: 0 0 10px;
    padding: 10px 12px;
  }
  .tbl-cards td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 5px 0;
    border: 0;
    text-align: right;
    min-width: 0;
  }
  .tbl-cards td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
    text-align: left;
    flex: none;
  }
  .tbl-cards td[data-label='']::before,
  .tbl-cards td.empty::before {
    content: none;
  }
  .tbl-cards:not(.tbl-ct) td:first-child,
  .tbl-ct td.card-t {
    order: -1;
    display: block;
    text-align: left;
    font-size: 15px;
    font-weight: 600;
    padding: 0 0 8px;
    margin: 0 0 4px;
    border-bottom: 1px solid var(--hair);
  }
  .tbl-cards:not(.tbl-ct) td:first-child::before,
  .tbl-ct td.card-t::before {
    content: none;
  }
  .tbl-cards td.empty {
    display: block;
    text-align: center;
  }
  .tbl-sticky1 th:first-child,
  .tbl-sticky1 td:first-child {
    position: sticky;
    left: 0;
    z-index: 1;
    background: var(--card);
    box-shadow: 1px 0 0 var(--hair);
  }
}

@media (max-width: 768px) {
  body.side-open .toasts {
    visibility: hidden;
  }
  /* a dialog is open: the toast rides above the sheet footer (demo-app.js toastAvoid sets its bottom) */
  .toasts.ov-up {
    z-index: 120;
  }
  /* the Ask Boss panel is full screen on a phone, so a toast goes to the top and never sits on the composer */
  body:has(.ab-wrap.on) .toasts {
    bottom: auto;
    top: calc(62px + env(safe-area-inset-top));
  }
}
/* with a modal or sheet open on a desktop, toasts move to the bottom-left corner, or wait out of sight if the dialog reaches there too (demo-app.js toastAvoid) */
@media (min-width: 769px) {
  .toasts.at-left {
    right: auto;
    left: 22px;
  }
  .toasts.ov-up {
    z-index: 120;
  }
  /* F19A4: beside an open dialog the toast is narrowed to the free margin (demo-app.js toastAvoid), so its message takes the full toast width on the first row and Undo and dismiss drop to a second row, instead of the title clipping ("Created PO-40...") */
  body:has(#modal-root [role='dialog'], #drawer-root [role='dialog']) .toasts .toast .t-txt {
    grid-column: 1 / -1;
  }
  body:has(#modal-root [role='dialog'], #drawer-root [role='dialog']) .toasts .toast .t-title,
  body:has(#modal-root [role='dialog'], #drawer-root [role='dialog']) .toasts .toast .t-sub {
    white-space: normal;
    overflow-wrap: break-word;
  }
}
/* F16Z5 and F18C: tablet strip widths with a dialog open keep the one-row pile, with no second line and a narrower box, so it covers little of the dialog */
@media (min-width: 769px) and (max-width: 860px) {
  body:has(#modal-root [role='dialog'], #drawer-root [role='dialog']) .toasts .toast .t-sub,
  body:has(#modal-root [role='dialog'], #drawer-root [role='dialog']) .toasts .toast .t-prog {
    display: none;
  }
  body:has(#modal-root [role='dialog'], #drawer-root [role='dialog']) .toasts {
    max-width: 300px;
  }
}
/* F16Z6 and F22L: while a toast shows over a dialog that leaves no free corner (a full-height tablet dialog, or a desktop dialog wider than the margins), the dialog gives up a band at the bottom (demo-app.js toastAvoid and placeWide set --toast-band), so the toast sits in the band and its body scrolls inside the shorter dialog */
@media (min-width: 769px) {
  body.toast-band .ov {
    padding-top: 24px;
  }
  body.toast-band .modal {
    max-height: calc(100vh - 24px - var(--toast-band, 0px));
  }
  body.toast-band .drawer {
    height: calc(100% - var(--toast-band, 0px));
  }
}
/* on a desktop the Ask Boss panel is a 420 px column on the right; toasts stand to its left */
@media (min-width: 769px) {
  body:has(.ab-wrap.on) .toasts {
    right: 442px;
  }
}

@media (max-width: 768px) {
  .strip-btn {
    min-width: 44px;
  }
  .tb-back {
    min-width: 44px;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    margin-right: 0;
  }
  .crumb-l {
    min-height: 44px;
    min-width: 44px;
    display: inline-flex;
    align-items: center;
  }
}

@media (max-width: 768px) {
  .strip-btn {
    min-width: 44px;
    min-height: 44px;
  }
}

@media (pointer: coarse) {
  .tb-back {
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .side-report-issue,
  .who-switch {
    min-height: 44px;
  }
}

/* coarse pointers: 44px tap targets for the strip text, breadcrumbs and sortable headers (desktop mouse unchanged) */
@media (pointer: coarse) {
  .crumb-l {
    min-height: 44px;
    min-width: 44px;
    display: inline-flex;
    align-items: center;
  }
  .tbl th.sortable {
    height: 44px;
  }
  .btn.x {
    min-width: 44px;
    min-height: 44px;
    justify-content: center;
  }
}

/* F21C: the shell */
/* toasts and their Undo stay above the tour card (z 210, demo-tour.css) */
.toasts,
.toasts.ov-up {
  z-index: 230;
}
@media (max-width: 768px) {
  /* View as wraps a long name instead of cutting it, and the foot row grows with it */
  .foot-row {
    align-items: stretch;
  }
  .foot-row .who-switch {
    height: auto;
    padding-top: 6px;
    padding-bottom: 6px;
  }
  .foot-row .who-switch b {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    line-height: 1.25;
  }
}
@media (max-width: 430px) {
  /* narrow phones give each foot button the full row, so the whole name fits on one line */
  .foot-row {
    flex-direction: column;
  }
  .foot-row > * {
    flex: none;
    width: 100%;
  }
  .foot-row .who-switch,
  .foot-row .side-report-issue {
    width: 100%;
  }
}
@media (max-width: 768px) {
  /* a confirm is a bottom sheet sized to its content, not a full screen */
  .modal.cf-dlg {
    height: auto;
    max-height: 92vh;
    border-radius: 10px 10px 0 0;
    border-width: 1px 0 0;
  }
  .ov:has(.modal.cf-dlg) {
    height: 100%;
    align-items: flex-end;
  }
}
@media (min-width: 861px) {
  /* while the tour runs, toasts keep to the bottom left (demo-tour.css:271) but start past the sidebar, so they never cover its foot or View as */
  html.kt-on body .toasts {
    left: 248px;
  }
}
