/* =====================================================================
   Screen layouts (page-specific grids). Components live in app.css.
   ===================================================================== */

/* ---- Inbox ---------------------------------------------------------- */
.inbox-panes { grid-template-columns: 360px minmax(0, 1fr) 300px; }
.inbox-panes .ctx-pane { background: var(--color-surface); }
.thread-head { height: auto; min-height: var(--pane-header-h); padding: var(--space-2) var(--space-4); }
.thread-head .th-title { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.thread-head .th-sub { font-size: var(--text-xs); color: var(--color-ink-3); }
.list-filter { display: flex; align-items: center; gap: var(--space-2); padding: var(--space-2) var(--space-4); border-bottom: 1px solid var(--color-line); flex: none; }
.form-fields { display: grid; grid-template-columns: 160px minmax(0,1fr); gap: var(--space-2) var(--space-4); padding: 0 var(--space-4) var(--space-4) calc(var(--space-4) + 32px + var(--space-3)); margin: 0; }
.form-fields dt { color: var(--color-ink-3); font-size: var(--text-sm); }
.form-fields dd { margin: 0; }
.queued-msg { opacity: .8; }
@media (max-width: 1199px) { .inbox-panes { grid-template-columns: 320px minmax(0, 1fr); } .inbox-panes .ctx-pane { display: none; } }
@media (max-width: 1023px) and (min-width: 768px) { .inbox-panes { grid-template-columns: 292px minmax(0, 1fr); } }
@media (max-width: 767px) {
  .inbox-panes .list-pane { display: flex; }
  .inbox-panes .thread-pane { display: none; }
  .is-detail .inbox-panes .list-pane { display: none; }
  .is-detail .inbox-panes .thread-pane { display: flex; }
  .thread-head { padding: 0 var(--space-2); gap: var(--space-1); }
  .form-fields { grid-template-columns: 1fr; gap: 2px; padding: 0 var(--space-4) var(--space-4); }
  .form-fields dd { margin-bottom: var(--space-2); }
  .reply-as { padding: var(--space-1) var(--space-2); }
}

/* ---- Contacts ------------------------------------------------------- */
.contact-wrap { flex: 1; min-height: 0; display: grid; grid-template-columns: 340px minmax(0, 1fr); }
.contact-side { border-right: 1px solid var(--color-line); overflow: auto; padding: var(--space-5); display: flex; flex-direction: column; gap: var(--space-5); }
.contact-main { overflow: auto; min-height: 0; }
.contact-main-inner { max-width: 760px; padding: var(--space-5); display: flex; flex-direction: column; gap: var(--space-4); }
.c-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-2); }
.c-actions .btn { flex-direction: column; height: 60px; gap: 4px; font-size: var(--text-sm); }
.note-box { border: 1px solid var(--color-control-border); border-radius: var(--radius-md); }
.note-box textarea { border: 0; width: 100%; resize: none; padding: var(--space-3); min-height: 52px; font-size: var(--text-md); border-radius: var(--radius-md); }
.note-box textarea:focus { outline: none; box-shadow: none; }
.contact-tabs { display: none; }
@media (max-width: 1023px) { .contact-wrap { grid-template-columns: 300px minmax(0,1fr); } }
@media (max-width: 1023px) {
  .contact-wrap { display: flex; flex-direction: column; overflow: auto; gap: var(--space-4); padding-bottom: var(--space-6); }
  .contact-side, .contact-main { display: contents; }
  .contact-wrap .c-ident { order: 1; padding: var(--space-4) var(--space-4) 0; }
  .contact-wrap .c-actions { order: 2; padding: 0 var(--space-4); }
  .contact-wrap .contact-tabs { order: 3; }
  .contact-wrap [data-ctab] { order: 4; padding: 0 var(--space-4); }
  .contact-main-inner { padding: 0 var(--space-4); max-width: none; }
  .contact-tabs { display: flex; position: sticky; top: 0; background: var(--color-surface); z-index: 2; }
  .c-actions .btn { height: 64px; font-size: var(--text-md); }
  [data-ctab]:not(.is-on) { display: none; }
  .contact-wrap [data-ctab], .contact-wrap .c-ident, .contact-wrap .c-actions { width: 100%; max-width: 760px; }
  .contact-wrap .c-actions { max-width: 520px; }
}

/* ---- Deals ---------------------------------------------------------- */
.stage-strip { display: none; }
.deal-phone-list { display: none; }
@media (max-width: 767px) {
  .board.desk-board { display: none; }
  .stage-strip { display: flex; gap: var(--space-2); overflow-x: auto; padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--color-line); flex: none; scrollbar-width: none; background: var(--color-surface); }
  .stage-strip::-webkit-scrollbar { display: none; }
  .stage-chip { flex: none; display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 var(--space-3); border-radius: var(--radius-pill); border: 1px solid var(--color-line-strong); background: var(--color-surface); font-size: var(--text-md); font-weight: var(--weight-medium); color: var(--color-ink-2); white-space: nowrap; text-decoration: none; }
  .stage-chip[aria-current="true"] { background: var(--color-ink); color: #fff; border-color: var(--color-ink); }
  .stage-chip .n { font-size: var(--text-xs); opacity: .8; }
  .deal-phone-list { display: flex; flex-direction: column; gap: var(--space-2); padding: var(--space-3) var(--space-4) var(--space-5); overflow: auto; flex: 1; min-height: 0; background: var(--color-canvas); }
  .deal-phone-list .dcard { padding: var(--space-4); }
}

/* ---- Documents list -------------------------------------------------- */
.docs-table td .num-cell { font-weight: var(--weight-semibold); font-variant-numeric: tabular-nums; }
.doc-cards { display: none; }
@media (max-width: 767px) {
  .docs-table { display: none; }
  .doc-cards { display: block; }
  .doc-card { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 2px var(--space-3); padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--color-line); text-decoration: none; color: inherit; }
  .doc-card:hover { text-decoration: none; background: var(--color-surface-2); }
}

/* ---- Document editor -------------------------------------------------- */
.ed-head { height: auto; min-height: 64px; padding: var(--space-2) var(--space-5); gap: var(--space-3); flex-wrap: nowrap; }
.ed-head .ed-title { display: flex; flex-direction: column; min-width: 0; }
.ed-head .ed-title .t { font-size: var(--text-xl); line-height: var(--lh-xl); font-weight: var(--weight-semibold); }
.line-card { display: none; }
@media (max-width: 1023px) { .ed-head { padding: var(--space-2) var(--space-4); } .ed-head .hide-md { display: none; } }
@media (max-width: 1023px) {
  .lines { display: none; }
  .doc-sec .grid-2 { grid-template-columns: 1fr; }
  .line-card { display: block; border: 1px solid var(--color-line); border-radius: var(--radius-md); padding: var(--space-3); margin-bottom: var(--space-2); }
  .line-card .lc-top { display: flex; gap: var(--space-3); align-items: flex-start; }
  .line-card .lc-meta { display: flex; gap: var(--space-2); flex-wrap: wrap; margin-top: var(--space-2); font-size: var(--text-md); color: var(--color-ink-2); }
}

/* ---- Bookings --------------------------------------------------------- */
.bk-wrap { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 380px; }
.bk-cal { overflow: auto; min-height: 0; }
.bk-side { border-left: 1px solid var(--color-line); overflow: auto; min-height: 0; display: flex; flex-direction: column; }
.bk-agenda { display: none; }
@media (max-width: 1199px) { .bk-wrap { grid-template-columns: minmax(0, 1fr); } .bk-side { display: none; } }
@media (max-width: 1023px) { .bk-wrap { grid-template-columns: minmax(0, 1fr); } .bk-side { display: none; } }
@media (max-width: 767px) {
  .bk-cal { display: none; }
  .bk-agenda { display: block; overflow: auto; flex: 1; min-height: 0; }
  .bk-wrap { display: flex; flex-direction: column; }
}

/* ---- Calls ------------------------------------------------------------ */
.calls-wrap { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 380px; }
.calls-log { overflow: auto; min-height: 0; }
.dialler { border-left: 1px solid var(--color-line); overflow: auto; min-height: 0; padding: var(--space-5); display: flex; flex-direction: column; gap: var(--space-4); background: var(--color-surface); }
.call-row { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto auto; gap: var(--space-3); align-items: center; padding: var(--space-3) var(--space-5); border-bottom: 1px solid var(--color-line); text-decoration: none; color: inherit; }
.call-row:hover { background: var(--color-surface-2); text-decoration: none; }
.call-row .cr-who { font-weight: var(--weight-medium); }
.call-row.missed .cr-who { color: var(--color-bad); font-weight: var(--weight-semibold); }
.call-row .cr-line { font-size: var(--text-xs); color: var(--color-ink-3); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.fab { display: none; }
@media (max-width: 1023px) { .calls-wrap { grid-template-columns: minmax(0, 1fr) 340px; } .dialler { padding: var(--space-4); } }
@media (max-width: 767px) {
  .calls-wrap { display: flex; flex-direction: column; position: relative; }
  .calls-log { flex: 1; }
  .dialler { display: none; border: 0; }
  .is-dial .dialler { display: flex; flex: 1; padding: var(--space-4); }
  .is-dial .calls-log { display: none; }
  .call-row { grid-template-columns: 32px minmax(0, 1fr) auto; padding: var(--space-3) var(--space-4); }
  .call-row .cr-dur { display: none; }
  .fab { display: inline-flex; position: absolute; right: var(--space-4); bottom: var(--space-4); width: 56px; height: 56px; border-radius: 50%; background: var(--color-call); color: #fff; border: 0; align-items: center; justify-content: center; box-shadow: var(--shadow-2); }
  .is-dial .fab { display: none; }
}

/* ---- Orders ----------------------------------------------------------- */
@media (max-width: 767px) { .orders-table { display: none; } }
.composer-box { position: relative; }
.list-pane { position: relative; }
.thread-head { height: var(--pane-header-h); }

.contact-side .dl { grid-template-columns: 72px minmax(0, 1fr); }
.contact-side { padding-bottom: var(--space-7); }
@media (max-width: 767px) {
  .tl-head .meta { display: none; }
  .act-filter { display: flex; width: 100%; } .act-filter button { flex: 1; justify-content: center; }
  .contact-wrap .contact-side .dl { grid-template-columns: 1fr; }
}
/* deals board */
.board { align-items: stretch; position: relative; }
.col { flex: 0 0 252px; width: 252px; min-width: 0; max-height: none; }
.col.is-collapsed { flex: 0 0 48px; width: 48px; }
.dcard { min-width: 0; }
.board::-webkit-scrollbar { height: 12px; }
.board::-webkit-scrollbar-track { background: var(--color-canvas); }
.board::-webkit-scrollbar-thumb { background: var(--color-line-strong); border-radius: 6px; border: 3px solid var(--color-canvas); }
.board { scrollbar-color: var(--color-line-strong) var(--color-canvas); }
.board-wrap { position: relative; flex: 1; min-height: 0; display: flex; }
.board-wrap::after { content: ""; position: absolute; top: 0; right: 0; bottom: 0; width: 40px; pointer-events: none; background: linear-gradient(to right, rgba(245,246,248,0), var(--color-canvas)); }
.dcard .dc-value .meta { font-weight: var(--weight-regular); }
@media (max-width: 767px) { .board-wrap { display: none; } .stage-strip { -webkit-mask-image: linear-gradient(to right, #000 85%, transparent); mask-image: linear-gradient(to right, #000 85%, transparent); } }
/* editor */
.lines tr.line td.amt { padding-top: 16px; }
.lines tr.line td.drag { padding-top: 16px; }
@media (max-width: 767px) { .doc-sheet .textarea { resize: none; } .doc-actions-phone { padding-left: var(--space-4); padding-right: var(--space-4); align-items: center; } .doc-actions-phone .ptotal { flex: 1; display: flex; flex-direction: column; } .doc-actions-phone .btn { flex: none; } }

.dial-wrap { display: flex; align-items: center; gap: var(--space-2); border-bottom: 1px solid var(--color-control-border); padding-bottom: var(--space-1); }
.dial-wrap:focus-within { border-bottom-color: var(--color-accent); }
.dial-wrap .dial-display:focus { outline: none; box-shadow: none; }
.dial-display::placeholder { color: var(--color-ink-3); font-weight: 500; font-size: var(--text-xl); }
.in-call .dialler > *:not(.in-call-note) { opacity: .45; pointer-events: none; }
.callcard { width: 340px; right: 20px; bottom: 20px; }
@media (prefers-reduced-motion: no-preference) {
  .avatar.ring { animation: ring 1.6s ease-out infinite; }
  @keyframes ring { 0% { box-shadow: 0 0 0 0 rgba(19,128,74,.55); } 100% { box-shadow: 0 0 0 28px rgba(19,128,74,0); } }
}
.avatar.ring { box-shadow: 0 0 0 6px rgba(19,128,74,.35); }
@media (max-width: 767px) { .callscreen .avatar.xl { --av: 96px; margin-top: var(--space-8); } }

.inbox-panes:has(> .ctx-pane[hidden]) { grid-template-columns: 360px minmax(0, 1fr); }
@media (max-width: 1199px) { .inbox-panes:has(> .ctx-pane[hidden]) { grid-template-columns: 320px minmax(0, 1fr); } }
@media (max-width: 1023px) and (min-width: 768px) { .inbox-panes:has(> .ctx-pane[hidden]) { grid-template-columns: 292px minmax(0, 1fr); } }
@media (max-width: 767px) { .thread-pane > .empty { display: none !important; } }

.tl-head { flex-wrap: nowrap; min-width: 0; }
.tl-head .t { white-space: nowrap; }
.tl-head .meta { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 1199px) { .col-email { display: none; } }
@media (max-width: 900px) { .col-last { display: none; } }

.col-co-inline { display: none; }
@media (max-width: 900px) { .col-co { display: none; } .col-co-inline { display: block; } }

.docs-table td { white-space: nowrap; }
.docs-table td .pill + .meta { margin-left: 4px; }
@media (max-width: 1199px) { .col-valid { display: none; } }
@media (max-width: 1439px) { .col-for .truncate { max-width: 220px !important; } }
@media (max-width: 1199px) { .col-for { display: none; } }

.line-desc-input { height: auto; min-height: 28px; padding: 4px var(--space-2); font-size: var(--text-sm); line-height: var(--lh-sm); border-color: transparent; resize: none; field-sizing: content; color: var(--color-ink-2); }
.line-desc-input:hover { border-color: var(--color-line-strong); }
#dactions { margin-right: var(--space-1); flex: none; }
@media (max-width: 767px) { .ed-head { display: none; } }

.line-name-input { height: auto; min-height: 34px; padding: 6px var(--space-3); resize: none; field-sizing: content; font-weight: var(--weight-medium); line-height: var(--lh-md); }
.doc-sheet.is-locked .drag { visibility: hidden; }
.doc-sheet.is-locked textarea { resize: none; }
.doc-sheet.is-locked .addon { background: var(--color-surface-2); border-color: var(--color-line); color: var(--color-ink-3); }
.doc-sheet.is-locked .line-desc-input:placeholder-shown { display: none; }
@media (max-width: 767px) {
  .banner { flex-wrap: wrap; }
  .banner .banner-actions { width: 100%; padding-left: 30px; }
  .banner .banner-actions .btn { height: 44px; }
}

.lines .line-name-input, .lines .line-desc-input { height: auto; }
.lines .line-name-input { min-height: 34px; }
.doc-sec .totals { padding-right: 44px; }
@media (max-width: 1023px) { .doc-sec .totals { padding-right: 0; } }

.col-date-inline { display: none !important; }
@media (max-width: 1099px) { .col-items { display: none; } }
@media (max-width: 900px) { .col-date { display: none; } .col-date-inline { display: block !important; } }
.orders-table td { white-space: nowrap; }
@media (max-width: 767px) {
  .doc-card > :nth-child(2), .doc-card > :nth-child(4) { justify-self: end; text-align: right; }
  .drawer-foot { flex-direction: column-reverse; align-items: stretch; padding-bottom: calc(var(--space-3) + env(safe-area-inset-bottom)); }
  .drawer-foot .spacer { display: none; }
  .drawer-foot .btn { width: 100%; }
}

.appt .a-sub { font-size: 11px; line-height: 13px; }
.appt:not(.follow):not(.cancelled) .a-sub { font-size: var(--text-xs); }
.range-short { display: none; }
@media (max-width: 1199px) { .range-long { display: none; } .range-short { display: inline; } }
@media (max-width: 1023px) { .bt-label { display: none; } .cal { min-width: 600px; grid-template-columns: 48px repeat(5, minmax(0, 1fr)); } }

.call-row .cr-dur { width: 44px; text-align: right; }
.call-row .cr-line .tag { margin-right: 2px; }
@media (max-width: 767px) { .calls-log { padding-bottom: 96px; } }

.fab { z-index: 5; }
.state-offline .call-row .btn-icon { opacity: .4; pointer-events: none; }
@media (max-width: 767px) { .calls-log > [data-when]:not(.fab) { padding-bottom: 96px; } }

/* =====================================================================
   Round 2 (23 Oct 2026). Inbox: 3-line rows, one unread signal, compact
   composer that grows on focus, actionable contact panel.
   ===================================================================== */
.thread-pane > .conv { flex: 1; min-height: 0; }
.thread-head h2 { font-size: var(--text-lg); line-height: var(--lh-lg); }
.thread-head { gap: var(--space-2); }
.thread { min-height: 100%; justify-content: flex-end; }
.msg-subj { font-weight: var(--weight-semibold); color: var(--color-ink); }
.event.solid { border-style: solid; background: var(--color-surface); color: var(--color-ink); }
.is-focus-row { box-shadow: 0 0 0 2px var(--color-ink); }
.seg-n { font-size: var(--text-xs); color: var(--color-ink-3); font-weight: var(--weight-semibold); }
.item .snip, .item .subj { text-overflow: ellipsis; }
.composer-main { display: flex; align-items: flex-end; gap: var(--space-2); }
.composer-main textarea { flex: 1; }
.composer-main .composer-foot { padding: 0 var(--space-2) var(--space-2) 0; flex: none; }
.composer-box:focus-within textarea { min-height: 96px; }
.ctx { gap: var(--space-4); }
.ctx-reach { display: flex; flex-direction: column; gap: 2px; margin-top: calc(-1 * var(--space-1)); }
.reach-row { display: flex; align-items: center; gap: 2px; min-height: 32px; font-size: var(--text-sm); color: var(--color-ink-2); }
.reach-row > :first-child { flex: 1; min-width: 0; }
.reach-row .btn-icon { width: 32px; height: 32px; color: var(--color-ink-2); }
.link-row.lr-2 { align-items: center; gap: var(--space-2); padding: var(--space-2) var(--space-2) var(--space-2) var(--space-3); }
.lr-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.lr-sub { display: flex; align-items: baseline; gap: var(--space-2); min-width: 0; }
.lr-sub > .meta:first-child { flex: 1; min-width: 0; }
.lr-val { white-space: nowrap; font-size: var(--text-sm); font-weight: var(--weight-semibold); margin-left: auto; }
.lr-val .meta { font-weight: var(--weight-regular); }
.lr-chev { color: var(--color-ink-3); flex: none; }
.wave i.on { background: var(--color-ink-2); }
@media (max-width: 767px) {
  .item { padding: 10px var(--space-4) 10px var(--space-5); }
  .item.unread::after { top: 20px; }
  .composer-box:focus-within textarea { min-height: 72px; }
  .composer-main .composer-foot .btn-primary { min-width: 44px; }
}
.reach-slot { width: 32px; flex: none; }
.item.unread::after { width: 10px; height: 10px; left: 7px; top: 17px; }

/* ---- Deals board, round 2: 5 Sales stages fit at 1440, content-height columns, fixed card anatomy ---- */
.board { align-items: flex-start; gap: var(--space-3); padding: var(--space-4) var(--space-5); }
.col { flex: 0 0 212px; width: 212px; max-height: 100%; background: var(--color-surface-2); border: 0; }
.col-cards { padding: 0 var(--space-2) var(--space-2); }
.col-head { padding: var(--space-3) var(--space-3) var(--space-2); gap: 4px; }
.col-head .col-title { gap: 6px; font-size: var(--text-sm); line-height: var(--lh-sm); }
.col-n { font-size: var(--text-xs); font-weight: var(--weight-semibold); color: var(--color-ink-2); background: var(--color-surface); border-radius: var(--radius-pill); padding: 0 6px; line-height: 18px; flex: none; }
.col-sum { margin-left: auto; font-size: var(--text-sm); font-weight: var(--weight-bold); color: var(--color-ink); flex: none; }
.col-head .col-auto { color: var(--color-ink-2); line-height: var(--lh-xs); align-items: flex-start; }
.col-head .col-auto .i, .dc-flag .i { color: var(--color-wait); flex: none; margin-top: 0; }
.col-empty { padding: var(--space-4) var(--space-3); text-align: center; font-size: var(--text-xs); color: var(--color-ink-3); border: 1px dashed var(--color-line-strong); border-radius: var(--radius-sm); }
.col.is-collapsed { flex: 0 0 44px; width: 44px; min-height: 180px; background: transparent; border: 1px dashed var(--color-line-strong); text-decoration: none; color: inherit; }
.col.is-collapsed .col-title { font-size: var(--text-sm); }
.dcard { padding: 10px var(--space-3); display: flex; flex-direction: column; gap: 2px; }
.dcard .dc-title { font-size: var(--text-sm); line-height: var(--lh-sm); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: calc(2 * var(--lh-sm)); }
.dcard .dc-co { font-size: var(--text-xs); line-height: var(--lh-xs); color: var(--color-ink-2); margin-top: 0; }
.dcard .dc-doc { margin-top: 4px; height: 22px; display: flex; align-items: center; gap: 6px; font-size: var(--text-xs); color: var(--color-ink-2); }
.dcard .dc-doc .pill { margin-left: auto; height: 20px; }
.dc-flag { display: flex; gap: 4px; align-items: flex-start; font-size: var(--text-xs); line-height: var(--lh-xs); color: var(--color-ink-2); margin-top: 4px; }
.dcard .dc-foot { margin-top: var(--space-2); gap: 6px; }
.dcard .dc-value { font-size: 15px; line-height: 20px; font-weight: var(--weight-bold); color: var(--color-ink); }
.dc-add { font-size: var(--text-xs); font-weight: var(--weight-medium); color: var(--color-ink-3); }
.avatar.owner { background: var(--color-ink-2); color: #fff; font-size: 10px; letter-spacing: 0; }
.p-sum { margin-left: var(--space-2); font-size: var(--text-md); white-space: nowrap; }
.board-wrap::after { display: none; }
.board-wrap.has-more::after { display: block; width: 72px; background: linear-gradient(to right, rgba(245,246,248,0), var(--color-canvas) 70%); }
.board-more { position: absolute; z-index: 2; right: 10px; top: 16px; display: inline-flex; align-items: center; gap: 4px; writing-mode: vertical-rl; padding: var(--space-3) 0; width: 36px; border-radius: var(--radius-pill); border: 1px solid var(--color-line-strong); background: var(--color-surface); color: var(--color-ink); font-size: var(--text-sm); font-weight: var(--weight-semibold); box-shadow: var(--shadow-2); }
.board-more:hover { background: var(--color-surface-2); }
.board-more .i { transform: rotate(-90deg); }
@media (max-width: 767px) { .board-more { display: none !important; } .deal-phone-list .dcard { padding: var(--space-3) var(--space-4); } .deal-phone-list .dcard .dc-title { font-size: var(--text-md); line-height: var(--lh-md); min-height: 0; } .deal-phone-list .dcard .dc-co { font-size: var(--text-sm); } .deal-phone-list .col-auto { display: flex; gap: 4px; font-size: var(--text-sm); color: var(--color-ink-2); } }
@media (max-width: 1199px) { .p-sum .meta { display: none; } }
/* deals r2b: columns sized so whole columns fit (5 at 1440, 4 at 1024, 3 at 768); scroll snaps to column edges; cue lives in its own gutter */
.board-wrap { container-type: inline-size; }
.board { --cols: 5; padding-right: 0; scroll-snap-type: x mandatory; scroll-padding-left: var(--space-5); }
.board-wrap.has-more .board { margin-right: 72px; }
.board .col { flex: 0 0 calc((100cqw - 72px - var(--space-5) - (var(--cols) - 1) * var(--space-3)) / var(--cols)); width: auto; min-width: 188px; scroll-snap-align: start; }
.board .col.is-collapsed { flex: 0 0 44px; min-width: 44px; }
.board::after { content: ""; flex: 0 0 1px; }
@media (max-width: 1199px) { .board { --cols: 4; } }
@media (max-width: 1023px) { .board { --cols: 3; } }
.dcard .dc-title { min-height: 0; }
.col-head .col-sum { margin-left: auto; font-size: var(--text-sm); font-weight: var(--weight-bold); color: var(--color-ink); }
.dc-add { display: inline-flex; align-items: center; gap: 2px; font-size: var(--text-xs); font-weight: var(--weight-semibold); color: var(--color-accent); }
.avatar.owner { font-size: 10px; }
.board-wrap.has-more::after { display: none; }
.board-more { writing-mode: horizontal-tb; right: 0; top: 0; bottom: 0; width: 72px; border-radius: 0; border: 0; border-left: 1px solid var(--color-line); box-shadow: none; background: var(--color-canvas); flex-direction: column; justify-content: flex-start; padding: var(--space-4) var(--space-1); gap: var(--space-3); }
.board-more .i { transform: none; }
.board-more .bm-btn { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--color-line-strong); background: var(--color-surface); display: inline-flex; align-items: center; justify-content: center; box-shadow: var(--shadow-1); }
.board-more:hover .bm-btn { background: var(--color-surface-2); }
.board-more .bm-text { display: flex; flex-direction: column; align-items: center; text-align: center; font-size: var(--text-xs); line-height: var(--lh-xs); font-weight: var(--weight-regular); color: var(--color-ink-2); }
.board-more .bm-text strong { font-size: var(--text-sm); color: var(--color-ink); }
.board-more .bm-sep { height: var(--space-2); }
.board .col { flex-basis: calc((100cqw - 72px - var(--space-5) - var(--space-3) - (var(--cols) - 1) * var(--space-3)) / var(--cols)); border: 1px solid var(--color-line); }
.board-wrap.has-more .board { margin-right: 72px; padding-right: var(--space-3); scroll-padding-right: var(--space-3); }
.dcard .dc-foot .meta { white-space: nowrap; }
.dc-none { color: var(--color-ink-3); font-weight: var(--weight-regular); }
.closed-link { color: var(--color-ink-2); text-decoration: underline; text-underline-offset: 2px; text-decoration-color: var(--color-line-strong); }
.board-more .bm-text > span:not(.bm-sep) { white-space: nowrap; }

/* ---- Document editor, round 2 ---- */
.lines th.th-in { padding-left: calc(var(--space-2) + var(--space-3)); }
.lines th.r.th-in { padding-left: var(--space-2); padding-right: calc(var(--space-2) + var(--space-3)); }
.lines th.r:not(.th-in) { padding-right: var(--space-2); }
.line-desc-input { border-color: var(--color-line); border-style: dashed; }
.line-desc-input:hover, .line-desc-input:focus { border-style: solid; }
.ro-value { display: flex; flex-direction: column; justify-content: center; min-height: var(--control-h); padding: 2px 0; }
.ro-value > span:first-child { font-weight: var(--weight-medium); }
.side-totals { width: 100%; margin: 0; gap: 6px var(--space-3); font-size: var(--text-sm); }
.side-totals .grand { font-size: var(--text-xl); }
.rail-act { padding: var(--space-4); border: 1px solid var(--color-line); border-radius: var(--radius-md); background: var(--color-surface-2); }
.rail-note strong { color: var(--color-ink); font-weight: var(--weight-semibold); overflow-wrap: anywhere; }
.repeat-more { display: flex; flex-direction: column; gap: var(--space-2); margin-top: var(--space-2); padding: var(--space-3); border-radius: var(--radius-sm); background: var(--color-surface-2); }
@media (min-width: 1200px) { .hide-wide { display: none !important; } }
@media (max-width: 1199px) { .rail-act { display: none; } }
.side-totals > :nth-child(even) { text-align: right; justify-self: end; }
.line-desc-input { border-style: solid; border-color: var(--color-line); background: var(--color-surface); }

/* ---- Bookings agenda, round 2 ---- */
.bk-wrap { position: relative; }
.agenda-day { min-height: 36px; }
.agenda-day.is-today { background: var(--color-ink); color: #fff; }
.agenda-day .ad-count { font-size: var(--text-xs); font-weight: var(--weight-medium); color: var(--color-ink-2); }
.agenda-day.is-today .ad-count { color: #e3e6eb; }
.agenda-item { grid-template-columns: 52px minmax(0, 1fr) auto; align-items: center; padding: 10px var(--space-3) 10px var(--space-4); min-height: 60px; }
.agenda-item .t { display: flex; flex-direction: column; line-height: var(--lh-md); }
.agenda-item .ai-len { font-size: var(--text-xs); line-height: var(--lh-xs); font-weight: var(--weight-regular); color: var(--color-ink-3); }
.ai-main { display: flex; flex-direction: column; min-width: 0; }
.ai-name { font-weight: var(--weight-semibold); }
.ai-sub { font-size: var(--text-sm); line-height: var(--lh-sm); color: var(--color-ink-2); }
.ai-note { display: flex; gap: 6px; align-items: flex-start; margin-top: 4px; font-size: var(--text-sm); line-height: var(--lh-sm); color: var(--color-ink); font-weight: var(--weight-medium); }
.ai-note .i { color: var(--color-attn); margin-top: 1px; }
.ai-end { display: flex; align-items: center; gap: var(--space-1); }
.ai-chev { color: var(--color-ink-3); }
.agenda-item.is-past { background: var(--color-surface-2); }
.agenda-item.is-past .t, .agenda-item.is-past .ai-name, .agenda-item.is-past .ai-sub, .agenda-item.is-past .ai-note { color: var(--color-ink-3); }
.agenda-item.is-past .ai-note .i { color: var(--color-ink-3); }
.agenda-item.is-cancelled .ai-name { text-decoration: line-through; color: var(--color-ink-3); }
.agenda-gap { min-height: 32px; padding: 0 var(--space-4) 0 calc(var(--space-4) + 52px + var(--space-3)); gap: 6px; background: var(--color-surface); font-size: var(--text-xs); line-height: var(--lh-xs); }
.agenda-gap .ag-free { margin-left: auto; color: var(--color-good); font-weight: var(--weight-semibold); }
.agenda-gap.is-past { background: var(--color-surface-2); color: var(--color-ink-3); }
.agenda-gap.is-past .ag-free { color: var(--color-ink-3); }
.agenda-gap.ag-off { background: var(--color-surface-2); color: var(--color-ink-2); }
.strip-month { flex: none; font-size: 11px; line-height: 13px; font-weight: var(--weight-semibold); color: var(--color-ink-2); text-align: center; align-self: center; }
.day-chip { gap: 6px; }
.day-chip .today-mark { font-size: 11px; font-weight: var(--weight-semibold); padding: 1px 6px; border-radius: var(--radius-pill); background: var(--color-accent); color: #fff; }
.day-chip[aria-current="true"] .today-mark { background: #fff; color: var(--color-ink); }
.fab-primary { background: var(--color-accent); }
@media (max-width: 767px) {
  .bk-agenda { padding-bottom: calc(56px + var(--space-6)); scroll-padding-top: 0; }
  .bk-wrap .fab { z-index: 5; }
}
.agenda-day.is-today { background: var(--color-surface-2); color: var(--color-ink); }
.agenda-day.is-today .ad-count { color: var(--color-ink-2); }
.agenda-day .today-mark { font-size: 11px; font-weight: var(--weight-semibold); padding: 1px 6px; border-radius: var(--radius-pill); background: var(--color-accent); color: #fff; margin-right: var(--space-2); }
.agenda-now { position: relative; height: 0; border-top: 2px solid var(--color-bad); margin: 0 0 0 var(--space-4); z-index: 1; }
.agenda-now span { position: absolute; left: 0; top: -10px; font-size: 11px; line-height: 16px; font-weight: var(--weight-semibold); color: #fff; background: var(--color-bad); padding: 0 6px; border-radius: var(--radius-pill); }
@media (max-width: 767px) { .tabbar { box-shadow: 0 -1px 0 var(--color-line), 0 -8px 20px rgba(22, 24, 29, .10); } }

/* ---- Calls, round 2: ringing state, business line first, minimum caller context ---- */
.call-row.missed .cr-who { color: var(--color-ink); }
.ws-mark.md { --m: 32px; }
.ring-dot { width: 10px; height: 10px; border-radius: 50%; background: #3ddc84; box-shadow: 0 0 0 0 rgba(61,220,132,.6); flex: none; }
.cc-ringing, .cs-ringing { display: inline-flex; align-items: center; gap: var(--space-2); font-weight: var(--weight-semibold); letter-spacing: .01em; color: #fff; }
.cc-ringing { padding: var(--space-3) var(--space-4) 0; font-size: var(--text-sm); }
.cc-lineblock { display: flex; gap: var(--space-3); align-items: center; margin: var(--space-3) var(--space-4) 0; padding: var(--space-3); border-radius: var(--radius-md); background: rgba(255,255,255,.08); font-size: var(--text-sm); color: #dfe3ea; }
.cc-lineblock .strong { color: #fff; font-size: var(--text-md); }
.cc-ctx { display: grid; grid-template-columns: 92px 1fr; gap: 4px var(--space-3); margin: 0 var(--space-4) var(--space-4); font-size: var(--text-sm); }
.cc-ctx dt { color: #b9bfca; } .cc-ctx dd { margin: 0; color: #fff; }
.avatar.ring { box-shadow: 0 0 0 6px rgba(255,255,255,.14); }
@media (prefers-reduced-motion: no-preference) {
  .avatar.ring { animation: ring2 1.8s ease-out infinite; }
  .ring-dot { animation: ringdot 1.2s ease-out infinite; }
  @keyframes ring2 { 0% { box-shadow: 0 0 0 0 rgba(255,255,255,.35); } 100% { box-shadow: 0 0 0 26px rgba(255,255,255,0); } }
  @keyframes ringdot { 0% { box-shadow: 0 0 0 0 rgba(61,220,132,.6); } 100% { box-shadow: 0 0 0 10px rgba(61,220,132,0); } }
}
@media (max-width: 767px) {
  .callscreen.cs-incoming { padding-top: calc(var(--space-6) + env(safe-area-inset-top)); }
  .cs-ringing { font-size: var(--text-lg); }
  .cs-lineblock { display: flex; align-items: center; gap: var(--space-3); margin-top: var(--space-4); padding: var(--space-3) var(--space-4); border-radius: var(--radius-md); background: rgba(255,255,255,.10); font-size: var(--text-md); color: #dfe3ea; width: 100%; max-width: 340px; }
  .cs-lineblock .cs-linename { font-size: var(--text-xl); line-height: var(--lh-xl); font-weight: var(--weight-semibold); color: #fff; }
  .callscreen.cs-incoming .avatar.xl { --av: 88px; margin-top: var(--space-6); }
  .callscreen.cs-incoming .cs-name { margin-top: var(--space-4); }
  .cs-ctx { display: grid; grid-template-columns: auto 1fr; gap: 6px var(--space-3); margin: var(--space-5) 0 0; padding: var(--space-3) var(--space-4); width: 100%; max-width: 340px; text-align: left; font-size: var(--text-md); border-top: 1px solid rgba(255,255,255,.14); }
  .cs-ctx dt { color: #b9bfca; } .cs-ctx dd { margin: 0; color: #fff; }
  .round-label { color: #fff; }
  .callscreen .cs-sub { color: #d5d9e0; }
}
.dd-sub { display: block; color: #b9bfca; font-size: var(--text-sm); }
@media (max-width: 767px) {
  .callscreen.cs-incoming { padding-top: calc(var(--space-8) + env(safe-area-inset-top)); }
  .callscreen.cs-incoming .avatar.xl.cs-push { margin-top: auto; }
  .callscreen.cs-incoming .cs-bottom { margin-top: auto !important; }
  .cs-lineblock .num { font-size: var(--text-sm); color: #b9bfca; }
}
.rl-sub { font-size: var(--text-xs); color: #b9bfca; margin-top: -6px; }
.thread .day-sep { position: sticky; top: 0; z-index: 2; background: var(--color-surface); padding: 6px 0; margin: -6px 0; }
.side-totals { column-gap: 0; }
.side-totals > :nth-child(even) { padding-left: var(--space-3); }
.rail-list { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; }
.rail-list strong { color: var(--color-ink); font-weight: var(--weight-semibold); overflow-wrap: anywhere; }
.board-more .bm-text > span.bm-name { white-space: normal; font-size: 11px; line-height: 13px; color: var(--color-ink-2); margin-top: 2px; }
.dcard .dc-foot .meta { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.dcard .dc-foot .dc-value { flex: none; padding-left: var(--space-1); }
.board-more .bm-text > span.bm-name { margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--color-line); width: 56px; }
.board-more .bm-text > span.bm-sep + span.bm-name { border-top: 0; padding-top: 0; }
.dc-age { display: inline-flex; align-items: center; gap: 3px; white-space: nowrap; }
.dc-age .i { width: 12px; height: 12px; flex: none; }
.dcard .dc-foot { gap: 4px; }
.bm-name b { color: var(--color-ink); }
.board-more .bm-text > span.bm-name { font-size: var(--text-xs); line-height: var(--lh-xs); color: var(--color-ink); }
.cr-follow { font-size: var(--text-xs); font-weight: var(--weight-medium); }
.call-row .cr-line + .cr-follow { display: inline-block; margin-top: 2px; }
@media (min-width: 768px) and (max-width: 1199px) { .from-btn { height: auto; min-height: 36px; padding: 4px var(--space-2); } .from-btn .fb-text { flex-direction: column; gap: 0; align-items: flex-start; line-height: 16px; } .from-btn .addr { font-size: var(--text-xs); } }
.call-row.missed .cr-line { color: var(--color-attn); font-weight: var(--weight-medium); }

/* =====================================================================
   Round 3 (23 Oct 2026). Density and weight rules (DESIGN.md 2.1a):
   list rows use at most two weights (regular + one emphasis), no boxed
   icon tiles in rows, secondary text regular ink-2/ink-3, rows 44 to 56px.
   ===================================================================== */

/* ---- Inbox list: two-line rows. Unread = dot in a fixed gutter + semibold name; read = regular ---- */
.item.r3 { grid-template-columns: minmax(0, 1fr) auto; gap: 2px var(--space-3); padding: 9px var(--space-4) 9px 28px; align-items: baseline; }
.item.r3 .who { font-weight: var(--weight-regular); color: var(--color-ink); }
.item.r3.unread .who { font-weight: var(--weight-semibold); }
.item.r3.unread::after { left: 11px; top: 16px; width: 8px; height: 8px; }
.item.r3 .l2 { grid-column: 1 / -1; display: flex; align-items: center; gap: 6px; min-width: 0; font-size: var(--text-sm); line-height: var(--lh-sm); color: var(--color-ink-3); }
.item.r3 .l2 .g { flex: none; width: 14px; height: 14px; color: var(--color-ink-3); stroke-width: 2; }
.item.r3 .l2 .g.attn { color: var(--color-attn); }
.item.r3 .l2 .tx { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.item.r3 .l2 .s { color: var(--color-ink-2); }
@media (max-width: 767px) {
  .item.r3 { padding: 11px var(--space-4) 11px 28px; }
  .item.r3.unread::after { top: 19px; }
  .item.r3 .l2 { font-size: var(--text-md); line-height: var(--lh-md); }
}

/* ---- Thread: dividers scroll with the content (no sticky label over half-cut text) ---- */
.thread .day-sep { position: static; margin: var(--space-1) 0 0; padding: 0; background: none; }
/* one email card style; your own messages carry a 3px left rule and "(you)" */
.msg.out { background: var(--color-surface); border-color: var(--color-line); margin-left: var(--space-7); }
.msg.out .avatar { background: var(--color-surface-3); color: var(--color-ink-2); box-shadow: none; }
.msg-subj { font-weight: var(--weight-regular); color: var(--color-ink); }
/* calls and other events: one muted line, no card */
.tl-ev { display: flex; align-items: center; gap: var(--space-3); min-height: 28px; padding: 0 calc(var(--space-4) + 1px) 0 calc(var(--space-4) + 1px); font-size: var(--text-sm); line-height: var(--lh-sm); color: var(--color-ink-2); }
.tl-ev > .i { width: 14px; height: 14px; color: var(--color-ink-3); flex: none; }
.tl-ev .tx { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.tl-ev .meta { flex: none; }
.tl-ev + .tl-card.note { margin-top: calc(-1 * var(--space-2)) !important; margin-left: calc(var(--space-4) + 22px); }
/* suggested action strip above the composer (replaces a primary button in the thread header) */
.suggest { display: flex; align-items: center; gap: var(--space-3); max-width: 820px; margin: 0 auto var(--space-2); padding: 6px 6px 6px var(--space-3); border: 1px solid var(--color-line); border-radius: var(--radius-md); background: var(--color-surface-2); font-size: var(--text-sm); line-height: var(--lh-sm); color: var(--color-ink-2); }
.suggest > .i { color: var(--color-ink-2); flex: none; }
.suggest .sg-text { flex: 1; min-width: 0; }
.suggest .sg-text strong { color: var(--color-ink); font-weight: var(--weight-semibold); }
.suggest .sg-btn { flex: none; color: var(--color-accent); border-color: var(--color-line-strong); background: var(--color-surface); }
@media (max-width: 767px) { .suggest { flex-wrap: wrap; } .suggest .sg-btn { width: 100%; height: 44px; justify-content: center; } }

/* ---- Inbox context: one card for the deal and its documents (value shown once) ---- */
.ctx-name { font-weight: var(--weight-semibold); }
.dk-card { border: 1px solid var(--color-line); border-radius: var(--radius-md); overflow: hidden; }
.dk-head { display: flex; align-items: flex-start; gap: var(--space-2); padding: var(--space-3) var(--space-2) 2px var(--space-3); color: inherit; text-decoration: none; }
.dk-head:hover { text-decoration: none; background: var(--color-surface-2); }
.dk-title { flex: 1; min-width: 0; font-size: var(--text-sm); line-height: var(--lh-sm); font-weight: var(--weight-medium); }
.dk-meta { display: flex; align-items: baseline; gap: var(--space-2); padding: 0 var(--space-3) var(--space-3); font-size: var(--text-sm); line-height: var(--lh-sm); color: var(--color-ink-2); }
.dk-meta > span:first-child { flex: 1; min-width: 0; }
.dk-val { white-space: nowrap; color: var(--color-ink); }
.dk-docs { border-top: 1px solid var(--color-line); }
.dk-doc { display: flex; align-items: center; gap: var(--space-2); min-height: 40px; padding: 0 var(--space-2) 0 var(--space-3); font-size: var(--text-sm); color: inherit; text-decoration: none; }
.dk-doc + .dk-doc { border-top: 1px solid var(--color-line); }
.dk-doc:hover { background: var(--color-surface-2); text-decoration: none; }
.dk-none { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); padding: var(--space-2) var(--space-2) var(--space-2) var(--space-3); }

.thread-pane .pane-body { -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 28px); mask-image: linear-gradient(to bottom, transparent 0, #000 28px); }
.tl-ev + .tl-card.note { margin-left: calc(var(--space-4) + 9px + 14px + var(--space-3)) !important; }

/* older messages in a thread collapse to their header and a one-line peek; the latest is open */
button.msg-head { width: 100%; border: 0; background: none; text-align: left; font: inherit; color: inherit; cursor: pointer; border-radius: var(--radius-md); }
button.msg-head:hover { background: var(--color-surface-2); }
.msg-peek { display: none; }
.msg.is-collapsed .msg-body { display: none; }
.msg.is-collapsed .msg-addr { display: none; }
.msg.is-collapsed .msg-peek { display: block; font-size: var(--text-sm); line-height: var(--lh-sm); color: var(--color-ink-2); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.item.r3 .l2 .g { color: var(--color-ink-2); }
.item.r3 .l2 .g.ch-mail { color: var(--color-ink-3); }
.sg-btn.btn-primary { color: #fff; background: var(--color-accent); border-color: var(--color-accent); }

/* sidebar: the current area is a filled neutral row, not a white box that looks like the search field */
.nav a[aria-current="page"] { background: var(--color-surface-3); box-shadow: none; color: var(--color-ink); font-weight: var(--weight-semibold); }
.nav a[aria-current="page"] .i { color: var(--color-ink); }

/* suggested action sits inside the message it is based on */
.msg > .suggest { margin: 0 var(--space-4) var(--space-4) calc(var(--space-4) + 32px + var(--space-3)); max-width: none; }
.msg > .suggest .sg-text .meta { display: block; }
@media (max-width: 767px) { .msg > .suggest { margin: 0 var(--space-3) var(--space-3); } .msg.out { margin-left: var(--space-6); } }

.dk-doc .num, .suggest strong, .sg-btn { white-space: nowrap; }

/* ---- Settings, round 3: phone numbers and email senders ---- */
.nc-ico { width: 32px; height: 32px; border-radius: var(--radius-sm); background: var(--color-surface-2); color: var(--color-ink-2); display: inline-flex; align-items: center; justify-content: center; flex: none; }
.nc-ico .i { width: 16px; height: 16px; }
.num-card .perm-row { grid-template-columns: minmax(0, 300px) 96px 112px; justify-content: start; }
.pr-who { display: flex; align-items: center; gap: var(--space-2); min-width: 0; }
.perm-row .c { flex-direction: column; align-items: center; gap: 2px; }
.perm-row.is-off .pr-who { color: var(--color-ink-2); }
.pr-why { font-size: var(--text-xs); line-height: var(--lh-xs); color: var(--color-ink-2); white-space: nowrap; }
.switch input:disabled + span { opacity: .45; cursor: not-allowed; }
.nc-dl { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: var(--space-3) var(--space-4); margin: var(--space-4) 0 0; padding-top: var(--space-4); border-top: 1px solid var(--color-line); font-size: var(--text-md); }
.nc-dl dt { color: var(--color-ink-2); font-weight: var(--weight-medium); padding-top: 6px; }
.nc-dl dd { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); min-height: 32px; color: var(--color-ink); }
.select-sm { height: 32px; width: auto; padding-top: 0; padding-bottom: 0; font-size: var(--text-md); }
.sv-val { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.auth-grid { display: grid; grid-template-columns: repeat(3, auto auto); justify-content: start; align-items: center; gap: var(--space-2) var(--space-2); }
.auth-grid > span:nth-child(odd) { font-weight: var(--weight-medium); }
.auth-grid > span:nth-child(odd):not(:first-child) { margin-left: var(--space-4); }
.sv-dmarc-note { display: flex; flex-direction: column; gap: var(--space-2); color: var(--color-ink); background: var(--color-bad-bg); border-radius: var(--radius-sm); padding: var(--space-3); }
.sv-dmarc-note[hidden] { display: none; }
.ok-txt { display: inline-flex; align-items: center; gap: 4px; color: var(--color-good); font-weight: var(--weight-medium); font-size: var(--text-sm); }
.pr-why { padding: 3px 8px; border-radius: var(--radius-pill); background: var(--color-surface-2); }
.set-inner > .banner { margin: 0; }
.pick-row { gap: var(--space-3); cursor: pointer; margin-top: var(--space-2); }
.pick-row input { accent-color: var(--color-accent); width: 18px; height: 18px; }
.chip-x { width: 28px; height: 28px; margin: -4px -6px -4px 0; }
.phone-status.is-off .ps-text { color: var(--color-ink-2); font-weight: var(--weight-regular); }
@media (max-width: 767px) {
  .num-card .perm-row { grid-template-columns: minmax(0, 1fr) 64px 84px; }
  .nc-dl { grid-template-columns: 1fr; gap: 4px; }
  .nc-dl dt { padding-top: var(--space-2); }
  .auth-grid { grid-template-columns: auto auto; }
  .auth-grid > span:nth-child(odd):not(:first-child) { margin-left: 0; }
  .select-sm { height: 44px; font-size: var(--text-lg); max-width: 100%; }
}


.sv-val .meta, .nc-head .meta { color: var(--color-ink-2); }
.sv-dmarc-note { background: var(--color-attn-bg); }
.noring-note { margin: 0; }

.switch.is-locked span { opacity: .4; background-image: repeating-linear-gradient(135deg, transparent 0 3px, rgba(255,255,255,.55) 3px 5px); }
.sv-val .email, .sv-val .sv-from, .sv-val .sv-acct { white-space: nowrap; }

.token-input { display: flex; align-items: center; gap: 6px; cursor: text; }
.token { display: inline-flex; align-items: center; height: 24px; padding: 0 8px; border-radius: var(--radius-sm); background: var(--color-accent-weak); color: var(--color-accent-ink); font-size: var(--text-sm); font-weight: var(--weight-medium); }
.tok-text { flex: 1; min-width: 0; }
.tok-add { margin-right: -6px; color: var(--color-ink-2); }

/* ---- Deals board, round 3: every Sales stage fits at 1360+; column total smaller and lighter than card values ---- */
.board { --gap: var(--space-2); gap: var(--gap); padding: var(--space-4) var(--space-5); }
.board .col { flex: 0 0 calc((100cqw - 2 * var(--space-5) - (var(--cols) - 1) * var(--gap)) / var(--cols)); min-width: 150px; }
.board-wrap.has-more .board { margin-right: 120px; padding-right: var(--space-3); }
.board-wrap.has-more .board .col { flex-basis: calc((100cqw - 120px - var(--space-5) - var(--space-3) - (var(--cols) - 1) * var(--gap)) / var(--cols)); }
.col-head { padding: var(--space-2) var(--space-2) var(--space-2) 10px; gap: 2px; }
.col-head .col-title { font-size: var(--text-sm); font-weight: var(--weight-semibold); }
.col-head .col-sum, .col-sum { margin: 0; font-size: var(--text-xs); line-height: var(--lh-xs); font-weight: var(--weight-regular); color: var(--color-ink-2); }
.col-cards { padding: 0 6px 6px; }
.dcard { padding: var(--space-2) 10px; }
.dcard .dc-title { text-wrap: balance; overflow-wrap: normal; word-break: normal; hyphens: manual; font-weight: var(--weight-medium); }
.dcard .dc-co { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: var(--text-xs); color: var(--color-ink-2); }
.dcard .dc-doc { color: var(--color-ink-2); }
.dc-age { font-size: var(--text-xs); color: var(--color-ink-2); }
.dc-age .i { color: var(--color-ink-2); }
.dcard .dc-value { font-size: var(--text-md); line-height: var(--lh-md); font-weight: var(--weight-bold); }
.dc-none { font-size: var(--text-xs); font-weight: var(--weight-regular); color: var(--color-ink-2); }
.p-sum { display: inline-flex; align-items: baseline; flex-wrap: wrap; }
.p-sub { color: var(--color-ink-2); white-space: pre; }
.closed-link { color: var(--color-ink-2); }
/* off-screen stages gutter (1024 and 768 only): readable, each stage a link */
.board-more { width: 120px; padding: var(--space-3) var(--space-2); gap: var(--space-2); align-items: stretch; }
.board-more .bm-btn { align-self: center; }
.bm-head { text-align: center; font-size: var(--text-sm); font-weight: var(--weight-semibold); color: var(--color-ink); }
.bm-stage { display: flex; flex-direction: column; gap: 0; padding: 6px var(--space-2); border-radius: var(--radius-sm); border: 1px solid var(--color-line); background: var(--color-surface); color: var(--color-ink); text-decoration: none; font-size: var(--text-sm); line-height: var(--lh-sm); }
.bm-stage:hover { background: var(--color-surface-2); text-decoration: none; }
.bm-stage .bm-n { font-weight: var(--weight-medium); }
.bm-stage .bm-v { color: var(--color-ink-2); font-size: var(--text-sm); }
.modal-wide { width: min(640px, 100%); }
.closed-list { list-style: none; margin: var(--space-3) 0; padding: 0; }
.closed-list li { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-2) 0; border-bottom: 1px solid var(--color-line); }
.cl-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.closed-list .num { font-weight: var(--weight-semibold); }
@media (max-width: 767px) { .closed-list li { flex-wrap: wrap; } .closed-list .btn { height: 44px; } }

.board { --slim: 0; }
.board { --split: 0; }
.board .col { flex-basis: calc((100cqw - 2 * var(--space-5) - var(--slim) * (96px + var(--gap)) - var(--split) * (17px + var(--gap)) - (var(--cols) - 1) * var(--gap)) / var(--cols)); }
.board-wrap.has-more .board { padding-right: 0; }
.board-wrap.has-more .board .col { flex-basis: calc((100cqw - 120px - var(--space-5) - var(--cols) * var(--gap)) / var(--cols)); }
.board .col.is-slim { flex: 0 0 96px; min-width: 96px; background: transparent; border: 1px dashed var(--color-line-strong); }
.col.is-slim .slim-note { align-items: flex-start; line-height: var(--lh-xs); margin-top: 2px; }
.board-split { flex: 0 0 17px; align-self: stretch; position: relative; display: flex; justify-content: center; }
.board-split::before { content: ""; width: 1px; background: var(--color-line-strong); position: absolute; top: 26px; bottom: 0; }
.board-split span { position: absolute; top: 0; left: 50%; transform: translateX(-2px); font-size: var(--text-xs); line-height: var(--lh-xs); color: var(--color-ink-2); font-weight: var(--weight-semibold); white-space: nowrap; }
.board-wrap.has-more .board-split { display: none; }
.slim-in { writing-mode: vertical-rl; display: flex; align-items: center; gap: var(--space-2); padding: var(--space-3) 0; margin: 0 auto; font-size: var(--text-sm); }
.slim-name { font-weight: var(--weight-semibold); color: var(--color-ink); }
.slim-in .col-n { writing-mode: horizontal-tb; }
.slim-note { display: inline-flex; align-items: center; gap: 4px; color: var(--color-ink-2); font-size: var(--text-xs); }
.slim-note .i { color: var(--color-wait); flex: none; }
.dcard .dc-doc { flex-wrap: wrap; height: auto; min-height: 22px; row-gap: 4px; }
.dcard .dc-doc .num { white-space: nowrap; }
.dcard .dc-doc .pill { margin-left: auto; }
.avatar.owner { background: var(--color-surface-3); color: var(--color-ink); font-weight: var(--weight-semibold); }

.board .col { flex-basis: calc((100cqw - 2 * var(--space-5) - (var(--cols) - 1) * var(--gap)) / var(--cols)); }
.board .col:nth-child(n) { min-width: 156px; }
.dcard .dc-co { font-size: var(--text-sm); line-height: var(--lh-sm); }

.dcard .dc-title { text-wrap: pretty; }
.col-auto.col-foot { display: flex; gap: 6px; align-items: flex-start; padding: 2px 10px 10px; font-size: var(--text-xs); line-height: var(--lh-xs); color: var(--color-ink-2); }
.col-auto.col-foot .i { color: var(--color-wait); flex: none; margin-top: 1px; }
.dcard.is-overdue { box-shadow: inset 3px 0 0 var(--color-attn); }

/* ---- Bookings agenda, round 3 ---- */
.day-strip { display: none; }
@media (max-width: 767px) {
  .day-strip { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3) 0 var(--space-3) var(--space-4); border-bottom: 1px solid var(--color-line); background: var(--color-surface); flex: none; }
  .day-scroll { flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; scroll-snap-type: x mandatory; scroll-padding-left: 0; }
  .day-scroll::-webkit-scrollbar { display: none; }
  .day-scroll.fade-r { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 32px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 32px), transparent); }
  .day-scroll.fade-l { -webkit-mask-image: linear-gradient(to right, transparent, #000 32px); mask-image: linear-gradient(to right, transparent, #000 32px); }
  .day-scroll.fade-l.fade-r { -webkit-mask-image: linear-gradient(to right, transparent, #000 32px, #000 calc(100% - 32px), transparent); mask-image: linear-gradient(to right, transparent, #000 32px, #000 calc(100% - 32px), transparent); }
  .day-chips { display: inline-flex; gap: var(--space-2); padding-right: var(--space-4); }
  .day-chip { flex: none; scroll-snap-align: start; display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 var(--space-3); border-radius: var(--radius-pill); border: 1px solid var(--color-line-strong); background: var(--color-surface); font-size: var(--text-md); font-weight: var(--weight-medium); color: var(--color-ink-2); white-space: nowrap; text-decoration: none; }
  .day-chip[aria-current="true"] { background: var(--color-ink); color: #fff; border-color: var(--color-ink); }
  /* FAB never covers the last row: list pads by FAB 56 + 16 gap + 16 margin + safe area (tab bar sits outside the scroller) */
  .bk-agenda { padding-bottom: calc(56px + var(--space-4) + var(--space-4) + env(safe-area-inset-bottom)); }
}
/* one free-time colour (green) everywhere; travel sits right before the visit it leads to */
.agenda-gap .ag-free { margin-left: 0; color: var(--color-good); font-weight: var(--weight-semibold); }
.agenda-gap.ag-free-row { color: var(--color-ink-2); }
.agenda-gap.ag-free-row > .i { color: var(--color-good); }
.agenda-gap.ag-free-row .meta { margin-left: auto; color: var(--color-ink-2); }
.agenda-gap .ag-leave { margin-left: auto; font-weight: var(--weight-semibold); color: var(--color-ink); }
.agenda-gap { color: var(--color-ink-2); }
/* past rows: dimmed by background and weight, text stays at 4.5:1 or better */
.agenda-item.is-past { background: var(--color-surface-2); }
.agenda-item.is-past .t, .agenda-item.is-past .ai-name { color: var(--color-ink-2); }
.agenda-item.is-past .ai-name { font-weight: var(--weight-regular); }
.agenda-item.is-past .ai-sub, .agenda-item.is-past .ai-len { color: var(--color-ink-2); }
.agenda-gap.is-past { background: var(--color-surface-2); color: var(--color-ink-2); }

/* phone: New booking lives in the header (like New contact and New deal), so nothing floats over the agenda */
.phone-new { height: 36px; padding: 0 var(--space-3); margin-right: var(--space-1); }
@media (max-width: 767px) { .bk-agenda { padding-bottom: calc(var(--space-6) + env(safe-area-inset-bottom)); } }
.agenda-item.is-past .t, .agenda-item.is-past .ai-name { color: var(--color-ink); }
.agenda-item.is-past .t { font-weight: var(--weight-medium); }

/* past rows stay white; they dim through muted text and regular weight, never a grey band (grey is for day headers) */
.agenda-item.is-past, .agenda-gap.is-past { background: var(--color-surface); }
.agenda-item.is-past .t, .agenda-item.is-past .ai-name { color: var(--color-ink-2); }
.agenda-item.is-past .ai-sub, .agenda-item.is-past .ai-len { color: var(--color-ink-3); }
@media (max-width: 767px) {
  .day-scroll.fade-l { -webkit-mask-image: linear-gradient(to right, transparent, #000 20px); mask-image: linear-gradient(to right, transparent, #000 20px); }
  .day-scroll.fade-l.fade-r { -webkit-mask-image: linear-gradient(to right, transparent, #000 20px, #000 calc(100% - 32px), transparent); mask-image: linear-gradient(to right, transparent, #000 20px, #000 calc(100% - 32px), transparent); }
}

/* ---- Document editor, round 3: wider item column, multi-line descriptions, sticky subtotal, save state beside Send ---- */
@media (min-width: 1200px) { .doc-wrap { grid-template-columns: minmax(0, 1fr) 312px; } .doc-main { padding: var(--space-4); } }
.doc-sheet { max-width: 920px; }
.doc-sec { padding: var(--space-5) var(--space-4); }
.lines td { padding-left: 6px; padding-right: 6px; }
.line-desc-input { min-height: 30px; field-sizing: content; resize: none; color: var(--color-ink-2); white-space: pre-wrap; }
.lines tfoot td { position: sticky; bottom: calc(-1 * var(--space-4)); z-index: 2; background: var(--color-surface); border-top: 1px solid var(--color-line-strong); padding-top: var(--space-3); padding-bottom: var(--space-3); box-shadow: 0 -6px 10px -8px rgba(22,24,29,.18); }
.lines tfoot .tf-label { font-size: var(--text-sm); color: var(--color-ink-2); font-weight: var(--weight-medium); padding-left: calc(6px + var(--space-3)); }
.lines tfoot .tf-sum { font-weight: var(--weight-bold); white-space: nowrap; }
.rail-save { display: flex; align-items: flex-start; gap: var(--space-2); font-size: var(--text-sm); line-height: var(--lh-sm); color: var(--color-ink-2); flex-wrap: wrap; }
.rail-save > .i { flex: none; margin-top: 1px; }
.rail-save > span { flex: 1; min-width: 0; }
.rail-save.is-saved > .i { color: var(--color-good); }
.rail-save.is-queued { padding: var(--space-2) var(--space-3); border-radius: var(--radius-sm); background: var(--color-attn-bg); color: var(--color-ink); }
.rail-save.is-queued > .i { color: var(--color-attn); }
.rail-save.is-failed { padding: var(--space-2) var(--space-3); border-radius: var(--radius-sm); background: var(--color-bad-bg); color: var(--color-ink); }
.rail-save.is-failed > .i { color: var(--color-bad); }
.rail-save > span { flex-basis: calc(100% - 24px); }
.rail-save.is-failed .btn { margin-left: 22px; }
.rail-save strong { font-weight: var(--weight-semibold); }

/* the sticky subtotal reads as a bar pinned to the bottom edge, flush with the viewport */
.lines tfoot td { background: var(--color-surface-2); border-top: 1px solid var(--color-line-strong); box-shadow: 0 -8px 16px -10px rgba(22,24,29,.28); padding-top: 10px; padding-bottom: calc(10px + var(--space-4)); }
.lines tfoot td:first-child { border-bottom-left-radius: var(--radius-sm); }
.line-desc-input { color: var(--color-ink); }
.line-desc-input::placeholder { color: var(--color-ink-3); }
.doc-side .meta { white-space: nowrap; }

.lines tfoot td::before { content: ""; position: absolute; left: 0; right: 0; top: -28px; height: 28px; background: linear-gradient(to bottom, rgba(255,255,255,0), var(--color-surface)); pointer-events: none; }
.lines th { padding-left: 6px; padding-right: 6px; }
.lines th.th-in { padding-left: 18px; }
.lines th.r.th-in { padding-left: 6px; padding-right: 18px; }
.lines th.r:not(.th-in) { padding-right: 6px; }

.tf-more { color: var(--color-ink); font-weight: var(--weight-semibold); }

.rail-list .email, .rail-note .email { white-space: nowrap; }
.rail-list strong, .rail-note strong { white-space: nowrap; }
.rail-list .email wbr, .rail-note .email wbr, .sv-val .email wbr { display: none; }
.doc-sec h4, .doc-sec > .row-flex > h4 { font-size: var(--text-md); line-height: var(--lh-md); color: var(--color-ink); font-weight: var(--weight-semibold); }

/* ---- Systemic density and weight (round 3): contacts, quotes and invoices, orders, calls ----
   Rows 44px; two weights per row (one medium/semibold identifier, the rest regular); secondary
   columns 13px ink-2; no boxed icon tiles; empty cells say "None" in ink-3. */
.table td { height: 44px; }
.table td.t2, .table td.meta, .table td.muted { font-size: var(--text-sm); color: var(--color-ink-2); }
.table .c-name { color: var(--color-ink); font-weight: var(--weight-medium); }
.table .none { color: var(--color-ink-3); }
.table .avatar.sm { --av: 24px; background: var(--color-surface-2); color: var(--color-ink-2); font-weight: var(--weight-medium); }
.docs-table td .num-cell { font-weight: var(--weight-medium); }
.table td.o-id { font-weight: var(--weight-medium); white-space: nowrap; }
.table tbody tr.clickable:hover td:last-child { box-shadow: inset -3px 0 0 var(--color-line-strong); }
.table td .c2 > span:first-child { font-weight: var(--weight-medium); }
/* calls log: one line per call, glyph not tile */
.call-row { grid-template-columns: 20px minmax(0, 1fr) auto auto; gap: var(--space-3); padding: 6px var(--space-4) 6px var(--space-5); min-height: 44px; }
.call-row .chan { width: 20px; height: 20px; background: none; color: var(--color-ink-3); }
.call-row .chan.missed { background: none; color: var(--color-attn); }
.call-row > .stack { flex-direction: row; align-items: baseline; gap: var(--space-3); min-width: 0; flex-wrap: nowrap; }
.call-row .cr-who { flex: none; max-width: 45%; font-weight: var(--weight-medium); }
.call-row .cr-line { flex: 0 1 auto; min-width: 0; display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: var(--text-sm); color: var(--color-ink-2); }
.call-row.missed .cr-line { color: var(--color-attn); font-weight: var(--weight-medium); }
.call-row .cr-line + .cr-follow { display: inline; margin: 0; flex: none; font-size: var(--text-sm); }
.call-row .cr-dur { font-size: var(--text-sm); color: var(--color-ink-2); }
.call-row .btn-icon { width: 32px; height: 32px; }
.calls-log .agenda-day { min-height: 32px; font-size: var(--text-sm); }
@media (max-width: 767px) {
  .call-row { padding: 10px var(--space-4); }
  .call-row > .stack { flex-direction: column; align-items: flex-start; gap: 2px; }
  .call-row .cr-who { max-width: 100%; }
  .call-row .btn-icon { width: 44px; height: 44px; }
}

.cell-link { color: inherit; text-decoration: none; }
.cell-link:hover { color: var(--color-accent); text-decoration: underline; }
.call-row { grid-template-columns: 44px 20px minmax(0, 1fr) auto 32px; }
.call-row .cr-time { font-size: var(--text-sm); color: var(--color-ink-2); }
.call-row .cr-act:empty { display: block; width: 0; }
.call-row .btn-icon { color: var(--color-ink-3); }
@media (max-width: 767px) { .call-row { grid-template-columns: 40px 20px minmax(0, 1fr) 44px; } .call-row .cr-act { display: none; } .call-row .btn-icon { width: 44px; height: 44px; } }

.dcard .dc-co { font-size: var(--text-xs); line-height: var(--lh-xs); }
.dcard.is-overdue { box-shadow: inset 3px 0 0 #c77700; }
.phone-status { font-size: var(--text-xs); font-weight: var(--weight-regular); min-height: 32px; }
.phone-status:hover { background: none; text-decoration: underline; text-underline-offset: 2px; }
/* settings header: title, description and the shared save state on the left; the one action top right */
.set-title .set-save { display: block; margin-top: var(--space-2); }
.set-title .set-save .savestate { height: auto; padding: 0; }
.set-inner.narrow { max-width: 784px; }
.num-card .perm-row { grid-template-columns: minmax(0, 260px) 96px 96px; }

.dcard .dc-foot { display: flex; align-items: center; min-width: 0; }
.dcard .dc-foot .dc-value { margin-left: auto; white-space: nowrap; flex: none; }
.dcard .dc-foot .dc-age { flex: 0 1 auto; min-width: 0; overflow: hidden; }
.p-legend { display: inline-flex; align-items: center; gap: 4px; margin-left: var(--space-4); font-size: var(--text-xs); color: var(--color-ink-2); }
.p-legend .i { width: 12px; height: 12px; }
@media (max-width: 1199px) { .p-legend { display: none; } }
.nc-sub { grid-column: 1 / -1; font-size: var(--text-sm); font-weight: var(--weight-semibold); color: var(--color-ink); margin-bottom: calc(-1 * var(--space-1)); }

.p-main { font-weight: var(--weight-medium); color: var(--color-ink); }
.num-card .perm-row { padding: var(--space-2) 0; }
.num-card .perm-row.head { padding-bottom: var(--space-1); }
.num-card .pr-who .meta { font-size: var(--text-sm); color: var(--color-ink-2); }
.num-card .nc-head .meta { font-size: var(--text-sm); }
.nc-dl { gap: var(--space-2) var(--space-4); margin-top: var(--space-3); padding-top: var(--space-3); }
.perm-row .c.c-locked { flex-direction: row; gap: 6px; }
.perm-row .c.c-locked .switch span { opacity: .35; background-image: none; }
.lock-i { width: 14px; height: 14px; color: var(--color-ink-2); }

.dcard .dc-doc { flex-wrap: nowrap; gap: 4px; }
.dcard .dc-doc .pill { margin-left: auto; flex: none; padding: 0 6px; }

.col-overdue { color: var(--color-attn); font-weight: var(--weight-semibold); }
.col-cards { padding: 0 4px 4px; }
.dcard { padding: var(--space-2) 9px; }

/* company: full width, wraps to a second line before it ever truncates */
.dcard .dc-co { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.p-item::before { content: "·"; margin: 0 6px; color: var(--color-ink-3); }
.p-item { white-space: nowrap; }
.perm-row .c.c-locked { position: relative; flex-direction: column; }
.perm-row .c.c-locked .lock-i { position: absolute; left: calc(50% + 26px); top: 50%; transform: translateY(-50%); }
.pr-name { min-width: 0; }
@media (max-width: 767px) {
  .num-card .nc-head { flex-wrap: nowrap; }
  .num-card .nc-head > .stack { flex: 1 1 0 !important; }
  .hide-phone { display: none; }
  .perm-row .c.c-locked .lock-i { left: calc(50% + 22px); }
  .call-row .cr-act, .call-row .cr-act:empty { display: none; }
}

@media (max-width: 767px) {
  .set-inner .num-card .nc-head { flex-wrap: nowrap; }
  .set-inner .num-card .nc-head > .stack { flex: 1 1 0 !important; min-width: 0; }
  .set-inner .num-card .perm-row { grid-template-columns: minmax(0, 1fr) 64px 76px; }
  .is-dial .phone-head .phone-new { display: none; }
}
@media (max-width: 767px) { .nc-dl { grid-template-columns: minmax(0, 1fr); } .nc-dl dd { min-width: 0; } .nc-dl dd .select { width: 100%; min-width: 0; text-overflow: ellipsis; } }

/* the Now line gets its own 20px band so it never reads as the bottom edge of the row above */
.agenda-now { margin: 10px 0 10px var(--space-4); }

.msg-exp { color: var(--color-ink-2); flex: none; margin-top: 2px; transition: transform var(--dur-fast); }
.msg:not(.is-collapsed) .msg-exp { transform: rotate(180deg); }
.msg-subj { font-weight: var(--weight-medium); }
.composer textarea { min-height: 52px; }
.suggest .btn-icon { flex: none; margin-left: -4px; color: var(--color-ink-2); }

/* ===== Settings (ported from design/settings.html inline styles) ===== */
.perm-row { display: grid; grid-template-columns: minmax(0, 1fr) 96px 96px; gap: var(--space-3); align-items: center; padding: var(--space-3) 0; border-bottom: 1px solid var(--color-line); }
.perm-row.head { font-size: var(--text-xs); color: var(--color-ink-3); font-weight: 600; padding-top: 0; }
.perm-row .c { display: flex; justify-content: center; }
.nc-body .perm-row:last-of-type { border-bottom: 0; }
.num-card { border: 1px solid var(--color-line); border-radius: var(--radius-md); }
.num-card .nc-head { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-4); border-bottom: 1px solid var(--color-line); flex-wrap: wrap; }
.num-card .nc-body { padding: var(--space-2) var(--space-4) var(--space-4); }
.conn-card { display: grid; grid-template-columns: 40px minmax(0,1fr) auto; gap: var(--space-3); align-items: center; padding: var(--space-4); border: 1px solid var(--color-line); border-radius: var(--radius-md); }
.conn-card > :last-child { justify-content: flex-end; min-width: 196px; }
.conn-logo { width: 40px; height: 40px; border-radius: var(--radius-sm); background: var(--color-surface-2); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: var(--text-sm); color: var(--color-ink-2); }
.form-row { display: grid; grid-template-columns: 200px minmax(0,1fr); gap: var(--space-4); align-items: start; padding: var(--space-4) 0; border-bottom: 1px solid var(--color-line); }
.form-row > .label { padding-top: 8px; }
.form-row .hint { margin-top: 6px; }
.tpl-row { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3) 0; border-bottom: 1px solid var(--color-line); }
.set-back { display: none; }
.role-sel { width: auto; height: 32px; }
@media (max-width: 767px) { .role-sel { height: 40px; font-size: var(--text-md); max-width: 128px; } .num-card .nc-head > .stack { flex: 1 1 calc(100% - 44px) !important; } .table .c2 { min-width: 0; } .table .c2 .meta, .table .c2 .strong { overflow-wrap: anywhere; } #users-table { table-layout: fixed; width: 100%; } #users-table td { padding-bottom: 14px; } #users-table th:last-child, #users-table td:nth-child(2) { width: 136px; } }
.form-row.text > .label { padding-top: 0; }
.rule .switch + .sw-label { font-size: var(--text-xs); color: var(--color-ink-3); }
.set-title { flex-wrap: wrap; }
@media (max-width: 767px) { .stage-row { grid-template-columns: 20px minmax(0,1fr) 96px 44px; gap: var(--space-2); padding: var(--space-2); } .stage-row .btn-icon { width: 44px; height: 44px; } .set-title > .btn:not(.btn-icon), .set-title > a.btn:not(.btn-icon) { width: 100%; } .set-title > a.btn-icon { display: none; } .set-title > .spacer { display: none; } }
@media (max-width: 1199px) { .form-row { grid-template-columns: 1fr; gap: var(--space-2); } .form-row > .label { padding-top: 0; } }
@media (max-width: 767px) {
  .settings .set-nav { display: block; }
  .is-detail .settings .set-nav { display: none; }
  .settings .set-body { display: none; }
  .is-detail .settings .set-body { display: block; }
  .form-row { grid-template-columns: 1fr; gap: var(--space-2); }
  .form-row > .label { padding-top: 0; }
  .perm-row { grid-template-columns: minmax(0,1fr) 64px 64px; }
  .conn-card { grid-template-columns: 40px minmax(0,1fr); }
  .conn-card > :last-child { grid-column: 1 / -1; }
}
.input-ghost { border-color: transparent; background: transparent; padding-left: 0; height: 32px; font-weight: var(--weight-semibold); }
.input-ghost:hover { border-color: var(--color-line); }
.input-ghost:focus { border-color: var(--color-accent); background: var(--color-surface); padding-left: var(--space-2); }
.input-sm, .select-sm { height: 32px; font-size: var(--text-sm); }
.btn-xs { width: 24px; height: 18px; min-height: 0; padding: 0; font-size: 9px; line-height: 1; }
.stage-row { display: grid; grid-template-columns: 28px minmax(0,1fr) 200px 36px; gap: var(--space-3); align-items: center; padding: var(--space-2) var(--space-4); border-bottom: 1px solid var(--color-line); }
.sender-card .nc-head .pill { margin-left: auto; }
.sender-card .form-row { padding: var(--space-3) 0; }
.sv-val { display: flex; flex-direction: column; gap: var(--space-2); }
.auth-grid { display: grid; grid-template-columns: 72px auto; gap: 6px var(--space-3); align-items: center; }
.stage-row { grid-template-columns: 28px minmax(0,1fr) 200px 56px; }
@media (max-width: 767px) {
  .settings.is-home .set-nav a[aria-current="page"] { background: none; }
  .settings .set-nav a::after { content: "›"; margin-left: auto; color: var(--color-ink-3); font-size: var(--text-xl); }
}
.table .c2 .meta { white-space: nowrap; }
.settings .table td:nth-child(4) { min-width: 200px; }
