/* The manager's web app: tokens, components, screens. Copied from the approved prototype (docs/ux/v2/styles.css),
   so it carries the styles of screens later iterations build; the prototype's screen picker is left out.
   Light tokens on :root; dark tokens follow the system unless data-theme="light", and data-theme="dark" forces them. */

:root {
  color-scheme: light;
  --font: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --bg: #eef0f2;
  --surface: #ffffff;
  --surface-2: #f6f7f8;
  --sunken: #e4e7ea;
  --line: #d9dde2;
  --line-strong: #78828d;
  --line-btn: #b9c0c8;
  --ink: #17212b;
  --ink-2: #47525e;
  --ink-3: #5f6a76;
  --inverse: #1f2a35;
  --on-inverse: #f1f4f6;

  --primary: #0b5d6b;
  --primary-hover: #084b57;
  --on-primary: #ffffff;
  --primary-soft: #e1eff1;
  --primary-ink: #0a5563;
  --inverse-link: #8fd3df;

  --attn: #f2b705;
  --attn-soft: #fff3c4;
  --attn-ink: #6d4500;
  --attn-edge: #a87b00;
  --danger: #b42318;
  --danger-hover: #93190f;
  --danger-soft: #fdeceb;
  --danger-ink: #9a1c12;
  --ok: #1a7f37;
  --ok-soft: #e3f3e7;
  --ok-ink: #145c29;
  --info-soft: #e7eefb;
  --info-ink: #1d4a9a;

  --focus: #2563eb;
  --bn-danger: var(--danger-soft);
  --bn-attn: var(--attn-soft);
  --bn-info: var(--info-soft);
  --bn-ok: var(--ok-soft);
  --bn-line: transparent;
  --bn-edge: 0px;
  --hl: #0b5d6b;
  --hl-fill: rgba(11, 93, 107, 0.14);
  --desk: #3b3f44;

  --r-sm: 6px;
  --r-md: 8px;
  --r-lg: 12px;
  --sh-pop: 0 12px 32px rgba(15, 23, 32, 0.18), 0 2px 6px rgba(15, 23, 32, 0.08);
  --sh-bar: 0 -1px 0 var(--line), 0 -6px 16px rgba(15, 23, 32, 0.06);

  --fs-xs: 12px;
  --fs-sm: 13px;
  --fs-md: 14px;
  --fs-lg: 16px;
  --fs-xl: 20px;
  --fs-2xl: 24px;
  --ctl: 36px;
  --side: 256px;

  /* Spacing scale (round 9). Rows, cards, chip lines, section gaps and dialogs take their space from here. */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 20px;
  --s-6: 24px;
  --s-8: 32px;
  /* A line of text carries about this much leading above its capitals and below its baseline; a painted chip or
     button carries none, so it takes this much margin to sit in a row or card as a line of text would. */
  --lead: var(--s-1);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0e1318;
    --surface: #161d24;
    --surface-2: #1b232b;
    --sunken: #0a0e12;
    --line: #29333d;
    --line-strong: #6b7884;
    --line-btn: #3d4955;
    --ink: #e6ebef;
    --ink-2: #b2bcc6;
    --ink-3: #95a0ab;
    --inverse: #e6ebef;
    --on-inverse: #121920;
    --primary: #58b9c8;
    --primary-hover: #74c8d5;
    --on-primary: #06232a;
    --primary-soft: #10323a;
    --primary-ink: #7fcad6;
    --inverse-link: #084b57;
    --attn: #f2b705;
    --attn-soft: #3a2f08;
    --attn-ink: #f6d36e;
    --attn-edge: #f2b705;
    --danger: #f2766b;
    --danger-hover: #f6948b;
    --danger-soft: #3b1714;
    --danger-ink: #f7a39b;
    --ok: #5cc27b;
    --ok-soft: #11301c;
    --ok-ink: #8fd9a4;
    --info-soft: #14243f;
    --info-ink: #9dbcf2;
    --focus: #7aa7ff;
    --bn-danger: var(--surface);
    --bn-attn: var(--surface);
    --bn-info: var(--surface);
    --bn-ok: var(--surface);
    --bn-line: var(--line);
    --bn-edge: 3px;
    --hl: #58b9c8;
    --hl-fill: rgba(88, 185, 200, 0.2);
    --desk: #23272b;
    --sh-pop: 0 12px 32px rgba(0, 0, 0, 0.5), 0 2px 6px rgba(0, 0, 0, 0.3);
    --sh-bar: 0 -1px 0 var(--line), 0 -6px 16px rgba(0, 0, 0, 0.3);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0e1318;
  --surface: #161d24;
  --surface-2: #1b232b;
  --sunken: #0a0e12;
  --line: #29333d;
  --line-strong: #6b7884;
  --line-btn: #3d4955;
  --ink: #e6ebef;
  --ink-2: #b2bcc6;
  --ink-3: #95a0ab;
  --inverse: #e6ebef;
  --on-inverse: #121920;
  --primary: #58b9c8;
  --primary-hover: #74c8d5;
  --on-primary: #06232a;
  --primary-soft: #10323a;
  --primary-ink: #7fcad6;
  --inverse-link: #084b57;
  --attn: #f2b705;
  --attn-soft: #3a2f08;
  --attn-ink: #f6d36e;
  --attn-edge: #f2b705;
  --danger: #f2766b;
  --danger-hover: #f6948b;
  --danger-soft: #3b1714;
  --danger-ink: #f7a39b;
  --ok: #5cc27b;
  --ok-soft: #11301c;
  --ok-ink: #8fd9a4;
  --info-soft: #14243f;
  --info-ink: #9dbcf2;
  --focus: #7aa7ff;
  --bn-danger: var(--surface);
  --bn-attn: var(--surface);
  --bn-info: var(--surface);
  --bn-ok: var(--surface);
  --bn-line: var(--line);
  --bn-edge: 3px;
  --hl: #58b9c8;
  --hl-fill: rgba(88, 185, 200, 0.2);
  --desk: #23272b;
  --sh-pop: 0 12px 32px rgba(0, 0, 0, 0.5), 0 2px 6px rgba(0, 0, 0, 0.3);
  --sh-bar: 0 -1px 0 var(--line), 0 -6px 16px rgba(0, 0, 0, 0.3);
}

@media (max-width: 719px) {
  :root {
    --fs-md: 15px;
  }
}

/* ---------- base ---------- */
* {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 var(--fs-md) / 1.45 var(--font);
  font-feature-settings: "tnum" 1;
  -webkit-font-smoothing: antialiased;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1 {
  font-size: var(--fs-2xl);
  line-height: 1.2;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-wrap: balance;
}
h2 {
  font-size: var(--fs-lg);
  line-height: 1.3;
  font-weight: 600;
}
h3 {
  font-size: var(--fs-md);
  font-weight: 600;
}
a {
  color: var(--primary-ink);
  text-underline-offset: 2px;
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
button {
  cursor: pointer;
  touch-action: manipulation;
}
:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  border-radius: 4px;
}
.num {
  font-variant-numeric: tabular-nums;
}
.muted {
  color: var(--ink-2);
}
.faint {
  color: var(--ink-3);
}
.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.icon {
  width: 18px;
  height: 18px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.icon-sm {
  width: 16px;
  height: 16px;
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: var(--ctl);
  padding: 0 14px;
  border: 1px solid var(--line-btn);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--ink);
  font-weight: 500;
  font-size: var(--fs-md);
  line-height: 1;
  white-space: nowrap;
  text-decoration: none;
  transition:
    background-color 0.12s,
    border-color 0.12s,
    color 0.12s;
}
.btn:hover {
  background: var(--sunken);
  border-color: var(--ink-3);
}
.btn:active {
  transform: translateY(1px);
}
.btn[disabled],
.btn[aria-disabled="true"],
.btn-primary[disabled],
.btn-danger[disabled] {
  background: var(--surface-2);
  border-color: var(--line);
  color: var(--ink-3);
  cursor: not-allowed;
  transform: none;
}
.btn-quiet[disabled],
.btn-quiet[aria-disabled="true"] {
  background: transparent;
  border-color: transparent;
}
.btn-primary {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--on-primary);
}
.btn-primary:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
}
.btn-danger {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
}
:root[data-theme="dark"] .btn-danger {
  color: #2a0b08;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .btn-danger {
    color: #2a0b08;
  }
}
.btn-danger:hover {
  background: var(--danger-hover);
  border-color: var(--danger-hover);
}
.btn-quiet {
  border-color: transparent;
  background: transparent;
  color: var(--ink-2);
}
.btn-quiet:hover {
  background: var(--sunken);
  border-color: transparent;
  color: var(--ink);
}
.btn-link {
  border: 0;
  background: none;
  padding: 0 2px;
  min-height: 0;
  color: var(--primary-ink);
  text-decoration: underline;
  text-underline-offset: 2px;
  font-weight: 500;
}
.btn-link:hover {
  background: none;
  color: var(--primary-hover);
}
.btn-sm {
  min-height: 30px;
  padding: 0 10px;
  font-size: var(--fs-sm);
}
.btn-block {
  width: 100%;
}
.icon-btn {
  width: var(--ctl);
  padding: 0;
}
.btn .kbd {
  margin-left: 4px;
}
.req .btn .kbd {
  visibility: hidden;
}
.req.is-cur .btn .kbd {
  visibility: visible;
}
.icon-more {
  stroke-width: 3.2;
}
.kbd {
  display: inline-block;
  min-width: 18px;
  padding: 1px 5px;
  border-radius: 4px;
  border: 1px solid currentColor;
  color: color-mix(in srgb, currentColor 85%, transparent);
  font-size: 12px;
  line-height: 14px;
  text-align: center;
  font-weight: 500;
}
@media (max-width: 1023px) {
  .kbd,
  .kbd-hint,
  .toast .t-key {
    display: none !important;
  }
}

/* ---------- status chips ---------- */
.st {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: var(--fs-xs);
  font-weight: 500;
  line-height: 18px;
  white-space: nowrap;
  background: var(--sunken);
  color: var(--ink-2);
}
.st::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.8;
}
.st-attn {
  background: var(--attn-soft);
  color: var(--attn-ink);
}
.st-attn::before {
  background: var(--attn);
  opacity: 1;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.15);
}
.st-danger {
  background: var(--danger-soft);
  color: var(--danger-ink);
}
.st-ok {
  background: var(--ok-soft);
  color: var(--ok-ink);
}
.st-primary {
  background: var(--primary-soft);
  color: var(--primary-ink);
}
.st-info {
  background: var(--info-soft);
  color: var(--info-ink);
}
.st-plain::before {
  display: none;
}
.count {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--sunken);
  color: var(--ink-2);
  font-size: var(--fs-xs);
  font-weight: 600;
}
.count-attn {
  background: var(--attn);
  color: #2b1d00;
}

/* ---------- form controls ---------- */
.field {
  display: grid;
  gap: 6px;
  min-width: 0;
}
.field > span,
.lbl {
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--ink-2);
}
.hint {
  font-size: var(--fs-sm);
  color: var(--ink-3);
}
.input {
  width: 100%;
  min-height: var(--ctl);
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  background: var(--surface);
}
textarea.input {
  padding: 8px 10px;
  min-height: 72px;
  resize: vertical;
  line-height: 1.4;
}
.input:hover {
  border-color: var(--ink-3);
}
.input:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 0;
  border-color: var(--focus);
  border-radius: var(--r-sm);
}
.input:disabled {
  border-color: var(--line);
  background: var(--sunken);
  color: var(--ink-3);
  cursor: not-allowed;
}
.input.is-flag {
  border: 2px solid var(--attn-edge);
  background: var(--attn-soft);
}
.input.is-error {
  border-color: var(--danger);
  background: var(--danger-soft);
}
.input.is-changed {
  border-color: var(--primary);
}
@media (max-width: 719px) {
  .input {
    font-size: 16px;
  }
}
.input-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.with-icon {
  position: relative;
}
.with-icon .icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ink-3);
  pointer-events: none;
}
.with-icon .input {
  padding-left: 34px;
}

.switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  min-height: var(--ctl);
}
.switch input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}
.switch .track {
  width: 36px;
  height: 20px;
  border-radius: 999px;
  background: var(--line-strong);
  position: relative;
  transition: background 0.15s;
  flex: none;
}
.switch .track::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.15s;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}
.switch input:checked + .track {
  background: var(--primary);
}
.switch input:checked + .track::after {
  transform: translateX(16px);
}
.switch input:focus-visible + .track {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.seg {
  display: inline-flex;
  flex-wrap: wrap;
  padding: 3px;
  gap: 2px;
  border-radius: var(--r-md);
  background: var(--sunken);
}
.seg button {
  border: 0;
  background: transparent;
  border-radius: var(--r-sm);
  padding: 0 12px;
  min-height: calc(var(--ctl) - 6px);
  font-weight: 500;
  color: var(--ink-2);
  white-space: nowrap;
}
.seg button[aria-pressed="true"],
.seg button[aria-selected="true"] {
  background: var(--surface);
  color: var(--ink);
  font-weight: 600;
  box-shadow:
    inset 0 -3px 0 var(--primary),
    0 1px 2px rgba(0, 0, 0, 0.12);
}

.chipset {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.pick {
  border: 1px solid var(--line-strong);
  background: var(--surface);
  border-radius: 999px;
  min-height: 32px;
  padding: 0 12px;
  font-size: var(--fs-sm);
  font-weight: 500;
}
@media (max-width: 719px) {
  .pick {
    min-height: 40px;
  }
}
.pick[aria-pressed="true"] {
  background: var(--primary-soft);
  border-color: var(--primary);
  color: var(--primary-ink);
  box-shadow: inset 0 0 0 1px var(--primary);
}
.pick {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.nick {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 1px 2px 1px 9px;
  /* A long nickname wraps inside its chip, which grows to hold it. */
  min-height: 26px;
  border-radius: 13px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  font-size: var(--fs-sm);
  color: var(--ink-2);
}
.nick button {
  flex: none;
  border: 0;
  background: none;
  width: 26px;
  height: 24px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  color: var(--ink-3);
}
.nick button:hover {
  background: var(--sunken);
  color: var(--danger-ink);
}
/* A chip without its × (no site to remove it on) is even on both sides. */
.nick:not(:has(button)) {
  padding-right: 9px;
}

/* ---------- banners ---------- */
.banner {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 14px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--surface-2);
}
.banner > .icon {
  margin-top: 1px;
}
.banner .b-body {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 4px;
}
.banner .b-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}
.banner-danger {
  background: var(--bn-danger);
  border-color: var(--bn-line);
  box-shadow: inset var(--bn-edge) 0 0 var(--danger);
  color: var(--danger-ink);
}
.banner-danger .b-body p {
  color: var(--ink);
}
.banner-attn {
  background: var(--bn-attn);
  border-color: var(--bn-line);
  box-shadow: inset var(--bn-edge) 0 0 var(--attn-edge);
  color: var(--attn-ink);
}
.banner-attn .b-body p {
  color: var(--ink);
}
.banner-info {
  background: var(--bn-info);
  border-color: var(--bn-line);
  box-shadow: inset var(--bn-edge) 0 0 var(--info-ink);
  color: var(--info-ink);
}
.banner-info .b-body p {
  color: var(--ink);
}
.banner-ok {
  background: var(--bn-ok);
  border-color: var(--bn-line);
  box-shadow: inset var(--bn-edge) 0 0 var(--ok);
  color: var(--ok-ink);
}
.banner-ok .b-body p {
  color: var(--ink);
}

/* ---------- app shell ---------- */
.app {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}
.side {
  display: none;
}
@media (min-width: 1024px) {
  .app {
    grid-template-columns: var(--side) minmax(0, 1fr);
  }
  .app.is-focus {
    grid-template-columns: minmax(0, 1fr);
  }
  .app.is-focus .side {
    display: none;
  }
  .side {
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    height: 100dvh;
    background: var(--surface);
    border-right: 1px solid var(--line);
    overflow-y: auto;
  }
}
.side-top {
  padding: 18px 16px 12px;
  display: grid;
  gap: 2px;
}
.side-top .org {
  font-weight: 600;
  font-size: var(--fs-md);
}
.side-top .who {
  font-size: var(--fs-sm);
  color: var(--ink-3);
}
.side nav {
  padding: 4px 8px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1px;
}
.side-h {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 8px 4px 8px;
}
.side-h h2 {
  font-size: var(--fs-sm);
  color: var(--ink-3);
  font-weight: 500;
}
.nav-a {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 36px;
  padding: 6px 8px;
  border-radius: var(--r-sm);
  color: var(--ink);
  text-decoration: none;
  position: relative;
}
.nav-a:hover {
  background: var(--surface-2);
}
.nav-a[aria-current="page"] {
  background: var(--primary-soft);
  color: var(--primary-ink);
  font-weight: 600;
}
.nav-a .nav-t {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nav-a .icon {
  color: var(--ink-3);
}
.nav-a[aria-current="page"] .icon {
  color: var(--primary-ink);
}
.nav-site {
  align-items: flex-start;
  padding: 7px 8px;
}
.nav-site .nav-sub {
  display: block;
  font-size: var(--fs-xs);
  color: var(--ink-3);
  font-weight: 400;
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.nav-site .nav-sub.warn {
  color: var(--danger-ink);
}
.nav-site .count {
  margin-top: 1px;
}
button.nav-a,
button.more-a {
  width: 100%;
  border: 0;
  background: none;
  text-align: left;
}
.side-foot {
  margin-top: auto;
  padding: 8px;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 1px;
}

.main {
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.page {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 24px 32px 48px;
}
@media (max-width: 1023px) {
  .page {
    padding: 16px 20px 40px;
  }
}
@media (max-width: 719px) {
  .page {
    padding: 12px 16px 32px;
  }
}

/* phone app bar */
.appbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 4px;
  min-height: 56px;
  padding: 6px 8px;
  padding-top: calc(6px + env(safe-area-inset-top, 0px));
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.appbar .ab-title {
  flex: 1;
  min-width: 0;
  font-size: var(--fs-lg);
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 0 6px;
}
.appbar .ab-title small {
  display: block;
  font-size: var(--fs-xs);
  color: var(--ink-3);
  font-weight: 400;
}
@media (min-width: 1024px) {
  .appbar.phone-only {
    display: none;
  }
}
@media (max-width: 1023px) {
  .desk-only {
    display: none !important;
  }
}
@media (min-width: 1024px) {
  .phone-show {
    display: none !important;
  }
}

/* ---------- page heads ---------- */
.head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.head .h-sub {
  color: var(--ink-2);
  margin-top: 4px;
}
.head-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.crumb {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--ink-2);
  text-decoration: none;
  font-size: var(--fs-sm);
  font-weight: 500;
  margin-bottom: 8px;
}
.crumb:hover {
  color: var(--ink);
}

/* ---------- site header and tabs ---------- */
.sitehead {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.sitehead-in {
  max-width: 1240px;
  margin: 0 auto;
  padding: 22px 32px 0;
}
@media (max-width: 1023px) {
  .sitehead-in {
    padding: 14px 20px 0;
  }
}
@media (max-width: 719px) {
  .sitehead-in {
    padding: 10px 16px 0;
  }
}
.sitehead .sh-row {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  justify-content: space-between;
}
.facts-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
  margin-top: 8px;
  color: var(--ink-2);
  font-size: var(--fs-sm);
}
.facts-row span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.facts-row .icon {
  width: 15px;
  height: 15px;
  color: var(--ink-3);
}
.facts-row .warn {
  color: var(--danger-ink);
  font-weight: 500;
}
.facts-row .warn .icon {
  color: var(--danger-ink);
}
.tabs {
  display: flex;
  gap: 2px;
  margin-top: 14px;
  overflow-x: auto;
  scrollbar-width: none;
  margin-bottom: -1px;
}
.tabs::-webkit-scrollbar {
  display: none;
}
.tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  min-height: 44px;
  flex: none;
  border-bottom: 2px solid transparent;
  color: var(--ink-2);
  text-decoration: none;
  font-weight: 500;
  white-space: nowrap;
}
.tab:hover {
  color: var(--ink);
}
.tab[aria-current="page"] {
  border-bottom-color: var(--primary);
  color: var(--ink);
  font-weight: 600;
}
@media (max-width: 719px) {
  .sitehead {
    position: sticky;
    top: 56px;
    z-index: 15;
  }
  .sitehead .sh-row,
  .sitehead .facts-row {
    display: none;
  }
  .tabs {
    margin-top: 0;
    margin-left: -8px;
    margin-right: -16px;
    padding-right: 16px;
  }
  .tab {
    padding: 0 10px;
  }
}

/* ---------- sections ---------- */
.sec {
  margin-bottom: 28px;
}
.sec-h {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: space-between;
  margin-bottom: 10px;
  min-height: 32px;
  flex-wrap: wrap;
}
.sec-h h2 {
  display: flex;
  align-items: center;
  gap: 8px;
}
.sec-h .sec-note {
  color: var(--ink-3);
  font-size: var(--fs-sm);
  flex-basis: 100%;
  margin-top: -6px;
}
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
}
.list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.list > li + li {
  border-top: 1px solid var(--line);
}

/* ---------- work (Teendők) ---------- */
.work {
  display: grid;
  gap: 24px;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
}
@media (min-width: 1180px) {
  .work {
    grid-template-columns: minmax(0, 1fr) 360px;
  }
}
.work-aside {
  display: none;
}
@media (min-width: 1180px) {
  .work-aside {
    display: block;
    position: sticky;
    top: 20px;
  }
}

/* note queue rows */
.qrow {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 12px 14px;
  color: inherit;
  text-decoration: none;
  position: relative;
}
.qrow:hover {
  background: var(--surface-2);
}
.list > li:first-child .qrow {
  border-top-left-radius: var(--r-lg);
  border-top-right-radius: var(--r-lg);
}
.list > li:last-child .qrow {
  border-bottom-left-radius: var(--r-lg);
  border-bottom-right-radius: var(--r-lg);
}
.thumb {
  width: 44px;
  height: 58px;
  border-radius: 4px;
  overflow: hidden;
  background: var(--desk);
  border: 1px solid var(--line);
}
.thumb svg {
  width: 100%;
  height: 100%;
  display: block;
}
.q-title {
  font-weight: 600;
  display: flex;
  gap: 8px;
  align-items: baseline;
  flex-wrap: wrap;
}
.q-title .q-no {
  font-weight: 400;
  color: var(--ink-2);
}
.q-body {
  display: flex;
  flex-direction: column;
  gap: var(--s-1);
  min-width: 0;
}
.q-title {
  row-gap: 0;
}
.q-meta {
  font-size: var(--fs-sm);
  color: var(--ink-2);
}
.q-side {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink-3);
}
@media (max-width: 719px) {
  .qrow {
    grid-template-columns: 40px minmax(0, 1fr) 18px;
    gap: 12px;
    padding: 12px;
  }
  .q-side .st,
  .q-side .st-why {
    display: none;
  }
  .q-state-m {
    display: flex !important;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--s-1) var(--s-2);
  }
  .q-state-m .st-why {
    margin: 0;
  }
}
.q-state-m {
  display: none;
}

/* request rows */
.req {
  display: grid;
  grid-template-columns: 108px minmax(0, 1fr) auto;
  gap: 16px;
  padding: 16px;
  position: relative;
}
.req:focus {
  outline: none;
}
.req.is-cur {
  background: var(--surface-2);
  box-shadow: inset 3px 0 0 var(--primary);
}
.req:focus-visible {
  box-shadow: inset 0 0 0 2px var(--focus);
  border-radius: var(--r-md);
}
.req.is-cur:focus-visible {
  box-shadow:
    inset 3px 0 0 var(--primary),
    inset 0 0 0 2px var(--focus);
}
.req-qty {
  display: grid;
  gap: 2px;
  align-content: start;
}
.qtybox {
  display: flex;
  align-items: center;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  background: var(--surface);
  height: 40px;
  overflow: hidden;
}
.qtybox:focus-within {
  outline: 2px solid var(--focus);
  outline-offset: 0;
  border-color: var(--focus);
}
.qtybox input {
  width: 100%;
  min-width: 0;
  height: 100%;
  border: 0;
  background: transparent;
  text-align: right;
  font-weight: 600;
  font-size: var(--fs-lg);
  padding: 0 2px 0 6px;
  font-variant-numeric: tabular-nums;
}
.qtybox input:focus {
  outline: none;
}
.qtybox span {
  padding: 0 8px 0 4px;
  color: var(--ink-2);
  font-size: var(--fs-sm);
  white-space: nowrap;
}
.req-qty .was {
  font-size: var(--fs-xs);
  color: var(--ink-3);
  text-align: right;
}
.req-title {
  font-weight: 600;
  font-size: var(--fs-lg);
  line-height: 1.3;
}
.req-meta {
  color: var(--ink-2);
  font-size: var(--fs-sm);
  margin-top: 2px;
  display: flex;
  flex-wrap: wrap;
  gap: 2px 10px;
  align-items: center;
}
.need-today {
  color: var(--danger-ink);
  font-weight: 600;
}
.need-soon {
  color: var(--ink);
  font-weight: 500;
}
.quote {
  margin-top: 8px;
  padding-left: 10px;
  border-left: 2px solid var(--line-strong);
  color: var(--ink-2);
  font-size: var(--fs-sm);
}
.facts {
  margin: 10px 0 0;
  display: grid;
  gap: 4px;
  font-size: var(--fs-sm);
}
.facts > div {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 8px;
}
.facts dt {
  color: var(--ink-3);
  font-weight: 500;
}
.facts dd {
  margin: 0;
  color: var(--ink);
}
.facts .pending {
  color: var(--ink-3);
}
.req-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: stretch;
  min-width: 132px;
}
@media (max-width: 719px) {
  .req {
    grid-template-columns: 76px minmax(0, 1fr);
    gap: 12px;
    padding: 14px 12px;
  }
  .req-actions {
    grid-column: 1 / -1;
    flex-direction: row;
    min-width: 0;
  }
  .req-actions .btn {
    flex: 1;
  }
  .facts > div {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }
}
.decided {
  margin-top: 10px;
}
.decided summary {
  cursor: pointer;
  color: var(--ink-2);
  font-size: var(--fs-sm);
  font-weight: 500;
  padding: 6px 0;
  min-height: 36px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.decided summary::-webkit-details-marker {
  display: none;
}
.decided summary::before {
  content: "›";
  display: inline-block;
  transition: transform 0.15s;
  font-size: 18px;
  line-height: 1;
}
.decided[open] summary::before {
  transform: rotate(90deg);
}
.drow {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
}
.drow .d-t {
  min-width: 0;
}
.drow .d-t s {
  color: var(--ink-3);
}

.empty {
  padding: 32px 20px;
  text-align: center;
  display: grid;
  gap: 8px;
  justify-items: center;
  color: var(--ink-2);
}
.empty > .icon {
  width: 28px;
  height: 28px;
  color: var(--ink-3);
}
.empty h3 {
  color: var(--ink);
  font-size: var(--fs-lg);
}
.empty p {
  max-width: 44ch;
}

/* ---------- order cart ---------- */
.cart {
  overflow: clip;
}
.cart-h {
  padding: 14px 16px 12px;
  border-bottom: 1px solid var(--line);
}
.cart-h .to {
  font-size: var(--fs-sm);
  color: var(--ink-2);
  margin-top: 2px;
  overflow-wrap: anywhere;
}
.cline {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 10px;
  padding: 10px 16px;
  align-items: center;
}
.cline .c-t {
  font-weight: 500;
}
.cline .c-t b {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.cline .c-m {
  font-size: var(--fs-xs);
  color: var(--ink-3);
  grid-column: 1;
}
.cline .btn {
  grid-row: 1 / span 2;
  grid-column: 2;
}
.cart-f {
  padding: 12px 16px 16px;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 10px;
  background: var(--surface-2);
}
.cart-f dl {
  margin: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 2px 12px;
  font-size: var(--fs-sm);
}
.cart-f dt {
  color: var(--ink-3);
}
.cart-f dd {
  margin: 0;
}
.cart-empty {
  padding: 20px 16px;
  color: var(--ink-2);
  font-size: var(--fs-sm);
}
.cart-sent {
  padding: 14px 16px;
  display: flex;
  gap: 10px;
  color: var(--ok-ink);
  background: var(--ok-soft);
  font-size: var(--fs-sm);
}
.cart-sent p {
  color: var(--ink);
}

/* phone / narrow: sticky order bar */
.orderbar {
  position: sticky;
  bottom: 0;
  z-index: 18;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
  background: var(--surface);
  box-shadow: var(--sh-bar);
}
.orderbar .ob-t {
  flex: 1;
  min-width: 0;
  font-size: var(--fs-sm);
  color: var(--ink-2);
}
.orderbar .ob-t b {
  display: block;
  color: var(--ink);
  font-size: var(--fs-md);
}
@media (min-width: 1180px) {
  .orderbar {
    display: none;
  }
}

/* ---------- tables ---------- */
.tbl-wrap {
  overflow-x: auto;
}
.tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-md);
}
.tbl th {
  text-align: left;
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--ink-3);
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  background: var(--surface-2);
}
.tbl th:first-child {
  border-top-left-radius: var(--r-lg);
}
.tbl th:last-child {
  border-top-right-radius: var(--r-lg);
}
.tbl td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.tbl tr:last-child td {
  border-bottom: 0;
}
.tbl .r {
  text-align: right;
}
.tbl tbody tr.link-row {
  cursor: pointer;
}
.tbl tbody tr.link-row:hover td {
  background: var(--surface-2);
}
.tbl .t-main {
  font-weight: 600;
}
.tbl .t-sub {
  font-size: var(--fs-sm);
  color: var(--ink-3);
}
.tbl a.rowlink {
  color: inherit;
  text-decoration: none;
  font-weight: 600;
}
.tbl a.rowlink:hover {
  text-decoration: underline;
}

/* stacked rows: phone version of tables */
.srow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 12px;
  padding: 12px 14px;
  color: inherit;
  text-decoration: none;
  align-items: start;
}
a.srow:hover {
  background: var(--surface-2);
}
.srow .s-t {
  font-weight: 600;
}
.srow .s-m {
  font-size: var(--fs-sm);
  color: var(--ink-2);
}
.srow .s-r {
  text-align: right;
  font-weight: 600;
  white-space: nowrap;
}
.srow .s-x {
  grid-column: 1 / -1;
}

/* ---------- home ---------- */
.today {
  color: var(--ink-2);
  margin-top: 4px;
}
.site-name {
  display: flex;
  align-items: center;
  gap: 8px;
}
.attn-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--attn);
  box-shadow: 0 0 0 1px var(--attn-edge);
  flex: none;
}
.cell-n {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.cell-n.zero {
  color: var(--ink-3);
  font-weight: 400;
}
.hsite {
  display: grid;
  gap: 8px;
  padding: 14px;
  color: inherit;
  text-decoration: none;
  position: relative;
}
.hsite:hover {
  background: var(--surface-2);
}
.hsite .hs-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.hsite .hs-meta {
  font-size: var(--fs-sm);
  color: var(--ink-3);
  display: flex;
  gap: 6px;
  align-items: center;
}
.hsite .hs-meta .icon {
  width: 14px;
  height: 14px;
}
.hsite.has-attn::before {
  content: "";
  position: absolute;
  left: 0;
  top: 12px;
  bottom: 12px;
  width: 4px;
  border-radius: 0 3px 3px 0;
  background: var(--attn);
  box-shadow: 0 0 0 1px var(--attn-edge);
}

/* ---------- material (Anyag) ---------- */
.toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.toolbar .with-icon {
  flex: 1;
  min-width: 200px;
  max-width: 360px;
}
.mat-total {
  font-weight: 600;
  font-size: var(--fs-lg);
  white-space: nowrap;
}
.nicks {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

/* ---------- orders history ---------- */
.ord {
  padding: 0;
}
.ord summary {
  list-style: none;
  cursor: pointer;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2px 12px;
  padding: 14px 16px;
  align-items: center;
}
.ord summary::-webkit-details-marker {
  display: none;
}
.ord summary:hover {
  background: var(--surface-2);
}
.ord .o-t {
  font-weight: 600;
}
.ord .o-m {
  font-size: var(--fs-sm);
  color: var(--ink-2);
  grid-column: 1;
}
.ord .chev {
  grid-row: 1 / span 2;
  grid-column: 2;
  transition: transform 0.15s;
  color: var(--ink-3);
}
.ord[open] .chev {
  transform: rotate(90deg);
}
.ord .tbl td {
  padding: 8px 16px;
}

/* ---------- group ---------- */
.kv {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 8px 20px;
  margin: 0;
}
.kv dt {
  color: var(--ink-3);
}
.kv dd {
  margin: 0;
  overflow-wrap: anywhere;
}
.steps {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 14px;
  counter-reset: st;
}
.steps li {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 12px;
  counter-increment: st;
}
.steps li::before {
  content: counter(st);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--primary-soft);
  color: var(--primary-ink);
  font-weight: 600;
  font-size: var(--fs-sm);
}
.linkbox {
  display: flex;
  gap: 8px;
  align-items: center;
}
.linkbox code {
  flex: 1;
  min-width: 0;
  padding: 8px 10px;
  min-height: var(--ctl);
  box-sizing: border-box;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface-2);
  font: 500 var(--fs-sm) / 1.4 var(--font);
  overflow-wrap: anywhere;
}
.qr {
  width: 132px;
  height: 132px;
  padding: 8px;
  background: #fff;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  flex: none;
}
.group-create {
  display: flex;
  gap: 24px;
  align-items: flex-start;
}
@media (max-width: 719px) {
  .group-create .qr-wrap {
    display: none;
  }
}

/* ---------- review ---------- */
.rv-bar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.rv-bar-in {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 24px;
  min-height: 64px;
}
.rv-bar .rv-title {
  flex: 1;
  min-width: 0;
}
.rv-title h1 {
  font-size: var(--fs-xl);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.rv-title .rv-sub {
  font-size: var(--fs-sm);
  color: var(--ink-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rv-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--ink-2);
  font-size: var(--fs-sm);
}
.rv-actions {
  display: flex;
  gap: 8px;
}
.rv-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: 24px;
  padding: 20px 24px 40px;
  max-width: 1480px;
  margin: 0 auto;
  align-items: start;
}
.photo-pane {
  position: sticky;
  top: 84px;
  display: grid;
  gap: 10px;
}
.photo {
  position: relative;
  background: var(--desk);
  border-radius: var(--r-lg);
  overflow: auto;
  height: calc(100vh - 196px);
  height: calc(100dvh - 196px);
  min-height: 420px;
  display: grid;
  place-items: center;
  overscroll-behavior: contain;
}
.photo svg {
  width: 100%;
  height: 100%;
  display: block;
}
.photo.is-zoom svg {
  width: 200%;
  height: auto;
}
.photo-tools {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}
.ph-hl {
  fill: var(--hl-fill);
  stroke: var(--hl);
  stroke-width: 3;
}
.ph-pin circle {
  fill: #f2b705;
  stroke: #2b1d00;
  stroke-width: 2;
}
.ph-pin text {
  fill: #2b1d00;
}
:root[data-theme="dark"] .photo svg,
:root[data-theme="dark"] .thumb svg,
:root[data-theme="dark"] .crop svg {
  filter: brightness(0.9);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .photo svg,
  :root:not([data-theme="light"]) .thumb svg,
  :root:not([data-theme="light"]) .crop svg {
    filter: brightness(0.9);
  }
}

.form-pane {
  display: grid;
  gap: 20px;
  min-width: 0;
}
.hdr-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) minmax(0, 0.9fr);
  gap: 12px;
}
@media (max-width: 1023px) {
  .hdr-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
  .hdr-grid .field:first-child {
    grid-column: 1 / -1;
  }
}
.lines {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}
.lines th {
  text-align: left;
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--ink-3);
  padding: 0 6px 6px;
  white-space: nowrap;
}
.lines td {
  padding: 5px 4px;
  vertical-align: middle;
  border-top: 1px solid transparent;
}
.lines tr.ln > td:first-child {
  padding-left: 8px;
  border-radius: var(--r-sm) 0 0 var(--r-sm);
}
.lines tr.ln > td:last-child {
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
}
.lines tr.ln.is-hi > td {
  background: var(--primary-soft);
}
.lines .pg {
  font-size: var(--fs-xs);
  color: var(--ink-3);
  white-space: nowrap;
  width: 34px;
}
.lines .c-code {
  width: 112px;
}
.lines .c-qty {
  width: 84px;
}
.lines .c-unit {
  width: 92px;
}
.lines .c-del {
  width: 40px;
}
.lines .input {
  min-height: 34px;
  padding: 0 8px;
}
.flagrow td {
  padding: 0 4px 10px;
}
.flagnote {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  color: var(--attn-ink);
  font-size: var(--fs-sm);
  font-weight: 500;
}
.flagnote .fn-why {
  flex: 1 1 260px;
  min-width: 0;
}
.flagnote .fn-act {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.flagnote .pin {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--attn);
  color: #2b1d00;
  box-shadow: 0 0 0 1px var(--attn-edge);
  display: inline-grid;
  place-items: center;
  font-size: 12px;
  font-weight: 600;
  flex: none;
}
.flagnote.is-ok {
  color: var(--ok-ink);
}
.crop {
  display: block;
  border-radius: var(--r-sm);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--desk);
}
.crop svg {
  display: block;
  width: 100%;
  height: auto;
}

.rv-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.mlines {
  display: grid;
  gap: 10px;
}
.mline {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
  padding: 12px;
  display: grid;
  gap: 10px;
}
.mline.is-flag {
  border-color: var(--attn-edge);
}
.mline .ml-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: var(--fs-xs);
  color: var(--ink-3);
}
.mline .ml-row {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
}
.rv-phone-tabs {
  position: sticky;
  top: 56px;
  z-index: 15;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  padding: 8px 16px;
}
.rv-phone-tabs .seg {
  display: flex;
}
.rv-phone-tabs .seg button {
  flex: 1;
}
.actionbar {
  position: sticky;
  bottom: 0;
  z-index: 18;
  display: flex;
  gap: 8px;
  padding: 10px 16px;
  padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
  background: var(--surface);
  box-shadow: var(--sh-bar);
}
.actionbar .btn-primary {
  flex: 1;
}
@media (max-width: 1023px) {
  .rv-bar.desk-only {
    display: none;
  }
  .rv-grid {
    display: block;
    padding: 12px 16px 24px;
  }
  .photo-pane {
    position: static;
  }
  .photo {
    height: auto;
    min-height: 0;
    aspect-ratio: 3 / 4;
  }
}
@media (min-width: 720px) and (max-width: 1023px) {
  .rv-grid {
    padding: 16px 20px 24px;
  }
}

/* ---------- overlay: dialog on desktop, bottom sheet on phone ---------- */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(10, 15, 20, 0.45);
  overscroll-behavior: contain;
}
.dialog {
  width: 100%;
  max-width: 560px;
  max-height: calc(100vh - 48px);
  max-height: calc(100dvh - 48px);
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-pop);
  overflow: hidden;
  animation: dlg-in 0.16s ease-out;
}
.dialog.wide {
  max-width: 760px;
}
.dlg-h {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 18px 20px 10px;
}
.dlg-h h2 {
  flex: 1;
  font-size: var(--fs-xl);
  line-height: 1.25;
}
.dlg-h .h-sub {
  color: var(--ink-2);
  font-size: var(--fs-sm);
  margin-top: 4px;
  font-weight: 400;
}
.dlg-b {
  padding: 6px 20px 20px;
  overflow-y: auto;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 0;
}
.dlg-b > * {
  flex-shrink: 0;
}
.dlg-f {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 20px;
  border-top: 1px solid var(--line);
  background: var(--surface-2);
  flex-wrap: wrap;
}
.dlg-f .spacer {
  flex: 1;
}
@keyframes dlg-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes sheet-in {
  from {
    transform: translateY(24px);
    opacity: 0.6;
  }
  to {
    transform: none;
    opacity: 1;
  }
}
@media (max-width: 719px) {
  .overlay {
    place-items: end stretch;
    padding: 0;
  }
  .dialog,
  .dialog.wide {
    max-width: none;
    max-height: 92vh;
    max-height: 92dvh;
    border-radius: 16px 16px 0 0;
    animation: sheet-in 0.2s ease-out;
  }
  .dialog::before {
    content: "";
    width: 36px;
    height: 4px;
    border-radius: 4px;
    background: var(--line-strong);
    margin: 8px auto 0;
    flex: none;
  }
  .dlg-h {
    padding: 10px 16px 6px;
  }
  .dlg-b {
    padding: 6px 16px 16px;
  }
  .dlg-f {
    padding: 10px 16px;
    padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
  }
  .dlg-f .btn {
    flex: 1;
  }
  .dlg-f .spacer {
    display: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  .dialog,
  .toast {
    animation: none !important;
  }
  * {
    transition: none !important;
  }
}

.mail {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: clip;
}
.mail-h {
  padding: 10px 14px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 2px 12px;
  font-size: var(--fs-sm);
}
.mail-h dt {
  color: var(--ink-3);
}
.mail-h dd {
  margin: 0;
  overflow-wrap: anywhere;
}
.mail pre {
  margin: 0;
  padding: 14px;
  font: 400 var(--fs-sm) / 1.55 var(--font);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.tgmsg {
  border-radius: 12px 12px 12px 4px;
  background: var(--primary-soft);
  padding: 10px 14px;
  font-size: var(--fs-sm);
  white-space: pre-wrap;
  max-width: 420px;
}
.tgmsg b {
  display: block;
  margin-bottom: 2px;
  color: var(--primary-ink);
}

.drop {
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--r-md);
  padding: 22px;
  display: grid;
  gap: 10px;
  justify-items: center;
  text-align: center;
  color: var(--ink-2);
  background: var(--surface-2);
}
.drop .icon {
  width: 26px;
  height: 26px;
  color: var(--ink-3);
}
.pages {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.pagethumb {
  width: 84px;
  display: grid;
  gap: 4px;
  font-size: var(--fs-xs);
  color: var(--ink-2);
  text-align: center;
}
.pagethumb .thumb {
  width: 84px;
  height: 108px;
}
.pagethumb .pt-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pagetab {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: var(--r-sm);
  padding: 4px 10px 4px 4px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  min-height: 44px;
}
.pagetab .thumb {
  width: 28px;
  height: 36px;
}
.pagetab[aria-pressed="true"] {
  border-color: var(--primary);
  box-shadow: inset 0 0 0 1px var(--primary);
}
.radio-list {
  display: grid;
  gap: 8px;
}
.radio {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  cursor: pointer;
}
.radio:has(input:checked) {
  border-color: var(--primary);
  background: var(--primary-soft);
}
.radio input {
  accent-color: var(--primary);
  width: 18px;
  height: 18px;
}
.sum {
  display: grid;
  gap: 6px;
  padding: 12px 14px;
  border-radius: var(--r-md);
  background: var(--surface-2);
  border: 1px solid var(--line);
  font-size: var(--fs-sm);
}
.sum b {
  font-size: var(--fs-md);
}
.grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 479px) {
  .grid2 {
    grid-template-columns: 1fr;
  }
}

/* ---------- toast ---------- */
.toasts {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  z-index: 60;
  display: grid;
  gap: 8px;
  width: max-content;
  max-width: calc(100vw - 32px);
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 10px 10px 16px;
  min-height: 48px;
  border-radius: var(--r-md);
  background: var(--inverse);
  color: var(--on-inverse);
  box-shadow: var(--sh-pop);
  font-size: var(--fs-md);
  animation: dlg-in 0.16s ease-out;
}
.toast .t-msg {
  flex: 1;
  min-width: 0;
}
.toast button {
  border: 0;
  background: transparent;
  color: var(--inverse-link);
  font-weight: 600;
  min-height: 36px;
  padding: 0 10px;
  border-radius: var(--r-sm);
}
.toast button:hover {
  background: rgba(127, 127, 127, 0.18);
}
.toast .t-bar {
  position: absolute;
}

@media (max-width: 719px) {
  .toasts {
    bottom: 16px;
    width: calc(100vw - 32px);
  }
}

/* ---------- forms pages ---------- */
.form {
  display: grid;
  gap: 18px;
  max-width: 640px;
}
.form-sec {
  display: grid;
  gap: 14px;
  padding: 20px;
}
.form-sec + .form-sec {
  border-top: 1px solid var(--line);
}
.form-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  flex-wrap: wrap;
}
.nickinput {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  min-height: var(--ctl);
  padding: 4px 6px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  background: var(--surface);
}
.nickinput:focus-within {
  outline: 2px solid var(--focus);
  border-color: var(--focus);
}
.nickinput input {
  border: 0;
  outline: 0;
  background: transparent;
  flex: 1;
  min-width: 120px;
  min-height: 28px;
}

.login {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px 16px;
}
.login .panel {
  width: 100%;
  max-width: 380px;
  padding: 28px 24px;
  display: grid;
  gap: 18px;
}

/* ---------- menu ---------- */
.menu-wrap {
  position: relative;
}
.menu {
  position: absolute;
  right: 0;
  bottom: calc(100% + 6px);
  z-index: 30;
  min-width: 220px;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--sh-pop);
  display: grid;
}
.menu.down {
  bottom: auto;
  top: calc(100% + 6px);
}
.menu button {
  border: 0;
  background: none;
  text-align: left;
  padding: 0 10px;
  min-height: 44px;
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  gap: 10px;
}
.menu button:hover {
  background: var(--surface-2);
}
.menu .danger {
  color: var(--danger-ink);
}

.kbd-hint {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  color: var(--ink-3);
  font-size: var(--fs-xs);
  margin-top: 10px;
}
.kbd-hint span {
  display: inline-flex;
  gap: 6px;
  align-items: center;
}

/* ---------- pass 1 fixes ---------- */
.side-h {
  padding-left: 16px;
}
.dialog:focus {
  outline: none;
}
body.has-dlg .toasts,
body.has-dlg.has-bar .toasts {
  bottom: auto;
  top: calc(12px + env(safe-area-inset-top, 0px));
}
@media (max-width: 719px) {
  .kv {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }
  .kv dt {
    margin-top: 8px;
    font-size: var(--fs-sm);
  }
  .kv dt:first-child {
    margin-top: 0;
  }
}

/* ---------- resource-management views ---------- */
.h-sub {
  color: var(--ink-2);
  margin-top: 4px;
  max-width: 72ch;
}
.h-link {
  color: inherit;
  text-decoration: none;
}
.h-link:hover {
  text-decoration: underline;
}
.side-h h2 a {
  color: inherit;
  text-decoration: none;
}
.side-h h2 a:hover {
  color: var(--ink);
  text-decoration: underline;
}
.sel-wrap .input {
  min-width: 200px;
}
.legend {
  margin-top: 12px;
  font-size: var(--fs-sm);
  color: var(--ink-3);
  max-width: 80ch;
}
.tbl-mat td.r,
.tbl-mat th.r {
  width: 112px;
}
.tbl-mat .st {
  margin-left: auto;
}

.mrow {
  padding: 12px 14px;
  display: grid;
  gap: 8px;
}
.m-h {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}
.pipe {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}
.pipe > div {
  background: var(--surface-2);
  border-radius: var(--r-sm);
  padding: 6px 8px;
  min-width: 0;
}
.pipe dt {
  font-size: var(--fs-xs);
  color: var(--ink-3);
  overflow-wrap: anywhere;
}
.pipe dd {
  margin: 0;
  font-weight: 600;
  font-size: var(--fs-sm);
  overflow-wrap: anywhere;
}

.more-a {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 0 14px;
  color: var(--ink);
  text-decoration: none;
}
.more-a > span:first-of-type {
  flex: 1;
  font-weight: 500;
}
.more-a .icon:first-child {
  color: var(--ink-3);
}
.more-a .icon:last-child {
  color: var(--ink-3);
}
.more-a:hover {
  background: var(--surface-2);
}

.bottomnav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 25;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: var(--surface);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.bottomnav a {
  display: grid;
  justify-items: center;
  gap: 2px;
  padding: 8px 4px 6px;
  min-height: 56px;
  color: var(--ink-3);
  text-decoration: none;
  font-size: var(--fs-xs);
  font-weight: 500;
}
.bottomnav a[aria-current="page"] {
  color: var(--primary-ink);
}
.bottomnav a[aria-current="page"] .icon {
  stroke-width: 2.2;
}
.bottomnav .bn-i {
  position: relative;
  display: grid;
  place-items: center;
  height: 24px;
}
.bottomnav .bn-i .icon {
  width: 22px;
  height: 22px;
}
.bottomnav .count {
  position: absolute;
  left: 14px;
  top: -4px;
  height: 18px;
  min-width: 18px;
  font-size: var(--fs-xs);
  padding: 0 5px;
}
@media (min-width: 1024px) {
  .bottomnav {
    display: none;
  }
}
@media (max-width: 1023px) {
  body.has-bnav .page {
    padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px));
  }
}
.tbl-mat td.r,
.tbl-mat th.r {
  width: 124px;
  white-space: nowrap;
}
.tbl-mat .t-sub {
  white-space: nowrap;
}
.t-main {
  font-weight: 600;
}
.t-sub {
  font-size: var(--fs-sm);
  color: var(--ink-3);
}
.pipe > div {
  padding: 5px 6px;
}
.pipe dt {
  font-size: var(--fs-xs);
}
@media (max-width: 719px) {
  .pend-row {
    grid-template-columns: minmax(0, 1fr);
  }
  .pend-row .btn {
    width: 100%;
  }
}
[hidden] {
  display: none !important;
}
/* ==========================================================================
   Round 2. Sizing follows the input device, not the width; new components for
   the material ledger, late and in-transit states, orders as living records,
   transfers (proposal), and the keyboard, focus and offline states.
   ========================================================================== */

/* ---------- touch: sized for a finger (and a glove), at any width ---------- */
@media (pointer: coarse) {
  :root {
    --ctl: 48px;
  }
  .input,
  .qtybox input {
    font-size: 16px;
  }
  .btn-sm,
  .seg button,
  .pick,
  .toast button,
  .pagetab,
  .tab,
  .t-link,
  .check,
  .decided summary,
  .menu button {
    min-height: 44px;
  }
  .btn-sm {
    padding: 0 12px;
  }
  .nick {
    min-height: 36px;
    border-radius: 18px;
  }
  .nick button {
    width: 44px;
    height: 44px;
    margin: -4px -6px -4px -6px;
  }
  .actionbar .btn,
  .orderbar .btn {
    min-height: 52px;
  }
  .qtybox {
    height: 48px;
  }
  .h-link,
  a.tap,
  .sub-site {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
  }
  .lines .input {
    min-height: 44px;
  }
  .icon-btn {
    width: var(--ctl);
  }
}

/* ---------- focus and keyboard ---------- */
.skip {
  position: absolute;
  left: 8px;
  top: -200px;
  z-index: 100;
  padding: 10px 14px;
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--sh-pop);
  font-weight: 600;
}
.skip:focus {
  top: calc(8px + env(safe-area-inset-top, 0px));
}
[data-h1]:focus,
h2[tabindex="-1"]:focus,
h3[tabindex="-1"]:focus {
  outline: none;
}
.tab:focus-visible {
  outline-offset: -2px;
}
/* What sits under the sticky bars is scrolled clear of them when it takes focus. */
@media (max-width: 1023px) {
  html {
    scroll-padding-top: calc(124px + env(safe-area-inset-top, 0px));
    scroll-padding-bottom: 16px;
  }
  html:has(body.has-bnav) {
    scroll-padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px));
  }
}
@media (max-width: 1179px) {
  html:has(body.has-bar) {
    scroll-padding-bottom: calc(92px + env(safe-area-inset-bottom, 0px));
  }
}
@media (min-width: 1024px) {
  html:has(.rv-bar) {
    scroll-padding-top: 84px;
  }
}

/* ---------- bottom bars and toasts share one height ---------- */
body {
  --bar-h: 0px;
}
@media (max-width: 1023px) {
  body.has-bnav {
    --bar-h: calc(57px + env(safe-area-inset-bottom, 0px));
  }
}
@media (max-width: 1179px) {
  body.has-bar {
    --bar-h: calc(69px + env(safe-area-inset-bottom, 0px));
  }
}
@media (min-width: 1024px) {
  body.has-bar:has(.actionbar) {
    --bar-h: 0px;
  }
}
.toasts {
  bottom: calc(var(--bar-h) + 16px);
}
.toast {
  position: relative;
  overflow: hidden;
}
.toast .t-key {
  margin-left: 6px;
  font-weight: 500;
  font-size: var(--fs-xs);
  opacity: 0.8;
}
.toast .t-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: var(--inverse-link);
  transform-origin: left;
}

/* ---------- landscape phone and 200% zoom: sticky chrome steps aside ---------- */
@media (max-height: 500px) {
  .sitehead,
  .rv-phone-tabs {
    position: static !important;
  }
  .appbar {
    position: static;
  }
  html {
    scroll-padding-top: 16px;
  }
}
@media (max-height: 500px) and (pointer: coarse) {
  .overlay {
    place-items: end stretch;
    padding: 0;
  }
  .dialog,
  .dialog.wide {
    max-width: none;
    max-height: 96dvh;
    border-radius: 16px 16px 0 0;
  }
  .dlg-f .btn {
    flex: 1;
  }
}
.page,
.sitehead-in,
.appbar,
.actionbar,
.orderbar {
  padding-left: max(var(--gut, 16px), env(safe-area-inset-left, 0px));
  padding-right: max(var(--gut, 16px), env(safe-area-inset-right, 0px));
}
.page,
.sitehead-in {
  --gut: 32px;
}
@media (max-width: 1023px) {
  .page,
  .sitehead-in {
    --gut: 20px;
  }
}
@media (max-width: 719px) {
  .page,
  .sitehead-in {
    --gut: 16px;
  }
}
.appbar {
  --gut: 8px;
}

/* ---------- tablet landscape: a narrower sidebar, and tables that show they scroll ---------- */
@media (min-width: 1024px) and (max-width: 1279px) {
  :root {
    --side: 216px;
  }
}
.tbl-wrap {
  background:
    linear-gradient(to right, var(--surface) 30%, transparent) left / 40px 100% no-repeat local,
    linear-gradient(to left, var(--surface) 30%, transparent) right / 40px 100% no-repeat local,
    radial-gradient(farthest-side at 0 50%, rgba(0, 0, 0, 0.16), transparent) left / 12px 100% no-repeat scroll,
    radial-gradient(farthest-side at 100% 50%, rgba(0, 0, 0, 0.16), transparent) right / 12px 100% no-repeat scroll;
}
.tbl-wrap .tbl th {
  background: var(--surface-2);
}

/* ---------- long names wrap ---------- */
h1,
h2,
h3,
.t-main,
.t-link,
.s-t,
.req-title,
.q-title,
.ab-title,
.nav-t,
.c-t {
  overflow-wrap: anywhere;
}
.nav-a .nav-t {
  white-space: normal;
}
.nav-site .nav-sub {
  white-space: normal;
}
@media (max-width: 380px) {
  .pipe {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ---------- buttons ---------- */
.btn-go {
  color: var(--primary-ink);
  font-weight: 600;
}
.btn-go:hover {
  color: var(--primary-ink);
  border-color: var(--primary);
}
.btn-bordered {
  border-color: var(--line-btn);
}
.btn-bordered:hover {
  border-color: var(--ink-3);
}
.btn-link {
  font-size: inherit;
}
.danger-text {
  color: var(--danger-ink);
}
.ok-text {
  color: var(--ok-ink);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.count-on-primary {
  background: color-mix(in srgb, var(--on-primary) 22%, transparent);
  color: var(--on-primary);
}
.spin {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-right-color: transparent;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ---------- selects: the app's chevron, not the OS one ---------- */
select.input {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 34px;
}
.sel-wrap {
  position: relative;
  display: inline-grid;
}
.field.sel-wrap {
  display: grid;
}
.sel-wrap::after {
  content: "";
  position: absolute;
  right: 14px;
  bottom: calc(var(--ctl) / 2 - 2px);
  width: 7px;
  height: 7px;
  border-right: 1.8px solid var(--ink-2);
  border-bottom: 1.8px solid var(--ink-2);
  transform: rotate(45deg);
  pointer-events: none;
}

/* ---------- check and switch labels ---------- */
.check {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 36px;
  cursor: pointer;
}
.check input {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
}
.switch .sw-l {
  color: var(--ink-2);
  font-size: var(--fs-sm);
  min-width: 76px;
}
.switch .track {
  background: var(--line-strong);
}

/* ---------- counts: one badge, three tones ---------- */
.count-attn {
  box-shadow: 0 0 0 1px var(--attn-edge);
}
.count-late {
  background: var(--danger-soft);
  color: var(--danger-ink);
}
.seg .count {
  margin-left: 6px;
  height: 18px;
  min-width: 18px;
  padding: 0 5px;
}

/* ---------- late and in transit ---------- */
.late,
.late b {
  color: var(--danger-ink);
}
.st-late {
  background: var(--danger-soft);
  color: var(--danger-ink);
}
.st-late::before {
  background: var(--danger);
}
.cell-n.late {
  color: var(--danger-ink);
}
.lstate {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--ink-2);
  white-space: nowrap;
}
.lstate.late {
  color: var(--danger-ink);
}
.st-why {
  display: block;
  margin-top: 2px;
  font-size: var(--fs-xs);
  color: var(--ink-3);
}

/* ---------- quantities: the number and the unit in their own columns ---------- */
.qu {
  display: inline-grid;
  grid-template-columns: auto 3.7em;
  column-gap: 0.35em;
  justify-content: end;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.qu .qn {
  font-weight: 500;
}
.qu .qunit {
  text-align: left;
  color: var(--ink-2);
  overflow-wrap: anywhere;
}
.qu.zero .qn {
  color: var(--ink-3);
}
.q-late .qn,
.q-late .qunit,
.s-r.q-late {
  color: var(--danger-ink);
  font-weight: 600;
}
.q-transit .qn {
  color: var(--ink-2);
}
.tbl-mat td.r,
.tbl-mat th.r {
  width: 118px;
}
.tbl-mat .t-sub {
  white-space: normal;
}
.tbl-mat tr.is-head td {
  background: var(--surface-2);
}
.tbl-mat tr.is-sub td {
  padding-top: 8px;
  padding-bottom: 8px;
}
.tbl-mat tr.is-sub td:nth-child(2) {
  padding-left: 24px;
}
.tbl .qcol {
  width: 132px;
  white-space: nowrap;
}
.tbl .stcol {
  width: 160px;
}
.nowrap {
  white-space: nowrap;
}
.strike {
  text-decoration: line-through;
  color: var(--ink-3);
}
.t-link {
  border: 0;
  background: none;
  padding: 0;
  font: inherit;
  font-weight: 600;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: var(--line-btn);
  text-underline-offset: 3px;
}
.t-link:hover {
  text-decoration-color: currentColor;
  color: var(--primary-ink);
}
.sub-site {
  font-weight: 400;
}
.result-count {
  font-size: var(--fs-sm);
  color: var(--ink-3);
  margin: -4px 0 10px;
}
.toolbar .grow {
  flex: 1 1 220px;
  max-width: 360px;
  min-width: 0;
}
.toolbar .push {
  margin-left: auto;
}
.daterange {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.daterange .input {
  width: auto;
}
.month-h {
  font-size: var(--fs-sm);
  color: var(--ink-2);
  font-weight: 600;
  margin: 18px 0 8px;
}
.month-h:first-of-type {
  margin-top: 4px;
}
.more-row {
  display: flex;
  justify-content: center;
  margin-top: 12px;
}
.s-st {
  text-align: right;
}

/* ---------- request card: facts as a ledger, the call hint, the source ---------- */
.req-code {
  margin-left: 8px;
  font-size: var(--fs-sm);
  font-weight: 400;
  color: var(--ink-3);
}
.src {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--ink-3);
}
.facts > div {
  align-items: start;
}
.facts .bal {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 14px;
}
.facts .bal b {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.facts .bal-pend {
  flex-basis: 100%;
  color: var(--ink-2);
}
.facts .other {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  align-items: center;
}
.facts .other .st {
  margin-left: 4px;
}
.callhint {
  display: flex;
  gap: 6px;
  align-items: flex-start;
  margin-top: 8px;
  font-size: var(--fs-sm);
  color: var(--danger-ink);
}
.callhint .icon {
  margin-top: 2px;
}
.callhint a {
  color: inherit;
  font-weight: 600;
}
.req-actions {
  gap: 10px;
}
@media (max-width: 719px) {
  .req-actions {
    gap: 12px;
  }
  .req {
    grid-template-columns: 96px minmax(0, 1fr);
  }
}
.qtybox input {
  min-width: 48px;
}

/* ---------- order panel ---------- */
.cart-h h2 {
  display: flex;
  align-items: center;
  gap: 8px;
}
.cline .c-fact {
  grid-column: 1;
  display: flex;
  gap: 6px;
  align-items: flex-start;
  font-size: var(--fs-xs);
  color: var(--ink-2);
}
.cline .c-fact .icon {
  margin-top: 1px;
  color: var(--ink-3);
}
.cline .btn {
  grid-row: 1 / span 3;
}
.cline.is-new {
  animation: flash 0.9s ease-out;
}
@keyframes flash {
  from {
    background: var(--primary-soft);
  }
  to {
    background: transparent;
  }
}
li.is-leaving {
  animation: leave 0.16s ease-in forwards;
  overflow: hidden;
}
@keyframes leave {
  to {
    opacity: 0;
    transform: translateX(12px);
  }
}
@media (prefers-reduced-motion: reduce) {
  .cline.is-new,
  li.is-leaving,
  .spin {
    animation: none;
  }
}
.cart-in-sheet {
  border-radius: var(--r-md);
}
.banner-tight {
  padding: 10px 12px;
}

/* ---------- overview ---------- */
.tbl-sites tr.has-attn td:first-child {
  box-shadow: inset 4px 0 0 var(--attn);
}
.tbl-sites td .st {
  margin-top: 6px;
}
.hs-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.hs-top .icon {
  color: var(--ink-3);
}
.legend {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}
.legend .icon {
  color: var(--ink-3);
}
p.legend {
  display: block;
}
.icon-line {
  display: flex;
  gap: 6px;
  align-items: center;
}

/* ---------- orders as living records ---------- */
.ord + .ord {
  border-top: 1px solid var(--line);
}
.ord .o-m .late {
  font-weight: 600;
}
.ord-f {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 16px 14px;
  border-top: 1px solid var(--line);
}
.ord-fix {
  display: flex;
  gap: 6px;
  align-items: center;
  padding: 8px 16px 0;
  font-size: var(--fs-sm);
  color: var(--ink-2);
}
.tbl-ord tr.is-cancelled td {
  color: var(--ink-3);
}
.fixlist .fixrow {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
}
.fixrow.is-del .fx-n {
  text-decoration: line-through;
  color: var(--ink-3);
}
.fixrow .fx-n .t-sub {
  display: block;
  text-decoration: none;
}
.qtybox-sm {
  height: 40px;
}
/* The live box adds nothing to the layout ([data-live]), so the error itself spans the row. */
.fixrow .fx-e > * {
  grid-column: 1 / -1;
}
.fx-send {
  display: contents;
}
.mail.is-stale {
  opacity: 0.6;
}
@media (max-width: 479px) {
  .fixlist .fixrow {
    grid-template-columns: 112px minmax(0, 1fr);
  }
  .fixrow .check {
    grid-column: 1 / -1;
  }
  .fixrow > .st {
    justify-self: start;
  }
}

/* ---------- material detail ---------- */
.pipe-6 {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}
.pipe-6 .is-late dd,
.pipe-6 .is-late dt {
  color: var(--danger-ink);
}
@media (max-width: 719px) {
  .pipe-6 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
.dlg-sh {
  font-size: var(--fs-sm);
  color: var(--ink-2);
  margin-bottom: 6px;
}
.tl-list .tl {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
  padding: 8px 0;
}
.tl-list > li + li {
  border-top: 1px solid var(--line);
}
.tl .tl-d {
  color: var(--ink-3);
  font-size: var(--fs-sm);
}
.tl .tl-b .t-sub {
  display: block;
}
@media (max-width: 479px) {
  .tl-list .tl {
    grid-template-columns: minmax(0, 1fr) auto;
  }
  .tl .tl-d {
    grid-column: 1 / -1;
  }
}
.callbox {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 12px 14px;
  display: grid;
  gap: 8px;
  background: var(--surface-2);
}
.callbox .b-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.dlg-f .spacer {
  flex: 1;
}

/* ---------- people and group ---------- */
.member {
  align-items: center;
}
.member-warn {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
  align-items: center;
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: var(--r-sm);
  background: var(--bn-attn);
  border: 1px solid var(--bn-line);
  box-shadow: inset var(--bn-edge) 0 0 var(--attn-edge);
  color: var(--ink);
  font-size: var(--fs-sm);
}
.member-warn > span {
  flex: 1 1 220px;
}
.member-warn .icon {
  color: var(--attn-ink);
}
.tgbtns {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.tgbtns span {
  padding: 6px 12px;
  border-radius: var(--r-md);
  background: var(--primary-soft);
  color: var(--primary-ink);
  font-size: var(--fs-sm);
  font-weight: 500;
}
.panel.pad {
  padding: 20px;
}
@media (max-width: 719px) {
  .panel.pad {
    padding: 16px;
  }
}
.srow.flush {
  padding: 0;
  grid-template-columns: minmax(0, 1fr);
}
.s-m .icon {
  vertical-align: middle;
}

/* ---------- review ---------- */
.input-quiet {
  border-color: transparent;
  background: transparent;
}
.lines tr.ln:hover .input-quiet,
.input-quiet:focus-visible,
.lines tr.ln.is-hi .input-quiet {
  border-color: var(--line-strong);
  background: var(--surface);
}
.input-quiet.is-flag {
  border: 2px solid var(--attn-edge);
  background: var(--attn-soft);
}
.lines .pg-h th {
  text-align: left;
  padding: 14px 8px 4px;
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--ink-2);
  text-transform: none;
}
.lines tr.ln > td:first-child {
  padding-left: 4px;
}
.why {
  font-size: var(--fs-sm);
}
.mline-ro {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
  width: 100%;
  min-height: 52px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
  text-align: left;
  color: var(--ink);
}
.mline-ro .ml-q {
  font-weight: 600;
  white-space: nowrap;
}
.mline-ro .ml-n .t-sub {
  display: block;
}
.mline-ro .ml-ok {
  color: var(--ok-ink);
}
.mline-ro > .icon:last-child {
  color: var(--ink-3);
}
.photo-fail {
  display: grid;
  gap: 10px;
  justify-items: center;
  color: #e6ebef;
  text-align: center;
  padding: 24px;
}
.crop-fail {
  display: block;
  padding: 10px 12px;
  font-size: var(--fs-xs);
  color: #e6ebef;
}
.rv-nav {
  gap: 2px;
}

/* ---------- upload ---------- */
.drop-add {
  width: 84px;
  height: 108px;
  padding: 0;
  place-content: center;
}
.pagethumb .upbar {
  height: 4px;
  border-radius: 2px;
  background: var(--sunken);
  overflow: hidden;
}
.pagethumb .upbar span {
  display: block;
  height: 100%;
  background: var(--primary);
}
.pagethumb.is-fail .thumb {
  outline: 2px solid var(--danger);
}

/* ---------- reject and export chips ---------- */
@media (max-width: 719px) {
  .chipgrid {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  .chipgrid .pick {
    justify-content: center;
  }
}
.pick-2 {
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
  padding: 8px 14px;
  border-radius: var(--r-md);
  text-align: left;
}
.pick-2 span {
  font-weight: 400;
  color: var(--ink-2);
}
.pick-2 .icon {
  position: absolute;
  opacity: 0;
}

/* ---------- shortcuts ---------- */
.keys {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 10px 16px;
  margin: 0;
  align-items: center;
}
.keys dd {
  margin: 0;
}
.sec-h .kbd-hint {
  margin: 0 0 0 auto;
}

/* ---------- offline ---------- */
.offline {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  padding: 10px max(16px, env(safe-area-inset-left, 0px));
  background: var(--inverse);
  color: var(--on-inverse);
  font-size: var(--fs-sm);
}
.offline > span {
  flex: 1 1 240px;
}
.offline .btn {
  background: transparent;
  color: var(--on-inverse);
  border-color: color-mix(in srgb, var(--on-inverse) 50%, transparent);
}

/* ---------- appbar, site tabs on the phone ---------- */
.appbar .ab-t {
  flex: 1;
  min-width: 0;
  padding: 0 6px;
}
.appbar .ab-title {
  font-size: var(--fs-lg);
  font-weight: 600;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 0;
}
.appbar .ab-sub {
  font-size: var(--fs-xs);
  color: var(--ink-3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dot-danger {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--danger);
}
@media (max-width: 719px) {
  .tabs {
    display: grid;
    grid-template-columns: repeat(5, auto);
    justify-content: space-between;
    margin: 0 -8px;
    padding: 0;
  }
  .tab {
    padding: 0 6px;
    gap: 4px;
    font-size: var(--fs-sm);
  }
  .tab .count {
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
  }
}

/* ---------- menus: disclosure lists ---------- */
ul.menu {
  list-style: none;
  margin: 0;
}
.menu button {
  width: 100%;
  white-space: nowrap;
}

/* ---------- login ---------- */
.brand {
  display: flex;
  gap: 12px;
  align-items: center;
}
.brand .mark {
  width: 44px;
  height: 44px;
  border-radius: var(--r-md);
  background: var(--primary);
  color: var(--on-primary);
  display: grid;
  place-items: center;
  font-weight: 600;
  letter-spacing: 0.02em;
  flex: none;
}
.brand h1 {
  font-size: var(--fs-xl);
}
.pw {
  display: flex;
  gap: 6px;
}
.pw .input {
  flex: 1;
}

@media (max-width: 719px) {
  .head > .head-actions {
    width: 100%;
  }
  .head > .head-actions .btn-primary {
    flex: 1;
  }
}
@media (max-width: 719px) {
  .tbl-ord,
  .tbl-ord tbody {
    display: block;
  }
  .tbl-ord tr {
    display: grid;
    grid-template-columns: 104px minmax(0, 1fr);
    column-gap: 10px;
    padding: 10px 16px;
    border-bottom: 1px solid var(--line);
  }
  .tbl-ord td {
    display: block;
    padding: 0;
    border: 0;
  }
  .tbl-ord .qcol {
    width: auto;
  }
  .tbl-ord td.stcol {
    grid-column: 2;
    width: auto;
    text-align: left;
    margin-top: 6px;
  }
}
a.tel {
  white-space: nowrap;
}
.pipe dt {
  hyphens: manual;
  overflow-wrap: normal;
}
.o-t,
.o-m,
.s-m,
.hint,
.h-sub,
.sec-note,
.legend,
.b-body p,
.c-m,
.q-meta,
.t-sub,
.kv dd {
  overflow-wrap: break-word;
}
.skip {
  min-height: 44px;
  padding: 12px 16px;
}
@media (pointer: coarse) {
  .qtybox-sm {
    height: 48px;
  }
  .facts-row a.tel {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
  }
}
@media (min-width: 1024px) and (max-width: 1279px) {
  .tbl th,
  .tbl td {
    padding-left: 9px;
    padding-right: 9px;
  }
}
.qtybox {
  overflow: visible;
}
@media (max-width: 719px) {
  .toolbar .seg {
    display: flex;
    width: 100%;
  }
  .toolbar .seg button {
    flex: 1 1 auto;
    padding: 0 6px;
  }
  .toolbar .grow {
    max-width: none;
    flex-basis: 100%;
  }
}
.keys .kbd {
  display: inline-block !important;
}

/* ---------- round 3 ---------- */
b,
strong {
  font-weight: 600;
}

/* Requests grouped by material: one verdict and one balance line, then a compact row per request.
   Only a group that needs judgement gets the yellow edge. */
.mgroup {
  position: relative;
}
.mgroup.needs-look {
  box-shadow: inset 3px 0 0 var(--attn-edge);
}
.mg-h {
  display: grid;
  gap: 4px;
  padding: 12px 16px 4px;
}
.mg-t {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
}
.mg-t .req-title {
  margin: 0;
  font-size: var(--fs-lg);
}
.mg-t .btn {
  margin-left: auto;
}
.mg-n {
  color: var(--ink-3);
  font-size: var(--fs-sm);
}
.verdict {
  white-space: nowrap;
}
.bal {
  margin: 0;
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0 12px;
  font-size: var(--fs-sm);
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}
.bal b {
  color: var(--ink);
}
.bal .bal-l {
  color: var(--ink-3);
}
.bal .late,
.bal .late b {
  color: var(--danger-ink);
}
.mg-x {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  font-size: var(--fs-sm);
  color: var(--ink-2);
}
.mg-reqs {
  list-style: none;
  margin: 0;
  padding: 0;
}
.mg-reqs .req {
  grid-template-columns: 96px minmax(0, 1fr) auto;
  gap: 12px;
  padding: 8px 16px 12px;
  align-items: start;
}
.mg-reqs > li + li .req {
  border-top: 1px dashed var(--line);
}
.req-meta b {
  color: var(--ink);
}
.req .quote {
  margin: 4px 0 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.req:focus-within .quote,
.req.is-cur .quote {
  white-space: normal;
}
.req .req-actions {
  flex-direction: row;
  align-items: center;
  min-width: 0;
  gap: 8px;
}
.req .callhint {
  grid-column: 2 / -1;
  margin: 0;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
}
.req .callhint > span {
  flex: 1 1 240px;
}
.req .callhint .btn {
  color: var(--ink);
}
@media (max-width: 719px) {
  .mg-h {
    padding: 12px 12px 4px;
  }
  .mg-reqs .req {
    grid-template-columns: 88px minmax(0, 1fr);
    padding: 8px 12px 12px;
  }
  .req .req-actions .menu-wrap {
    flex: none;
  }
  .req .callhint {
    grid-column: 1 / -1;
  }
}

/* J/K selection is a surface and a bar; the focus ring is for Tab only. */
.req.is-cur:focus-visible {
  box-shadow: inset 3px 0 0 var(--primary);
}
.req:focus {
  outline: 2px solid transparent;
  outline-offset: -2px;
}

/* Late lines: Emlékeztető plus a menu with Ígéret and Megjött papír nélkül. */
.row-acts {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}
.ln-x {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
  margin-top: 6px;
}
.s-x {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.empty-line {
  margin: 0 0 20px;
}

/* A delivery-note number used as a link: a 24 px target. */
.note-a {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  min-width: 24px;
}

/* Site tabs keep their full names on the phone: the row scrolls, with a fade while more is to the right. */
@media (max-width: 719px) {
  .tabs {
    display: flex;
    justify-content: flex-start;
    margin: 0 -16px 0 -8px;
    padding: 0 16px 0 0;
    overflow-x: auto;
  }
  .tabs.has-more {
    -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 40px), transparent);
    mask-image: linear-gradient(to right, #000 calc(100% - 40px), transparent);
  }
  .tab {
    padding: 0 10px;
  }
}

/* The review's Dátum field shrinks with its column; below 400 px every header field has its own row. */
.hdr-grid .input {
  width: 100%;
  min-width: 0;
}
@media (max-width: 399px) {
  .hdr-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .hdr-grid .field {
    grid-column: 1 / -1;
  }
}
.lines .input-quiet {
  box-shadow: inset 0 -1px 0 var(--line);
}

/* Long unbroken names wrap instead of pushing the page sideways. */
.t-link,
.sub-site,
.m-h a,
.site-name a,
.req-title {
  overflow-wrap: anywhere;
}
.m-h > div {
  min-width: 0;
}

/* Toast: the keyboard hint means nothing on a touch screen, and stays at full contrast elsewhere. */
.toast .t-key {
  opacity: 1;
}
@media (pointer: coarse) {
  .toast .t-key {
    display: none;
  }
}

/* Windows contrast themes drop box-shadows, so the selection and pressed states also get an outline. */
@media (forced-colors: active) {
  .req:focus-visible,
  .req.is-cur {
    outline: 3px solid Highlight;
    outline-offset: -3px;
  }
  .seg button[aria-pressed="true"],
  .seg button[aria-selected="true"],
  .pick[aria-pressed="true"] {
    outline: 2px solid Highlight;
    outline-offset: -2px;
  }
  .count,
  .st {
    border: 1px solid CanvasText;
  }
  .mgroup.needs-look {
    border-left: 3px solid CanvasText;
  }
  .tab[aria-current="page"] {
    border-bottom-color: Highlight;
  }
}

/* Beállítások, Funkciók: one switch per feature with what it changes. */
.feats .feat {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 16px;
  align-items: center;
  padding: 12px 0;
}
.feats .feat.is-off .s-t,
.feats .feat.is-off .s-m {
  color: var(--ink-3);
}
.switch input:disabled + .track {
  opacity: 0.45;
}
.switch input:disabled {
  cursor: not-allowed;
}
/* At 320 px: the review page may shrink below its content's min width, and screen-reader text stays inside its tab. */
.rv-grid {
  min-width: 0;
  width: 100%;
}
.form-pane {
  grid-template-columns: minmax(0, 1fr);
}
.tab {
  position: relative;
}
/* The delivery-note link: 24 px in layout, a 44 px target under a coarse pointer without growing the line. */
@media (pointer: coarse) {
  .note-a {
    min-height: 44px;
    min-width: 44px;
    justify-content: center;
    margin-block: -10px;
  }
}
@media (pointer: coarse) {
  .check input {
    width: 24px;
    height: 24px;
  }
}
.tbl-ord .ln-x {
  flex-wrap: nowrap;
}
@media (max-width: 719px) {
  .tbl-ord .ln-x {
    flex-wrap: wrap;
  }
}

/* ---------- round 4 ---------- */
/* Spare (Van belőle, Máshol van belőle) is amber: "think before you order". Yellow stays "waits for you". */
:root {
  --spare-soft: #ffe7cc;
  --spare-ink: #7a3a00;
  --spare-edge: #c25e00;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --spare-soft: #3d240e;
    --spare-ink: #ffbe7a;
    --spare-edge: #f08a2c;
  }
}
:root[data-theme="dark"] {
  --spare-soft: #3d240e;
  --spare-ink: #ffbe7a;
  --spare-edge: #f08a2c;
}
.st-spare {
  background: var(--spare-soft);
  color: var(--spare-ink);
  box-shadow: inset 0 0 0 1px var(--spare-edge);
}
.mgroup.needs-look {
  box-shadow: inset 3px 0 0 var(--spare-edge);
}
.banner .b-body h2 {
  font-size: var(--fs-md);
  font-weight: 600;
}

/* The balance line: label and value pairs; on the phone a 3-column grid, so numbers sit in the same place on every card. */
.bal {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 12px;
}
.bal-n {
  display: contents;
}
.bal-n > div {
  display: flex;
  gap: 4px;
}
.bal-n dt {
  color: var(--ink-2);
}
.bal-n dd {
  margin: 0;
  color: var(--ink);
  font-weight: 600;
}
.bal-n .late dt,
.bal-n .late dd {
  color: var(--danger-ink);
}
.bal-x {
  color: var(--ink-2);
}
@media (max-width: 599px) {
  .bal {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px 8px;
  }
  .bal .bal-l {
    display: none;
  }
  .bal-n > div {
    display: grid;
    gap: 0;
  }
  .bal-n dt {
    font-size: var(--fs-xs);
    color: var(--ink-3);
  }
  .bal-n dd {
    font-size: var(--fs-md);
  }
  .bal-x {
    grid-column: 1 / -1;
  }
}

/* A field's own error, under it. */
.field-err {
  color: var(--danger-ink);
  font-size: var(--fs-sm);
  font-weight: 500;
}
.input[aria-invalid="true"] {
  border-color: var(--danger);
  box-shadow: inset 0 0 0 1px var(--danger);
}

/* Kérés rögzítése: what happens to the request is a choice in the form, not a third button. */
.seg-field {
  border: 0;
  margin: 0;
  padding: 0;
  min-width: 0;
}
.seg-field legend {
  padding: 0 0 6px;
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--ink);
}
.seg-radio {
  display: flex;
  flex-wrap: wrap;
  width: 100%;
}
.seg-radio label {
  flex: 1 1 auto;
  position: relative;
  display: grid;
}
.seg-radio input {
  position: absolute;
  opacity: 0;
  inset: 0;
  margin: 0;
}
.seg-radio span {
  display: grid;
  place-items: center;
  padding: 0 12px;
  min-height: calc(var(--ctl) - 6px);
  border-radius: var(--r-sm);
  font-weight: 500;
  color: var(--ink-2);
  text-align: center;
}
.seg-radio input:checked + span {
  background: var(--surface);
  color: var(--ink);
  font-weight: 600;
  box-shadow:
    inset 0 -3px 0 var(--primary),
    0 1px 2px rgba(0, 0, 0, 0.12);
}
.seg-radio input:focus-visible + span {
  outline: 2px solid var(--focus);
  outline-offset: 1px;
}
.grid-qty {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 112px;
  gap: 12px;
}

/* On the review: this note is probably the paper of a delivery recorded without one. */
.paperless {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin: 4px 0 0;
  padding: 8px 10px;
  border-radius: var(--r-sm);
  background: var(--info-soft);
  color: var(--info-ink);
  font-size: var(--fs-sm);
}
.paperless .icon {
  flex: none;
  margin-top: 2px;
}

/* Menu items that are links (Bolt hívása, Átvevő hívása) look like the buttons beside them. */
.menu a {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  padding: 0 10px;
  border-radius: var(--r-sm);
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}
.menu a:hover {
  background: var(--surface-2);
}
.cb-tel {
  margin-top: 6px;
  font-size: var(--fs-sm);
}
.tbl-ord .sr-head th {
  padding: 0;
  height: 0;
  border: 0;
  line-height: 0;
}

/* Windows contrast themes: a switch keeps a border and a thumb. */
@media (forced-colors: active) {
  .switch .track {
    forced-color-adjust: none;
    background: Canvas;
    border: 1px solid CanvasText;
  }
  .switch .track::after {
    background: CanvasText;
    box-shadow: none;
  }
  .switch input:checked + .track {
    background: Highlight;
    border-color: Highlight;
  }
  .switch input:checked + .track::after {
    background: HighlightText;
  }
  .switch input:disabled + .track {
    border-color: GrayText;
  }
  .mgroup.needs-look {
    border-left: 3px solid CanvasText;
  }
}

/* Funkciók on the phone: title and description get the full width, the switch sits below them. */
@media (max-width: 599px) {
  .feats .s-m {
    hyphens: auto;
  }
  .feats .feat {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
  }
  .feats .feat > div {
    display: contents;
  }
  .feats .feat .s-t {
    grid-column: 1 / -1;
    grid-row: 1;
    hyphens: auto;
  }
  .feats .feat .s-m {
    grid-column: 1 / -1;
    grid-row: 2;
  }
  .feats .feat .switch {
    grid-column: 1 / -1;
    grid-row: 3;
    justify-self: start;
  }
}

/* Desktop request rows: who, when and the need stay on one line; the installer's words wrap to two lines. */
.req-meta .rm-who {
  display: inline-flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 2px 10px;
  white-space: nowrap;
}
.req-meta .rm-need {
  white-space: nowrap;
}
.req .quote {
  white-space: normal;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
}
@media (min-width: 1100px) {
  .mg-reqs .req .req-actions .btn {
    padding-inline: 14px;
  }
}
.req:focus-within .quote,
.req.is-cur .quote {
  -webkit-line-clamp: unset;
  line-clamp: none;
}
@media (pointer: coarse) {
  .mg-reqs .req {
    column-gap: 14px;
  }
  .mg-reqs .req .qtybox {
    min-width: 104px;
  }
}

/* Toasts: on the desktop at the bottom left of the work area, clear of the order column; the page keeps room for
   them, so a control scrolled into view stops above the toast. */
html {
  scroll-padding-bottom: calc(16px + var(--toast-h, 0px));
}
/* The room sits inside the page, before any sticky bar, so the bar stays at the bottom edge. */
.page::after {
  content: "";
  display: block;
  height: var(--toast-h, 0px);
}
@media (max-width: 1023px) {
  html {
    scroll-padding-bottom: calc(16px + var(--toast-h, 0px));
  }
  html:has(body.has-bnav) {
    scroll-padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px) + var(--toast-h, 0px));
  }
}
@media (max-width: 1179px) {
  html:has(body.has-bar) {
    scroll-padding-bottom: calc(92px + env(safe-area-inset-bottom, 0px) + var(--toast-h, 0px));
  }
}
@media (min-width: 1024px) {
  .toasts {
    left: calc(216px + 32px);
    transform: none;
    max-width: min(560px, calc(100vw - 216px - 64px));
  }
}
@media (min-width: 1280px) {
  .toasts {
    left: calc(256px + 32px);
    max-width: min(560px, calc(100vw - 256px - 64px));
  }
}
body:has(.app.is-focus) .toasts {
  left: 50%;
  transform: translateX(-50%);
}
.req-meta .rm-who {
  flex-wrap: wrap;
  min-width: 0;
}
.req-meta .rm-who b {
  white-space: normal;
  overflow-wrap: anywhere;
}
.check input {
  flex: none;
}
/* A field with a hint or an error under it does not stretch the field beside it. */
.grid2 {
  align-items: start;
}
.field .hint,
.field .field-err {
  font-weight: 400;
}

/* ---------- round 5 ---------- */

/* A field's error is red and says so with an icon; the hint under the same field steps aside while it shows. */
.field .field-err,
.field-err {
  color: var(--danger-ink);
  font-weight: 500;
  display: flex;
  gap: 6px;
  align-items: flex-start;
}
.field .field-err[hidden] {
  display: none;
}
.field .field-err::before {
  content: "!" / "";
  flex: none;
  display: grid;
  place-items: center;
  width: 16px;
  height: 16px;
  margin-top: 1px;
  border-radius: 50%;
  background: var(--danger);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}

/* Mi legyen vele? and Hogyan rendelted?: on the phone a vertical list of three equal choices. */
@media (max-width: 599px) {
  .seg.seg-radio {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 4px;
    padding: 4px;
  }
  .seg-radio span {
    justify-items: start;
    place-items: center start;
    min-height: 48px;
    padding: 0 12px 0 40px;
    text-align: left;
    position: relative;
  }
  .seg-radio span::before {
    content: "";
    position: absolute;
    left: 12px;
    top: 50%;
    width: 16px;
    height: 16px;
    margin-top: -8px;
    border-radius: 50%;
    box-shadow: inset 0 0 0 2px var(--line-strong);
  }
  .seg-radio input:checked + span {
    box-shadow:
      inset 2px 0 0 var(--primary),
      0 1px 2px rgba(0, 0, 0, 0.12);
  }
  .seg-radio input:checked + span::before {
    box-shadow: inset 0 0 0 5px var(--primary);
  }
}

/* The request card: a transfer that filled part of it, and the call path for what is needed today. */
.moved-in,
.req-main .callhint {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  align-items: center;
  margin: 8px 0 0;
  font-size: var(--fs-sm);
  color: var(--ink-2);
}
.moved-in .icon {
  width: 14px;
  height: 14px;
  flex: none;
}
.req-main .callhint {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr);
  grid-column: auto;
  color: var(--danger-ink);
}
.req-main .callhint > .icon {
  margin-top: 2px;
}
.req-main .callhint .ch-acts {
  grid-column: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* The order line repeats the card's verdict in amber: spare here or elsewhere, before money is spent. */
.cline .c-look {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  margin-top: 4px;
  padding: 4px 8px;
  border-radius: var(--r-sm);
  background: var(--spare-soft);
  color: var(--spare-ink);
  box-shadow: inset 3px 0 0 var(--spare-edge);
  font-size: var(--fs-sm);
  font-weight: 500;
}
.cline .c-look .icon {
  width: 14px;
  height: 14px;
}
.cline .c-look .btn {
  color: var(--spare-ink);
  min-height: 28px;
}

/* Note review: each material against what was ordered for the site. */
.ordcheck {
  display: flex;
  gap: 6px;
  align-items: flex-start;
  margin: 4px 0 0;
  font-size: var(--fs-sm);
  color: var(--ink-2);
}
.ordcheck .icon {
  width: 14px;
  height: 14px;
  flex: none;
  margin-top: 2px;
}
.ordcheck.is-short,
.ordcheck.is-unordered,
.ordcheck.is-over {
  color: var(--spare-ink);
}

/* Phone overview: one quiet line of counts per site, at most one chip. */
.hsite .hs-top {
  gap: 8px;
}
.hsite .hs-top .st {
  margin-left: auto;
}
.hsite .hs-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 6px;
  font-size: var(--fs-sm);
  color: var(--ink-2);
}
.hsite .hs-facts b {
  color: var(--ink);
  font-weight: 600;
}
.hsite .hs-warn {
  display: flex;
  gap: 6px;
  align-items: center;
  font-size: var(--fs-sm);
  color: var(--danger-ink);
  font-weight: 500;
}
.hsite .hs-warn .icon {
  width: 14px;
  height: 14px;
}

/* Sent-order lines on the phone: the hidden column headers take no room; quantity, name and state in one row. */
.tbl-ord thead.sr-head,
.tbl-ord thead.sr-head tr {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  border: 0;
  white-space: nowrap;
}
@media (max-width: 719px) {
  .tbl-ord tbody tr {
    grid-template-columns: 84px minmax(0, 1fr) auto;
    grid-template-areas:
      "q n s"
      "q m s";
    column-gap: 10px;
    row-gap: 2px;
    align-items: start;
    padding-block: 8px;
  }
  .tbl-ord td {
    padding: 0;
  }
  .tbl-ord td:nth-child(2) {
    display: contents;
  }
  /* The quantity has its whole column (no cell padding); a longer unit wraps in it instead of running under the
     name. */
  .tbl-ord td.qcol {
    grid-area: q;
    text-align: left;
    padding: 0;
    white-space: normal;
    min-width: 0;
  }
  .tbl-ord .ol-n {
    grid-area: n;
    min-width: 0;
  }
  .tbl-ord .ol-m {
    grid-area: m;
  }
  .tbl-ord td.stcol {
    grid-area: s;
    text-align: right;
    display: grid;
    grid-template-columns: auto auto;
    justify-items: end;
    align-items: center;
    column-gap: 2px;
  }
  .tbl-ord td.stcol .st-row > * {
    grid-column: 1;
  }
  .tbl-ord td.stcol .st-row > .ln-x {
    grid-column: 2;
    grid-row: 1;
  }
}

/* Request actions wrap below 360 px whatever the pointer (400 % zoom on a desktop, text spacing). */
@media (max-width: 360px) {
  .mg-reqs .req .req-actions {
    grid-column: 1 / -1;
    flex-wrap: wrap;
  }
  .req .quote {
    -webkit-line-clamp: unset;
    line-clamp: none;
    display: block;
  }
}

/* A very short window (a desktop at 400 % zoom): the toast keeps to a strip at the bottom and scrolls inside. */
@media (max-height: 420px) {
  .toast {
    max-height: 30vh;
    overflow: auto;
    align-items: flex-start;
    min-height: 0;
    padding-block: 6px;
    font-size: var(--fs-sm);
  }
  .toasts {
    bottom: calc(var(--bar-h) + 4px);
  }
}

/* The hidden radio of a segment is what a pointer hits, above the label it sits in. */
.seg-radio input {
  z-index: 1;
}
.seg-radio span {
  pointer-events: none;
}
/* A long status chip in a row may wrap (text spacing, 400 % zoom). */
.drow .st {
  white-space: normal;
}

/* The review on a phone or tablet: the Jóváhagyom bar stays at the bottom of the screen even when the note is short,
   so a toast above the bars never lands on it. */
@media (max-width: 1023px) {
  .app.is-focus .main {
    display: flex;
    flex-direction: column;
    min-height: 100dvh;
  }
  .app.is-focus .main > .rv-grid {
    flex: 1 0 auto;
  }
}
.req-main .callhint .ch-acts .btn {
  max-width: 100%;
  white-space: normal;
  text-align: left;
}

/* ---------- round 6 ---------- */
/* A field to check on the review is yellow with a dark edge; red stays for errors that block saving (visual M3). */
.input.is-flag,
.input-quiet.is-flag,
.input.is-flag[aria-invalid="true"] {
  border: 2px solid var(--attn-ink);
  background: var(--attn-soft);
}

/* Radio rows (the unchecked ring is --line-strong, 3.15:1 on the group since round 6, a11y m8). In Windows contrast themes the choice keeps a ring and
   the selection a Highlight outline and a filled mark (a11y M2), like the switches. */
@media (forced-colors: active) {
  .seg-radio input:checked + span {
    outline: 2px solid Highlight;
    outline-offset: -2px;
  }
  .seg-radio span::before {
    forced-color-adjust: none;
    border: 2px solid CanvasText;
    box-shadow: none;
    background: Canvas;
  }
  .seg-radio input:checked + span::before {
    background: Highlight;
    border-color: Highlight;
  }
}

/* Touch phones: the request quantity column is as wide as its box, so the box never runs into the text (visual M2). */
@media (pointer: coarse) {
  .mg-reqs .req {
    grid-template-columns: 104px minmax(0, 1fr) auto;
    column-gap: 12px;
  }
  .mg-reqs .req .qtybox {
    min-width: 0;
    width: 100%;
  }
}
@media (pointer: coarse) and (max-width: 719px) {
  .mg-reqs .req {
    grid-template-columns: 104px minmax(0, 1fr);
  }
}

/* Desktop order lines: the chip and its ⋮ share the title row, so every line is the same height (visual M4); a
   note number sits before its chip. */
.tbl-ord .st-row {
  display: contents;
}
@media (min-width: 720px) {
  .tbl-ord .st-row {
    display: flex;
    flex-wrap: nowrap;
    white-space: nowrap;
    justify-content: flex-end;
    align-items: center;
    gap: 4px 6px;
  }
  .tbl-ord .st-row > .t-sub {
    order: -1;
  }
  .tbl-ord .st-row > .ln-x {
    margin-top: 0;
  }
}

/* An error under one field of a row does not push its neighbour down (visual m2). */
.grid-qty {
  align-items: start;
}

/* The check against the order: a shortfall is plain text with its figure; an extra is amber and asks (visual m4). */
.ordcheck.is-short {
  color: var(--ink-2);
}
.ordcheck.is-short b {
  color: var(--ink);
  font-weight: 600;
}
.ordcheck.is-over,
.ordcheck.is-unordered {
  color: var(--spare-ink);
  padding: 6px 10px;
  border-radius: var(--r-sm);
  background: var(--spare-soft);
  box-shadow: inset 3px 0 0 var(--spare-edge);
}
.ordcheck > div {
  display: grid;
  gap: 6px;
  min-width: 0;
  flex: 1;
}
.ordcheck p {
  margin: 0;
}
.ordcheck .extra-q legend {
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 4px;
}
.ordcheck .seg-radio span {
  color: var(--ink);
}
.ordcheck .b-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* Amber facts outside a cart line: the send preview's list and the elsewhere dialog's spare note (visual m5). */
.c-look {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin: 0 0 12px;
  padding: 8px 10px;
  border-radius: var(--r-sm);
  background: var(--spare-soft);
  color: var(--spare-ink);
  box-shadow: inset 3px 0 0 var(--spare-edge);
  font-size: var(--fs-sm);
  font-weight: 500;
}
.c-look .icon {
  flex: none;
  width: 14px;
  height: 14px;
  margin-top: 2px;
}
.c-look p,
.c-look ul {
  margin: 0;
}
.c-look ul {
  padding-left: 18px;
}
.cline .c-acts {
  grid-row: 1 / span 2;
  grid-column: 2;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}
.cline .c-acts .btn {
  grid-row: auto;
  grid-column: auto;
}
.t-spare {
  color: var(--spare-ink);
  font-weight: 500;
}
.callbox-spare {
  background: var(--spare-soft);
  box-shadow: inset 3px 0 0 var(--spare-edge);
}
.callbox-spare p {
  color: var(--spare-ink);
}

/* Numeric headers on Anyagok sit over the numbers, not over the unit slot beside them (visual m8). */
@media (min-width: 720px) {
  .tbl-mat th.r {
    padding-right: calc(12px + 4.05em);
  }
}

/* The Ma kell row: the two call buttons share a row (visual m6). */
.req-main .callhint .ch-acts {
  flex-wrap: nowrap;
}
@media (max-width: 379px) {
  .req-main .callhint .ch-acts {
    flex-wrap: wrap;
  }
}
.req-main .callhint .ch-acts .btn {
  flex: 0 1 auto;
}

/* Desktop overview: a site without a group says so in red text, as on the phone (visual m9). */
.tbl-sites .hs-warn {
  display: flex;
  gap: 6px;
  align-items: center;
  font-size: var(--fs-sm);
  color: var(--danger-ink);
  font-weight: 500;
}
.tbl-sites .hs-warn .icon {
  width: 14px;
  height: 14px;
}

/* A dialog under its own toast on a short screen starts below the toast (a11y m2). */
@media (max-height: 600px) {
  body.has-dlg-toast .overlay {
    padding-top: calc(var(--toast-h, 0px) + 4px);
  }
}
@media (max-height: 600px) {
  body.has-dlg-toast .dialog {
    max-height: calc(100dvh - 28px - var(--toast-h, 0px));
  }
}
/* Dialogs grow downward from a fixed top, so a field that appears does not move the controls under the pointer
   (visual M1). */
@media (min-width: 720px) and (min-height: 601px) {
  .overlay {
    place-items: start center;
  }
  .dialog {
    margin-top: min(10vh, 80px);
    max-height: calc(100dvh - 48px - min(10vh, 80px));
  }
}
/* A very short window (400 % zoom): the whole dialog scrolls, header and footer with it, so the body is not squeezed
   into one line between them (a11y m7). */
@media (max-height: 420px) {
  .dialog,
  .dialog.wide {
    display: block;
    overflow-y: auto;
    overscroll-behavior: contain;
  }
  .dlg-b {
    overflow: visible;
  }
}

/* Round 7: the Anyag table keeps seven columns (Hiányzik sits in Késik, transfers under Beérkezett), and below 1280
   the numeric columns size to their content, so it fits beside the sidebar at 1024 (visual M1, a11y M3). */
.tbl-mat td:first-child {
  min-width: 170px;
}
.tbl-mat .t-sub.num {
  white-space: nowrap;
}
@media (max-width: 1279px) {
  .tbl-mat td.r,
  .tbl-mat th.r {
    width: auto;
  }
  .tbl-mat th,
  .tbl-mat td {
    padding-left: 8px;
    padding-right: 8px;
  }
  .tbl-mat th.r {
    padding-right: 12px;
  }
}

/* ---------- Round 8: ticking rows on the material tables, and the bar that acts on them ---------- */
.pickcell {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.pickcell > div {
  min-width: 0;
}
th .pickcell {
  align-items: center;
}
/* Below 1280 the seven columns fit beside the sidebar only just; the tick takes the least room it can. */
@media (max-width: 1279px) {
  .tbl-mat .pickcell {
    gap: 6px;
  }
}
.tick {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 24px;
  height: 24px;
  margin: -2px 0;
  cursor: pointer;
}
.tick input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--primary);
  cursor: pointer;
}
.tbl-mat tr.is-picked td,
.mrow.is-picked {
  background: var(--primary-soft);
}
.m-name {
  flex: 1;
  min-width: 0;
}
.pick-all {
  margin: 0 0 6px;
}
.selbar {
  position: sticky;
  bottom: 16px;
  z-index: 18;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding: 10px 12px 10px 16px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-pop);
}
.sb-t {
  flex: 1;
  min-width: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  column-gap: 12px;
}
.sb-t span {
  color: var(--ink-2);
  font-size: var(--fs-sm);
}
.sb-acts {
  display: flex;
  gap: 8px;
}
.sb-acts:empty {
  display: none;
}
body.has-sel {
  --bar-h: calc(var(--sel-h, 0px) + 16px);
}
/* A control scrolled to, or lifted clear of a new toast, stops above the bar and the toast. */
html:has(body.has-sel) {
  scroll-padding-bottom: calc(32px + var(--sel-h, 0px) + var(--toast-h, 0px));
}
/* The multi-line transfer: one block per material. */
.tf-lines {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}
/* What typing a quantity redraws in Áthelyezés: a box that adds nothing to the layout. */
[data-live] {
  display: contents;
}
.dlg-b > [data-live] > * {
  flex-shrink: 0;
}
.tf-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 160px;
  gap: 4px 16px;
  align-items: start;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
}
.tf-line .tf-warn,
.tf-line .tf-sum {
  grid-column: 1 / -1;
  margin: 0;
}
.tf-l-h {
  display: grid;
  gap: 2px;
  padding-top: 4px;
}
.tf-n {
  font-weight: 600;
  overflow-wrap: anywhere;
}
.tf-q {
  margin: 0;
}
.tf-from {
  margin: 0;
  min-height: 40px;
  display: flex;
  align-items: center;
  font-weight: 500;
}
@media (max-width: 1023px) {
  /* Phone: fixed above the tab bar (or at the bottom of a site page), safe-area aware; the clear button is an icon. */
  .selbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    margin: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 8px max(16px, env(safe-area-inset-right, 0px)) calc(10px + env(safe-area-inset-bottom, 0px))
      max(16px, env(safe-area-inset-left, 0px));
    border: 0;
    border-top: 1px solid var(--line);
    border-radius: 0;
    box-shadow: var(--sh-bar);
  }
  body.has-bnav .selbar {
    bottom: var(--bnav-h, calc(57px + env(safe-area-inset-bottom, 0px)));
    padding-bottom: 10px;
  }
  .sb-clear .sb-cl {
    display: none;
  }
  .sb-clear {
    min-width: 44px;
    min-height: 44px;
    padding: 0;
    justify-content: center;
  }
  .sb-acts {
    grid-column: 1 / -1;
  }
  .sb-acts .btn {
    flex: 1;
    min-height: 48px;
  }
  body.has-sel {
    --bar-h: var(--sel-h, 0px);
  }
  body.has-sel.has-bnav {
    --bar-h: calc(var(--bnav-h, 57px) + var(--sel-h, 0px));
  }
  body.has-sel .page {
    padding-bottom: calc(24px + var(--bar-h));
  }
  html:has(body.has-sel) {
    scroll-padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px) + var(--sel-h, 0px) + var(--toast-h, 0px));
  }
  html:has(body.has-sel.has-bnav) {
    scroll-padding-bottom: calc(16px + var(--bnav-h, 57px) + var(--sel-h, 0px) + var(--toast-h, 0px));
  }
  .tf-line {
    grid-template-columns: minmax(0, 1fr) 120px;
  }
}
@media (pointer: coarse) {
  /* 44 px to touch, level with the name's own 44 px link. */
  .tick {
    width: 44px;
    height: 44px;
    margin: 0 -10px 0 -12px;
  }
  th .tick {
    margin-block: -10px;
  }
  .tick input {
    width: 24px;
    height: 24px;
  }
  .pick-all .check {
    min-height: 44px;
  }
}
@media (forced-colors: active) {
  .tbl-mat tr.is-picked td:first-child,
  .mrow.is-picked {
    border-left: 4px solid Highlight;
  }
  .selbar {
    border: 2px solid CanvasText;
  }
}

/* ---------- round 9: painted chips and buttons in rows and cards carry a line's leading ---------- */
/* Row and card padding is set for text, whose capitals sit about --lead below its line box and whose baseline sits
   about --lead above it. A chip or a filled button paints its whole box, so one that starts or ends a row sat that
   much closer to the edge than text does (the Átnézendő chip on the row divider). tools/probe-spacing.js measures it. */
:is(.list.panel > li, .panel .list > li, .banner, .callbox, .cart, .panel)
  :is(.st, .btn:not(.btn-quiet, .btn-link), .pipe, .qtybox):not(.tbl *) {
  margin-block: var(--lead);
}

/* A touch target that is taller than the line it sits on gives the extra back with negative margins, as .note-a
   does: the 44 px box still takes the tap, but the row is laid out around the line, so a title link at the top of a
   row no longer pushes its text 11 px down from the edge. */
@media (pointer: coarse) {
  .t-link,
  .h-link {
    margin-block: calc((1lh - 44px) / 2);
  }
  /* The checkbox is painted, so it also keeps a line's leading (--lead) from the row's edge. */
  .tick {
    margin-block: calc((1lh - 44px) / 2 + var(--lead));
  }
}
.switch {
  margin-block: calc((1lh - var(--ctl)) / 2 + var(--lead));
}

/* Order lines: the actions column spans every line and starts on the title's line; before, it was centred and
   stretched the title, requester and note lines apart around two 44 px buttons. */
.cline {
  align-items: start;
  padding: var(--s-3) var(--s-4);
}
.cline .c-acts {
  grid-row: 1 / span 3;
  margin-block: calc((1lh - 30px) / 2);
}
@media (pointer: coarse) {
  .cline .c-acts {
    margin-block: calc((1lh - 44px) / 2);
  }
}
.cart-h {
  padding: var(--s-4) var(--s-4) var(--s-3);
}
/* A painted callout or a field that ends a row or a form section keeps the same line leading below it. */
.member-warn {
  margin-bottom: var(--lead);
}
.form-sec:has(> :is(.field, .grid2):last-child) {
  padding-bottom: calc(var(--s-5) + var(--lead));
}
/* An empty state opens with its picture, which has no leading, and closes with text, which does. */
.empty {
  padding-bottom: calc(var(--s-8) - var(--lead));
}
/* No line ends on a lone short word: the browser balances the last lines of a wrapped meta line or paragraph. */
body {
  text-wrap: pretty;
}

/* ---------- the real app ---------- */
/* A note's first page as its thumbnail (the prototype drew one). */
.thumb img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}
/* A note uploaded as a PDF: its thumbnail says so, and the review shows the PDF with a way out to a tab. */
.thumb-pdf {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--danger);
  background: var(--surface);
}
.photo-pdf {
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 8px;
  padding: 8px;
  justify-items: end;
}
.photo-pdf iframe {
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: var(--r-md);
  background: #fff;
}
/* The review shows the note's photo, not the prototype's drawing of it: whole in the pane, twice as wide zoomed. The
   frame has the photo's shape (--ar, set once it loads), so the lines' outlines and pins, placed in fractions of the
   page, sit on the paper at any size. */
.photo {
  container-type: size;
}
.ph-frame {
  position: relative;
  width: min(100cqw, calc(100cqh * var(--ar)));
  aspect-ratio: var(--ar);
}
.photo.is-zoom .ph-frame {
  width: 200cqw;
}
.photo.is-zoom {
  place-items: start;
}
.ph-frame img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.ph-box {
  position: absolute;
  border: 2px solid var(--hl);
  background: var(--hl-fill);
  border-radius: 3px;
  pointer-events: none;
  display: none;
}
.ph-box.is-hi {
  display: block;
}
.ph-pin {
  --pin: 26px;
  position: absolute;
  left: calc(var(--x) + var(--step, 0) * (var(--pin) + 2px));
  transform: translate(-50%, -50%);
  width: var(--pin);
  height: var(--pin);
  border-radius: 50%;
  border: 2px solid #2b1d00;
  background: #f2b705;
  color: #2b1d00;
  font: 700 13px/1 var(--font);
  display: grid;
  place-items: center;
  padding: 0;
  cursor: pointer;
  box-shadow: 0 1px 3px rgb(0 0 0 / 0.35);
}
.ph-pin:hover {
  background: #ffd23f;
}
/* On a phone the whole page is small and its rows close together: smaller pins, so fewer have to step aside
   (staggerPins; Nagyítás spreads them out). */
@media (max-width: 1023px) {
  .ph-pin {
    --pin: 20px;
    font-size: 11px;
    border-width: 1.5px;
  }
}
/* A destination a later version opens: shown where it will be, not a link yet. */
.nav-a[aria-disabled="true"],
.more-a[aria-disabled="true"],
.tab[aria-disabled="true"],
.bottomnav [aria-disabled="true"] {
  color: var(--ink-3);
  opacity: 0.6;
  cursor: default;
}
/* An action a later version wires keeps its outline, so the row reads the same. */
.btn-bordered[disabled] {
  border-color: var(--line);
}
