/* ==================================================================== *
 * Pages (2026-09-28): the console redo's language — the one already on
 * Communities, the Order Book and Operations — carried to the pages that
 * were still plain Bootstrap: Customers, Expenses, Reports, the Setup
 * lists, Subscriptions, Payments and Traces. Tokens and the shared parts
 * (.nt-chip, .nt-num, .nt-tiles, .nt-empty, page_head) live in theme.css;
 * this file only arranges them. Loaded after theme.css.
 * ==================================================================== */

/* ---- Top bar: the city slot (only on a page filtered by the city) ---- */
.nt-topbar-cityname {
  margin-left: 6px;
  padding: 3px 10px;
  border: 1px solid var(--nt-line);
  border-radius: 8px;
  background-color: var(--nt-wash);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--nt-ink-2);
  white-space: nowrap;
}

/* With no switcher, the jump box takes the room the switcher had, so the bar
   still reads left name · centre search · right Live. */
.nt-topbar:not(:has(.nt-city-switch)) .nt-jump { margin-left: auto; }
.nt-topbar:not(:has(.nt-city-switch)) .nt-topbar-date { margin-left: 12px; }

@media (max-width: 860px) {
  /* A phone hides the name because the switcher fills the bar; without a
     switcher the name comes back so the bar is not an empty strip. */
  .nt-topbar:not(:has(.nt-city-switch)) .nt-topbar-name { display: block; flex: 1 1 auto; }
  .nt-topbar-cityname { margin-left: 0; }
}

/* ---- A page: head, then cards, 12px apart ---- */
.nt-page { display: flex; flex-direction: column; gap: 12px; min-width: 0; }

/* ---- The list card: a table (or list) inside one pane ---- */
.nt-lcard {
  position: relative; /* so a positioned child (a hidden label) is clipped too */
  min-width: 0;
  background: var(--nt-shell);
  border: 1px solid var(--nt-line);
  border-radius: var(--nt-r-pane);
  overflow: hidden;
}

.nt-lcard-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--nt-line);
}

.nt-lcard-title { margin: 0; font-family: var(--nt-font-display); font-size: 15px; font-weight: 700; }
.nt-lcard-sub { font-size: 12px; color: var(--nt-muted); font-variant-numeric: tabular-nums; }
.nt-lcard-aside { margin-left: auto; display: inline-flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.nt-lcard-body { padding: 12px 14px; overflow-x: auto; }
.nt-lcard-foot { padding: 8px 14px; border-top: 1px solid var(--nt-line); background: var(--nt-wash); font-size: 12.5px; color: var(--nt-ink-2); }
.nt-lcard > .nt-empty { margin: 0; border: 0; border-radius: 0; }

/* A table inside the card: no second border, the card is the frame. */
.nt-lcard > .table,
.nt-lcard > .table-scroll > .table,
.nt-lcard > form > .table,
.nt-ltable {
  margin: 0;
  font-size: 13px;
}

.nt-lcard > .table,
.nt-lcard > form > .table,
.nt-lcard > .table-scroll {
  border: 0;
  border-radius: 0;
}

.nt-ltable > tbody > tr { position: relative; }
/* A row that opens on click (row-link): the whole row reads as one target. */
tr.nt-row-link { cursor: pointer; }
.nt-ltable > tbody > tr:hover > * { background-color: var(--nt-wash); }
.nt-ltable .nt-lt-name { font-weight: 600; }
.nt-ltable .nt-lt-name a { color: var(--nt-ink); }
.nt-ltable .nt-lt-name a:hover { color: var(--nt-link); }
.nt-lt-sub { display: block; font-size: 11.5px; font-weight: 400; color: var(--nt-muted); }
.nt-ltable td.nt-num, .nt-ltable th.nt-num { text-align: right; white-space: nowrap; }
.nt-ltable td.nt-lt-actions { text-align: right; white-space: nowrap; }
.nt-ltable tfoot td, .nt-ltable tfoot th { font-weight: 600; background: var(--nt-wash); }

/* Money: mono, tabular, and a colour only when somebody must act. */
.nt-money { font-family: var(--nt-font-mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
.nt-money--bad { color: var(--nt-brick); font-weight: 600; }
.nt-money--ok { color: var(--nt-leaf); }
.nt-money--quiet { color: var(--nt-muted); }

/* A filter form inside a card head carries no margin of its own. */
.nt-lcard-head > .nt-xreg-filters,
.nt-lcard-head > form { margin: 0; }

/* ---- Search box + filter chips over a list ---- */
.nt-lfilters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.nt-lsearch { display: flex; align-items: center; gap: 6px; flex: 1 1 16rem; max-width: 26rem; margin: 0; }
.nt-lsearch .form-control,
.nt-lsearch .form-select { height: 32px; font-size: 13px; }
.nt-lsearch .form-select { width: auto; flex: none; padding-top: 0; padding-bottom: 0; }
.nt-fchips { display: flex; flex-wrap: wrap; gap: 6px; }
.nt-fchip {
  display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 11px;
  border: 1px solid var(--nt-rule); border-radius: 999px; background: var(--nt-shell); color: var(--nt-ink-2);
  font-size: 12.5px; font-weight: 500; text-decoration: none; white-space: nowrap;
}
.nt-fchip:hover { background: var(--nt-wash); color: var(--nt-ink); text-decoration: none; }
.nt-fchip.is-on { border-color: var(--nt-ink); background: var(--nt-ink); color: var(--nt-shell); }
.nt-fchip .nt-num { font-size: 11.5px; opacity: .8; }

/* A small outline button inside a card (Find, Clear, Edit). */
.nt-lbtn {
  display: inline-flex; align-items: center; gap: 5px; height: 30px; padding: 0 11px;
  border: 1px solid var(--nt-rule); border-radius: 6px; background: var(--nt-shell); color: var(--nt-ink-2);
  font: 500 12.5px var(--nt-font-body); cursor: pointer; white-space: nowrap; text-decoration: none;
}
.nt-lbtn:hover { background: var(--nt-wash); color: var(--nt-ink); text-decoration: none; }
.nt-lbtn--primary { border-color: var(--nt-spruce); background: var(--nt-spruce); color: #fff; }
.nt-lbtn--primary:hover { background: var(--nt-link-hover); color: #fff; }

/* Controls riding in the page head's right-hand slot. */
.nt-head-filters { margin: 0; }

/* ---- A detail page: identity line under the head, tiles, sections ---- */
.nt-idline { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: 13px; color: var(--nt-ink-2); }
.nt-idline .nt-num { color: var(--nt-ink); }
.nt-wa-link { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; color: var(--nt-leaf); }
.nt-wa-link:hover { color: var(--nt-ink); }

.nt-dl { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 16px; margin: 0; font-size: 13px; }
.nt-dl dt { font-weight: 500; color: var(--nt-muted); }
.nt-dl dd { margin: 0; }

.nt-pair { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 12px; align-items: start; }
.nt-pair > * { min-width: 0; }
@media (max-width: 960px) { .nt-pair { grid-template-columns: minmax(0, 1fr); } }

/* A compact list of recent things (orders, payments): one line each. */
.nt-mini { list-style: none; margin: 0; padding: 0; }
.nt-mini-row {
  display: grid; grid-template-columns: 7.5rem minmax(0, 1fr) auto auto; gap: 4px 12px; align-items: center;
  padding: 8px 14px; border-bottom: 1px solid var(--nt-line); font-size: 13px;
}
.nt-mini-row:last-child { border-bottom: 0; }
.nt-mini-when { font-family: var(--nt-font-mono); font-variant-numeric: tabular-nums; font-size: 12.5px; }
.nt-mini-what { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--nt-ink-2); }

/* ---- Setup lists: the list-card look instead of striped + bordered ---- */
.nt-setup-table.table-striped > tbody > tr:nth-of-type(odd) > * { --bs-table-bg-type: transparent; }
.nt-setup-table.table-bordered > :not(caption) > * > * { border-width: 0 0 1px 0; }
.nt-setup-table { border: 1px solid var(--nt-line); border-radius: var(--nt-r-pane); font-size: 13px; }
.nt-setup-table > tbody > tr:hover > * { background-color: var(--nt-wash); }
.nt-setup-table td:last-child { white-space: nowrap; }
.nt-setup-section .form-label { font-size: 12.5px; font-weight: 600; color: var(--nt-ink-2); margin-bottom: 4px; }

/* Forms that sit on a page (not in the drawer) get a pane of their own. */
.nt-form-pane { max-width: 44rem; padding: 16px 18px; background: var(--nt-shell); border: 1px solid var(--nt-line); border-radius: var(--nt-r-pane); }
.nt-form-pane .form-label { font-size: 12.5px; font-weight: 600; color: var(--nt-ink-2); margin-bottom: 4px; }

/* ---- Phone: a table becomes a stack of cards (`.nt-stack`, labelled by
   stack_table_controller.js). 44px targets, no sideways page scroll. ---- */
@media (max-width: 640px) {
  table.nt-stack,
  table.nt-stack > tbody,
  table.nt-stack > tbody > tr,
  table.nt-stack > tbody > tr > td,
  table.nt-stack > tfoot,
  table.nt-stack > tfoot > tr,
  table.nt-stack > tfoot > tr > * {
    display: block;
    width: 100%;
    white-space: normal;
  }

  /* theme.css makes a wide table scroll sideways under 768px; a stack does
     not need to. */
  table.nt-stack { overflow: visible; }
  table.nt-stack > thead { display: none; }

  table.nt-stack > tbody > tr,
  table.nt-stack > tfoot > tr {
    position: relative;
    padding: 10px 14px;
    border-bottom: 1px solid var(--nt-line);
  }

  table.nt-stack > tbody > tr:last-child { border-bottom: 0; }

  table.nt-stack > tbody > tr > td,
  table.nt-stack > tfoot > tr > * {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    padding: 2px 0;
    border: 0;
    text-align: right;
    background: transparent;
  }

  table.nt-stack > tbody > tr > td[data-label]::before,
  table.nt-stack > tfoot > tr > [data-label]::before {
    content: attr(data-label);
    flex: none;
    font-family: var(--nt-font-body);
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--nt-muted);
    text-align: left;
  }

  /* A row heading (a report's label column) is the card's title. */
  table.nt-stack > tbody > tr > th {
    display: block;
    width: 100%;
    padding: 0 0 4px;
    border: 0;
    font-weight: 600;
    text-align: left;
    background: transparent;
  }

  /* An empty cell says nothing on a card. */
  table.nt-stack > tbody > tr > td:empty { display: none; }

  /* The name is the card's title: full width, no label, bigger. */
  table.nt-stack > tbody > tr > td.nt-lt-name {
    display: block;
    padding-bottom: 4px;
    font-size: 15px;
    text-align: left;
  }

  table.nt-stack > tbody > tr > td.nt-lt-name::before { display: none; }

  /* Row actions: a line of 44px buttons at the card's foot. */
  table.nt-stack > tbody > tr > td.nt-lt-actions,
  table.nt-stack > tbody > tr > td:last-child:has(a, button) {
    justify-content: flex-start;
    flex-wrap: wrap;
    padding-top: 6px;
  }

  table.nt-stack > tbody > tr > td.nt-lt-actions::before,
  table.nt-stack > tbody > tr > td:last-child:has(a, button)::before { display: none; }

  table.nt-stack a, table.nt-stack button, table.nt-stack .btn { min-height: 44px; display: inline-flex; align-items: center; }
  table.nt-stack > tbody > tr > td.nt-lt-name a { min-height: 0; display: inline; }
  table.nt-stack > tbody > tr > td.nt-lt-name a.nt-customer-link { min-height: 44px; }

  /* A foot row (a total) reads label ··· figure on one line. */
  table.nt-stack > tfoot > tr { display: flex; justify-content: space-between; gap: 12px; }
  table.nt-stack > tfoot > tr > * { width: auto; padding: 0; }
  table.nt-stack > tfoot > tr > td:empty { display: none; }
  table.nt-stack > tfoot > tr > [data-label]::before { display: none; }

  /* A row being edited in place: each field full width under its label. */
  table.nt-stack > tbody > tr > td:has(input, select, textarea) { display: block; text-align: left; padding: 4px 0; }
  table.nt-stack > tbody > tr > td:has(input, select, textarea)::before { display: block; margin-bottom: 3px; }
  table.nt-stack .form-control, table.nt-stack .form-select { min-height: 44px; font-size: 16px; }

  .nt-fchip { height: 36px; padding: 0 13px; }
  .nt-lsearch { max-width: none; flex-basis: 100%; }
  .nt-lsearch .form-control, .nt-lsearch .form-select { height: 44px; font-size: 16px; }
  .nt-lbtn { height: 44px; }
  .nt-lcard-head { padding: 10px 12px; }

  .nt-mini-row { grid-template-columns: minmax(0, 1fr) auto; padding: 10px 12px; min-height: 44px; }
  .nt-mini-what { grid-column: 1 / -1; grid-row: 2; white-space: normal; }
  .nt-dl { grid-template-columns: minmax(0, 1fr); gap: 0 0; }
  .nt-dl dd { margin-bottom: 8px; }
}

/* ---- The customer page: ledger with evidence beside the customer's
   messages (mockups/customer-ledger-evidence.html). ---- */
.nt-cl-mono { font-family: var(--nt-font-mono); font-variant-numeric: tabular-nums; font-size: 11.5px; }
.nt-idline .nt-cl-mono { background: var(--nt-wash); border-radius: var(--nt-r-ctl); padding: 1px 6px; color: var(--nt-ink-2); }
.nt-cl-sources { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.nt-cl-src { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; border: 1px solid var(--nt-line);
  border-radius: 12px; padding: 2px 9px; background: var(--nt-shell); color: var(--nt-ink); }
.nt-cl-dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.nt-cl-dot--group { background: var(--nt-info); }
.nt-cl-dot--dm { background: var(--nt-ok); }

.nt-cl-tiles--money { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.nt-cl-tiles .nt-tile { min-width: 0; }

.nt-cl-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 12px; align-items: start; }
.nt-cl-pane { display: flex; flex-direction: column; }
.nt-cl-empty { margin: 14px; }

.nt-cl-ledger { display: flex; flex-direction: column; }
.nt-cl-hdr, .nt-cl-entry { display: grid; grid-template-columns: 58px minmax(0, 1fr) 96px 96px; gap: 10px; padding: 10px 14px; }
.nt-cl-hdr { padding-block: 7px; background: var(--nt-wash); }
.nt-cl-hdr span { font-size: 10.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--nt-muted); }
.nt-cl-hdr span:nth-child(n+3) { text-align: right; }
.nt-cl-entry { border-top: 1px solid var(--nt-line); align-items: start; outline: none; }
.nt-cl-hdr + .nt-cl-entry { border-top: 0; }
.nt-cl-entry.is-linked, .nt-cl-entry:focus-visible { background: var(--nt-saffron-wash); }
.nt-cl-entry:focus-visible { box-shadow: inset 3px 0 0 var(--nt-saffron-deep); outline: 2px solid var(--nt-saffron-deep); outline-offset: -2px; }
.nt-cl-date { font: 600 12px var(--nt-font-mono); color: var(--nt-ink-2); }
.nt-cl-date small { display: block; color: var(--nt-muted); font: 500 11px var(--nt-font-body); }
.nt-cl-what { display: flex; flex-direction: column; gap: 5px; min-width: 0; font-size: 13px; }
.nt-cl-l1 { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.nt-cl-l1 b { font-weight: 600; }
.nt-cl-ev { display: flex; align-items: flex-start; gap: 7px; font-size: 12px; color: var(--nt-ink-2);
  border-left: 2px solid var(--nt-rule); padding: 3px 0 3px 8px; }
.nt-cl-ev > span { min-width: 0; }
.nt-cl-ev--missing { border-left-color: var(--nt-bad); color: var(--nt-bad); }
.nt-cl-where { color: var(--nt-muted); white-space: nowrap; }
.nt-cl-q { color: var(--nt-ink); font-style: italic; overflow-wrap: anywhere; }
.nt-cl-how { display: block; color: var(--nt-muted); font-size: 11px; }
.nt-cl-thumb { width: 34px; height: 44px; flex-shrink: 0; border-radius: 5px; object-fit: cover; background: var(--nt-carton);
  display: inline-flex; align-items: flex-end; justify-content: center; padding-bottom: 3px; font: 600 8px var(--nt-font-mono); color: var(--nt-ink-2); }
.nt-cl-amt, .nt-cl-bal { text-align: right; font: 600 13px var(--nt-font-mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
.nt-cl-amt--cr { color: var(--nt-ok); }
/* Screen-reader-only column names: the header row is aria-hidden. */
.nt-cl-cell { position: relative; }
.nt-cl-cell::before { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.nt-cl-amt::before { content: "Amount "; }
.nt-cl-bal::before { content: "Balance "; }
.nt-cl-bal { color: var(--nt-ink-2); }
.nt-cl-bal.nt-ledger-balance--bad { color: var(--nt-brick); }
.nt-cl-foot { display: flex; flex-direction: column; gap: 4px; }
.nt-cl-foot .nt-ledger-note, .nt-cl-foot .nt-total { margin: 0; padding: 0; }

.nt-cl-loose { border-top: 1px solid var(--nt-line); padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; background: var(--nt-saffron-wash-2); }
.nt-cl-label { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--nt-muted); }
.nt-cl-loose-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-size: 13px; border-radius: 6px; outline: none; }
.nt-cl-loose-row.is-linked, .nt-cl-loose-row:focus-visible { background: var(--nt-saffron-wash); }
.nt-cl-loose-row:focus-visible { outline: 2px solid var(--nt-saffron-deep); outline-offset: 2px; }
.nt-cl-loose-acts { display: inline-flex; flex-wrap: wrap; gap: 6px; margin-left: auto; }
.nt-cl-loose-acts form { margin: 0; }

.nt-cl-tag { display: inline-block; margin-right: 6px; font: 700 10.5px var(--nt-font-body); border-radius: 8px; padding: 0 6px; white-space: nowrap; }
.nt-cl-tag--order { background: var(--nt-saffron-wash); color: var(--nt-warn); }
.nt-cl-tag--payment { background: var(--nt-wash-ok); color: var(--nt-ok); }
.nt-cl-tag--untied { background: var(--nt-wash-bad); color: var(--nt-bad); }

/* The ledger's chips: a segmented control beside the title, each with its count. */
.nt-cl-seg { flex-wrap: wrap; }
.nt-cl-seg .nt-seg-link { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; padding: 4px 11px; }
.nt-cl-seg .nt-num { font: 600 11.5px var(--nt-font-mono); font-variant-numeric: tabular-nums; color: var(--nt-muted); }
.nt-cl-seg .is-active .nt-num { color: var(--nt-ink-2); }
.nt-cl-seg .nt-cl-seg--bad .nt-num { color: var(--nt-bad); }

/* The Orders and Payments lists: totals over the window, then a row per
   order or payment with its status and what it is tied to on the right. */
.nt-cl-sums { display: flex; flex-wrap: wrap; gap: 6px 22px; margin: 0; padding: 10px 14px; border-bottom: 1px solid var(--nt-line); }
.nt-cl-sums > div { display: flex; flex-direction: column; gap: 1px; }
.nt-cl-sums dt { font-size: 10.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--nt-muted); }
.nt-cl-sums dd { margin: 0; font-size: 15px; font-weight: 600; }
.nt-cl-sums dd.nt-cl-sums--bad { color: var(--nt-brick); }
.nt-cl-list .nt-cl-hdr, .nt-cl-list .nt-cl-entry { grid-template-columns: 58px minmax(0, 1fr) 96px minmax(130px, .7fr); }
.nt-cl-list .nt-cl-hdr span:nth-child(4) { text-align: left; }
.nt-cl-items { color: var(--nt-ink-2); font-variant-numeric: tabular-nums; }
.nt-cl-state { display: flex; flex-direction: column; gap: 5px; min-width: 0; font-size: 12px; }
.nt-cl-state::before { content: "Status "; }
.nt-cl-links { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px;
  font: 500 12px var(--nt-font-mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
.nt-cl-advance { align-self: flex-start; }

.nt-cl-chat { max-height: 680px; flex: none; }
/* Side by side, the messages pane stays in view while a long ledger scrolls:
   sticky under the 52px top bar, at most 75% of the window tall, its chat
   scrolling inside it. Stacked (≤1020px) it goes back to the page's flow. */
@media (min-width: 1021px) {
  #customer_messages_pane { position: sticky; top: 64px; max-height: 75vh; overflow: hidden; }
  #customer_messages_pane > turbo-frame { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; }
  #customer_messages_pane .nt-cl-chat { flex: 1 1 auto; min-height: 0; max-height: none; overflow-y: auto; }
}
.nt-cl-chat .nt-wa-row { outline: none; }
.nt-cl-chat .nt-wa-row.is-linked .nt-wa-bubble,
.nt-cl-chat .nt-wa-row:focus-visible .nt-wa-bubble { box-shadow: 0 0 0 2px var(--nt-saffron); }
.nt-cl-chat .nt-wa-row:focus-visible .nt-wa-bubble { outline: 2px solid var(--nt-saffron-deep); outline-offset: 2px; }
.nt-cl-chat:focus-visible { outline: 2px solid var(--nt-saffron-deep); outline-offset: -2px; }
.nt-cl-ch { font-size: 11px; font-weight: 700; color: var(--nt-info); margin-bottom: 2px; }
.nt-cl-ch--dm { color: var(--nt-ok); }
.nt-cl-img { display: flex; align-items: center; justify-content: center; max-width: 220px; max-height: 180px; min-height: 60px; margin: 2px 0 4px;
  border-radius: 7px; object-fit: cover; background: var(--nt-carton); font: 600 11px var(--nt-font-mono); color: var(--nt-ink-2); }

@media (max-width: 1020px) {
  .nt-cl-grid { grid-template-columns: minmax(0, 1fr); }
  .nt-cl-tiles--money { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .nt-cl-chat { max-height: 520px; }
}

@media (max-width: 640px) {
  .nt-cl-hdr, .nt-cl-entry { grid-template-columns: 50px minmax(0, 1fr) 84px; padding-inline: 12px; }
  .nt-cl-bal, .nt-cl-hdr span:nth-child(4) { display: none; }
  .nt-cl-list .nt-cl-hdr, .nt-cl-list .nt-cl-entry { grid-template-columns: 50px minmax(0, 1fr) 84px; }
  .nt-cl-list .nt-cl-state { grid-column: 2 / -1; }
  .nt-cl-entry, .nt-cl-loose-row { min-height: 44px; }
  .nt-cl-loose-acts { margin-left: 0; }
  .nt-cl-loose-acts .nt-lbtn { height: 44px; }
  .nt-cl-sources { width: 100%; }
  .nt-cl-where { white-space: normal; }
  .nt-cl-grid .nt-fchip, .nt-agent-chip { min-height: 44px; height: auto; }
  .nt-cl-l1 b a, .nt-cl-foot .nt-ledger-steps a { display: inline-flex; align-items: center; min-height: 44px; }
  .nt-cl-tiles .nt-tile-value { font-size: 1.15rem; overflow-wrap: anywhere; }
}

/* ---- Agent harness (Traces): spend, runs, one run's detail ------------ *
 * The approved mockup (docs/superpowers/mockups/agent-traces.html) in the
 * app's tokens. The runs list scrolls inside its own box with a sticky head;
 * on a phone everything is one column. */
.nt-traces { display: flex; flex-direction: column; gap: 22px; }
.nt-trace-pane { display: block; background: var(--nt-shell); border: 1px solid var(--nt-line); border-radius: var(--nt-r-pane); overflow: hidden; }
.nt-trace-detail-frame { display: block; }
.nt-trace-pick { margin: 0; }
.nt-trace-ph { display: flex; align-items: center; gap: 8px 10px; padding: 12px 16px; border-bottom: 1px solid var(--nt-line); flex-wrap: wrap; }
.nt-trace-ph h2 { font: 700 17px/1.2 var(--nt-font-display); margin: 0; }
.nt-trace-ph-end { margin-left: auto; display: inline-flex; gap: 6px; flex-wrap: wrap; }
.nt-trace-label { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--nt-muted); }
.nt-trace-sub { font-size: 12px; color: var(--nt-muted); }
.nt-trace-mono { font-family: var(--nt-font-mono); font-variant-numeric: tabular-nums; }
.nt-trace-bad { color: var(--nt-bad); }

.nt-trace-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.nt-trace-chips--end { margin-left: auto; }
.nt-trace-chip { font-size: 12px; font-weight: 600; border: 1px solid var(--nt-rule); border-radius: 13px; padding: 2px 10px; color: var(--nt-ink-2); background: var(--nt-shell); text-decoration: none; white-space: nowrap; }
.nt-trace-chip:hover { color: var(--nt-ink); border-color: var(--nt-edge); }
.nt-trace-chip.is-on { background: var(--nt-spruce); border-color: var(--nt-spruce); color: #fff; }
.nt-trace-chip:focus-visible, .nt-trace-tab:focus-visible, .nt-trace-node:focus-visible, .nt-trace-runs:focus-visible,
.nt-trace-when a:focus-visible { outline: 2px solid var(--nt-saffron-deep); outline-offset: 2px; }
.nt-trace-search { flex: 0 1 240px; }
.nt-trace-count { font-size: 12px; color: var(--nt-muted); margin-left: auto; }

.nt-trace-tiles { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); }
.nt-trace-tile { padding: 13px 16px; border-left: 1px solid var(--nt-line); display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.nt-trace-tile:first-child { border-left: 0; }
.nt-trace-big { font: 600 21px/1.1 var(--nt-font-mono); font-variant-numeric: tabular-nums; }

.nt-trace-spend { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); border-top: 1px solid var(--nt-line); }
.nt-trace-chart { margin: 0; padding: 14px 16px; border-right: 1px solid var(--nt-line); }
.nt-trace-chart-svg { width: 100%; height: auto; display: block; }
.nt-trace-chart-axis { font: 9px var(--nt-font-mono); fill: var(--nt-muted); }
.nt-trace-chart-day { font: 10px var(--nt-font-body); fill: var(--nt-ink-2); }
.nt-trace-legend, .nt-trace-blegend { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12px; color: var(--nt-ink-2); margin: 6px 0 0; padding: 0; list-style: none; }
.nt-trace-legend i, .nt-trace-blegend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }

.nt-trace-tw { overflow-x: auto; }
.nt-trace-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.nt-trace-table th { font-size: 10.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--nt-muted); text-align: left; padding: 8px 12px; background: var(--nt-wash); white-space: nowrap; }
.nt-trace-table td { padding: 8px 12px; border-top: 1px solid var(--nt-line); vertical-align: middle; }
.nt-trace-table .nt-num { text-align: right; font-family: var(--nt-font-mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
.nt-trace-agent { font-weight: 600; }
.nt-trace-subj { color: var(--nt-spruce); font-weight: 600; }
a.nt-trace-subj { color: var(--nt-link); }

.nt-trace-runs { max-height: 420px; overflow: auto; overscroll-behavior: contain; }
.nt-trace-runs thead th { position: sticky; top: 0; z-index: 1; }
.nt-trace-runs tbody tr[data-trace-row] { cursor: pointer; }
.nt-trace-runs tbody tr[data-trace-row]:hover td { background: var(--nt-wash); }
.nt-trace-runs tr.is-selected td { background: var(--nt-saffron-wash-2); }
.nt-trace-when { font-family: var(--nt-font-mono); white-space: nowrap; }
.nt-trace-when a { color: var(--nt-ink); text-decoration: none; }
.nt-trace-status { white-space: nowrap; }
.nt-trace-more td { text-align: center; color: var(--nt-muted); font-size: 12px; background: var(--nt-paper); }

.nt-trace-detail { display: grid; grid-template-columns: 260px minmax(0, 1fr); min-height: 300px; }
.nt-trace-tree { border-right: 1px solid var(--nt-line); padding: 12px; display: flex; flex-direction: column; gap: 4px; background: var(--nt-paper); }
.nt-trace-node { border-radius: 8px; padding: 7px 9px; font-size: 12.5px; display: flex; flex-direction: column; gap: 2px; border: 1px solid transparent; color: var(--nt-ink); text-decoration: none; }
.nt-trace-node:hover { background: var(--nt-wash); color: var(--nt-ink); }
.nt-trace-node.is-on { background: var(--nt-shell); border-color: var(--nt-rule); }
.nt-trace-node.is-tool { font-family: var(--nt-font-mono); font-size: 11.5px; padding-block: 4px; }
.nt-trace-node-r { display: flex; justify-content: space-between; gap: 6px; }
.nt-trace-main { min-width: 0; }
.nt-trace-tabs { display: flex; gap: 2px; padding: 0 16px; border-bottom: 1px solid var(--nt-line); flex-wrap: wrap; }
.nt-trace-tab { padding: 10px 12px; font-size: 13px; font-weight: 600; color: var(--nt-muted); border-bottom: 2px solid transparent; text-decoration: none; }
.nt-trace-tab:hover { color: var(--nt-ink); }
.nt-trace-tab.is-on { color: var(--nt-ink); border-bottom-color: var(--nt-spruce); }
.nt-trace-body { padding: 14px 16px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.nt-trace-body .nt-empty, .nt-trace-body p { margin: 0; }
.nt-trace-kv { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.nt-trace-kv > div { background: var(--nt-wash); border-radius: 8px; padding: 8px 10px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.nt-trace-kv b { font: 600 14px var(--nt-font-mono); }
.nt-trace-ctx { display: flex; flex-direction: column; gap: 6px; }
.nt-trace-budget { display: flex; height: 14px; border-radius: 4px; overflow: hidden; background: var(--nt-carton); }
.nt-trace-budget i { display: block; height: 100%; }
.nt-trace-reason { border-left: 3px solid var(--nt-saffron); background: var(--nt-saffron-wash-2); border-radius: 0 8px 8px 0; padding: 10px 12px; font-size: 13px; color: var(--nt-ink-2); display: flex; flex-direction: column; gap: 6px; }
.nt-trace-reason p { margin: 0; white-space: pre-wrap; }
.nt-trace-fold summary { cursor: pointer; font-weight: 600; font-size: 13px; padding: 4px 0; }
.nt-trace-pre { margin: 0; padding: 10px 12px; background: var(--nt-wash); font: 12px/1.5 var(--nt-font-mono); color: var(--nt-ink); overflow: auto; white-space: pre; max-height: 28rem; border-radius: 6px; }
.nt-trace-pre--wrap { white-space: pre-wrap; overflow-wrap: anywhere; }
.nt-trace-call { border: 1px solid var(--nt-line); border-radius: 10px; overflow: hidden; }
.nt-trace-call-h { display: flex; gap: 8px; align-items: center; padding: 8px 10px; background: var(--nt-wash); font-size: 12.5px; flex-wrap: wrap; }
.nt-trace-call-h b { font-family: var(--nt-font-mono); }
.nt-trace-cols { display: grid; grid-template-columns: 1fr 1fr; }
.nt-trace-cols .nt-trace-pre { border-radius: 0; }
.nt-trace-cols .nt-trace-pre + .nt-trace-pre { border-left: 1px solid var(--nt-line); }
.nt-trace-ops { display: flex; flex-direction: column; gap: 6px; margin: 6px 0 0; padding: 0; list-style: none; }
.nt-trace-op { display: flex; gap: 8px; align-items: center; font-size: 12.5px; padding: 6px 10px; border: 1px solid var(--nt-line); border-radius: 8px; flex-wrap: wrap; }
.nt-trace-op code { font: 600 12px var(--nt-font-mono); color: var(--nt-ink); }
.nt-trace-op-end { margin-left: auto; }
.nt-trace-fb { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.nt-trace-fb textarea { flex: 1 1 320px; min-height: 54px; }

@media (max-width: 1000px) {
  .nt-trace-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .nt-trace-tile:nth-child(n+4) { border-top: 1px solid var(--nt-line); }
  .nt-trace-spend, .nt-trace-detail { grid-template-columns: minmax(0, 1fr); }
  .nt-trace-chart { border-right: 0; border-bottom: 1px solid var(--nt-line); }
  .nt-trace-tree { border-right: 0; border-bottom: 1px solid var(--nt-line); }
  .nt-trace-kv { grid-template-columns: 1fr 1fr; }
  .nt-trace-cols { grid-template-columns: 1fr; }
  .nt-trace-cols .nt-trace-pre + .nt-trace-pre { border-left: 0; border-top: 1px solid var(--nt-line); }
}
@media (max-width: 560px) {
  .nt-trace-tiles { grid-template-columns: 1fr 1fr; }
  .nt-trace-tile { border-left: 0; border-top: 1px solid var(--nt-line); }
  .nt-trace-runs { max-height: 60vh; }
  .nt-trace-search { flex-basis: 100%; }
  .nt-trace-count { margin-left: 0; }
}

/* ---- Agents (mockup agents-inbox.html): the conversation list on the left,
   the chosen conversation on the right. On a phone the two stack: the list
   alone until a conversation is open (the frame holds .nt-agents-conv),
   then the conversation with a back arrow. ---- */
.nt-agents {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  background: var(--nt-shell);
  border: 1px solid var(--nt-line);
  border-radius: 14px;
  overflow: hidden;
  height: calc(100dvh - 12rem);
  min-height: 30rem;
}
.nt-agents-side { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--nt-line); }
.nt-agents-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--nt-shell); }

.nt-agents-picker { position: relative; margin: 12px; }
.nt-agents-pick {
  width: 100%; min-height: 44px; border: 1px solid var(--nt-edge); border-radius: 9px; background: var(--nt-shell);
  display: flex; align-items: center; gap: 8px; padding: 0 10px; font: 600 13.5px var(--nt-font-body); color: var(--nt-ink); cursor: pointer;
}
.nt-agents-pick small, .nt-agents-opt small { font: 600 11px var(--nt-font-mono); color: var(--nt-muted); }
.nt-agents-pick .nt-icon { margin-left: auto; color: var(--nt-muted); }
.nt-agents-pick:focus-visible, .nt-agents-opt:focus-visible, .nt-agents-row:focus-visible, .nt-agents-fchip:focus-visible {
  outline: 2px solid var(--nt-saffron-deep); outline-offset: 2px;
}
.nt-agents-menu {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 5; background: var(--nt-shell);
  border: 1px solid var(--nt-rule); border-radius: 10px; box-shadow: var(--nt-shadow); padding: 4px; display: flex; flex-direction: column;
}
.nt-agents-menu[hidden] { display: none; }
.nt-agents-opt {
  display: flex; align-items: center; gap: 9px; min-height: 44px; padding: 0 9px; border-radius: 7px;
  font-size: 13px; color: var(--nt-ink); text-decoration: none;
}
.nt-agents-opt:hover { background: var(--nt-wash); color: var(--nt-ink); }
.nt-agents-opt.is-on { background: color-mix(in srgb, var(--nt-yolk) 12%, var(--nt-shell)); font-weight: 600; }
.nt-agents-opt-label { flex: 1; min-width: 0; }
.nt-agents-sep { height: 1px; background: var(--nt-line); margin: 4px 6px; }

.nt-agents-av {
  width: 32px; height: 32px; border-radius: 8px; flex: none; display: inline-flex; align-items: center; justify-content: center;
  font: 700 12px var(--nt-font-display); color: var(--nt-shell); background: var(--nt-ink-2);
}
.nt-agents-av--sm { width: 22px; height: 22px; border-radius: 6px; font-size: 10px; }
.nt-agents-av--sheet { background: var(--nt-spruce); }
.nt-agents-av--community { background: var(--nt-saffron-deep); }
.nt-agents-av--customer { background: var(--nt-info); }
.nt-agents-av--operations { background: var(--nt-muted); }
.nt-agents-av--payments { background: var(--nt-ok); }
.nt-agents-av--chat { background: var(--nt-spruce-soft); }

.nt-agents-pill { font-size: 11px; font-weight: 600; border-radius: 10px; padding: 1px 7px; white-space: nowrap; background: var(--nt-wash); color: var(--nt-ink-2); }
.nt-agents-pill--warn { background: var(--nt-wash-warn); color: var(--nt-warn); }
.nt-agents-pill--ok { background: var(--nt-wash-ok); color: var(--nt-ok); }

.nt-agents-find {
  margin: 0 12px 8px; min-height: 40px; border: 1px solid var(--nt-edge); border-radius: 8px;
  display: flex; align-items: center; gap: 8px; padding: 0 10px; color: var(--nt-muted); background: var(--nt-shell);
}
.nt-agents-find:focus-within { outline: 2px solid var(--nt-saffron-deep); outline-offset: 1px; }
.nt-agents-find input { flex: 1; min-width: 0; border: 0; background: transparent; font-size: 13.5px; color: var(--nt-ink); outline: none; min-height: 38px; }

.nt-agents-filters { display: flex; gap: 6px; padding: 0 12px 10px; flex-wrap: wrap; }
.nt-agents-fchip {
  display: inline-flex; align-items: center; gap: 5px; min-height: 32px; font-size: 12px; font-weight: 600;
  border: 1px solid var(--nt-rule); border-radius: 16px; padding: 0 11px; color: var(--nt-ink-2); text-decoration: none;
}
.nt-agents-fchip:hover { background: var(--nt-wash); color: var(--nt-ink); }
.nt-agents-fchip.is-on { background: var(--nt-spruce); border-color: var(--nt-spruce); color: var(--nt-shell); }
.nt-agents-fcount { font: 600 11px var(--nt-font-mono); }

.nt-agents-list { overflow-y: auto; flex: 1; min-height: 0; border-top: 1px solid var(--nt-line); }
.nt-agents-grp {
  margin: 0; padding: 8px 14px 4px; font-size: 10.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  color: var(--nt-muted); background: var(--nt-paper); position: sticky; top: 0; z-index: 1; font-family: var(--nt-font-body);
}
.nt-agents-row {
  display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; gap: 10px; min-height: 56px; padding: 10px 14px;
  border-top: 1px solid var(--nt-line); align-items: start; color: var(--nt-ink); text-decoration: none;
}
.nt-agents-grp + .nt-agents-row { border-top: 0; }
.nt-agents-row:hover { background: var(--nt-wash); color: var(--nt-ink); }
.nt-agents-row.is-on { background: color-mix(in srgb, var(--nt-yolk) 12%, var(--nt-shell)); }
.nt-agents-row-text { display: flex; flex-direction: column; min-width: 0; }
.nt-agents-row-title { font-weight: 600; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nt-agents-row-preview { font-size: 12px; color: var(--nt-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nt-agents-row-side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; font: 500 11px var(--nt-font-mono); color: var(--nt-muted); }
.nt-agents-dots { display: inline-flex; padding: 5px 8px; margin-top: 2px; }
.nt-agents-empty { margin: 0; padding: 14px; font-size: 13px; color: var(--nt-muted); }
.nt-agents-more { display: block; }

.nt-agents-blank { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; color: var(--nt-muted); padding: 24px; text-align: center; }
.nt-agents-blank-title { margin: 0; font-weight: 600; color: var(--nt-ink); }
.nt-agents-blank-note { margin: 0; font-size: 13px; }

.nt-agents-conv { display: flex; flex-direction: column; min-height: 0; height: 100%; }
.nt-agents-head { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--nt-line); flex-wrap: wrap; }
.nt-agents-head-text { min-width: 0; flex: 1; }
.nt-agents-head-title { margin: 0; font: 700 16px/1.25 var(--nt-font-display); color: var(--nt-ink); }
.nt-agents-head-sub { margin: 1px 0 0; font-size: 12px; color: var(--nt-muted); }
.nt-agents-head-acts { display: flex; gap: 6px; flex-wrap: wrap; }
.nt-agents-head-acts .nt-agent-btn { display: inline-flex; align-items: center; text-decoration: none; }
.nt-agents-back { display: none; }

.nt-agents-pending {
  display: flex; gap: 10px; align-items: center; padding: 9px 16px; background: var(--nt-wash-yolk);
  border-bottom: 1px solid var(--nt-line); font-size: 12.5px; flex-wrap: wrap; color: var(--nt-ink);
}
.nt-agents-pending-sub { color: var(--nt-ink-2); }
.nt-agents-pending-act { margin-left: auto; }
.nt-agents-pending-act .nt-agent-btn { display: inline-flex; align-items: center; text-decoration: none; }
.nt-agents-chat { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.nt-agents-chat .nt-agent-chat { flex: 1; }

.nt-agents-findings { flex: 1; min-height: 0; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; background: var(--nt-paper); }
.nt-agents-finding { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 14px; padding: 12px; background: var(--nt-shell); border: 1px solid var(--nt-line); border-radius: 10px; }
.nt-agents-shot { width: 96px; height: 128px; border-radius: 8px; overflow: hidden; background: var(--nt-wash); display: flex; align-items: center; justify-content: center; color: var(--nt-muted); }
.nt-agents-shot img { width: 100%; height: 100%; object-fit: cover; }
.nt-agents-finding-body { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.nt-agents-read { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 0; }
.nt-agents-read dt { font-size: 10.5px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--nt-muted); }
.nt-agents-read dd { margin: 0; font-size: 13.5px; font-weight: 600; overflow-wrap: anywhere; }
.nt-agents-mono { font-family: var(--nt-font-mono); font-size: 12px !important; }
.nt-agents-match { margin: 0; font-size: 13px; color: var(--nt-ink-2); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.nt-agents-finding-acts { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.nt-agents-finding-acts .nt-agent-btn { min-height: 36px; display: inline-flex; align-items: center; text-decoration: none; }
.nt-agents-reject { display: inline; }
.nt-agents-run { font-size: 12px; margin-left: auto; }

@media (max-width: 767.98px) {
  .nt-agents { grid-template-columns: minmax(0, 1fr); height: calc(100dvh - 12rem); }
  .nt-agents-side { border-right: 0; }
  .nt-agents-main { display: none; }
  .nt-agents:has(.nt-agents-conv) .nt-agents-side { display: none; }
  .nt-agents:has(.nt-agents-conv) .nt-agents-main { display: flex; }
  .nt-agents-back {
    display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; margin-left: -10px;
    font-size: 18px; color: var(--nt-ink); text-decoration: none;
  }
  .nt-agents .nt-agent-btn { min-height: 44px; }
  .nt-agents-finding { grid-template-columns: 72px minmax(0, 1fr); }
  .nt-agents-shot { width: 72px; height: 96px; }
  .nt-agents-read { grid-template-columns: 1fr 1fr; }
}

/* ---- Autopilot feed (AutopilotController) ------------------------------- */
.nt-autopilot { display: grid; gap: 1.25rem; max-width: 72rem; }
.nt-ap-state { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  padding: .75rem 1rem; border: 1px solid var(--bs-border-color); border-radius: .5rem; background: var(--bs-body-bg); }
.nt-ap-state.is-paused { border-color: var(--bs-warning); background: var(--bs-warning-bg-subtle); }
.nt-ap-state-main { display: flex; flex-direction: column; gap: .15rem; min-width: 0; }
.nt-ap-reason { color: var(--bs-warning-text-emphasis); }
.nt-ap-meta, .nt-ap-item-meta, .nt-ap-note { color: var(--bs-secondary-color); font-size: .85rem; }
.nt-ap-summary { margin: 0; font-weight: 500; }
.nt-ap-h2 { font-size: 1rem; font-weight: 600; margin: 0 0 .5rem; }
.nt-ap-switch-list { display: flex; flex-wrap: wrap; gap: .4rem; }
.nt-ap-switch-list form { margin: 0; }
.nt-ap-switch { display: inline-flex; align-items: center; gap: .35rem; border: 1px solid var(--bs-border-color);
  border-radius: 999px; padding: .2rem .7rem; background: var(--bs-body-bg); font-size: .85rem; }
.nt-ap-switch .nt-ap-dot { width: .55rem; height: .55rem; border-radius: 50%; background: var(--bs-secondary-color); }
.nt-ap-switch.is-on .nt-ap-dot { background: var(--bs-success); }
.nt-ap-switch.is-off { opacity: .7; text-decoration: line-through; }
.nt-ap-table { font-size: .85rem; }
.nt-ap-actions-head { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: .5rem; }
.nt-ap-filters { display: flex; gap: .5rem; flex-wrap: wrap; }
.nt-ap-filter { font-size: .85rem; text-decoration: none; padding: .1rem .5rem; border-radius: .35rem; }
.nt-ap-filter.is-on { background: var(--bs-secondary-bg); font-weight: 600; }
.nt-ap-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .5rem; }
.nt-ap-item { display: grid; grid-template-columns: 1fr auto; gap: .25rem .75rem; padding: .6rem .75rem;
  border: 1px solid var(--bs-border-color); border-radius: .5rem; }
.nt-ap-item.is-review { border-color: var(--bs-warning); }
.nt-ap-item.is-undone { opacity: .6; }
.nt-ap-item-main { display: flex; gap: .5rem; align-items: baseline; flex-wrap: wrap; min-width: 0; }
.nt-ap-item-meta { grid-column: 1; overflow-wrap: anywhere; }
.nt-ap-undo { grid-column: 2; grid-row: 1 / span 2; align-self: center; }
.nt-ap-chip { font-size: .75rem; font-weight: 600; padding: .05rem .45rem; border-radius: .35rem; background: var(--bs-secondary-bg); white-space: nowrap; }
.nt-ap-item.is-review .nt-ap-chip { background: var(--bs-warning-bg-subtle); color: var(--bs-warning-text-emphasis); }
.nt-ap-summary-text { overflow-wrap: anywhere; }
.nt-agents-autopilot { font-size: .85rem; text-decoration: none; }

/* ---- Payments received (mockups/payments-received.html) ---- */
.nt-chip--info { background-color: var(--nt-wash-info); border-color: var(--nt-wash-info); color: var(--nt-info); }

/* customers-payments: the month stepper (‹ October 2026 ›), not a select. */
.nt-payr-month { display: inline-flex; align-items: center; gap: 2px; height: 32px; padding: 0 2px; border: 1px solid var(--nt-rule); border-radius: 99px; background: var(--nt-shell); }
.nt-payr-step { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 99px; font-size: 18px; line-height: 1; font-weight: 600; color: var(--nt-ink); text-decoration: none; }
a.nt-payr-step:hover { background: var(--nt-wash); color: var(--nt-ink); }
.nt-payr-step.is-off { color: var(--nt-muted); opacity: .4; cursor: default; }
.nt-payr-month-label { padding: 0 6px; font-size: 13px; font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
@media (max-width: 640px) {
  .nt-payr-month { height: 44px; }
  .nt-payr-step { width: 40px; height: 40px; }
}
/* customers-payments: Customers' Status and Sort segmented links. */
.nt-cust-seg { flex-wrap: wrap; align-items: center; }
.nt-cust-seg .nt-seg-link { font-size: 13px; padding: 4px 11px; }
.nt-cust-seg-cap { padding: 0 6px 0 8px; font-size: 11.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--nt-muted); }
@media (max-width: 640px) {
  .nt-cust-seg .nt-seg-link { min-height: 40px; display: inline-flex; align-items: center; }
}

.nt-payr-tiles {
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
  background: var(--nt-shell); border: 1px solid var(--nt-line); border-radius: var(--nt-r-pane); overflow: hidden;
}
.nt-payr-tile { display: flex; flex-direction: column; gap: 4px; padding: 12px 16px; border-left: 1px solid var(--nt-line); min-width: 0; }
.nt-payr-tile:first-child { border-left: 0; }
.nt-payr-tile-label { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--nt-muted); }
.nt-payr-tile-big { font: 600 20px/1.1 var(--nt-font-mono); font-variant-numeric: tabular-nums; color: var(--nt-ink); }
.nt-payr-tile-big--ok { color: var(--nt-ok); }
.nt-payr-tile-big--warn { color: var(--nt-warn); }
.nt-payr-tile-big--bad { color: var(--nt-bad); }
.nt-payr-tile-sub { font-size: 12px; color: var(--nt-muted); }

.nt-payr-seg { flex-wrap: wrap; }
.nt-payr-seg .nt-seg-link { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; }
.nt-payr-seg small { font-size: 11px; color: var(--nt-muted); }
.nt-payr-find { margin-left: auto; }

.nt-payr-row { cursor: pointer; }
.nt-payr-row:focus-visible { outline: 2px solid var(--nt-saffron-deep); outline-offset: -2px; }
.nt-payr-row td { vertical-align: middle; }
.nt-payr-when { white-space: nowrap; }
.nt-payr-who b { font-weight: 600; }
.nt-payr-ev { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--nt-ink-2); max-width: 340px; }
.nt-payr-ev q { font-style: italic; color: var(--nt-ink); quotes: "“" "”"; }
.nt-payr-thumb { width: 30px; height: 40px; flex: none; object-fit: cover; border-radius: 5px; background: var(--nt-carton); border: 1px solid var(--nt-line); }
.nt-payr-alloc { font-size: 12px; color: var(--nt-ink-2); }
.nt-payr-alloc a { color: var(--nt-spruce); font-weight: 600; text-decoration: none; }
.nt-payr-alloc a:hover { text-decoration: underline; }
.nt-payr-alloc .nt-chip { margin-left: 4px; }
.nt-payr-more { display: block; }
.nt-payr-more-note { margin: 0; padding: 10px 14px; font-size: 12.5px; color: var(--nt-muted); }
/* Customers: the rows scroll in a box under a sticky head (.table-scroll);
   on a phone the cards flow in the page and the page scrolls instead, the
   lazy frame at the foot still fetching as it comes into view. */
/* The table's own clip (theme.css) would unstick the head; the box clips. */
.nt-cust-scroll > table.nt-ltable { overflow: visible; }
.nt-cust-more { display: block; }
.nt-cust-more-note { margin: 0; padding: 10px 14px; font-size: 12.5px; color: var(--nt-muted); }
@media (max-width: 640px) {
  .nt-cust-scroll { max-height: none; overflow: visible; }
}
.nt-payr-foot { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* The evidence modal: a native <dialog>, the page behind it inert. */
.nt-paym {
  width: min(980px, calc(100vw - 32px)); max-height: calc(100vh - 48px); padding: 0;
  border: 1px solid var(--nt-rule); border-radius: 14px; background: var(--nt-shell); color: var(--nt-ink);
  box-shadow: var(--nt-palette-shadow);
}
.nt-paym::backdrop { background: var(--nt-scrim); }
.nt-paym-card { display: flex; flex-direction: column; min-height: 0; }
.nt-paym-card > turbo-frame { display: block; }
.nt-paym-loading { margin: 0; padding: 24px; color: var(--nt-muted); }
.nt-paym-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--nt-line); }
.nt-paym-head form { margin: 0; }
.nt-paym-kicker { margin: 0; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--nt-muted); }
.nt-paym-title { margin: 2px 0 0; font: 700 18px/1.25 var(--nt-font-display); }
.nt-paym-said { margin: 10px 16px 0; }
.nt-paym-body { display: grid; grid-template-columns: minmax(0, 300px) minmax(0, 1fr); gap: 16px; padding: 14px 16px 16px; background: var(--nt-paper); }
.nt-paym-proof { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.nt-paym-shot { display: block; padding: 0; border: 1px solid var(--nt-line); border-radius: 10px; background: var(--nt-carton); overflow: auto; cursor: zoom-in; max-height: 62vh; }
.nt-paym-shot img { display: block; width: 100%; height: auto; }
.nt-paym-shot.is-zoomed { cursor: zoom-out; max-height: 75vh; }
.nt-paym-shot.is-zoomed img { width: 200%; max-width: none; }
.nt-paym-none { padding: 16px; border: 1px dashed var(--nt-rule); border-radius: 10px; background: var(--nt-shell); font-size: 13px; color: var(--nt-ink-2); }
.nt-paym-none p { margin: 0 0 6px; }
.nt-paym-note { color: var(--nt-ink); font-style: italic; }
.nt-paym-bubble { display: flex; flex-direction: column; gap: 4px; max-width: 92%; padding: 8px 10px; border-radius: 10px; font-size: 13px; box-shadow: var(--nt-wa-shadow); background: var(--nt-shell); }
.nt-paym-bubble--ack { align-self: flex-end; background: var(--nt-wa-out); }
.nt-paym-bubble-who { font-size: 11.5px; font-weight: 600; color: var(--nt-muted); }
.nt-paym-bubble-img { max-width: 100%; border-radius: 6px; }
.nt-paym-facts { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.nt-paym-kv { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.nt-paym-kv > div { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; background: var(--nt-shell); border: 1px solid var(--nt-line); border-radius: 8px; min-width: 0; }
.nt-paym-kv span { font-size: 12px; color: var(--nt-muted); }
.nt-paym-kv b { font: 600 13px var(--nt-font-mono); overflow-wrap: anywhere; }
.nt-paym-checks { display: flex; flex-direction: column; gap: 4px; margin: 0; padding: 0; list-style: none; font-size: 13px; }
.nt-paym-checks li { display: flex; gap: 6px; }
.nt-paym-mark { width: 1em; flex: none; font-weight: 700; }
.nt-paym-checks .is-ok .nt-paym-mark { color: var(--nt-ok); }
.nt-paym-checks .is-bad .nt-paym-mark { color: var(--nt-bad); }
.nt-paym-checks .is-bad { color: var(--nt-bad); }
.nt-paym-checks .is-skip { color: var(--nt-muted); }
.nt-paym-hint { margin: 0; font-size: 12.5px; color: var(--nt-ink-2); }
.nt-paym-label { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--nt-muted); margin-right: 6px; }
.nt-paym-paid { font-size: 13px; }
.nt-paym-paid a { color: var(--nt-spruce); font-weight: 600; }
.nt-paym-acts { display: flex; flex-wrap: wrap; gap: 8px; }
.nt-paym-form { display: inline; margin: 0; }
.nt-paym-realloc > summary { list-style: none; width: max-content; }
.nt-paym-realloc > summary::-webkit-details-marker { display: none; }
.nt-paym-realloc-form { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; padding: 10px; background: var(--nt-shell); border: 1px solid var(--nt-line); border-radius: 8px; }
.nt-paym-realloc-form .nt-lbtn { align-self: flex-start; }
.nt-paym-pick { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px; align-items: center; font-size: 13px; }

/* Record payment (the drawer form). */
.nt-paye { display: flex; flex-direction: column; gap: 12px; }
.nt-paye-field { display: flex; flex-direction: column; gap: 4px; margin: 0; min-width: 0; border: 0; padding: 0; }
.nt-paye-label { font-size: 12.5px; font-weight: 600; color: var(--nt-ink-2); }
.nt-paye-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.nt-paye-radios { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; }
.nt-paye-orders { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.nt-paye-hint, .nt-paye-hint-inline { font-size: 12px; font-weight: 400; color: var(--nt-muted); }
.nt-paye-hint { margin: 6px 0 0; }
.nt-paye-foot { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.nt-paye-wrap.nt-page .nt-paye { max-width: 560px; }

@media (max-width: 900px) {
  .nt-payr-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .nt-payr-tile { border-top: 1px solid var(--nt-line); }
  .nt-payr-find { margin-left: 0; flex: 1 1 100%; max-width: none; }
  .nt-paym-body { grid-template-columns: 1fr; }
  .nt-paym-kv { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ==================================================================== *
 * Planner (mockup docs/superpowers/mockups/planner.html): the standing
 * week, cities × weekdays as one CSS grid whose items carry both their
 * places, so "Days as rows" swaps them without redrawing anything.
 * ==================================================================== */
.nt-plan .is-tone-1 { --tone: var(--nt-city-1); --tone-wash: var(--nt-city-1-wash); }
.nt-plan .is-tone-2 { --tone: var(--nt-city-2); --tone-wash: var(--nt-city-2-wash); }
.nt-plan .is-tone-3 { --tone: var(--nt-city-3); --tone-wash: var(--nt-city-3-wash); }
.nt-plan .is-tone-4 { --tone: var(--nt-city-4); --tone-wash: var(--nt-city-4-wash); }

.nt-plan-saved { font-size: 12px; color: var(--nt-muted); }
.nt-plan-saved b { color: var(--nt-ok); font-weight: 600; }
.nt-plan-btn[aria-pressed="true"] { background: var(--nt-spruce); border-color: var(--nt-spruce); color: var(--nt-rail-ink); }

.nt-plan-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-items: start; }
.nt-plan-layout.with-pool { grid-template-columns: minmax(0, 1fr) 250px; }
.nt-plan-main { min-width: 0; display: flex; flex-direction: column; gap: 12px; }

.nt-plan-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--tone); display: inline-block; flex: none; }

/* The day picker. */
.nt-plan-daypick { display: flex; flex-wrap: wrap; gap: 2px; background: var(--nt-carton); border-radius: 9px; padding: 2px; width: fit-content; max-width: 100%; }
.nt-plan-daypick button { border: 0; background: none; font: 600 12.5px var(--nt-font-body); color: var(--nt-ink-2); padding: 6px 11px; border-radius: 7px; cursor: pointer; }
.nt-plan-daypick button[aria-pressed="true"] { background: var(--nt-shell); color: var(--nt-ink); box-shadow: 0 1px 2px var(--nt-scrim); }
.nt-plan-daypick .nt-num { font-size: 10.5px; color: var(--nt-muted); margin-left: 4px; }

/* The week. */
.nt-plan-board { background: var(--nt-shell); border: 1px solid var(--nt-rule); border-radius: 12px; overflow: auto; max-width: 100%; }
.nt-plan-grid { display: grid; grid-template-columns: 140px repeat(7, minmax(110px, 1fr)); min-width: 860px; }
.nt-plan.is-transposed .nt-plan-grid { grid-template-columns: 110px repeat(var(--cities), minmax(150px, 1fr)); min-width: calc(110px + var(--cities) * 150px); }
.nt-plan-grid > * { grid-row: var(--row); grid-column: var(--col); border-right: 1px solid var(--nt-line); border-bottom: 1px solid var(--nt-line); min-width: 0; }
.nt-plan.is-transposed .nt-plan-grid > * { grid-row: var(--trow); grid-column: var(--tcol); }
.nt-plan-corner { background: var(--nt-wash); position: sticky; top: 0; left: 0; z-index: 3; }
.nt-plan-dayhead { background: var(--nt-wash); font-size: 12px; font-weight: 600; color: var(--nt-ink-2); padding: 8px 10px; position: sticky; top: 0; z-index: 2; }
.nt-plan-dayhead small { display: block; font-size: 11px; font-weight: 500; color: var(--nt-muted); }
.nt-plan-dayhead.is-today { box-shadow: inset 0 -3px 0 var(--nt-saffron); color: var(--nt-ink); }
.nt-plan-cityhead { padding: 10px; background: var(--nt-shell); position: sticky; left: 0; z-index: 1; }
.nt-plan.is-transposed .nt-plan-dayhead { position: sticky; left: 0; top: auto; z-index: 1; padding: 10px; }
.nt-plan.is-transposed .nt-plan-cityhead { position: sticky; top: 0; left: auto; z-index: 2; background: var(--nt-wash); padding: 8px 10px; }
.nt-plan.is-transposed .nt-plan-dayhead.is-today { box-shadow: inset 3px 0 0 var(--nt-saffron); }
.nt-plan-rowname { font: 700 14px var(--nt-font-display); display: flex; align-items: center; gap: 6px; }
.nt-plan-rowsub { font-size: 11.5px; color: var(--nt-muted); font-weight: 500; }

.nt-plan-cell { padding: 6px; min-height: 118px; display: flex; flex-direction: column; gap: 5px; transition: background .12s; }
.nt-plan-chip { font-size: 12px; font-weight: 600; border-radius: 7px; padding: 4px 6px 4px 8px; display: flex; justify-content: space-between; align-items: center; gap: 4px; background: var(--tone-wash); color: var(--tone); border: 1px solid color-mix(in srgb, var(--tone) 25%, transparent); overflow-wrap: anywhere; }
.nt-plan-chip[draggable="true"] { cursor: grab; }
.nt-plan-x { border: 0; background: none; color: inherit; opacity: .55; cursor: pointer; font-size: 14px; line-height: 1; padding: 0 2px; }
.nt-plan-x:hover { opacity: 1; }
.nt-plan-empty { font-size: 11.5px; color: var(--nt-muted); opacity: 0; margin: auto; transition: opacity .12s; }
.nt-plan-cell:hover .nt-plan-empty { opacity: .8; }
.nt-plan-count { font-size: 10.5px; color: var(--nt-muted); text-align: right; margin-top: auto; }
.nt-plan-cell.is-pending, .nt-plan-chip.is-pending, .nt-plan-card.is-pending { opacity: .6; }

/* Drop feedback, the grid's cells and the day's lanes alike. */
.nt-plan [data-drop].is-can-drop { background: var(--nt-saffron-wash-2); }
.nt-plan [data-drop].is-over { background: var(--nt-saffron-wash); box-shadow: inset 0 0 0 2px var(--nt-saffron); }
.nt-plan .nt-plan-cell.is-no-drop { background: repeating-linear-gradient(-45deg, transparent 0 6px, var(--nt-wash) 6px 12px); }
.nt-plan .nt-plan-lane.is-no-drop { opacity: .55; }

/* The day focus. */
.nt-plan-focus { display: flex; flex-direction: column; gap: 12px; }
.nt-plan-focus-head { font-size: 12.5px; color: var(--nt-muted); margin: -4px 2px 0; }
.nt-plan-lane { background: var(--nt-shell); border: 1px solid var(--nt-rule); border-radius: 12px; padding: 12px 14px; transition: background .12s; }
.nt-plan-lane-head { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: baseline; margin-bottom: 10px; }
.nt-plan-lane-head .nt-plan-rowname { font-size: 16px; }
.nt-plan-lane.is-today { box-shadow: inset 4px 0 0 var(--nt-saffron); }
.nt-plan-lane-head .nt-plan-rowname small { font: 500 12px var(--nt-font-body); color: var(--nt-muted); }
.nt-plan-city-head { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: baseline; margin: 0 2px; color: var(--nt-ink); }
.nt-plan-city-head .nt-plan-rowname { font-size: 18px; }
.nt-plan-citypick-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.nt-plan-lane-sum { font-size: 12.5px; color: var(--nt-muted); }
.nt-plan-lane-sum b { font: 600 12.5px var(--nt-font-mono); color: var(--nt-ink); }
.nt-plan-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; min-height: 64px; }
.nt-plan-card { border: 1px solid var(--nt-line); border-left: 4px solid var(--tone); border-radius: 9px; padding: 9px 10px 10px; background: var(--nt-paper); display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.nt-plan-card[draggable="true"] { cursor: grab; }
.nt-plan-card-t { display: flex; justify-content: space-between; align-items: center; gap: 6px; font: 700 13.5px var(--nt-font-display); }
.nt-plan-card-t .nt-plan-x { color: var(--nt-muted); font-size: 15px; }
.nt-plan-also { font-size: 11.5px; color: var(--nt-ink-2); }
.nt-plan-also b { font-family: var(--nt-font-mono); font-weight: 600; }
.nt-plan-note { font: 12.5px var(--nt-font-body); border: 1px solid var(--nt-line); border-radius: 6px; padding: 5px 7px; background: var(--nt-shell); color: var(--nt-ink); width: 100%; }
.nt-plan-note-text { font-size: 12.5px; color: var(--nt-ink); margin: 0; }
.nt-plan-hint { grid-column: 1 / -1; font-size: 12px; color: var(--nt-muted); border: 1.5px dashed var(--nt-rule); border-radius: 9px; padding: 14px; text-align: center; }

/* The communities panel, on the right. */
.nt-plan-side { background: var(--nt-shell); border: 1px solid var(--nt-rule); border-radius: 12px; padding: 12px; position: sticky; top: 12px; max-height: calc(100vh - 24px); overflow: auto; }
.nt-plan-side h2 { font: 700 13px var(--nt-font-display); margin: 0 0 8px; display: flex; justify-content: space-between; gap: 8px; }
.nt-plan-side h2 span { font: 500 12px var(--nt-font-body); color: var(--nt-muted); }
.nt-plan-search { width: 100%; font-size: 13px; padding: 7px 10px; border: 1px solid var(--nt-rule); border-radius: 8px; background: var(--nt-paper); color: var(--nt-ink); margin-bottom: 8px; }
.nt-plan-seg { display: flex; background: var(--nt-carton); border-radius: 8px; padding: 2px; margin-bottom: 10px; }
.nt-plan-seg button { flex: 1; border: 0; background: none; font: 600 12px var(--nt-font-body); color: var(--nt-ink-2); padding: 5px 4px; border-radius: 6px; cursor: pointer; }
.nt-plan-seg button[aria-pressed="true"] { background: var(--nt-shell); color: var(--nt-ink); box-shadow: 0 1px 2px var(--nt-scrim); }
.nt-plan-citygroup { margin: 10px 0 4px; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--nt-muted); display: flex; align-items: center; gap: 6px; }
.nt-plan-badges { display: flex; flex-direction: column; gap: 4px; }
.nt-plan-badge { font: 600 12.5px var(--nt-font-body); text-align: left; border-radius: 7px; padding: 5px 8px 5px 10px; cursor: grab; user-select: none; display: flex; justify-content: space-between; gap: 6px; align-items: center; background: var(--tone-wash); color: var(--tone); border: 1px solid color-mix(in srgb, var(--tone) 25%, transparent); }
.nt-plan-badge.is-unplanned { border-style: dashed; }
.nt-plan-badge.is-picked { outline: 2px solid var(--nt-saffron); outline-offset: 1px; }
.nt-plan-badge .nt-num { font-size: 10.5px; padding: 0 5px; border-radius: 999px; background: var(--nt-shell); }

/* The notes under the plan. */
.nt-plan-notes { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.nt-plan-notes div { background: var(--nt-shell); border: 1px solid var(--nt-line); border-radius: 10px; padding: 10px 12px; font-size: 12.5px; color: var(--nt-ink-2); }
.nt-plan-notes b { display: block; color: var(--nt-ink); margin-bottom: 2px; }

@media (max-width: 900px) {
  .nt-plan-layout.with-pool { grid-template-columns: minmax(0, 1fr); }
  .nt-plan-side { position: static; max-height: none; }
}

/* ---------------------------------------------------------------- chats panel
   The Chats page's permanent right-hand panel (mockup
   docs/superpowers/mockups/chats-side-panel.html): NT Agent · Orders ·
   Payments beside the thread. The thread frame holds both, so a row click
   swaps them together; the thread scrolls in its own column, the panel in
   its own. At 1100px and below the panel stacks under the thread. */
.nt-wa-thread:has(> .nt-wa-split) { overflow: hidden; }
.nt-wa-split { display: grid; grid-template-columns: minmax(0, 1fr) 400px; height: 100%; min-height: 0; }
.nt-wa-log { min-width: 0; min-height: 0; overflow-y: auto; }
.nt-wa-log .nt-thread { border: 0; border-radius: 0; min-height: 100%; }

.nt-day-chip { padding: .1rem .625rem .15rem; background: var(--nt-wash); border: 1px solid var(--nt-line); border-radius: 999px;
  color: var(--nt-muted); font: 500 .75rem var(--nt-font-body); cursor: pointer; }
.nt-day-chip:hover { border-color: var(--nt-saffron); color: var(--nt-ink); }
.nt-day-chip.is-on { background: var(--nt-saffron-wash); border-color: var(--nt-saffron-deep); color: var(--nt-ink); }
.nt-msg.is-jumped .nt-bubble { box-shadow: 0 0 0 2px var(--nt-saffron); transition: box-shadow .3s; }

/* Live thread (wa_live_controller): a zero-height dock pinned to the bottom
   of whichever box scrolls, holding the "N new messages" pill. */
.nt-live-dock { position: sticky; bottom: 0; z-index: 2; height: 0; display: flex; justify-content: center; overflow: visible; }
.nt-live-new { transform: translateY(calc(-100% - 14px)); display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px;
  border: 1px solid var(--nt-saffron-deep); border-radius: 999px; background: var(--nt-shell); color: var(--nt-ink);
  font: 600 12px var(--nt-font-body); box-shadow: 0 4px 14px rgb(0 0 0 / .14); cursor: pointer; white-space: nowrap; }
.nt-live-new[hidden] { display: none; }
.nt-live-new:hover { background: var(--nt-saffron-wash); }
.nt-live-gap { align-self: center; margin: .5rem 0; color: var(--nt-muted); font-size: 12px; }

.nt-cpanel { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--nt-shell); border-left: 1px solid var(--nt-rule); }
.nt-cpanel-tabs { display: flex; flex: none; gap: 2px; padding: 0 10px; border-bottom: 1px solid var(--nt-rule); }
.nt-cpanel-tab { display: inline-flex; align-items: center; gap: 5px; padding: 12px 10px 10px; border: 0; border-bottom: 2px solid transparent;
  background: none; color: var(--nt-muted); font: 600 13px var(--nt-font-body); cursor: pointer; }
.nt-cpanel-tab:hover { color: var(--nt-ink); }
.nt-cpanel-tab.is-on { color: var(--nt-ink); border-bottom-color: var(--nt-saffron); }
.nt-cpanel-tab .nt-drawer-mode-key { margin-left: 2px; }
.nt-cpanel-datebar { display: flex; flex: none; align-items: center; gap: 8px; padding: 10px 14px; background: var(--nt-wash);
  border-bottom: 1px solid var(--nt-line); }
.nt-cpanel-datebar[hidden] { display: none; }
.nt-cpanel-step { width: 28px; height: 28px; flex: none; border: 1px solid var(--nt-rule); border-radius: 6px; background: var(--nt-shell);
  color: var(--nt-ink); cursor: pointer; line-height: 1; }
.nt-cpanel-day { font: 700 14px var(--nt-font-display); white-space: nowrap; }
.nt-cpanel-scope { flex: 1; min-width: 0; overflow: hidden; color: var(--nt-muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.nt-cpanel-stale { flex: none; padding: 2px 9px; border: 1px solid var(--nt-saffron-deep); border-radius: 999px; background: var(--nt-saffron-wash);
  color: var(--nt-ink); font: 600 11px var(--nt-font-body); cursor: pointer; white-space: nowrap; }
.nt-cpanel-stale[hidden] { display: none; }
.nt-cpanel-body { flex: 1; min-height: 0; overflow-y: auto; }
.nt-cpanel-body[hidden] { display: none; }
.nt-cpanel-agent { display: flex; flex-direction: column; overflow: hidden; }
.nt-cpanel-agent .nt-agent-chat { flex: 1; }
.nt-cpanel-pane { display: flex; flex-direction: column; gap: 8px; padding: 10px 14px 16px; }
.nt-cpanel-tot { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin-bottom: 4px; }
.nt-cpanel-tot div { padding: 6px 8px; background: var(--nt-paper); border: 1px solid var(--nt-line); border-radius: 8px; color: var(--nt-muted); font-size: 11px; }
.nt-cpanel-tot b { display: block; color: var(--nt-ink); font: 600 14px var(--nt-font-mono); font-variant-numeric: tabular-nums; }
.nt-cpanel-row { display: grid; gap: 3px; padding: 8px 10px; border: 1px solid var(--nt-line); border-radius: 9px; }
.nt-cpanel-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; font-size: 13px; font-weight: 600; }
.nt-cpanel-who { min-width: 0; }
.nt-cpanel-sub { color: var(--nt-ink-2); font-size: 12px; }
.nt-cpanel-sub a, .nt-cpanel-foot a { font-weight: 600; }
.nt-cpanel-empty { margin: 0; padding: 12px 0; color: var(--nt-muted); font-size: 13px; }
.nt-cpanel-foot { margin: 4px 0 0; font-size: 12px; }
.nt-cpanel-note { color: var(--nt-muted); }

@media (max-width: 1100px) {
  .nt-wa-thread:has(> .nt-wa-split) { overflow-y: auto; }
  .nt-wa-split { display: block; height: auto; }
  .nt-wa-log { overflow: visible; }
  .nt-cpanel { height: 34rem; border-left: 0; border-top: 1px solid var(--nt-rule); }
}

/* ---- Review (rk, 2026-10-03; mockups/review-queue.html): the questions on
   the left, the open one on the right ---- */
.nt-rail-badge {
  margin-left: auto; padding: 0 7px; border-radius: 999px; background: var(--nt-saffron); color: #13201F;
  font: 600 11px var(--nt-font-mono); line-height: 18px;
}
.nt-rail-badge:empty { display: none; }
.nt-rv-filters { display: flex; gap: 6px; flex-wrap: wrap; }
.nt-rv-tabs { display: flex; flex-wrap: wrap; gap: 2px; background: var(--nt-carton); border-radius: 10px; padding: 3px; margin: 0 0 12px; width: fit-content; max-width: 100%; }
.nt-rv-tab { font: 600 13px var(--nt-font-body); color: var(--nt-ink-2); text-decoration: none; padding: 7px 12px; border-radius: 8px; white-space: nowrap; }
.nt-rv-tab:hover { color: var(--nt-ink); background: color-mix(in srgb, var(--nt-shell) 55%, transparent); }
.nt-rv-tab.is-on { background: var(--nt-shell); color: var(--nt-ink); box-shadow: 0 1px 2px rgba(10, 32, 30, .12); }
.nt-rv-tab-n { font: 600 11px var(--nt-font-mono); color: var(--nt-muted); margin-left: 3px; }
.nt-rv-filters select {
  font: 500 13px var(--nt-font-body); border: 1px solid var(--nt-rule); background: var(--nt-shell); color: var(--nt-ink);
  border-radius: 8px; padding: 6px 10px;
}
.nt-rv { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 16px; align-items: start; }
.nt-rv-list {
  background: var(--nt-shell); border: 1px solid var(--nt-rule); border-radius: 12px; overflow: auto;
  max-height: calc(100vh - 190px); position: sticky; top: 12px;
}
.nt-rv-item {
  display: block; padding: 10px 14px; border-bottom: 1px solid var(--nt-line); color: var(--nt-ink); text-decoration: none;
}
.nt-rv-item:hover { background: var(--nt-wash); color: var(--nt-ink); }
.nt-rv-item.is-on { background: var(--nt-saffron-wash-2); box-shadow: inset 3px 0 0 var(--nt-saffron); }
.nt-rv-item b { display: block; font-weight: 600; font-size: 13.5px; }
.nt-rv-item span { font-size: 12px; color: var(--nt-muted); }
.nt-rv-item .nt-rv-like { float: right; margin-left: 8px; font: 600 11px var(--nt-font-mono); color: var(--nt-muted); }
.nt-rv-more, .nt-rv-empty { margin: 0; padding: 10px 14px; font-size: 12px; color: var(--nt-muted); }
.nt-rv-card {
  background: var(--nt-shell); border: 1px solid var(--nt-rule); border-radius: 12px; padding: 22px 24px;
  display: flex; flex-direction: column; gap: 16px; min-width: 0;
}
.nt-rv-count { font-size: 12.5px; color: var(--nt-muted); }
.nt-rv-q { font: 700 22px/1.25 var(--nt-font-display); margin: 0; text-wrap: balance; max-width: 40ch; }
.nt-rv-ctx { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.nt-rv-box { border: 1px solid var(--nt-line); border-radius: 10px; padding: 10px 12px; min-width: 0; }
.nt-rv-box h3 {
  margin: 0 0 6px; font: 600 11px var(--nt-font-body); letter-spacing: .06em; text-transform: uppercase; color: var(--nt-muted);
}
.nt-rv-box ul { margin: 0; padding-left: 18px; }
.nt-rv-box li { margin: 2px 0; }
.nt-rv-chat { background: var(--nt-wa-bg); }
.nt-rv-chat .nt-wa-bubble { max-width: 100%; }
.nt-rv-chat .nt-wa-text { white-space: pre-line; overflow-wrap: anywhere; }
.nt-rv-shot { display: block; max-width: 160px; max-height: 200px; border-radius: 6px; margin: 4px 0; }
.nt-rv-none { margin: 0; font-size: 13px; color: var(--nt-muted); }
.nt-rv-form { display: flex; flex-direction: column; gap: 12px; }
.nt-rv-answers { display: grid; gap: 8px; max-width: 620px; }
.nt-rv-ans {
  display: flex; gap: 12px; align-items: center; text-align: left; border: 1.5px solid var(--nt-rule); background: var(--nt-shell);
  color: var(--nt-ink); border-radius: 10px; padding: 12px 14px; cursor: pointer; font: inherit; text-decoration: none;
}
.nt-rv-ans:hover { border-color: var(--nt-spruce); color: var(--nt-ink); }
.nt-rv-ans kbd { font: 600 12px var(--nt-font-mono); background: var(--nt-carton); color: var(--nt-ink); border-radius: 6px; padding: 2px 8px; }
.nt-rv-ans b { display: block; font-weight: 600; }
.nt-rv-ans-text span { display: block; font-size: 12.5px; color: var(--nt-muted); }
.nt-rv-ans.is-main { border-color: var(--nt-spruce); background: var(--nt-wash-ok); }
.nt-rv-inputs { border: 1px dashed var(--nt-rule); border-radius: 10px; padding: 8px 12px 10px; max-width: 620px; display: grid; gap: 8px; margin: 0; }
.nt-rv-inputs legend { font: 600 11px var(--nt-font-body); letter-spacing: .06em; text-transform: uppercase; color: var(--nt-muted); padding: 0 4px; width: auto; float: none; margin: 0; }
/* An answer's own details, right under it (rk, 2026-10-03). */
.nt-rv-detail { border: 1.5px solid var(--nt-spruce); border-top: 0; border-radius: 0 0 10px 10px; margin: -10px 0 0; padding: 14px 14px 12px; display: grid; gap: 10px; background: var(--nt-shell); }
.nt-rv-detail legend { font: 600 11px var(--nt-font-body); letter-spacing: .06em; text-transform: uppercase; color: var(--nt-muted); padding: 0; float: left; width: 100%; margin: 0 0 2px; }
.nt-rv-ans.is-open { border-color: var(--nt-spruce); border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.nt-rv-confirm { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.nt-rv-go { font: 600 13.5px var(--nt-font-body); background: var(--nt-spruce); color: var(--nt-rail-ink); border: 0; border-radius: 8px; padding: 9px 14px; cursor: pointer; }
.nt-rv-go:hover { background: var(--nt-spruce-2); }
.nt-rv-go:focus-visible { outline: 2px solid var(--nt-saffron); outline-offset: 2px; }
.nt-rv-cancel { font: 600 13px var(--nt-font-body); background: none; border: 0; color: var(--nt-link); cursor: pointer; }
.nt-rv-field-row { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: end; font-size: 12.5px; color: var(--nt-ink-2); }
.nt-rv-field-row label { display: flex; flex-direction: column; gap: 3px; }
.nt-rv-field-row input, .nt-rv-field-row select {
  font: 500 13px var(--nt-font-body); border: 1px solid var(--nt-rule); border-radius: 8px; padding: 5px 8px;
  background: var(--nt-shell); color: var(--nt-ink); min-width: 0;
}
.nt-rv-packs label { flex-direction: row; align-items: center; }
.nt-rv-packs input { width: 58px; }
.nt-rv-search { border: 1px solid var(--nt-rule); background: var(--nt-wash); color: var(--nt-ink); border-radius: 8px; padding: 5px 10px; font: 600 12.5px var(--nt-font-body); }
.nt-rv-same { display: flex; gap: 8px; align-items: center; font-size: 13px; color: var(--nt-ink-2); }
.nt-rv-foot { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; font-size: 13px; color: var(--nt-muted); }
.nt-rv-foot a { color: var(--nt-link); font-weight: 600; text-decoration: none; }
.nt-rv-keys { margin-left: auto; font-size: 12px; }
.nt-rv-keys kbd { font: 600 11px var(--nt-font-mono); background: var(--nt-carton); color: var(--nt-ink); border-radius: 4px; padding: 0 5px; }
.nt-rv-toast {
  position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 70; display: flex; align-items: center; gap: 12px;
  background: var(--nt-ink); color: var(--nt-shell); border-radius: 10px; padding: 10px 12px 10px 14px; font-size: 13px;
  box-shadow: 0 12px 30px -12px rgba(10, 32, 30, .6); max-width: calc(100vw - 32px);
}
.nt-rv-toast .nt-muted { color: var(--nt-rail-muted); }
.nt-rv-toast-no { color: var(--nt-rail-muted); font-size: 12px; }
.nt-daily-review { font-weight: 600; color: var(--nt-link); text-decoration: none; white-space: nowrap; }
.nt-ap-behind { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: .8rem; font-weight: 600;
  text-decoration: none; white-space: nowrap; max-width: 28rem; overflow: hidden; text-overflow: ellipsis; vertical-align: middle; }
.nt-ap-behind.is-amber { background: var(--nt-wash-warn); color: var(--nt-warn); }
.nt-ap-behind.is-red { background: var(--nt-wash-bad); color: var(--nt-bad); }
.nt-ap-late.is-amber { color: var(--nt-warn); font-weight: 600; }
.nt-ap-late.is-red { color: var(--nt-bad); font-weight: 600; }
/* Close as paid / Reopen (rk, 2026-10-04): a quiet link beside the status chips. */
.nt-wo-form { display: inline; margin: 0; }
.nt-wo-link { font-size: .8rem; color: var(--nt-link); background: none; border: 0; padding: 0; text-decoration: underline; cursor: pointer; white-space: nowrap; }
.nt-wo-pane { max-width: 32rem; }
.nt-wo-facts { color: var(--bs-secondary-color); }
.nt-rail-alert { width: 6px; height: 6px; border-radius: 50%; background: var(--nt-bad); margin-left: 4px; flex: none; }
@media (max-width: 980px) {
  .nt-rv { grid-template-columns: 1fr; }
  .nt-rv-list { max-height: 220px; position: static; }
  .nt-rv-ctx { grid-template-columns: 1fr; }
  .nt-rv-card { padding: 16px; }
}

/* ---- Sales reports (Daily / Monthly sales; mockup sales-reports.html) ---- */
.nt-sales-filters .form-select, .nt-sales-filters .form-control { width: auto; }
/* Sales channel / basis filters: segmented links in place of native selects. */
.nt-sales-seg { flex-wrap: wrap; max-width: 100%; }
.nt-sales-seg .nt-seg-link { font-size: 13px; padding: 4px 11px; white-space: nowrap; }
.nt-sales-stepper { display: inline-flex; align-items: center; gap: 6px; padding: 3px; border: 1px solid var(--nt-rule);
  border-radius: 9px; background: var(--nt-shell); }
.nt-sales-step { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 6px;
  background: var(--nt-wash); color: var(--nt-ink); text-decoration: none; font-weight: 600; }
.nt-sales-step:hover { background: var(--nt-carton); color: var(--nt-ink); }
.nt-sales-stepper-day { font: 700 14px var(--nt-display); padding: 0 4px; }
.nt-sales-month { min-width: 130px; text-align: center; }
.nt-sales-stepper .form-control { border: 0; background: transparent; color: var(--nt-ink); padding: 2px 4px; }
.nt-sales-tiles { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin-bottom: 1rem; }
.nt-sales-tiles .nt-tile-value { font-family: var(--nt-font-mono); font-size: 1.35rem; }
.nt-sales-up { color: var(--nt-ok); font-weight: 600; }
.nt-sales-down { color: var(--nt-bad); font-weight: 600; }
.nt-sales-flat { color: var(--nt-muted); }
.nt-sales-pane { margin-bottom: 1rem; overflow: hidden; }
.nt-sales-aside { font-size: 12px; color: var(--nt-muted); }
.nt-sales-empty { margin: 0; border: 0; border-radius: 0; }
.nt-sales-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; }

/* The tree: each row is the same grid, so nesting (and a lazy frame) never
   breaks the columns. */
.nt-sales-crumbs { font-size: 12px; color: var(--nt-muted); margin-top: 2px; }
.nt-sales-crumbs a { color: var(--nt-link); font-weight: 600; text-decoration: none; }
.nt-sales-crumbs a[aria-current] { color: var(--nt-ink-2); }
.nt-sales-scroll { overflow-x: auto; }
.nt-sales-tree { min-width: 760px; font-size: 13px; }
.nt-sales-tree turbo-frame { display: block; }
.nt-st-row { display: grid; grid-template-columns: minmax(260px, 2.6fr) repeat(6, minmax(78px, 1fr)); align-items: center;
  border-bottom: 1px solid var(--nt-line); font-variant-numeric: tabular-nums; }
.nt-st-row > * { padding: 7px 12px; text-align: right; white-space: nowrap; }
.nt-st-row > .nt-st-where { text-align: left; white-space: normal; position: relative; min-width: 0; }
.nt-st-head { background: var(--nt-wash); font-size: 12px; font-weight: 600; color: var(--nt-ink-2); }
.nt-st-lv0 { font-weight: 700; background: var(--nt-saffron-wash-2); }
.nt-st-lv1 .nt-st-where { font-weight: 600; }
.nt-st-lv2 .nt-st-where { padding-left: 34px; }
.nt-st-lv3 .nt-st-where { padding-left: 58px; color: var(--nt-ink-2); }
.nt-st-lv2 .nt-st-where::before, .nt-st-lv3 .nt-st-where::before, .nt-st-lv3 .nt-st-where::after {
  content: ""; position: absolute; top: 0; bottom: 0; width: 1px; background: var(--nt-rule); }
.nt-st-lv2 .nt-st-where::before { left: 19px; }
.nt-st-lv3 .nt-st-where::before { left: 19px; }
.nt-st-lv3 .nt-st-where::after { left: 43px; }
.nt-st-row.is-toggle { cursor: pointer; }
.nt-st-row.is-toggle:hover > *, .nt-st-lv3:hover > * { background: var(--nt-wash); }
.nt-st-twisty { border: 0; background: none; color: var(--nt-muted); width: 16px; padding: 0; margin-right: 2px; cursor: pointer; }
.nt-st-link { color: var(--nt-link); text-decoration: none; }
.nt-st-link:hover { text-decoration: underline; }
.nt-st-lv1 .nt-st-link, .nt-st-lv2 .nt-st-link { color: var(--nt-ink); }
.nt-st-pe { color: var(--nt-ink-2); }
.nt-st-flat { font-family: var(--nt-font-mono); font-size: 12px; }
.nt-st-items { margin-left: 6px; color: var(--nt-muted); font-size: 12px; }
.nt-st-loading { color: var(--nt-muted); padding: 7px 12px 7px 58px; display: block; }

/* The month's stacked bars: one column per delivery day, city segments. */
.nt-sales-chart { padding: 14px 16px; }
.nt-sales-bars { display: flex; align-items: flex-end; gap: 3px; height: 170px; border-bottom: 1px solid var(--nt-edge); }
.nt-sales-bar { flex: 1; min-width: 6px; height: 100%; display: flex; flex-direction: column-reverse; }
.nt-sales-bar i { display: block; min-height: 1px; }
.nt-sales-bar i + i { border-bottom: 1px solid var(--nt-shell); }
.nt-sales-xl { display: flex; gap: 3px; margin-top: 4px; font: 500 10px var(--nt-font-mono); color: var(--nt-muted); }
.nt-sales-xl span { flex: 1; min-width: 6px; text-align: center; }
.nt-sales-legend { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 8px; font-size: 12px; color: var(--nt-ink-2); }
.nt-sales-legend .nt-sales-aside { margin-left: auto; }
.nt-sales-table th[scope=row] { font-weight: 600; white-space: nowrap; }

.nt-sales-note { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 10px; margin-top: 4px; }
.nt-sales-note div { padding: 10px 12px; border: 1px solid var(--nt-line); border-radius: var(--nt-r-pane);
  background: var(--nt-shell); font-size: 12.5px; color: var(--nt-ink-2); }
.nt-sales-note b { display: block; color: var(--nt-ink); }

/* Bills on a bulk customer's page, Add bill, and Reports → Bulk accounts
   (rk, 2026-10-03). */
.nt-bills { margin-top: 1rem; }
.nt-bills .nt-lcard-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.nt-bills-add { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; }
.nt-bills-list { list-style: none; margin: 0; padding: 0; }
.nt-bill { display: grid; grid-template-columns: 8.5rem minmax(0, 1fr) 9rem 5.5rem; gap: 6px 14px; align-items: start;
           padding: 10px 14px; border-top: 1px solid var(--nt-line); }
.nt-bill-when { font-weight: 600; }
.nt-bill-when small { display: block; font-weight: 400; color: var(--nt-muted); font-size: 11.5px; }
.nt-bill-lines-table { width: 100%; font-size: 13px; border-collapse: collapse; }
.nt-bill-lines-table td { padding: 1px 6px 1px 0; }
.nt-bill-lines-table td.nt-num { text-align: right; white-space: nowrap; width: 1%; }
.nt-bill-money { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.nt-bill-photo { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 12px; }
.nt-bill-thumb img { width: 4.5rem; height: 4.5rem; object-fit: cover; border-radius: 6px; border: 1px solid var(--nt-line); }
.nt-bill-file { display: inline-block; padding: 1.2rem .4rem; border: 1px dashed var(--nt-line); border-radius: 6px; font-size: 11px; }
.nt-bill-nophoto { color: var(--nt-muted); }
.nt-bill-note { grid-column: 2 / -1; margin: 0; font-size: 12.5px; color: var(--nt-ink-2); }
@media (max-width: 640px) {
  .nt-bill { grid-template-columns: minmax(0, 1fr) auto; }
  .nt-bill-lines-table { grid-column: 1 / -1; }
  .nt-bill-note { grid-column: 1 / -1; }
}

.nt-bill-page { max-width: 44rem; }
.nt-bill-form { display: flex; flex-direction: column; gap: 12px; }
.nt-bill-form > label { display: flex; flex-direction: column; gap: 4px; max-width: 24rem; }
.nt-bill-lines { display: flex; flex-direction: column; gap: 6px; }
.nt-bill-lines legend { font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.nt-bill-line { display: grid; grid-template-columns: minmax(0, 2fr) 5.5rem 7rem 6.5rem 2rem; gap: 6px; align-items: center; margin-bottom: 6px; }
.nt-bill-line--head { font-size: 10.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--nt-muted); margin: 0; }
.nt-bill-line-amt { text-align: right; }
.nt-bill-x { border: 0; background: none; font-size: 18px; color: var(--nt-muted); line-height: 1; }
.nt-bill-x:hover { color: var(--nt-bad); }
.nt-bill-total { font-size: 16px; font-weight: 600; margin: 0; }
.nt-bill-dup { padding: 10px 12px; border-radius: var(--nt-r-ctl); background: var(--nt-wash-warn); border: 1px solid var(--nt-edge-warn); }
@media (max-width: 640px) {
  .nt-bill-line { grid-template-columns: minmax(0, 1fr) 4.5rem 5.5rem 1.5rem; }
  .nt-bill-line > label:first-child { grid-column: 1 / -1; }
  .nt-bill-line-amt { display: none; }
  .nt-bill-line--head { display: none; }
}

.nt-bulk-table td, .nt-bulk-table th { white-space: nowrap; }
.nt-bulk-table td.nt-bulk-cell a { display: block; color: inherit; text-decoration: none; }
.nt-bulk-table td.nt-bulk-cell a:hover { background: var(--nt-wash); }
.nt-bulk-cell small { display: block; color: var(--nt-muted); font-size: 11px; }
.nt-bulk-cell .nt-bulk-due { color: var(--nt-bad); }
.nt-bulk-table tr.nt-bulk-flag > * { background: var(--nt-wash-bad); }
.nt-bulk-table tr.nt-bulk-flag th[scope=row] { box-shadow: inset 3px 0 0 var(--nt-bad); }
.nt-bulk-table tfoot th, .nt-bulk-table tfoot td { font-weight: 600; border-top: 2px solid var(--nt-line); }
.nt-bulk-old { color: var(--nt-bad); font-weight: 600; }
.nt-bulk-links a { margin-right: 8px; font-size: 12px; }
.nt-bulk-range { display: flex; gap: 8px; align-items: end; flex-wrap: wrap; }
.nt-bulk-range label { display: flex; flex-direction: column; font-size: 12px; gap: 2px; }

/* The Bank page (BankController). */
.nt-bank-bar, .nt-bank-filters, .nt-bank-map { display: flex; gap: 10px; align-items: end; flex-wrap: wrap; margin-bottom: 12px; }
.nt-bank-filters label, .nt-bank-map label { display: flex; flex-direction: column; font-size: 12px; gap: 2px; }
.nt-bank-upload { display: flex; gap: 8px; align-items: center; margin-left: auto; max-width: 100%; }
.nt-bank-tabs { margin: 8px 0 14px; flex-wrap: wrap; }
.nt-bank-warn { color: var(--nt-bad); font-weight: 600; }
/* Bank-first (rk, 2026-10-04): how far the bank reaches, and what each uploaded file did. */
.nt-bank-fresh { display: flex; flex-direction: column; gap: 6px; margin: 0 0 12px; font-size: 13px; color: var(--nt-ink-2); }
.nt-bank-fresh-line { display: flex; flex-wrap: wrap; gap: 6px; }
.nt-bank-feed-results { list-style: none; padding-left: 12px; display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.nt-bank-upload .nt-lt-sub { white-space: nowrap; }
@media (max-width: 640px) { .nt-bank-upload { flex-wrap: wrap; } }
.nt-split { display: block; font-size: 11.5px; color: var(--nt-ink-2); font-weight: 400; white-space: nowrap; }
.nt-split b { color: var(--nt-ok); font-weight: 600; }
.nt-bank-diff-bad { color: var(--nt-bad); font-weight: 700; }
.nt-bank-off td { background-color: var(--nt-wash-brick); }
.nt-bank-ignored { margin-top: 12px; font-size: 13px; color: var(--nt-ink-2); }
.nt-bank-day { padding: 4px 0; }
.nt-bank-ref { white-space: nowrap; user-select: all; }

/* ---- Reports → Check sheet (rk, 2026-10-03): a day → city → sheet table
   for ticking against the paper records; clean A4 when printed. */
.nt-check-print-head { display: none; }
.nt-check-day { margin: 18px 0 26px; }
.nt-check-date { font-size: 17px; font-weight: 600; margin: 0 0 6px; }
.nt-check-table { font-size: 13px; }
.nt-check-table td, .nt-check-table th { vertical-align: top; }
.nt-check-city th { background: var(--nt-wash); font-size: 13px; }
.nt-check-sheet th { font-weight: 600; color: var(--nt-muted); }
.nt-check-sheet small { font-weight: 400; margin-left: 6px; }
.nt-check-row--unpaid td:nth-child(7) { color: var(--nt-bad); font-weight: 600; }
.nt-check-total th { border-top: 2px solid var(--nt-line); }
.nt-check-tick { width: 28px; }
.nt-check-box { display: none; width: 14px; height: 14px; border: 1px solid #000; }
.nt-check-ref { color: var(--nt-muted); font-size: 11px; }

@media print {
  @page { size: A4; margin: 12mm 10mm; }
  .nt-check .nt-page-head, .nt-check #check_filters { display: none !important; }
  .nt-check-print-head { display: block; font-size: 11px; margin: 0 0 6px; }
  .nt-check { color: #000; }
  .nt-check-table { font-size: 10.5px; width: 100%; }
  .nt-check-table td, .nt-check-table th { padding: 2px 4px; }
  .nt-check-box { display: inline-block; }
  .nt-check-city th { background: #eee !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .nt-check-row--unpaid td:nth-child(7) { color: #000; }
  .nt-check-table tr { break-inside: avoid; }
  .nt-check-day--long { break-before: page; }
  .nt-check-day--long:first-of-type { break-before: auto; }
  .nt-check-date { break-after: avoid; font-size: 14px; }
}

/* ---- Prepaid orders (mockup prepaid-order.html) ----
   The page takes the main column's whole width, as the sheet does; every
   form row is a 160px label column and one control column whose controls
   share its left edge, 36px high, wrapping inside it (min-width: 0 all the
   way down, so no control can push past the card). */
.nt-pp { min-width: 0; }
.nt-pp-filters { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin: 0; }
.nt-pp-filter { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 16px; border: 1px solid var(--nt-rule);
  background: var(--nt-shell); color: var(--nt-ink); font: 600 13px var(--nt-font-body); text-decoration: none; }
.nt-pp-filter[aria-pressed="true"] { background: var(--nt-spruce); color: var(--nt-shell); border-color: var(--nt-spruce); }
.nt-pp-filter-n { opacity: .7; font-variant-numeric: tabular-nums; }
.nt-pp-find { margin-left: auto; height: 32px; border: 1px solid var(--nt-rule); border-radius: 8px; padding: 0 10px; background: var(--nt-shell);
  color: var(--nt-ink); font: 14px var(--nt-font-body); width: 220px; max-width: 100%; }
.nt-pp-sum { padding: 12px 14px; border-radius: 10px; background: var(--nt-wash); display: flex; gap: 8px 14px; flex-wrap: wrap; align-items: center; }
.nt-pp-sum b { font-size: 20px; font-variant-numeric: tabular-nums; }
.nt-pp-sum span { color: var(--nt-muted); font-size: 13.5px; }
.nt-pp-right { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.nt-pp-tree { background: var(--nt-shell); border: 1px solid var(--nt-line); border-radius: 14px; padding: 8px 10px; }
.nt-pp-empty { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; padding: 22px 16px; color: var(--nt-ink-2); font-size: 15px; }
.nt-pp-rows { list-style: none; margin: 0 0 6px 40px; padding: 0; border-top: 1px solid var(--nt-line); }
.nt-pp-row { border-bottom: 1px solid var(--nt-line); }
.nt-pp-row-hit { display: grid; grid-template-columns: minmax(180px, 260px) minmax(0, 1fr) auto; gap: 4px 12px; align-items: center; padding: 9px 8px;
  color: var(--nt-ink); text-decoration: none; font-size: 14px; }
.nt-pp-row-hit:hover { background: var(--nt-wash); }
.nt-pp-row-who { font-weight: 600; }
.nt-pp-row-sub { color: var(--nt-muted); }
.nt-pp-row-tags, .nt-pp-r { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.nt-pp-tag { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 8px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.nt-pp-tag--ok { background: var(--nt-wash-ok); color: var(--nt-ok); }
.nt-pp-tag--skip { background: var(--nt-wash); color: var(--nt-muted); }
.nt-pp-tag--next, .nt-pp-tag--plan { background: var(--nt-wash-info); color: var(--nt-info); }
.nt-pp-note { color: var(--nt-muted); font-size: 13px; margin: 0; }
.nt-pp-hint { color: var(--nt-muted); font-size: 14px; margin: 4px 0 0; padding-left: 176px; }

/* One card: the form, the plan. */
.nt-pp-form, .nt-pp-plan { background: var(--nt-shell); border: 1px solid var(--nt-line); border-radius: 14px; padding: 18px 20px; min-width: 0; }
.nt-pp-body { display: block; min-width: 0; }
.nt-pp-sentence { color: var(--nt-bad); font-weight: 600; margin: 8px 0; }
.nt-pp-f { display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: 8px 16px; align-items: center; padding: 10px 0; border-top: 1px solid var(--nt-line); }
.nt-pp-f--first { border-top: 0; padding-top: 0; }
.nt-pp-f[hidden] { display: none; }
.nt-pp-f > label { font-weight: 600; font-size: 14px; }
.nt-pp-v { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; min-width: 0; }
.nt-pp-input { height: 36px; border: 1px solid var(--nt-rule); border-radius: 8px; padding: 0 10px; background: var(--nt-shell); color: var(--nt-ink);
  font: 15px var(--nt-font-body); min-width: 0; max-width: 100%; }
.nt-pp-input:focus { outline: 2px solid var(--nt-saffron-deep); outline-offset: 0; }
.nt-pp-grow-input { flex: 1 1 240px; }
.nt-pp-num { width: 72px; text-align: center; }
.nt-pp-pickbox { flex: 1 1 auto; min-width: 0; display: flex; }
.nt-pp-pickbox .nt-pp-input { width: 100%; }
.nt-pp-strip-who { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 0; padding: 10px 12px; margin: 4px 0 6px; border-radius: 10px; background: var(--nt-wash); font-size: 14px; }
.nt-pp-strip-who b { font-size: 16px; }
.nt-pp-strip-who > span::before { content: "·"; margin: 0 8px; color: var(--nt-muted); }
.nt-pp-strip-who > .nt-pp-ph { margin-left: 10px; }
.nt-pp-strip-who > .nt-pp-ph::before { content: none; }
.nt-pp-v .nt-ocard-ctr .nt-ocard-qty { height: 22px; }
.nt-pp-seg { display: inline-flex; flex-wrap: wrap; border: 1px solid var(--nt-rule); border-radius: 9px; overflow: hidden; max-width: 100%; }
.nt-pp-seg > button, .nt-pp-seg > label { display: inline-flex; align-items: center; height: 36px; padding: 0 12px; border: 0; border-left: 1px solid var(--nt-line);
  background: var(--nt-shell); color: var(--nt-ink); font: 600 14px var(--nt-font-body); cursor: pointer; margin: 0; }
.nt-pp-seg > :first-child { border-left: 0; }
.nt-pp-seg > button[aria-pressed="true"], .nt-pp-seg > label:has(input:checked) { background: var(--nt-spruce); color: var(--nt-shell); }
.nt-pp-seg > label input { position: absolute; opacity: 0; pointer-events: none; }
.nt-pp-seg > label:has(input:focus-visible) { outline: 2px solid var(--nt-saffron-deep); outline-offset: -2px; }
.nt-pp-dates { display: flex; gap: 6px; flex-wrap: wrap; min-width: 0; }
.nt-pp-date { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px; border: 1px solid var(--nt-rule); border-radius: 16px;
  font: 600 13.5px var(--nt-font-body); background: var(--nt-shell); color: var(--nt-ink); }
.nt-pp-date.is-next { border-color: var(--nt-spruce); box-shadow: inset 0 0 0 1px var(--nt-spruce); }
.nt-pp-date--add { border-style: dashed; color: var(--nt-link); cursor: pointer; }
.nt-pp-x { border: 0; background: none; color: var(--nt-muted); font-size: 15px; cursor: pointer; padding: 0; line-height: 1; }
.nt-pp-form .nt-pp-sum { margin-top: 12px; }
.nt-pp-form > .nt-pp-body > .nt-pp-note:last-child { margin-top: 10px; }
.nt-pp-b { display: inline-flex; align-items: center; justify-content: center; height: 36px; padding: 0 14px; border-radius: 9px; border: 1px solid var(--nt-rule);
  background: var(--nt-shell); color: var(--nt-ink); font: 600 14px var(--nt-font-body); cursor: pointer; text-decoration: none; list-style: none; white-space: nowrap; }
.nt-pp-b::-webkit-details-marker { display: none; }
.nt-pp-b.nt-pp-p { background: var(--nt-spruce); border-color: var(--nt-spruce); color: var(--nt-shell); }
.nt-pp-b:disabled { opacity: .55; cursor: default; }
.nt-pp-b.nt-pp-sm { height: 30px; padding: 0 10px; font-size: 13px; }
.nt-pp-b.nt-pp-quiet { color: var(--nt-muted); }
.nt-pp-inline { display: inline; margin: 0; }

/* One plan. */
.nt-pp-top { display: flex; align-items: baseline; gap: 6px 12px; flex-wrap: wrap; }
.nt-pp-flat { font-size: 26px; font-weight: 700; letter-spacing: -.01em; font-family: var(--nt-font-display); }
.nt-pp-name { font-size: 16px; font-weight: 600; color: var(--nt-ink); }
.nt-pp-ph { font: 500 12px var(--nt-font-mono); color: var(--nt-ink-2); background: var(--nt-wash); border-radius: 5px; padding: 1px 6px; }
.nt-pp-state { font-size: 12.5px; font-weight: 600; border-radius: 9px; padding: 3px 9px; background: var(--nt-wash-info); color: var(--nt-info); }
.nt-pp-state--waiting_payment { background: var(--nt-wash-warn); color: var(--nt-warn); }
.nt-pp-state--done { background: var(--nt-wash-ok); color: var(--nt-ok); }
.nt-pp-state--cancelled { background: var(--nt-wash); color: var(--nt-muted); }
.nt-pp-left { margin-left: auto; font-size: 14px; color: var(--nt-ink-2); }
.nt-pp-left b { font-size: 22px; color: var(--nt-ink); }
.nt-pp-bar { height: 8px; border-radius: 4px; background: var(--nt-wash); margin: 10px 0 14px; overflow: hidden; }
.nt-pp-bar i { display: block; height: 100%; background: var(--nt-spruce); border-radius: 4px; }
.nt-pp-from { display: flex; gap: 6px 14px; flex-wrap: wrap; color: var(--nt-muted); font-size: 13px; margin-bottom: 10px; }
.nt-pp-from a { color: var(--nt-link); font-weight: 600; text-decoration: none; }
.nt-pp-owe { color: var(--nt-warn); font-weight: 600; }
.nt-pp-advance { margin: 4px 0 14px; padding: 4px 14px 12px; border: 1.5px dashed var(--nt-saffron-deep); border-radius: 10px; }
.nt-pp-advance h3, .nt-pp-timeline h3 { margin: 10px 0 0; font-size: 15px; }
.nt-pp-advance .nt-pp-f:first-of-type { border-top: 0; }
.nt-pp-move-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.nt-pp-dl { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--nt-line); }
.nt-pp-dl-row { display: grid; grid-template-columns: 120px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--nt-line); font-size: 14.5px; }
.nt-pp-d { font-weight: 600; }
.nt-pp-s { color: var(--nt-muted); }
.nt-pp-dl-row--skipped .nt-pp-d, .nt-pp-dl-row--moved .nt-pp-d { color: var(--nt-muted); text-decoration: line-through; }
.nt-pp-move, .nt-pp-add { position: relative; display: inline-block; }
.nt-pp-move[open] .nt-pp-move-form { position: absolute; right: 0; top: calc(100% + 6px); z-index: 5; background: var(--nt-shell); border: 1px solid var(--nt-rule);
  border-radius: 10px; padding: 8px; box-shadow: var(--nt-shadow); }
.nt-pp-add[open] .nt-pp-move-form { margin-top: 8px; }
.nt-pp-foot { display: flex; gap: 8px; justify-content: flex-end; align-items: flex-start; margin-top: 12px; flex-wrap: wrap; }
.nt-pp-tl { list-style: none; margin: 8px 0 0; padding: 0; }
.nt-pp-tl li { display: grid; grid-template-columns: 150px minmax(0, 1fr) auto; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--nt-line); font-size: 14px; }
.nt-pp-tl-at { color: var(--nt-muted); font-variant-numeric: tabular-nums; }
.nt-pp-tl-by { color: var(--nt-muted); }
.nt-pp-strip { padding: 12px 16px; }
.nt-pp-strip-h { display: flex; align-items: center; gap: 12px; margin: 0 0 6px; font-size: 14px; }
.nt-pp-rows--flat { margin-left: 0; }
.nt-bulk-ahead { display: block; color: var(--nt-ok); font-size: 12px; font-weight: 600; }
@media (max-width: 640px) {
  .nt-pp-f { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .nt-pp-hint { padding-left: 0; }
  .nt-pp-form, .nt-pp-plan { padding: 14px; }
  .nt-pp-row-hit, .nt-pp-dl-row, .nt-pp-tl li { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .nt-pp-rows { margin-left: 8px; }
  .nt-pp-left { margin-left: 0; }
  .nt-pp-find { margin-left: 0; width: 100%; }
  .nt-pp-row-tags, .nt-pp-r { justify-content: flex-start; }
  .nt-pp-right { margin-left: 0; width: 100%; }
  .nt-pp-right > * { flex: 1 1 auto; }
  .nt-pp-seg > button, .nt-pp-seg > label { padding: 0 9px; }
}
.nt-pp-num-wide { width: 110px; }
.nt-pp-file { font: 14px var(--nt-font-body); max-width: 100%; }
.nt-pp-advance .nt-pp-use { margin: 8px 8px 0 0; }
.nt-pp-renews { margin: 6px 0; padding: 10px 12px; border-radius: 10px; background: var(--nt-wash-info); color: var(--nt-ink); font-size: 14px; }
.nt-pp-renews a { color: var(--nt-link); font-weight: 600; text-decoration: none; }
.nt-pp-link { color: var(--nt-link); font-weight: 600; text-decoration: none; }
.nt-pp-row--act { display: flex; align-items: center; gap: 8px; }
.nt-pp-row--act > .nt-pp-row-hit { flex: 1 1 auto; min-width: 0; }
.nt-pp-row--act > .nt-pp-b { margin-right: 8px; flex-shrink: 0; }
@media (max-width: 640px) { .nt-pp-row--act { flex-wrap: wrap; } .nt-pp-row--act > .nt-pp-b { margin: 0 8px 8px; } }

/* Row actions beside Edit (Members): a real button, and a quiet line saying
   why a record can't be removed. The in-row confirm opens under them. */
.nt-rowacts { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.nt-rowacts-note { font-size: 12px; color: var(--nt-muted); white-space: nowrap; }
.nt-rowacts-confirm { max-width: 360px; margin-top: 8px; white-space: normal; text-align: left; cursor: default; }
/* Customers: the row's ⋯ (owner, coordinator), its confirm under it.
   On a wide screen the confirm opens inside the row (the list scrolls in a
   box, which would clip a floating one); on a phone it floats over the card. */
.nt-ltable td.nt-cust-acts { position: relative; width: 1%; text-align: right; white-space: nowrap; }
.nt-ltable td.nt-cust-acts .nt-menu { display: inline-block; }
.nt-ltable td.nt-cust-acts .nt-menu-list { text-align: left; white-space: normal; min-width: 280px; }
.nt-ltable td.nt-cust-acts .nt-rowacts-confirm { width: 340px; margin-left: auto; }
@media (max-width: 640px) {
  table.nt-stack > tbody > tr > td.nt-cust-acts { position: absolute; top: 6px; right: 8px; width: auto; padding: 0; display: block; }
  table.nt-stack > tbody > tr > td.nt-cust-acts .nt-rowacts-confirm { position: absolute; top: 50px; right: 0; z-index: 15;
    width: calc(100vw - 48px); margin: 0; box-shadow: 0 6px 18px rgb(0 0 0 / .12); }
}
@media (max-width: 640px) {
  table.nt-stack td .nt-rowacts + .nt-rowacts-confirm { flex-basis: 100%; max-width: none; }
}

/* The all-cities tree (CityTreeHelper, rk 2026-10-07): always open, each
   level indented under a faint guide, the heads carrying counts and totals.
   The History tree's type and figures (theme.css .nt-htree-*), no folding. */
.nt-tree-root { display: flex; flex-direction: column; gap: 10px; }
.nt-tree { min-width: 0; }
.nt-tree-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; min-height: 34px; padding: 6px 8px 4px; }
.nt-tree--l1 > .nt-tree-head { padding-left: 0; }
.nt-tree-label { margin: 0; font-family: var(--nt-font-display); font-weight: 700; color: var(--nt-ink); line-height: 1.25; }
.nt-tree--l1 > .nt-tree-head .nt-tree-label { font-size: 17px; }
.nt-tree--l2 > .nt-tree-head .nt-tree-label { font-size: 14.5px; }
.nt-tree--l3 > .nt-tree-head .nt-tree-label { font: 600 13px var(--nt-font-body); }
.nt-tree-note { font-size: 12px; color: var(--nt-muted); }
.nt-tree-sub { display: inline-flex; flex-wrap: wrap; gap: 2px 0; font-size: 12px; color: var(--nt-muted); font-variant-numeric: tabular-nums; }
.nt-tree-sub > * + *::before { content: "·"; margin: 0 6px; }
.nt-tree-act { margin-left: auto; align-self: center; }
.nt-tree-open-form { display: inline; margin: 0; }
.nt-tree-open { height: 28px; }
.nt-tree-kids { display: flex; flex-direction: column; gap: 8px; min-width: 0; margin-left: 15px; padding: 2px 0 6px 14px; border-left: 1px solid var(--nt-rule); }
@media (max-width: 860px) {
  .nt-tree-kids { margin-left: 6px; padding-left: 8px; }
  .nt-tree-head { padding-left: 4px; padding-right: 4px; }
}
/* The Order Book's column header over a two-level tree: stepped in by both
   levels' indents so its labels stay over their columns. */
.nt-book-cols--tree2 { margin-left: 60px; }
/* ---- Order Book History (rk 2026-10-07) -------------------------------
   Under "All" the year › month › date › city tree is always open (no fold
   arrows) and every level steps in by the same --nt-ht-step at every width:
   year, month, date and city labels, then the lines, each one step further
   in, so a city never sits left of its date on a phone. --nt-ht-pad is the
   heads' own left padding. One city keeps theme.css's folding tree. */
.nt-book-history.is-city-tree { --nt-ht-step: 22px; --nt-ht-pad: 8px; }
.nt-book-history.is-city-tree > .nt-book-cols { margin-left: calc(4 * var(--nt-ht-step) + var(--nt-ht-pad)); }
.nt-book-history.is-city-tree .nt-htree.is-always-open > .nt-htree-head { cursor: default; background: none; padding-left: var(--nt-ht-pad); }
.nt-book-history.is-city-tree .nt-htree--month.is-always-open > .nt-htree-head { padding-left: calc(var(--nt-ht-step) + var(--nt-ht-pad)); }
.nt-book-history.is-city-tree .nt-htree--day.is-always-open > .nt-htree-head { padding-left: calc(2 * var(--nt-ht-step) + var(--nt-ht-pad)); }
.nt-book-history.is-city-tree .nt-htree--day.is-always-open > .nt-htree-kids {
  margin-left: calc(2 * var(--nt-ht-step) + var(--nt-ht-pad)); padding-left: calc(var(--nt-ht-step) - var(--nt-ht-pad) - 1px); }
.nt-book-history.is-city-tree .nt-htree-kids .nt-tree-head { padding-left: var(--nt-ht-pad); }
.nt-book-history.is-city-tree .nt-htree-kids .nt-tree-kids { margin-left: var(--nt-ht-pad); padding-left: calc(var(--nt-ht-step) - 1px); }
@media (max-width: 860px) {
  .nt-book-history.is-city-tree { --nt-ht-step: 10px; --nt-ht-pad: 6px; }
}
/* History's Kind / Outcome / Receipts filters: chips, not selects; a chip
   is a radio, applied as soon as it is picked. */
.nt-book-chips { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px; max-width: 100%; min-width: 0; }
.nt-book-chips-name { margin-right: 2px; font: 500 12.5px var(--nt-font-body); color: var(--nt-muted); }
.nt-book-chip { position: relative; display: inline-flex; align-items: center; margin: 0; }
.nt-book-chip input { position: absolute; opacity: 0; pointer-events: none; }
.nt-book-chip:hover { border-color: var(--nt-ink-2); color: var(--nt-ink); }
.nt-book-chip:has(input:checked) { border-color: var(--nt-spruce); background: var(--nt-spruce); color: var(--nt-shell); }
.nt-book-chip:has(input:focus-visible) { outline: 2px solid var(--nt-saffron-deep); outline-offset: 1px; }
/* ---- end Order Book History ------------------------------------------ */
/* Daily under "All": each city's sheets, one link each. */
.nt-day-all-rows { list-style: none; margin: 0; padding: 0; border: 1px solid var(--nt-rule); border-radius: var(--nt-r-pane, 12px); background: var(--nt-shell); overflow: hidden; }
.nt-day-all-rows > li + li { border-top: 1px solid var(--nt-line); }
.nt-day-all-row { display: grid; grid-template-columns: 112px minmax(0, 1fr) 110px 90px 80px 18px; align-items: center; gap: 10px; min-height: 46px; padding: 6px 14px; color: var(--nt-ink); text-decoration: none; }
.nt-day-all-row:hover { background: var(--nt-wash); color: var(--nt-ink); }
.nt-day-all-name { font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nt-day-all-fig { text-align: right; font-size: 13px; color: var(--nt-ink-2); }
.nt-day-all-go { color: var(--nt-muted); display: inline-flex; }
.nt-day-all-empty { margin: 0; padding: 8px 4px; font-size: 13px; color: var(--nt-muted); }
.nt-nudge-city { font-size: 14.5px; margin: 12px 0 4px; }
@media (max-width: 860px) {
  .nt-day-all-row { grid-template-columns: auto minmax(0, 1fr) 18px; grid-template-areas: "kind name go" "status figs figs"; row-gap: 4px; }
  .nt-day-all-kind { grid-area: kind; } .nt-day-all-name { grid-area: name; white-space: normal; }
  .nt-day-all-go { grid-area: go; } .nt-day-all-status { grid-area: status; }
  .nt-day-all-fig { grid-area: figs; text-align: left; }
  .nt-day-all-fig + .nt-day-all-fig { display: none; }
}
.nt-ops-all-cities { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 14px; }
/* A tree straight under the page head lines up with the head's own gutter. */
.nt-tree-pad, .nt-ops-all-cities { padding: 0 16px; }
/* Customers under "All": each city's head row is the tree's city level. */
table .nt-tree-row > th { padding: 14px 8px 6px; background: var(--nt-shell); border-bottom: 1px solid var(--nt-rule); }
table .nt-tree-row .nt-tree-label { font-size: 15px; margin-right: 10px; }
table tbody.nt-cust-city-rows > tr > td:first-child { padding-left: 22px; }
.nt-cust-more-body td { padding: 0; border: 0; }
@media (max-width: 860px) {
  /* customers-payments: a phone keeps a smaller indent, never none. */
  table tbody.nt-cust-city-rows > tr > td:first-child { padding-left: 14px; }
  table.nt-stack .nt-tree-row, table.nt-stack .nt-tree-row > th { display: block; }
  table.nt-stack .nt-cust-more-body tr, table.nt-stack .nt-cust-more-body td { display: block; }
}
/* Payments under "All": date rows, then city rows, then the payments. */
table .nt-tree-row--l1 > th { padding-top: 16px; }
table .nt-tree-row--l1 .nt-tree-label { font-size: 16px; }
table .nt-tree-row--l2 > th { padding-left: 22px; padding-top: 10px; }
table .nt-tree-row--l2 .nt-tree-label { font-size: 14px; }
table.is-city-tree tbody > tr.nt-payr-row > td:first-child { padding-left: 38px; }
@media (max-width: 860px) {
  table.is-city-tree tbody > tr.nt-payr-row > td:first-child { padding-left: 26px; }
  table .nt-tree-row--l2 > th { padding-left: 16px; }
}
/* ---- customers-payments: the All-cities tree on a phone (rk 2026-10-07).
   A stacked table (.nt-stack, under 640px) makes each row a block card, so
   the indent moves onto the card: city rows (Customers, Communities) step in
   one level, Payments' city heads one and its payments two. Smaller than on
   a wide screen, but each level still visibly steps in. ---- */
@media (max-width: 640px) {
  table.nt-stack > tbody.nt-cust-city-rows > tr { padding-left: 28px; }
  table.nt-stack > tbody.nt-cust-city-rows > tr > td:first-child { padding-left: 0; }
  table.nt-stack > tbody > tr.nt-tree-row--l2 { padding-left: 26px; }
  table.nt-stack.is-city-tree > tbody > tr.nt-payr-row { padding-left: 38px; }
}
/* ---- customers-payments: Payments on a phone (rk 2026-10-07). The list
   stacks into cards (.nt-stack): each field on its own line, its label in a
   fixed left column, the value wrapping beside it, so nothing scrolls
   sideways at 400px. ---- */
@media (max-width: 640px) {
  table.nt-stack.nt-payr-table > tbody > tr.nt-payr-row > td {
    display: block; position: relative; min-height: 22px;
    padding: 3px 0 3px 84px; text-align: left; white-space: normal; overflow-wrap: anywhere;
  }
  table.nt-stack.nt-payr-table > tbody > tr.nt-payr-row > td:empty { display: none; }
  table.nt-stack.nt-payr-table > tbody > tr.nt-payr-row > td[data-label]::before {
    position: absolute; left: 0; top: 5px; width: 78px;
  }
  table.nt-stack.nt-payr-table .nt-payr-when .nt-lt-sub { display: inline; margin-left: 6px; }
  table.nt-stack.nt-payr-table .nt-payr-ev { max-width: none; }
  table.nt-stack.nt-payr-table .nt-payr-alloc a { min-height: 0; display: inline; }
  table.nt-stack.nt-payr-table .nt-chip { white-space: normal; }
  table.nt-stack.nt-teamcash-table td, table.nt-stack.nt-teamcash-table th { white-space: normal; }
  /* The cards flow in the page, as Customers' do; no inner scroll box. */
  .nt-payr-list > .table-scroll { max-height: none; overflow: visible; }
}
table .nt-tree-row .nt-tree-sub { font-weight: 400; text-transform: none; letter-spacing: 0; }
/* Chats under "All": one scrolling tree, each city a head over its chats. */
.nt-wa-side .nt-chats-tree { flex: 1; min-height: 0; overflow-y: auto; }
.nt-wa-side .nt-chats-tree .nt-chats { flex: none; overflow: visible; margin-left: 10px; border-left: 1px solid var(--nt-rule); }
.nt-chats-city-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 8px; margin: 0; padding: 12px 12px 6px; font-size: 14.5px; }
/* Review under "All": a head over each city's questions. */
.nt-rv-city { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 8px; margin: 0; padding: 12px 10px 6px; font-size: 14.5px; }

/* The report pages under All (rk 2026-10-07): a tree head's "Open <city>"
   is for the screen, and on paper the Check sheet's tree drops its guides. */
.nt-check-table--total { margin-top: 2px; }
@media print {
  .nt-tree-act { display: none !important; }
  .nt-check .nt-tree-kids { border-left: 0; margin-left: 0; padding-left: 0; }
}

/* ==== Daily + Operations at phone width (rk, 2026-10-07) ====================
   At 400px Daily scrolled sideways (478px): the head's aside (the autopilot
   chip, "N to review") and its buttons now wrap and shrink; the phone's two
   big buttons bleed only as far as the 14px page gutter; and on these pages
   the city switcher wraps inside the top bar instead of clipping its last
   city. Scoped to #today_head / #operations_head so other pages are untouched. */
#today_head .nt-page-head-actions,
#operations_head .nt-page-head-actions { flex-wrap: wrap; min-width: 0; max-width: 100%; }
#today_head .nt-ap-behind { max-width: 100%; }
.nt-meter-stock .nt-ocards-chips { min-width: 0; }
@media (max-width: 860px) {
  #today_head .nt-page-head-title,
  #operations_head .nt-page-head-title { flex: 1 1 100%; }
  #today_head .nt-page-head-actions,
  #operations_head .nt-page-head-actions { margin-left: 0; row-gap: 6px; }
  #today_head .nt-ap-behind { white-space: normal; }
  .nt-phone-acts { margin-left: -14px; margin-right: -14px; padding-left: 14px; padding-right: 14px; }
  body:has(#today_head, #operations_head) .nt-topbar { flex-wrap: wrap; height: auto; min-height: 52px; padding-top: 6px; padding-bottom: 6px; row-gap: 6px; }
  body:has(#today_head, #operations_head) .nt-city-switch { flex-wrap: wrap; overflow: visible; }
}
/* ==== end Daily + Operations at phone width ================================ */

/* ==== Expenses register + Communities list (expenses-communities, rk 2026-10-07) ====
   The expense form and filters have no native select: short choices are
   segmented buttons (.nt-pp-seg), long ones a typeahead (option_pick).
   Every control is labelled above it; buttons wrap rather than clip. On a
   phone the Add form folds behind its own "Add expense" button, the register
   has no inner scroll box, and the Communities table stacks as cards. */
.nt-xf { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.nt-xf-grid { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: flex-end; min-width: 0; }
.nt-xf-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; max-width: 100%; margin: 0; padding: 0; border: 0; }
.nt-xf-label { float: none; width: auto; margin: 0; padding: 0; font-size: 12px; font-weight: 600; color: var(--nt-ink-2); line-height: 1.3; }
.nt-xf .nt-pp-seg > label { height: auto; min-height: 36px; padding: 4px 12px; font-size: 13.5px; white-space: normal; line-height: 1.2; flex-direction: row; gap: 0; }
.nt-xf-seg { align-self: flex-start; }
.nt-xf-pick { width: 260px; max-width: 100%; }
.nt-xf-pick .nt-pp-input { width: 100%; }
.nt-xf-pick .nt-buyer-option[hidden] { display: none; }
.nt-xf-wide { flex: 1 1 260px; }
.nt-xf-wide .nt-pp-input { width: 100%; }
.nt-xf-check { display: flex; gap: 6px; align-items: center; font-size: 13px; }
.nt-xf-foot { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.nt-xf-foot .nt-note { flex-basis: 100%; margin: 0; }
.nt-xf .nt-lbtn { min-height: 36px; }
.nt-xreg-filters.nt-xf { flex-direction: column; align-items: stretch; margin: 0; }
.nt-xreg-filters .nt-xf-dates { align-items: flex-end; }
.nt-xf-months { display: flex; gap: 8px; flex-wrap: wrap; }
.nt-xadd { padding: 12px 14px; border-bottom: 1px solid var(--nt-line); }
.nt-xadd-toggle { display: none; }
.nt-xadd-title { margin-bottom: 10px; }
.nt-xreg tr.nt-xreg-form > td { padding: 12px 14px; background: var(--nt-wash); }
table.is-city-tree.nt-xreg tbody > tr.nt-xreg-row > td:first-child { padding-left: 38px; }
@media (max-width: 860px) {
  table.is-city-tree.nt-xreg tbody > tr.nt-xreg-row > td:first-child { padding-left: 8px; }
}
@media (max-width: 640px) {
  .nt-xadd-title { display: none; }
  .nt-xadd-toggle { display: inline-flex; justify-content: center; width: 100%; min-height: 44px; }
  .nt-xadd-switch:checked + .nt-xadd-toggle { border-color: var(--nt-spruce); background: var(--nt-spruce); color: #fff; }
  .nt-xadd-switch:focus-visible + .nt-xadd-toggle { outline: 2px solid var(--nt-saffron-deep); outline-offset: 2px; }
  .nt-xadd-body { display: none; margin-top: 12px; }
  .nt-xadd-switch:checked ~ .nt-xadd-body, .nt-xadd:target .nt-xadd-body, .nt-xadd-body.is-open { display: block; }
  .nt-xf-grid > .nt-xf-field { flex: 1 1 140px; }
  /* A long control gets the whole line: the typeaheads, Notes, and the file
     picker (whose "No file chosen" was cut short beside Notes). */
  .nt-xf-grid > .nt-xf-fieldset, .nt-xf-pick, .nt-xf-grid > .nt-xf-wide,
  .nt-xf-grid > .nt-xf-field:has(.nt-xf-pick), .nt-xf-grid > .nt-xf-field:has(.nt-pp-file) { flex-basis: 100%; width: 100%; }
  .nt-xf .nt-lbtn, .nt-xf .nt-pp-seg > label { min-height: 44px; }
  .nt-xf-go { flex: 1 1 auto; justify-content: center; }
  /* No inner scroll box: the register runs down the page. */
  .nt-xreg-page .table-scroll { max-height: none; overflow: visible; }
  .nt-xreg-page table.nt-stack, .nt-community-list table.nt-stack { display: block; overflow: visible; white-space: normal; }
  table.nt-xreg > tbody > tr.nt-xreg-form > td { display: block; text-align: left; padding: 10px 0; background: transparent; }
  table.nt-xreg > tbody > tr.nt-xreg-form > td::before { display: none; }
  /* Communities: a card a community. */
  .nt-community-list { overflow-x: visible; }
  .nt-community-list table.nt-stack > tbody > tr > td.nt-lt-name { font-size: 15px; }
}
/* ==== end Expenses register + Communities list ==== */
