/* Dial Haul CRM, round 3 (owner, Nov 10 2026): light for everyone, the Bevel & Sloane palette as support colors.
   Loaded after every other style sheet. Dial Haul's own brand (the ink sidebar, the blue primary button) stays.
   Light mode tokens (the dark block in crm-live.css still wins when a person switches dark on in Settings).
   Design pass of Nov 10 (design/crm-round3-design.md): the blocks below are 1 tokens, 2 type, 3 sidebar, 4 stat cards, 5 chips,
   6 tables, 7 buttons and fields, 8 empty states, 9 charts, 10 pipeline, 11 panels and strips, 12 phone, 13 dark guards, 14 footer.
   Every text color here was checked against its background (contrast table in the design note). */

/* ===== 1. tokens ===== */
:root:not([data-theme=dark]) {
  --paper: #FAF9F6; --panel: #FFFDF8; --ink: #2E2326; --body: #594F4F; --muted: #6E6464; --line: #E7E1D8;
  --tint: #EEF3F8;
  /* words in color on cream: each one is the palette hue, darkened until it passes AA on its chip and on a card */
  --green: #3F5D27;        /* moss as text: 5.35 on the moss tint, 7.36 on a card */
  --red-text: #9C3A24;     /* terracotta as text: 4.97 on blush, 6.79 on a card */
  --amber-text: #7A4A1E;   /* apricot as text: 5.86 on peach */
  --olive-text: #6B4A10;   /* mustard as text: 5.97 on olive */
  --wine-text: #5C1A33;    /* burgundy as text: 9.17 on blush */
  --soft: #F1EEE8;         /* the neutral chip and the quiet tile: warm, one step under the page */
}
:root {
  --terracotta: #D0583B; --burgundy: #5C1A33; --mustard: #DDB24A; --moss: #5E7F3F; --apricot: #F09367; --blush: #F2B5B4;
  --t-blush: #F7D3CB; --t-apricot: #F7C3A8; --t-copper: #F4C7B8; --t-moss: #D9DCC6; --t-olive: #E3E0B4; --t-peach: #F6E1CC;
  --t-blue: #E4EEF7;
}

/* ===== 2. type: ink for headings and numbers, body for text, muted for notes; numbers line up in columns ===== */
:root:not([data-theme=dark]) body { color: var(--body); }
:root:not([data-theme=dark]) h1, :root:not([data-theme=dark]) h2, :root:not([data-theme=dark]) h3,
:root:not([data-theme=dark]) strong, :root:not([data-theme=dark]) .statvalue, :root:not([data-theme=dark]) .chart-total { color: var(--ink); }
:root:not([data-theme=dark]) .negative, :root:not([data-theme=dark]) .down { color: var(--red-text); }
:root:not([data-theme=dark]) .positive, :root:not([data-theme=dark]) .up { color: var(--green); }
.statvalue, .chart-total, td, th, .mini-kpis strong, #app .dh-tile strong, .linkstats strong, .day strong { font-variant-numeric: tabular-nums; }
.pagehead h1 { letter-spacing: -.02em; }
.panelhead h2, .tabletop h2 { letter-spacing: -.01em; }

/* ===== 3. the sidebar keeps Dial Haul's navy and its own light text; the ink rule above must not reach it ===== */
.side { background: #07111b; }
:root:not([data-theme=dark]) .side h1, :root:not([data-theme=dark]) .side h2, :root:not([data-theme=dark]) .side h3, :root:not([data-theme=dark]) .side strong { color: inherit; }
:root:not([data-theme=dark]) .side .me strong, :root:not([data-theme=dark]) .side .user strong, :root:not([data-theme=dark]) .side .profile strong { color: #fff; }
/* the other dark surfaces (the reward hero, the plan card, the tour call, the toast, the pack brand) keep their own light text */
:root:not([data-theme=dark]) .reward-hero h2, :root:not([data-theme=dark]) .reward-hero h3, :root:not([data-theme=dark]) .reward-hero strong,
:root:not([data-theme=dark]) .plan-card h2, :root:not([data-theme=dark]) .plan-card h3, :root:not([data-theme=dark]) .plan-card strong,
:root:not([data-theme=dark]) .tour-call h2, :root:not([data-theme=dark]) .tour-call h3, :root:not([data-theme=dark]) .tour-call strong,
:root:not([data-theme=dark]) #toast strong, :root:not([data-theme=dark]) .pack-modal-brand h2, :root:not([data-theme=dark]) .pack-modal-brand h3, :root:not([data-theme=dark]) .pack-modal-brand strong,
:root:not([data-theme=dark]) .mobile-callbar strong, :root:not([data-theme=dark]) button.primary strong { color: inherit; }
/* the plan card, the pack brand strip and the toast are Dial Haul's navy, like the sidebar, not the plum ink of the text */
:root:not([data-theme=dark]) .plan-card, :root:not([data-theme=dark]) .pack-modal-brand, :root:not([data-theme=dark]) #toast { background: #07111b; border-color: #07111b; }
/* the reward hero is the one dark card on a page: burgundy, the palette's deep tone, with blush text (eyebrow 7.0, body 9.2 on it) */
:root:not([data-theme=dark]) .reward-hero { background: var(--burgundy); color: #fff; }
:root:not([data-theme=dark]) .reward-hero .eyebrow { color: var(--blush); }
:root:not([data-theme=dark]) .reward-hero p { color: var(--t-blush); }
:root:not([data-theme=dark]) .reward-budget { border-color: rgba(255, 255, 255, .28); background: rgba(255, 255, 255, .06); }
:root:not([data-theme=dark]) .reward-budget strong { color: #fff; }
:root:not([data-theme=dark]) .reward-budget small, :root:not([data-theme=dark]) .reward-budget span { color: var(--t-blush); }

/* ===== 4. stat cards (owner, Nov 13: calm): a white card, the label in gray with a small gray icon beside it, the number and its
   note under it. No colored strip, no tinted band, no colored icon square, on every role. crm-theme.js still sets data-metric. ===== */
.stat { --sp: 20px; padding: var(--sp) !important; display: flex; flex-direction: column; overflow: hidden; min-height: 0; background: #fff; border-top: 1px solid var(--line); }
@media (max-width: 1200px) { .stat { --sp: 17px; } }
@media (max-width: 600px) { .stat { --sp: 14px; } }
.stat .statlabel { margin: 0 0 10px; padding: 0; min-height: 0; background: transparent; border: 0; color: var(--muted); font-weight: 500; font-size: 13px;
  display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.stat .statlabel .ui-icon { width: 16px; height: 16px; min-width: 16px; max-width: 16px; max-height: 16px; padding: 0; border-radius: 0; background: transparent;
  color: #8a94a3; box-shadow: none; }
.stat .statvalue, .stat .statfoot { padding: 0; }
.stat .statvalue { margin: 0 0 5px; line-height: 1.15; }
.stat .statfoot { padding-bottom: 0; margin-top: 0; line-height: 1.5; }
@media (max-width: 600px) {
  .stat .statlabel { margin-bottom: 8px; }
  .stat .statlabel .ui-icon { display: inline-flex; width: 15px; height: 15px; min-width: 15px; max-width: 15px; }
}

/* ===== 5. chips: one meaning, one color. green is money or done (moss), amber is waiting (apricot on peach), olive is scheduled or
   on its way (mustard), red is stop (terracotta on blush), blue is new or information, grey is a plain fact. Roles are quiet outline
   chips (a table of people is not a rainbow); the owner and an admin read in burgundy. The !important beats polish.css. ===== */
:root:not([data-theme=dark]) .badge { font-weight: 500; letter-spacing: .01em; }
:root:not([data-theme=dark]) .badge.status-success, :root:not([data-theme=dark]) .badge.green, :root:not([data-theme=dark]) .badge.success,
:root:not([data-theme=dark]) .pill.green, :root:not([data-theme=dark]) .badge.gray.status-success { background: var(--t-moss) !important; color: var(--green) !important; border-color: transparent !important; }
:root:not([data-theme=dark]) .badge.status-warning, :root:not([data-theme=dark]) .badge.amber,
:root:not([data-theme=dark]) .badge.gray.status-warning { background: var(--t-peach) !important; color: var(--amber-text) !important; border-color: transparent !important; }
:root:not([data-theme=dark]) .badge.status-invited { background: var(--t-olive) !important; color: var(--olive-text) !important; border-color: transparent !important; }
:root:not([data-theme=dark]) .badge.status-danger, :root:not([data-theme=dark]) .badge.red, :root:not([data-theme=dark]) .badge.danger { background: var(--t-blush) !important; color: var(--red-text) !important; border-color: transparent !important; }
:root:not([data-theme=dark]) .badge.status-info, :root:not([data-theme=dark]) .badge.blue, :root:not([data-theme=dark]) .badge.gray.status-info { background: var(--t-blue) !important; color: var(--blue) !important; border-color: transparent !important; }
:root:not([data-theme=dark]) .badge.status-neutral, :root:not([data-theme=dark]) .badge.gray { background: var(--soft) !important; color: var(--body) !important; border-color: transparent !important; }
:root:not([data-theme=dark]) .badge[class*="role-"] { background: transparent !important; color: var(--body) !important; border: 1px solid var(--line) !important; padding: 4px 8px; }
:root:not([data-theme=dark]) .badge.role-owner, :root:not([data-theme=dark]) .badge.role-admin { color: var(--wine-text) !important; border-color: #E9C9C4 !important; }
:root:not([data-theme=dark]) .chip { background: var(--panel); border-color: var(--line); color: var(--body); }
:root:not([data-theme=dark]) .chip.on { background: var(--t-blue); border-color: var(--blue); color: var(--blue); }

/* ===== 6. tables: rows a step tighter, headers quiet, numbers right aligned in tabular figures (crm-theme.js marks a column whose
   cells are all numbers with dh-num), the row action a small quiet button, the pinned action column on a solid card ===== */
td { padding: 12px 20px; }
td small { margin-top: 3px; }
:root:not([data-theme=dark]) th { background: transparent; color: var(--muted); font-weight: 600; letter-spacing: .04em; border-top: 0; }
:root:not([data-theme=dark]) tbody tr:hover { background: var(--paper); }
th.dh-num, td.dh-num { text-align: right; }
td.dh-num { font-variant-numeric: tabular-nums; }
tbody td:last-child > button:not(.primary):not(.ghost):not(.link), tbody td:last-child > .actions > button:not(.primary):not(.ghost):not(.link) { min-height: 32px; padding: 6px 11px; font-size: 12px; font-weight: 500; }
tbody td:last-child > button .ui-icon, tbody td:last-child > .actions > button .ui-icon { width: 14px; height: 14px; min-width: 14px; }
:root:not([data-theme=dark]) .table-wrap.dh-ovf.dh-pin tbody tr > :last-child { background: var(--panel); }
:root:not([data-theme=dark]) .table-wrap.dh-ovf.dh-pin tbody tr:hover > :last-child { background: var(--paper); }
/* the pinned action cell covers a solid strip to its left, so no sliver of the cell scrolling under it peeks out beside the button */
.table-wrap.dh-ovf.dh-pin tbody tr > :last-child { box-shadow: -1px 0 0 var(--line), -28px 0 0 var(--panel); }
.table-wrap.dh-more-r.dh-pin tbody tr > :last-child { box-shadow: -1px 0 0 var(--line), -28px 0 0 var(--panel), -12px 0 12px -12px rgba(46, 35, 38, .18); }
:root:not([data-theme=dark]) .table-wrap.dh-ovf.dh-pin tbody tr:hover > :last-child { box-shadow: -1px 0 0 var(--line), -28px 0 0 var(--paper); }
.table-wrap .empty { padding: 36px 20px; }
@media (max-width: 600px) { td { padding: 14px 16px; } }

/* ===== 7. buttons and fields: cream surfaces, one hairline, the blue focus ring the CRM already has ===== */
/* plain buttons already take --panel and --line from the prototype's own rule, so nothing is restyled here (the nav and the tabs share the element) */
:root:not([data-theme=dark]) button.lime { background: var(--t-blue); border-color: var(--t-blue); color: var(--blue); }
:root:not([data-theme=dark]) .search input, :root:not([data-theme=dark]) textarea, :root:not([data-theme=dark]) input[type=text], :root:not([data-theme=dark]) input[type=email],
:root:not([data-theme=dark]) input[type=tel], :root:not([data-theme=dark]) input[type=number], :root:not([data-theme=dark]) input[type=date], :root:not([data-theme=dark]) input[type=search],
:root:not([data-theme=dark]) .filters input, :root:not([data-theme=dark]) .filters select, :root:not([data-theme=dark]) .agent-stage-filter select, :root:not([data-theme=dark]) .page-size select,
:root:not([data-theme=dark]) .modal input, :root:not([data-theme=dark]) .modal select, :root:not([data-theme=dark]) .modal textarea, :root:not([data-theme=dark]) #app .dh-snooze input, :root:not([data-theme=dark]) .dh-nexttry input {
  background-color: var(--panel); border-color: var(--line); color: var(--ink); }
:root:not([data-theme=dark]) input::placeholder, :root:not([data-theme=dark]) textarea::placeholder { color: var(--muted); opacity: 1; }
:root:not([data-theme=dark]) .role { background: var(--panel); border-color: var(--line); }
:root:not([data-theme=dark]) .teamlink, :root:not([data-theme=dark]) .status-card, :root:not([data-theme=dark]) .setup-task { background: var(--paper); border-color: var(--line); }
/* ===== switches (owner, Nov 16: "it is hard to tell if these permissions are on or off") =====
   One switch on every screen (Settings, Dark mode, team alerts, the admin Permissions tab), light and dark, every width. The old
   layers drew the knob with flex and the button's 8px gap, so a child <span> pushed the "on" knob back to the middle of the track
   and on and off differed by a few pixels. Now the button is only the tap box: ::after is the 44x24 track at its right edge,
   ::before the 18px knob, placed with right and moved with transform, so no child, gap or padding can shift it.
   On: the brand blue track, the knob on the right (white; the page navy in dark mode, where the blue is light).
   Off: an outlined track (the muted line on the panel), a muted knob on the left. 150ms slide, none with reduced motion. */
:is(#app, #overlay) button.switch {
  position: relative; display: inline-block; flex: 0 0 44px; box-sizing: border-box; width: 44px; min-width: 44px; height: 24px; min-height: 24px;
  margin: 0; padding: 0; border: 0 solid transparent; border-radius: 12px; background: transparent; box-shadow: none; transform: none;
  vertical-align: middle; cursor: pointer; -webkit-tap-highlight-color: transparent;
}
:is(#app, #overlay) button.switch > * { display: none; }
:is(#app, #overlay) button.switch:hover, :is(#app, #overlay) button.switch:active { background: transparent; transform: none; }
:is(#app, #overlay) button.switch::after {
  content: ''; position: absolute; right: 0; top: 50%; width: 44px; height: 24px; margin-top: -12px; box-sizing: border-box; border-radius: 12px;
  background: var(--blue); box-shadow: none; transition: background-color .15s ease-out, box-shadow .15s ease-out;
}
:is(#app, #overlay) button.switch::before {
  content: ''; position: absolute; z-index: 1; right: 3px; top: 50%; width: 18px; height: 18px; margin-top: -9px; border-radius: 50%; flex: none;
  background: #fff; box-shadow: 0 1px 2px rgba(7, 17, 27, .3); transform: translateX(0); transition: transform .15s ease-out, background-color .15s ease-out;
}
:is(#app, #overlay) button.switch.off::after { background: var(--panel); box-shadow: inset 0 0 0 1.5px var(--muted); }
:is(#app, #overlay) button.switch.off::before { background: var(--muted); box-shadow: none; transform: translateX(-20px); }
:root:not([data-theme=dark]) :is(#app, #overlay) button.switch.off:hover::after { background: var(--soft); }
:is(#app, #overlay) button.switch:focus { outline: none; }
:is(#app, #overlay) button.switch:focus-visible::after { box-shadow: 0 0 0 2px var(--panel), 0 0 0 4px var(--blue); }
:is(#app, #overlay) button.switch.off:focus-visible::after { box-shadow: inset 0 0 0 1.5px var(--muted), 0 0 0 2px var(--panel), 0 0 0 4px var(--blue); }
:is(#app, #overlay) button.switch[aria-busy=true] { cursor: progress; }
html[data-theme=dark] :is(#app, #overlay) button.switch, html[data-theme=dark] :is(#app, #overlay) button.switch:hover { background: transparent; border-color: transparent; }
html[data-theme=dark] :is(#app, #overlay) button.switch::before { background: var(--paper); box-shadow: none; }
html[data-theme=dark] :is(#app, #overlay) button.switch.off::before { background: var(--muted); }
html[data-theme=dark] :is(#app, #overlay) button.switch.off:hover::after { background: #1b2636; }
/* phones and touch screens: a 52x44 tap box, the same track at its right edge (so it lines up with the row's buttons) */
@media (max-width: 700px), (pointer: coarse) {
  :is(#app, #overlay) button.switch { flex: 0 0 52px; width: 52px; min-width: 52px; height: 44px; min-height: 44px; border-radius: 0; }
}
@media (prefers-reduced-motion: reduce) {
  :is(#app, #overlay) button.switch::before, :is(#app, #overlay) button.switch::after { transition: none; }
}
body.reduce-motion :is(#app, #overlay) button.switch::before, body.reduce-motion :is(#app, #overlay) button.switch::after { transition: none; }
:root:not([data-theme=dark]) #app .dh-seg { background: var(--soft); }
:root:not([data-theme=dark]) #app .dh-seg button { color: var(--muted); }
#app .dh-seg button { white-space: nowrap; }   /* "7 days" broke into two lines on a phone */
:root:not([data-theme=dark]) #app .dh-seg button.selected { background: var(--panel); color: var(--ink); box-shadow: 0 1px 2px rgba(46, 35, 38, .08); }
:root:not([data-theme=dark]) .modal .dh-ms-btn, :root:not([data-theme=dark]) .dh-ms-panel, :root:not([data-theme=dark]) .chart-tip, :root:not([data-theme=dark]) .crm-gate-box { background: var(--panel); border-color: var(--line); }
:root:not([data-theme=dark]) .modal input[type=file] { background: var(--paper); border-color: #D9CFC2; color: var(--body); }
:root:not([data-theme=dark]) #app .dh-chip { background: var(--panel); border-color: var(--line); color: var(--body); }
/* the shop: pack groups and pack cards on cream with the one hairline; the dark pack face keeps its own white count */
:root:not([data-theme=dark]) .dh-grp, :root:not([data-theme=dark]) .dh-bc { background: var(--panel); border-color: var(--line); }
:root:not([data-theme=dark]) .dh-grp { box-shadow: none; }
:root:not([data-theme=dark]) .dh-bc { color: var(--ink); }
:root:not([data-theme=dark]) .dh-bc-face h2, :root:not([data-theme=dark]) .dh-bc-face h3, :root:not([data-theme=dark]) .dh-bc-face strong,
:root:not([data-theme=dark]) .pack-face h2, :root:not([data-theme=dark]) .brand-pack .pack-face strong { color: inherit; }
:root:not([data-theme=dark]) #app .dh-chip.selected { background: var(--ink); border-color: var(--ink); color: #fff; }
:root:not([data-theme=dark]) #app .dh-bar, :root:not([data-theme=dark]) .bar, :root:not([data-theme=dark]) .metric-spark { background: var(--line); }
:root:not([data-theme=dark]) #app .dh-bar b { background: var(--moss); }
:root:not([data-theme=dark]) #app .dh-tile { background: var(--paper); border: 1px solid var(--line); }
:root:not([data-theme=dark]) .avatar { background: var(--t-blue); color: var(--blue); }
:root:not([data-theme=dark]) .mini-kpis > div, :root:not([data-theme=dark]) .detail-grid > div { background: var(--panel); border-color: var(--line); }

/* ===== 8. empty states: a round soft icon chip, a short line, no tall blank ===== */
.empty { padding: 40px 20px; color: var(--muted); }
.empty h3 { font-size: 14px; margin: 0 0 4px; }
.empty p { font-size: 13px; margin: 0; line-height: 1.6; }
.empty p + button, .empty p + .actions { margin-top: 14px; }
.empty > .ui-icon { width: 40px; height: 40px; min-width: 40px; max-width: 40px; max-height: 40px; padding: 10px; border-radius: 50%; margin-bottom: 12px; box-sizing: border-box; }
:root:not([data-theme=dark]) .empty > .ui-icon { background: var(--t-peach); color: var(--red-text); }
:root:not([data-theme=dark]) .column .ui-empty, :root:not([data-theme=dark]) #app .dh-empty { color: var(--muted); }
/* a panel the grid stretches to its neighbor's height keeps its empty line in the middle, not pinned under the title */
.panel:has(> .empty:last-child), .panel > div:has(> .empty:last-child) { display: flex; flex-direction: column; }
.panel > .empty:last-child, .panel > div > .empty:last-child { margin: auto 0; }
@media (max-width: 600px) { .empty { padding: 28px 14px; } }

/* ===== 9. charts: solid bars without the icon stroke (the global svg stroke reached the rects), today's bar in the full blue,
   the rest a lighter blue; the tooltip on a card ===== */
.chart svg rect { stroke: none; }
:root:not([data-theme=dark]) .chart svg rect { fill: var(--blue); fill-opacity: .42; }
:root:not([data-theme=dark]) .chart svg rect:last-of-type { fill-opacity: 1; }
:root:not([data-theme=dark]) .chart svg line, :root:not([data-theme=dark]) .chart svg path.grid { stroke: var(--line); }
:root:not([data-theme=dark]) .chart-dot { background: var(--blue); border-color: var(--panel); }
:root:not([data-theme=dark]) .chart-guide { background: var(--muted); }

/* ===== 10. pipeline: a stage mark before each column name (new blue, contacted mustard, appointment apricot, sold moss),
   the card's two actions on one line ===== */
.column > h3 { display: flex; align-items: center; gap: 8px; }
.column > h3:before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--stage, var(--blue)); flex: 0 0 8px; }
.column:nth-child(1) { --stage: var(--blue); }
.column:nth-child(2) { --stage: var(--mustard); }
.column:nth-child(3) { --stage: var(--apricot); }
.column:nth-child(4) { --stage: var(--moss); }
.column:nth-child(5) { --stage: var(--terracotta); }
.column .leadcard .actions { align-items: center; gap: 4px; }
.column .leadcard .actions button.link, .column .leadcard .actions button.ghost { min-height: 32px; padding: 6px 8px; }
:root:not([data-theme=dark]) .column { background: var(--paper); }
:root:not([data-theme=dark]) .column .leadcard { background: var(--panel); }

/* ===== 11. panels and strips: the invite hero is a cream card, not a blue block; a panel drawn inside a panel loses its own frame;
   the information strips (offer, notice, drop banner) keep the blue tint but a hairline edge so they sit on cream ===== */
:root:not([data-theme=dark]) .invite-hero { background: var(--panel); border-color: var(--line); }
.invite-hero { padding: 26px 28px; align-items: flex-start; }
.invite-hero h2 { font-size: 22px; }
.invite-hero p { font-size: 13px; line-height: 1.6; margin: 8px 0 18px; }
.invite-hero .actions { align-items: center; }
.invite-hero > div > button { vertical-align: middle; }   /* two inline buttons sat on the text baseline, one 5px lower */
.panel .panel { border: 0; border-radius: 0; border-top: 1px solid var(--line); }
.panel .panel:first-child { border-top: 0; }
:root:not([data-theme=dark]) .notice, :root:not([data-theme=dark]) .crm-offer:not(.unpaid-banner), :root:not([data-theme=dark]) .insight { background: var(--t-blue); border-color: #D5E2EE; }
:root:not([data-theme=dark]) .panel, :root:not([data-theme=dark]) .leadcard, :root:not([data-theme=dark]) .modal, :root:not([data-theme=dark]) .drawer { background: var(--panel); border-color: var(--line); }
:root:not([data-theme=dark]) .top, :root:not([data-theme=dark]) .topbar { background: var(--panel); border-color: var(--line); }
.linkstats > div, .link-stats > div { background: var(--paper); }

/* ===== 12. phone: the footer stacks, the numbers tiles pair up, the range row keeps its label on the line ===== */
@media (max-width: 600px) {
  .footer { flex-direction: column; gap: 6px; }
  .footer .dh-made { display: block; }
  .mini-kpis { grid-template-columns: 1fr 1fr; gap: 10px; }
  .mini-kpis > div { padding: 13px; }
  .mini-kpis strong { font-size: 20px; }
  .pagehead .actions > span { white-space: nowrap; }
  .invite-hero { padding: 20px; }
  .invite-hero h2 { font-size: 20px; }
  .column h3 { margin-bottom: 12px; }
  /* the team list on a phone: a long status chip wraps under the name instead of squeezing it to "Nathani..." */
  #app .dh-net-main { flex-wrap: wrap; row-gap: 6px; }
  #app .dh-net-main > .grow { flex: 1 1 150px; }
  #app .dh-net-main > .badge { margin-left: 46px; }
}

/* ===== 13. dark guards: the dark tokens live in crm-live.css; only the metric tints and the chips need their own dark values ===== */
[data-theme=dark] .stat .statlabel { color: var(--muted); }
[data-theme=dark] .stat .statlabel .ui-icon { color: var(--muted); }
[data-theme=dark] .stat { background: var(--panel); }
[data-theme=dark] .chart svg rect { fill: var(--blue); fill-opacity: .45; }
[data-theme=dark] .chart svg rect:last-of-type { fill-opacity: 1; }
[data-theme=dark] .empty > .ui-icon { background: color-mix(in srgb, var(--apricot) 22%, transparent); color: var(--apricot); }
[data-theme=dark] .panel .panel { border-top-color: var(--line); }
/* dark chips in the same meanings, on deep tints (each pair checked: 4.9 to 11.5); the role chips stay quiet outlines */
[data-theme=dark] .badge.status-success, [data-theme=dark] .badge.green, [data-theme=dark] .badge.gray.status-success { background: #27371F !important; color: #B9D39A !important; border-color: transparent !important; }
[data-theme=dark] .badge.status-warning, [data-theme=dark] .badge.amber, [data-theme=dark] .badge.gray.status-warning { background: #4A3414 !important; color: #F3CF8F !important; border-color: transparent !important; }
[data-theme=dark] .badge.status-invited { background: #3F3A16 !important; color: #E3D27A !important; border-color: transparent !important; }
[data-theme=dark] .badge.status-danger, [data-theme=dark] .badge.red, [data-theme=dark] .badge.danger { background: #4A1F1A !important; color: #F0A090 !important; border-color: transparent !important; }
[data-theme=dark] .badge.status-info, [data-theme=dark] .badge.blue, [data-theme=dark] .badge.gray.status-info { background: #1D3A66 !important; color: #CFE1FF !important; border-color: transparent !important; }
[data-theme=dark] .badge.status-neutral, [data-theme=dark] .badge.gray { background: #243247 !important; color: var(--ink) !important; border-color: transparent !important; }
[data-theme=dark] .badge[class*="role-"] { background: transparent !important; color: #C6D4E9 !important; border: 1px solid var(--line) !important; padding: 4px 8px; }
[data-theme=dark] .badge.role-owner, [data-theme=dark] .badge.role-admin { color: #F2B5B4 !important; border-color: #5C1A33 !important; }
/* the dark button rule in crm-live.css reached the text tabs, the period switch and the role picker: those stay flat */
[data-theme=dark] .section-tabs button, [data-theme=dark] .queue-pills button, [data-theme=dark] .section-tabs button.selected, [data-theme=dark] .queue-pills button.selected,
[data-theme=dark] #app .dh-seg button, [data-theme=dark] .role { background: transparent; border-color: transparent; }
[data-theme=dark] .section-tabs button.selected, [data-theme=dark] .queue-pills button.selected { border-bottom-color: var(--blue); }
[data-theme=dark] .role { border-color: var(--line); }
[data-theme=dark] #app .dh-seg button.selected { background: #243247; }
[data-theme=dark] .mobile-dock > button:not(.selected) { background: transparent; border-color: transparent; }

/* ===== 14. the credit in the footer (owner: keep "Made by Rankwyre") ===== */
.footer .dh-made a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }

/* round 3 test fixes: partner and leader */
/* The phone network row (Team Overview, Members & Invites, My Network > Network at 390): the name column was squeezed to about
   70px by the status chip and the drill down button, so "Nathaniel Turner" read "Nathani…". The text takes the row's width and the
   chip sits under it, in line with the text. */
/* (crm-live.css is added by crm-boot.js after this sheet, so these carry one more class than its rules) */
@media (max-width: 700px) {
  #app .dh-net-card .dh-net-main { flex-wrap: wrap; row-gap: 6px; }
  #app .dh-net-card .dh-net-main .grow { flex: 1 1 calc(100% - 46px); }
  #app .dh-net-card .dh-net-main strong { white-space: normal; overflow: visible; text-overflow: clip; }
  #app .dh-net-card .dh-net-main .badge { margin-left: 46px; }
}

/* round 3 test fixes: agent and bulk buyer */
/* the light theme's ink rule for strong reached the figures on dark cards: the lead count on a pack card's face and the prize
   budget in the Team Rewards hero went near black on navy. They keep the colors their own rules give them */
:root:not([data-theme=dark]) .dh-bcf-count strong { color: #fff; }
:root:not([data-theme=dark]) .reward-hero strong, :root:not([data-theme=dark]) .reward-budget strong { color: #cae1ff; }
:root:not([data-theme=dark]) .reward-hero h2, :root:not([data-theme=dark]) .reward-hero h3 { color: #fff; }
@media (max-width: 600px) {
  /* a panel head's button ("My leads") and the 7 or 30 day switch keep their words on one line */
  #app .panelhead > button, #app .panelhead .actions > button, #app .dh-seg button { white-space: nowrap; }
  /* the Due now strip: the lead's line, then its three buttons on a line of their own, the same for every row */
  #app .dh-strip-row .grow { flex-basis: 100%; }
}
/* the Bad Number Policy link in the pack's accept box took the browser's own blue and underline; it reads in the CRM's blue */
#overlay .modal label a, #overlay .modal .dh-accept a { color: var(--blue); text-decoration: underline; text-underline-offset: 2px; }

/* round 3 test fixes: owner and admin */
/* index.html loads this sheet before crm-live.css, so a rule here that overrides one in crm-live.css needs more specificity */
/* People & Teams > Network at 1440: the 8 column table ran 111px past its card and the Earned column sat off screen. Tighter
   cell sides at desktop fit every column; the phone list (dh-net-phone) is its own markup and is not touched */
@media (min-width: 1200px) {
  #app .dh-net-table th, #app .dh-net-table td { padding-left: 10px; padding-right: 10px; }
  #app .dh-net-table th:first-child, #app .dh-net-table td:first-child { padding-left: 20px; }
}
/* People & Teams > Network on a phone: a long name was cut to "Nathani..." beside the status chip; the name wraps instead */
@media (max-width: 700px) {
  #app .dh-net .dh-net-main strong { white-space: normal; overflow: visible; text-overflow: clip; }
}
/* Drops & Launches on a phone: "Next drop: Tomorrow, 9:00 AM Central" broke over four lines beside its button; the button drops under */
@media (max-width: 600px) {
  #app .drop-banner { flex-wrap: wrap; }
  #app .drop-banner > button { flex: 1 1 100%; justify-content: center; }
}

/* ===== no status dots anywhere (owner, Nov 12): pills and markers are plain text tags. The stage dot before each pipeline column,
   the bell's dot, the badge dot, the pulse and the calling marker are gone; a count or a word says it instead ===== */
.badge.dot:before, .badge:before, .badge:after, .chip:before, .chip:after, .pulse, .calling-dot, .status-dot, .live-dot,
.column > h3:before, .bell:after, .nav .count:before, .healthstrip .pulse { content: none !important; display: none !important; }

/* ===== phones (owner, Nov 13): every page works at 375px. The sidebar is a slide out menu from the left, the top bar holds the menu
   button, the Dial Haul mark, View as and the bell; cards stack in one column; tables scroll sideways; taps are 44px ===== */
@media (max-width: 600px) {
  .top > .mobile-menu { display: inline-flex !important; width: 44px; height: 44px; min-width: 44px; padding: 10px; margin: 0; }
  .top .dh-top-brand { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 44px; flex: none; margin-right: auto; }
  .top .dh-top-brand svg { width: 28px; height: 28px; }
  .top { gap: 4px !important; padding: 0 10px !important; }
  .top-right { gap: 4px !important; min-width: 0; }
  .top-right .bell { min-width: 44px; min-height: 44px; }
  .top-right .role label { display: none; }
  .side.open { position: fixed !important; top: 0 !important; bottom: 0 !important; left: 0 !important; right: auto !important; width: min(300px, 86vw) !important;
    height: 100% !important; max-height: none !important; display: flex !important; flex-direction: column !important; padding: 22px 14px calc(16px + env(safe-area-inset-bottom)) !important;
    overflow-y: auto !important; border-radius: 0 !important; z-index: 120 !important; transform: none !important; box-shadow: 0 0 0 100vmax rgba(7, 17, 27, .45) !important; }
  .side.open .nav { display: flex !important; flex-direction: column !important; grid-template-columns: none !important; gap: 2px !important; margin-top: 0; }
  .side.open .nav button { width: 100% !important; min-height: 44px !important; justify-content: flex-start !important; flex-direction: row !important; text-align: left !important; padding: 10px 12px !important; }
  .side.open .nav button span { display: inline !important; }
  .side.open .side-bottom { margin-top: auto !important; padding-top: 18px !important; }
  .side.open .logo { display: flex !important; width: auto !important; overflow: visible !important; justify-content: flex-start !important; padding: 0 0 0 4px !important; min-height: 44px; }
  .side.open .logo .brand-logo, .side.open .logo > .logo-home > .brand-logo { display: block !important; width: 146px !important; min-width: 146px !important; height: 44px !important; }
  .side.open .logo .compact-brand { display: none !important; }
  .side.open .logo .logo-home { display: inline-flex; }
  .side.open .dh-agency { padding: 0 12px; margin: 12px 0 18px; justify-content: flex-start; }
  .side.open .dh-agency-name { display: block; }
  .side.open .side-close { top: 14px !important; right: 10px !important; width: 44px !important; height: 44px !important; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 10px !important; }
  .grid, .two, .dh-rw-grid, .dh-home-two { grid-template-columns: minmax(0, 1fr) !important; }
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .content h1, .content h2, .content h3, .content p, .content td, .content strong { overflow-wrap: break-word; }
  .footer a, .footer .link { display: inline-flex; align-items: center; min-height: 44px; }
  .pagehead .actions button, .tabletop button, .modal footer button { min-height: 44px; }
}
@media (max-width: 600px) {
  /* viewing as someone on a phone: the person button and Exit fit; their own role switch and the search icon step aside */
  .top-right .dh-va select.dh-va-roles { display: none !important; }
  .top:has(.dh-va-on) > .shortcut { display: none !important; }
  .dh-va-who strong { max-width: 76px !important; }
}

/* Text wrap rules (owner, Nov 13): buttons, tabs, pills, nav items, badges and stat labels sit on one line; a row of buttons
   wraps as a row (each button whole) instead of breaking a label; headings never end on one lonely word. qa/wrap_check.js
   walks every page of every role at 375, 768 and 1280 and fails the checkout gate on any label that wraps. */
#app button, #overlay button, .btn, a.btn, [role="tab"], .section-tabs > *, .pill, .chip, .badge, .tag, .side .nav button,
.stat .statlabel, .dh-va-who, .teamlink button { white-space: nowrap; }
/* buttons that are cards (a title with a sub line) keep normal wrapping inside their text block */
#app .setup-task, #app .setup-task *, #app .dh-net-main, #app .dh-net-main *, #app .lead-row, #app .lead-row *, #app .dh-act-cards button { white-space: normal; }
#app .setup-task small { text-wrap: pretty; }
.content h1, .content h2, .content h3, .content h4, .modal h2, .modal h3, .panelhead h2, .dh-hero h2 { text-wrap: balance; }
.content p, .modal p, .panelhead p, .content small, .statfoot { text-wrap: pretty; }
/* a page header: the title takes the room it needs, the buttons drop under it as a row when they do not fit beside it */
.pagehead { flex-wrap: wrap; row-gap: 14px; }
@media (min-width: 601px) { .pagehead > :first-child { flex: 1 1 260px; min-width: 0; } }
.pagehead .actions { flex-wrap: wrap; justify-content: flex-start; }
.pagehead .actions > * { flex: 0 0 auto; }
/* the team link box: the link shortens with an ellipsis, Copy link stays whole */
.teamlink { min-width: 0; }
.teamlink > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.teamlink > button { flex: 0 0 auto; }
/* a stat card label is one line: long ones end in an ellipsis rather than wrap */
.stat .statlabel > span, .stat .statlabel > :first-child:not(.ui-icon) { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 600px) {
  /* on a phone a header's buttons share the full width, each whole */
  .pagehead .actions { width: 100%; }
  .pagehead .actions > button, .pagehead .actions > a { flex: 1 1 auto; justify-content: center; }
}
/* the tablet rail (601 to 900px): the small mark, not the full word logo cut in half (the logo now sits inside a home link) */
@media (min-width: 601px) and (max-width: 900px) {
  .side:not(.open) .logo .brand-logo { display: none !important; }
  .side:not(.open) .logo .compact-brand { display: block !important; }
}
