/* Admin Console -> Email configuration -> Inbound Tasks by Email: the regions of `#ecfgInboundPanel` toggled by wireOutboundLocalTabs()
   (admin-email.js); behaviour in admin-inbound-email.js. Reuses the outbound side's rows (`.smtp-team`), `.pref-switch`/`.track`/`.knob`
   and `.bench-*` (alt-admin-email.css); the shared parts are `.a-stat`, `.a-chip-st`, `.a-notice`, `.a-table`, `.a-code`
   (alt-admin-components.css). Token-only, so a size or a colour here is the control specification's. */

/* `.inb-panel`, not `.sec-section`: admin-paneling.test.js counts `sec-section` inside `#smtpPane` and asserts exactly 4. Run that
   suite after any change here. A panel is a container: radius 14 (DS-05). */
.inb-panel{
  min-width: 0;
  background: var(--a-panel);
  border: 1px solid var(--a-line-soft);
  border-radius: var(--a-r-lg);
  padding: var(--a-sp-16);
}
.inb-panel-head{
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: var(--a-sp-12); margin-bottom: var(--a-sp-4);
}
/* A band heading is the overlay title (DS-A13): one heading level per pane. */
.inb-panel-head h3{
  margin: var(--a-sp-2) 0 var(--a-sp-6);
  font-family: var(--a-display); font-size: var(--a-fs-16); font-weight: 600; line-height: var(--a-lh-tight); color: var(--a-text);
}

/* The service state chip keeps its width: a chip is capped at 170px with overflow hidden, and beside a heading it was cut mid-word. */
.inb-panel-head > .a-chip{ flex: 0 0 auto; max-width: none; }

/* Two columns above 1180px: access+audit (left, wants width) and service+bench (right). Below that, DOM order already reads
   service, access, audit, bench. The 2fr column comes first so the dense audit table gets the wide side and the forms get the
   300px-floor side. */
.inb-grid{
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--a-sp-16);
}
.inb-col{ display: flex; flex-direction: column; gap: var(--a-sp-16); min-width: 0; }
@media (min-width: 1181px){
  .inb-grid{ grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr); }
  /* Columns are placed explicitly so a markup reorder cannot silently move one; it also gives `.inb-col-main` and `.inb-col-side` a
     rule, which admin-inbound-panel.test.js requires for every emitted class. */
  .inb-col-main{ grid-column: 1; }
  .inb-col-side{ grid-column: 2; }
}

/* The inbound address: a copyable value in a box wide enough that an address never wraps. The address itself is `.a-code`. */
.inb-address{
  display: flex; align-items: center; justify-content: space-between; gap: var(--a-sp-8);
  margin: var(--a-sp-12) 0; padding: var(--a-sp-8) var(--a-sp-12);
  background: var(--a-raised); border: 1px solid var(--a-line-soft); border-radius: var(--a-r-sm);
}
.inb-address code{ min-width: 0; overflow-wrap: anywhere; }

/* A label above a full-width control: the subject and message pair, and the mode strips. The label is `.a-eyebrow`. */
.inb-field{ display: grid; gap: var(--a-gap-label); margin: var(--a-sp-12) 0; }
.inb-field textarea{ resize: vertical; min-height: calc(var(--a-ctl) * 2); }

/* The ledger table is `.a-table`; these two are inbound-only reading aids under a sender or a result. */
.inb-sub{ margin-top: var(--a-sp-2); font-size: var(--a-fs-12); line-height: var(--a-lh-ui); color: var(--a-faint); overflow-wrap: anywhere; }

/* Org grouping sits inside a panel, not at the pane's own left margin: `.group-head-sub`'s top margin was measured for the Boards
   pane, which does not already open with its own gap. */
.inb-panel > .group-head-sub:first-child{ margin-top: 0; }

/* ================= Sender verification: held mail, allowed domains, mode =================
   The three surfaces admin-inbound-email.js builds in script. `hidden` must win over any display a rule here sets. */
.inb-panel [hidden]{ display: none !important; }

/* The domain leads the sender cell: it is the decision, the address only says which member. */
.inb-panel .inb-domain{ font-size: var(--a-fs-13); font-weight: 600; line-height: var(--a-lh-ui); color: var(--a-text); overflow-wrap: break-word; }
.inb-panel .inb-subject{ overflow-wrap: anywhere; }
.inb-panel .inb-used{ color: var(--a-dim); }
.inb-panel .inb-note{ margin: var(--a-sp-8) 0; }

/* A count beside the heading: the count chip, which is quiet at zero and hidden when there is nothing waiting. */
.inb-count-badge{ flex: 0 0 auto; }

/* The why-held cell: the reason, the three verdicts, then the actions. */
.inb-panel .inb-why{ margin: 0 0 var(--a-sp-6); font-size: var(--a-fs-12); line-height: var(--a-lh-ui); color: var(--a-dim); }
.inb-panel .inb-why-disabled{ margin: var(--a-sp-6) 0 0; font-size: var(--a-fs-12); line-height: var(--a-lh-ui); color: var(--a-faint); }

.inb-verdicts{ display: flex; flex-wrap: wrap; gap: var(--a-sp-4); margin-bottom: var(--a-sp-8); }

.inb-row-actions{ display: flex; flex-wrap: wrap; align-items: center; gap: var(--a-sp-6); }

/* Each item is its own <tbody>: the row and its hidden two-step confirm. */
.inb-item + .inb-item > tr:first-child > td{ border-top: 1px solid var(--a-line-soft); }
tr.inb-confirm > td{ padding: 0; }
.inb-confirm-body{
  margin: var(--a-sp-6) 0 var(--a-sp-12); padding: var(--a-sp-12);
  background: var(--a-raised); border: 1px solid var(--a-line-soft); border-radius: var(--a-r-sm);
}
.inb-confirm-body .inb-why{ margin-bottom: var(--a-sp-8); }
.inb-panel > .inb-confirm-body{ margin: var(--a-sp-8) 0 0; }

/* Narrow tables scroll inside `.a-table-wrap`, never the page. */
#inboundHeldTable{ min-width: 720px; }
/* Floors for the narrow columns, or the domain breaks mid-word and the date wraps to three lines. */
#inboundHeldTable th:nth-child(1), #inboundHeldTable td:nth-child(1){ min-width: 96px; }
#inboundHeldTable th:nth-child(2), #inboundHeldTable td:nth-child(2){ min-width: 200px; }
#inboundHeldTable th:nth-child(4), #inboundHeldTable td:nth-child(4){ min-width: 260px; }
.inb-panel .a-table td{ vertical-align: top; }

/* Add-domain row: the domain field takes the room, the optional reason wraps below it when tight. */
.inb-add-row{ margin-top: var(--a-sp-12); align-items: stretch; }
.inb-add-row input{ flex: 1 1 140px; min-width: 0; }

/* The mode strips sit in the service panel's narrow column, so they may wrap instead of squeezing. The bench's four-mode strip
   (#inboundBenchTabs) sits in the same column: unwrapped, its nowrap segments set the column's min-content and the whole pane
   scrolled sideways. */
.a-seg-ctl.inb-mode, #inboundBenchTabs{ flex-wrap: wrap; height: auto; min-height: var(--a-ctl); }
.a-seg-ctl.inb-mode > .a-tab, #inboundBenchTabs > .a-tab{ height: auto; padding-top: var(--a-sp-6); padding-bottom: var(--a-sp-6); }
.inb-verify{ margin-top: var(--a-sp-4); }
.inb-verify .inb-field input[type="number"]{ width: 90px; }

/* The domains table lives in the narrow service column, so it fits the column instead of scrolling: the Used cell wraps and the
   Remove cell is the table's own action cell (`td.act`), as wide as its button. */
#inboundDomainsTable{ min-width: 0; width: 100%; }

/* THE HELD TABLE IS WIDER THAN A PHONE AND SCROLLS INSIDE ITS OWN BOX, so an in-row confirm that spans it would open out of sight.
   Pinned to the scroller's left edge and capped to the viewport, it stays readable wherever the table happens to be scrolled. */
#inboundHeldTable .inb-confirm-body{
  position: sticky; left: 0; box-sizing: border-box;
  width: max-content; max-width: min(100%, calc(100vw - 72px));
}
