/* ===========================================================
   DTF.uk · Ops — backoffice CRM design system
   Light workspace · black chrome · mint accent · dense/pro
   =========================================================== */

:root {
  /* paper / ink */
  --ink:        #0B0C0E;
  --ink-2:      #16181C;
  --ink-3:      #22262C;
  --paper:      #F6F5F1;
  --paper-2:    #FFFFFF;
  --panel:      #FFFFFF;
  --rule:       #E6E3DB;
  --rule-2:     #D6D2C7;
  --rule-dark:  #20242B;

  /* text */
  --txt:        #14161A;
  --txt-2:      #565A60;
  --txt-3:      #8A8E94;
  --txt-inv:    #F6F5F1;

  /* mint accent */
  --mint:       #18f4af;
  --mint-ink:   #057a54;   /* readable mint text on light */
  --mint-deep:  #0fb880;
  --mint-wash:  #e6fbf3;

  /* status hues (all share roughly equal chroma) */
  --c-blue:   #2f6df0;   --c-blue-w:  #e9f0ff;
  --c-amber:  #d98a00;   --c-amber-w: #fdf3df;
  --c-violet: #7b54e0;   --c-violet-w:#f0ebff;
  --c-teal:   #0a9e8e;   --c-teal-w:  #e4f7f4;
  --c-green:  #1f9d54;   --c-green-w: #e6f6ec;
  --c-grey:   #6b7077;   --c-grey-w:  #eeeeec;
  --c-red:    #e0392b;   --c-red-w:   #fdeceb;
  --c-pink:   #d23f86;   --c-pink-w:  #fcebf3;

  --shadow-sm: 0 1px 2px rgba(11,12,14,.06);
  --shadow-md: 0 8px 24px -12px rgba(11,12,14,.18), 0 1px 3px rgba(11,12,14,.07);
  --shadow-lg: 0 30px 70px -28px rgba(11,12,14,.34), 0 4px 12px rgba(11,12,14,.10);

  --font-display: "Archivo", sans-serif;
  --font-body:    "Inter Tight", sans-serif;
  --font-mono:    "JetBrains Mono", monospace;

  --sidebar-w: 232px;
  --topbar-h:  56px;
  --radius:    9px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; width: 100%; max-width: 100%; overflow-x: hidden; }
body {
  font-family: var(--font-body);
  color: var(--txt);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;             /* stop iOS auto-zooming text */
  font-feature-settings: "ss01","cv11";
  overflow: hidden;
}
#root { height: 100vh; height: 100dvh; }
button { font-family: inherit; cursor: pointer; border: 0; background: none; color: inherit; }
input, select, textarea { font-family: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
/* Baseline icon size — Icon renders <svg> without width/height and relies on CSS.
   Specific component rules (.btn svg, .empty svg, etc.) override this default. */
svg { width: 16px; height: 16px; flex: none; }
::selection { background: var(--mint); color: #00301f; }

.mono { font-family: var(--font-mono); }
.kick {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--txt-3); font-weight: 600;
}

/* keyboard shortcut hint pill shown next to its CTA */
.kbd-hint {
  font-family: var(--font-mono); font-size: 11px; font-weight: 600;
  color: var(--txt-2); background: var(--rule-2-wash, #f1efe9);
  border: 1px solid var(--rule-2); border-radius: 5px;
  padding: 1px 6px; line-height: 1.5; white-space: nowrap;
}

/* scrollbars */
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: #cfccc2; border-radius: 6px; border: 2px solid transparent; background-clip: content-box; }
*::-webkit-scrollbar-thumb:hover { background: #b6b2a6; background-clip: content-box; }

/* ============================ APP SHELL ============================ */
.app { display: grid; grid-template-columns: var(--sidebar-w) 1fr; height: 100vh; height: 100dvh; }

.sidebar {
  background: var(--ink); color: var(--txt-inv);
  display: flex; flex-direction: column;
  border-right: 1px solid #000;
  /* Grid items default to min-height:auto (= content height), so a long nav stretched the
     sidebar past the 100dvh app and the bottom got cut off instead of scrolling. Bound it
     to the row; .sb__nav (flex:1; overflow-y:auto) then scrolls and the footer stays visible. */
  min-height: 0; overflow: hidden;
}
.sb__brand {
  display: flex; align-items: center; gap: 10px;
  padding: 16px 18px; height: var(--topbar-h);
  border-bottom: 1px solid var(--rule-dark);
}
.sb__mark {
  width: 30px; height: 30px; border-radius: 7px;
  background: var(--mint); color: #00271a;
  display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 900; font-size: 11px; letter-spacing: .02em;
}
.sb__name { font-family: var(--font-display); font-weight: 800; font-size: 15px; letter-spacing: -.01em; }
.sb__name small { display: block; font-family: var(--font-mono); font-weight: 500; font-size: 9px; letter-spacing: .18em; color: var(--txt-3); margin-top: 1px; }

.sb__nav { padding: 12px 10px calc(16px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 2px; flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.sb__sec { font-family: var(--font-mono); font-size: 9px; letter-spacing: .16em; text-transform: uppercase; color: #5a5f66; padding: 14px 10px 6px; }
.sb__item {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 10px; border-radius: 7px;
  font-size: 13.5px; font-weight: 500; color: #c5c8cc;
  position: relative; transition: background .12s, color .12s;
}
.sb__item:hover { background: #1b1e23; color: #fff; }
.sb__item.is-active { background: #1b1e23; color: #fff; }
.sb__item.is-active::before {
  content: ""; position: absolute; left: -10px; top: 8px; bottom: 8px; width: 3px;
  background: var(--mint); border-radius: 0 3px 3px 0;
}
.sb__item svg { width: 17px; height: 17px; flex: none; }
.sb__item .cnt {
  margin-left: auto; font-family: var(--font-mono); font-size: 10px; font-weight: 600;
  background: #2a2e34; color: #c5c8cc; padding: 2px 7px; border-radius: 20px;
}
.sb__item.is-active .cnt { background: var(--mint); color: #00271a; }

.sb__foot { padding: 10px; border-top: 1px solid var(--rule-dark); }
.sb__user { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 7px; }
.sb__user:hover { background: #1b1e23; }
.sb__user .av { width: 28px; height: 28px; border-radius: 50%; background: var(--mint); color:#00271a; display:grid; place-items:center; font-family: var(--font-mono); font-weight: 700; font-size: 11px; flex:none; }
.sb__user .nm { font-size: 12.5px; font-weight: 600; line-height: 1.2; }
.sb__user .rl { font-family: var(--font-mono); font-size: 9px; letter-spacing:.1em; color: var(--txt-3); text-transform: uppercase; }

/* main column */
.main { display: flex; flex-direction: column; min-width: 0; height: 100vh; height: 100dvh; }
.topbar {
  height: var(--topbar-h); flex: none;
  background: var(--paper-2); border-bottom: 1px solid var(--rule);
  display: flex; align-items: center; gap: 14px; padding: 0 20px;
}
.topbar__title { display: flex; align-items: baseline; gap: 10px; }
.topbar__title h1 { font-family: var(--font-display); font-weight: 800; font-size: 17px; letter-spacing: -.01em; margin: 0; }
.topbar__title .sub { font-family: var(--font-mono); font-size: 11px; color: var(--txt-3); }
.topbar__search {
  margin-left: auto; display: flex; align-items: center; gap: 8px;
  background: var(--paper); border: 1px solid var(--rule); border-radius: 8px;
  padding: 7px 12px; width: 280px; color: var(--txt-2);
}
.topbar__search:focus-within { border-color: var(--ink-3); box-shadow: 0 0 0 3px rgba(11,12,14,.05); }
.topbar__search input { border: 0; background: none; outline: none; font-size: 13px; width: 100%; }
.topbar__search svg { width: 15px; height: 15px; flex: none; }
.topbar__search kbd { font-family: var(--font-mono); font-size: 10px; background:#fff; border:1px solid var(--rule); border-radius:4px; padding:1px 5px; color: var(--txt-3); }
.gsearch__pop { position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 60;
  background: var(--paper,#fff); border: 1px solid var(--rule); border-radius: 10px;
  box-shadow: 0 12px 32px rgba(11,12,14,.14); padding: 4px; max-height: 60vh; overflow: auto; }
.gsearch__row { display: flex; align-items: center; justify-content: space-between; gap: 10px;
  width: 100%; text-align: left; border: 0; background: none; cursor: pointer;
  padding: 8px 10px; border-radius: 7px; font-size: 13px; color: var(--txt-1); }
.gsearch__row:hover, .gsearch__row.is-hi { background: var(--surface-2,#f4f5f7); }
.gsearch__main { display: flex; align-items: center; gap: 7px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gsearch__main svg { width: 14px; height: 14px; flex: none; color: var(--txt-3); }
.topbar__btn { display:flex; align-items:center; gap:7px; padding: 8px 12px; border:1px solid var(--rule); border-radius: 8px; font-size: 12.5px; font-weight:600; background:#fff; }
.topbar__btn:hover { border-color: var(--rule-2); }
.topbar__btn svg { width: 15px; height: 15px; }
.icon-btn { width: 34px; height: 34px; display: grid; place-items: center; border:1px solid var(--rule); border-radius: 8px; background:#fff; position: relative; }
.icon-btn:hover { border-color: var(--rule-2); }
.icon-btn svg { width: 16px; height: 16px; }
.icon-btn .ping { position:absolute; top:-3px; right:-3px; width:16px;height:16px; background: var(--c-red); color:#fff; border-radius:50%; font-family:var(--font-mono); font-size:9px; font-weight:700; display:grid; place-items:center; border:2px solid #fff; }

.content { flex: 1; overflow: auto; }

/* ============================ BADGES ============================ */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: var(--font-mono); font-size: 10.5px; font-weight: 600;
  letter-spacing: .03em; text-transform: uppercase;
  padding: 3px 8px; border-radius: 6px; white-space: nowrap; line-height: 1.3;
}
.badge .dot { width: 6px; height: 6px; border-radius: 50%; flex: none; }
.badge--blue   { background: var(--c-blue-w);   color: #1d4dad; }
.badge--amber  { background: var(--c-amber-w);  color: #9a6300; }
.badge--violet { background: var(--c-violet-w); color: #5a37b3; }
.badge--teal   { background: var(--c-teal-w);   color: #07736a; }
.badge--green  { background: var(--c-green-w);  color: #137a40; }
.badge--grey   { background: var(--c-grey-w);   color: #5a5f66; }
.badge--red    { background: var(--c-red-w);    color: #b32a1f; }
.badge--pink   { background: var(--c-pink-w);   color: #a52d68; }
.badge--mint   { background: var(--mint-wash);  color: var(--mint-ink); }
.badge--solid-mint { background: var(--mint); color: #00271a; }
.badge--ghost  { background: transparent; border: 1px solid var(--rule-2); color: var(--txt-2); }

.flag { display:inline-grid; place-items:center; width:20px; height:20px; border-radius: 5px; font-size: 11px; }
.flag--risk  { background: var(--c-red-w);   color: var(--c-red); }
.flag--vip   { background: var(--mint-wash); color: var(--mint-ink); }
.flag--note  { background: var(--c-amber-w); color: var(--c-amber); }
.flag--repeat{ background: var(--c-blue-w);  color: var(--c-blue); }

/* ============================ TABLE / BOARD ============================ */
.board { padding: 18px 20px 60px; }

.toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.seg { display: inline-flex; background: var(--paper-2); border: 1px solid var(--rule); border-radius: 8px; overflow: hidden; }
.seg button { padding: 7px 12px; font-size: 12px; font-weight: 600; color: var(--txt-2); border-right: 1px solid var(--rule); white-space: nowrap; }
.seg button:last-child { border-right: 0; }
.seg button.is-active { background: var(--ink); color: #fff; }
.seg--xs button { padding: 2px 8px; font-size: 11px; }
.chip-filter { display:flex; align-items:center; gap:6px; padding: 7px 11px; border:1px solid var(--rule); border-radius: 8px; background:#fff; font-size: 12px; font-weight:600; color: var(--txt-2); }
.chip-filter:hover { border-color: var(--rule-2); }
.chip-filter svg { width: 13px; height: 13px; }
.chip-filter.is-on { background: var(--ink); color:#fff; border-color: var(--ink); }

.grp { margin-bottom: 22px; }
.grp__head {
  display: flex; align-items: center; gap: 12px; padding: 8px 4px 8px;
  position: sticky; top: 0; background: var(--paper); z-index: 4;
}
.grp__date { font-family: var(--font-display); font-weight: 800; font-size: 14px; letter-spacing: -.01em; }
.grp__rel  { font-family: var(--font-mono); font-size: 10px; letter-spacing:.08em; text-transform: uppercase; color: var(--txt-3); }
.grp__count{ font-family: var(--font-mono); font-size: 11px; color: var(--txt-2); margin-left: auto; }
.grp__bar { flex: 1; height: 1px; background: var(--rule); }

.tbl { width: 100%; border-collapse: collapse; background: var(--panel); border: 1px solid var(--rule); border-radius: var(--radius); overflow: hidden; }
.tbl thead th {
  font-family: var(--font-mono); font-size: 9.5px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--txt-3); text-align: left; font-weight: 600;
  padding: 9px 12px; background: #fbfaf7; border-bottom: 1px solid var(--rule); white-space: nowrap;
}
.tbl tbody td { padding: 10px 12px; border-bottom: 1px solid var(--rule); font-size: 13px; vertical-align: top; }
.ord-status { display: flex; flex-direction: column; align-items: flex-start; gap: 5px; }
.ord-status .btn { padding: 2px 8px; font-size: 10px; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tbody tr { cursor: pointer; transition: background .1s; }
.tbl tbody tr:hover { background: #fbfaf7; }
.tbl tbody tr.is-sel { background: var(--mint-wash); }
.tbl .num { font-family: var(--font-mono); text-align: right; }
.tbl .ordno { font-family: var(--font-mono); font-weight: 600; font-size: 12.5px; }
.tbl .cust { font-weight: 600; }
.tbl .muted { color: var(--txt-3); }
.cellflags { display: flex; gap: 4px; }
.tags-cell { display: flex; gap: 4px; flex-wrap: wrap; }
.tag { font-family: var(--font-mono); font-size: 10px; padding: 2px 6px; border-radius: 5px; background: var(--paper-2); border: 1px solid var(--rule); color: var(--txt-2); }

.urg-rail { width: 4px; border-radius: 3px; height: 24px; display:inline-block; }
.urg--sd { background: var(--c-red); }
.urg--rm24 { background: var(--c-amber); }
.urg--rm48 { background: var(--c-grey); }
.urg--dpd { background: var(--c-blue); }
.urg--collect { background: var(--c-violet); }
.urg--free { background: var(--c-green); }

.checkbox { width: 16px; height: 16px; border: 1.5px solid var(--rule-2); border-radius: 4px; background:#fff; display:inline-grid; place-items:center; }
.checkbox.is-on { background: var(--ink); border-color: var(--ink); }
.checkbox.is-on::after { content:"✓"; color: var(--mint); font-size: 11px; font-weight:700; }

.prog { display:flex; align-items:center; gap:6px; }
.prog__dots { display:flex; gap:3px; }
.prog__dot { width:7px; height:7px; border-radius:50%; background: var(--rule-2); }
.prog__dot.on { background: var(--mint-deep); }
/* The stage the order is currently at gets a ring so the pipeline position reads at a glance. */
.prog__dot.is-current { box-shadow: 0 0 0 2px var(--mint-deep); }

/* stat strip */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.stat { background: var(--panel); border: 1px solid var(--rule); border-radius: var(--radius); padding: 13px 15px; }
.stat__k { font-family: var(--font-mono); font-size: 10px; letter-spacing:.1em; text-transform: uppercase; color: var(--txt-3); }
.stat__v { font-family: var(--font-display); font-weight: 800; font-size: 24px; margin-top: 3px; letter-spacing: -.02em; }
.stat__d { font-family: var(--font-mono); font-size: 11px; margin-top: 2px; color: var(--txt-2); }
.stat__d .up { color: var(--c-green); } .stat__d .dn { color: var(--c-red); }
.stat--prod .stat__v { margin-bottom: 4px; }
.prod-break { display: flex; flex-wrap: wrap; gap: 4px 6px; }
.prod-break__i { font-family: var(--font-mono); font-size: 10.5px; color: var(--txt-2); background: var(--bg, #f5f5f4); border: 1px solid var(--rule); border-radius: 6px; padding: 1px 6px; white-space: nowrap; }
.prod-break__i b { color: var(--txt); font-weight: 800; }
.prod-break__i.is-zero { opacity: .45; }

/* ============================ BUTTONS ============================ */
.btn { display:inline-flex; align-items:center; justify-content:center; gap:7px; padding: 9px 15px; border-radius: 8px; font-size: 13px; font-weight: 700; letter-spacing:.01em; transition: transform .1s, box-shadow .1s, background .12s; white-space: nowrap; }
.btn svg { width: 15px; height: 15px; }
.btn--primary { background: var(--mint); color: #00271a; box-shadow: 0 3px 0 var(--mint-deep); }
.btn--primary:hover { transform: translateY(-1px); box-shadow: 0 4px 0 var(--mint-deep); }
.btn--primary:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--mint-deep); }
.btn--dark { background: var(--ink); color: #fff; }
.btn--dark:hover { background: var(--ink-2); }
.btn--ghost { background: #fff; border: 1px solid var(--rule); color: var(--txt); }
.btn--ghost:hover { border-color: var(--rule-2); background: #fbfaf7; }
.btn--sm { padding: 6px 11px; font-size: 12px; }
.btn--block { width: 100%; }

/* ============================ DRAWER / DETAIL ============================ */
.overlay { position: fixed; inset: 0; background: rgba(11,12,14,.32); z-index: 40; opacity: 0; pointer-events: none; transition: opacity .2s; }
.overlay.is-open { opacity: 1; pointer-events: auto; }

/* ============================ DETAIL PAGE LAYOUT ============================ */
.detail { display: grid; grid-template-columns: 1fr 340px; gap: 18px; padding: 18px 20px 60px; align-items: start; }
.detail__main { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.detail__side { display: flex; flex-direction: column; gap: 16px; position: sticky; top: 18px; }

.card { background: var(--panel); border: 1px solid var(--rule); border-radius: var(--radius); }
.card__head { display:flex; align-items:center; gap:10px; padding: 13px 16px; border-bottom: 1px solid var(--rule); }
.card__head h3 { font-family: var(--font-display); font-weight: 800; font-size: 13.5px; letter-spacing: -.01em; margin: 0; text-transform: uppercase; }
.card__head svg { width: 16px; height: 16px; flex: none; color: var(--txt-2); }
.card__head .right { margin-left: auto; display:flex; gap:8px; align-items:center; }
.card__body { padding: 16px; }
.card__body--flush { padding: 0; }

.crumbs { display:flex; align-items:center; gap:8px; font-family: var(--font-mono); font-size: 11px; color: var(--txt-3); }
.crumbs a:hover { color: var(--txt); }
.crumbs .sep { color: var(--rule-2); }

.pagehead { display:flex; align-items:center; gap:14px; margin-bottom: 16px; flex-wrap: wrap; }
.pagehead h2 { font-family: var(--font-display); font-weight: 900; font-size: 22px; letter-spacing: -.02em; margin: 0; }
.pagehead .meta { font-family: var(--font-mono); font-size: 11.5px; color: var(--txt-2); }
.pagehead .actions { margin-left: auto; display:flex; gap:8px; flex-wrap: wrap; justify-content: flex-end; }

.kv { display: grid; grid-template-columns: 96px 1fr; gap: 9px 14px; font-size: 13px; }
.kv dt { font-family: var(--font-mono); font-size: 10.5px; letter-spacing:.05em; text-transform: uppercase; color: var(--txt-3); align-self: center; }
.kv dd { margin: 0; font-weight: 500; min-width: 0; overflow-wrap: anywhere; }

/* line items */
.lineitem { display: flex; flex-direction: column; gap: 9px; padding: 13px 16px; border-bottom: 1px solid var(--rule); min-width: 0; }
.lineitem:last-child { border-bottom: 0; }
/* Refunded / edited-out line — dimmed + struck so it reads as "not being made". */
.lineitem--removed { opacity: .6; }
.lineitem--removed .li__name, .lineitem--removed .li__meta { text-decoration: line-through; text-decoration-color: rgba(0,0,0,.35); }
.lineitem--removed .li__thumb { filter: grayscale(1); }
.li__removed-tag { display: inline-block; margin-left: 7px; padding: 1px 7px; border-radius: 999px; background: #fdecec; color: #c0392b; border: 1px solid #f3c2c2; font-family: var(--font-mono); font-weight: 700; font-size: 10px; letter-spacing: .02em; text-transform: uppercase; vertical-align: middle; text-decoration: none; }
.li__thumb { width: 46px; height: 46px; border-radius: 7px; overflow: hidden; border: 1px solid var(--rule); display:grid; place-items:center; flex:none; background: repeating-linear-gradient(45deg,#f0eee7,#f0eee7 6px,#f6f5f1 6px,#f6f5f1 12px); }
.li__thumb .gm { font-family: var(--font-mono); font-size: 8px; color: var(--txt-3); }
.li__thumb img { width: 100%; height: 100%; object-fit: cover; }
.li__links { display: flex; gap: 12px; margin: 3px 0; }
.li__links a { font-size: 11px; color: var(--mint-ink); font-weight: 600; text-decoration: underline; }

/* attachment tiles (emails, customer profile, attachments view) */
.att-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.att-tile { display: flex; gap: 10px; align-items: center; border: 1px solid var(--rule); border-radius: 8px; padding: 8px; background: #fff; width: 248px; max-width: 100%; }
.att-tile__thumb { width: 44px; height: 44px; border-radius: 6px; overflow: hidden; flex: none; display: grid; place-items: center; border: 1px solid var(--rule); background: repeating-linear-gradient(45deg,#f0eee7,#f0eee7 5px,#f8f7f3 5px,#f8f7f3 10px); }
.att-tile__thumb img { width: 100%; height: 100%; object-fit: cover; }
.att-tile__thumb--file svg { width: 18px; height: 18px; color: var(--txt-3); }
.att-tile__body { min-width: 0; flex: 1; }
.att-tile__name { font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.att-tile__meta { font-family: var(--font-mono); font-size: 10px; color: var(--txt-3); margin-top: 1px; }
.att-tile__links { display: flex; gap: 10px; margin-top: 3px; }
.att-tile__links a, .att-tile__links button { font-size: 11px; color: var(--mint-ink); font-weight: 600; text-decoration: underline; padding: 0; }
/* Orders grid — instant search */
.ord-search { display: flex; align-items: center; gap: 6px; background: var(--surface-2, #f4f4f1); border: 1px solid var(--rule); border-radius: 8px; padding: 0 8px; height: 30px; min-width: 320px; }
.ord-search svg { width: 14px; height: 14px; color: var(--txt-3); flex: none; }
.ord-search input { border: 0; background: transparent; outline: none; font: inherit; font-size: 12px; width: 100%; color: var(--txt-1); }
.ord-search input::-webkit-search-cancel-button { display: none; }
.ord-search__clear { border: 0; background: transparent; cursor: pointer; color: var(--txt-3); font-size: 16px; line-height: 1; padding: 0 2px; flex: none; }
.ord-search__clear:hover { color: var(--txt-1); }
.status-select { display: flex; align-items: center; gap: 6px; background: var(--surface-2, #f4f4f1); border: 1px solid var(--rule); border-radius: 8px; padding: 0 8px 0 10px; height: 30px; }
.status-select svg { width: 14px; height: 14px; color: var(--txt-3); flex: none; }
.status-select select { border: 0; background: transparent; outline: none; font: inherit; font-size: 12px; color: var(--txt-1); cursor: pointer; }
.status-select.is-on { border-color: var(--mint-ink); }
.modal-overlay { position: fixed; inset: 0; background: rgba(20,22,26,.45); display: flex; align-items: center; justify-content: center; z-index: 1000; padding: 24px; }
.modal { background: #fff; border-radius: 12px; width: 100%; max-width: 560px; max-height: 88vh; display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.modal--wide { max-width: 920px; }
.modal__head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--rule); }
.modal__head h3 { margin: 0; font-size: 15px; }
.modal__body { padding: 16px 18px; overflow: auto; }
.modal__foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 18px; border-top: 1px solid var(--rule); }
.ship-applyall { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.ship-tbl td { vertical-align: top; }
.warn-banner { display: flex; align-items: center; gap: 8px; background: #fde8e8; border: 1px solid #f3c0c0; color: #8a2b2b; border-radius: var(--radius); padding: 10px 14px; margin-bottom: 16px; font-size: 12.5px; }
.warn-banner svg { width: 15px; height: 15px; flex: none; }
/* Update-available announce bar — sits above the topbar, full width. */
.update-bar { display: flex; align-items: center; gap: 10px; background: var(--ink); color: var(--txt-inv, #fff); padding: 8px 18px; font-size: 12.5px; font-weight: 500; }
.update-bar svg { width: 15px; height: 15px; flex: none; color: var(--mint); }
.update-bar__btn { margin-left: auto; background: var(--mint); color: #00301f; border: none; font-weight: 700; }
.update-bar__btn:hover { background: var(--mint-deep); }
.browse-feed { display: flex; flex-direction: column; }
.browse-row { display: flex; gap: 12px; align-items: baseline; padding: 4px 0; border-bottom: 1px solid var(--rule); font-size: 12.5px; }
.browse-row:last-child { border-bottom: 0; }
.browse-row__t { color: var(--txt-3); font-size: 11px; white-space: nowrap; flex: none; width: 96px; }
.browse-row__e { color: var(--txt-1); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }
/* production queue rows */
.prod-row { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--rule); flex-wrap: wrap; }
.prod-row:last-child { border-bottom: 0; }
.prod-row .ordno { flex: none; }
.prod-row__who { flex: 1; min-width: 140px; font-size: 12.5px; }
.prod-row__act { display: flex; gap: 6px; flex-wrap: wrap; margin-left: auto; }
.prod-art { flex-basis: 100%; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 11.5px; color: var(--txt-2); padding-left: 2px; }
.prod-art svg { width: 14px; height: 14px; flex: none; color: var(--txt-3); }
.prod-art__link { color: var(--mint-ink, #1b9e77); font-weight: 600; text-decoration: none; background: #f0fbf6; border: 1px solid #cdeede; border-radius: 6px; padding: 2px 7px; }
.prod-art__link:hover { text-decoration: underline; }
.browse-sentinel { display: flex; justify-content: center; padding: 10px; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c-green, #16a34a); flex: none; box-shadow: 0 0 0 0 rgba(22,163,74,.6); animation: live-pulse 1.8s infinite; }
@keyframes live-pulse { 0% { box-shadow: 0 0 0 0 rgba(22,163,74,.5); } 70% { box-shadow: 0 0 0 6px rgba(22,163,74,0); } 100% { box-shadow: 0 0 0 0 rgba(22,163,74,0); } }
.load-more { display: flex; align-items: center; gap: 12px; justify-content: center; padding: 18px 8px 6px; }
/* Royal Mail services settings table */
/* Shipments list — tabs */
.ship-tabs { display: flex; gap: 4px; background: var(--paper-2, #f7f5f0); border-radius: 8px; padding: 3px; }
.ship-tab {
  padding: 5px 14px; border-radius: 6px; border: none; background: transparent;
  font-size: 12px; font-weight: 500; color: var(--txt-2); cursor: pointer;
  display: flex; align-items: center; gap: 6px; transition: background .1s, color .1s;
}
.ship-tab:hover { color: var(--txt-1); background: #fff; }
.ship-tab.is-on { background: #fff; color: var(--txt-1); font-weight: 600; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
/* Shipments list table */
.ship-list { font-size: 12.5px; }
.ship-list th { white-space: nowrap; }
.ship-list td { white-space: nowrap; }

.rm-svc { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.rm-svc th { text-align: left; font-size: 10px; letter-spacing: .04em; text-transform: uppercase; color: var(--txt-3); padding: 6px 8px; border-bottom: 1px solid var(--rule); }
.rm-svc td { padding: 6px 8px; border-bottom: 1px solid var(--rule); vertical-align: middle; }
.rm-svc tr.is-off td { opacity: .5; }
.rm-svc tr.is-off td:first-child { opacity: 1; }
.rm-svc input[type="checkbox"], .rm-svc input[type="radio"] { width: 15px; height: 15px; cursor: pointer; }
.rm-in { width: 84px; border: 1px solid var(--rule); border-radius: 6px; padding: 4px 7px; font-size: 12px; }
.rm-in--name { width: 100%; min-width: 170px; }
.rm-svc select { border: 1px solid var(--rule); border-radius: 6px; padding: 4px 6px; font: inherit; font-size: 12px; background: #fff; }
/* Create-label modal: give each field room so the service name isn't clipped. */
.ship-tbl td { vertical-align: top; }
.ship-tbl td:nth-child(3) { width: 84px; }
.ship-tbl td:nth-child(4) { min-width: 220px; }
.ship-tbl td .rm-in, .ship-tbl td select { width: 100%; box-sizing: border-box; }
.ship-tbl td:nth-child(4) .rm-in--sm { width: 100%; }
.ship-applyall .rm-in, .ship-applyall select { width: auto; box-sizing: border-box; }
.ship-applyall select { min-width: 120px; }

/* Parcel type picker — box vs envelope icons + service chips */
.ptype-picker { display: flex; flex-direction: column; gap: 0; }
.ptype-picker__icons { display: flex; gap: 8px; flex-wrap: wrap; }
.ptype-btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; padding: 10px; border: 2px solid var(--rule); border-radius: 10px;
  background: var(--paper-2, #f7f5f0); cursor: pointer; color: var(--txt-2);
  font-size: 12px; font-weight: 600; flex: 1; min-width: 5cm; min-height: 5cm;
  transition: border-color .12s, background .12s, color .12s;
}
.ptype-btn svg { width: 2.6cm; height: 2.6cm; stroke-width: 1.4; }
.ptype-btn:hover { border-color: var(--c-green, #18f4af); color: var(--txt-1); background: #fff; }
.ptype-btn.is-on { border-color: var(--c-green, #18f4af); background: #edfff8; color: var(--mint-ink, #0d8a61); }
/* Compact variant (Apply-to-all bar) stays small — override the big tile sizing. */
.ptype-btn--sm { flex-direction: row; padding: 5px 10px; flex: none; font-size: 11px; min-width: 0; min-height: 0; gap: 5px; }
.ptype-btn--sm svg { width: 14px; height: 14px; stroke-width: 1.7; }
.ptype-picker__svcs { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
/* Touch-friendly service chips — sized for a finger tap on touch monitors. */
.svc-chip {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  padding: 12px 18px; border: 2px solid var(--rule); border-radius: 10px;
  background: #fff; cursor: pointer; min-width: 88px; min-height: 64px;
  transition: border-color .1s, background .1s;
}
.svc-chip { position: relative; }
.svc-chip:hover { border-color: var(--c-green, #18f4af); }
.svc-chip.is-on { border-color: var(--c-green, #18f4af); background: #edfff8; box-shadow: 0 0 0 1px var(--c-green, #18f4af) inset; }
.svc-chip__tier { font-size: 22px; font-weight: 700; color: var(--txt-1); line-height: 1; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.svc-chip.is-on .svc-chip__tier { color: var(--mint-ink, #0d8a61); }
.svc-chip__code { font-size: 12px; font-family: var(--font-mono); color: var(--txt-3); letter-spacing: .04em; }
/* The service the customer requested — dashed blue ring so it stands out even unselected. */
.svc-chip.is-requested { border-color: #2f6bd6; border-style: dashed; }
.svc-chip__req { position: absolute; top: -9px; background: #2f6bd6; color: #fff; font-size: 8.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; padding: 1px 6px; border-radius: 999px; }
/* Operator picked a service different from the requested one — hard amber highlight. */
.svc-chip.is-deviated { border-color: var(--c-amber, #e6952a); background: #fff7ea; box-shadow: 0 0 0 2px var(--c-amber, #e6952a) inset; }
.svc-chip.is-deviated .svc-chip__tier { color: #b4700f; }
/* Requested-service line above the picker */
.req-svc { font-size: 11px; color: var(--txt-2); margin-bottom: 6px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.req-svc__k { text-transform: uppercase; font-size: 9.5px; letter-spacing: .05em; color: var(--txt-3); font-weight: 700; }
.req-svc__map { color: var(--mint-ink, #0d8a61); font-weight: 600; font-size: 10px; }
.req-svc__diff { background: var(--c-amber, #e6952a); color: #fff; font-size: 9px; font-weight: 700; text-transform: uppercase; padding: 1px 6px; border-radius: 999px; }
.req-svc--deviated { color: #b4700f; font-weight: 600; }
/* Combined-dispatch note attached to the parent order row */
.combined-note { margin-top: 5px; font-size: 10.5px; font-weight: 600; color: var(--mint-ink, #0d8a61); display: inline-flex; align-items: center; gap: 4px; background: #edfff8; border: 1px solid var(--c-green, #18f4af); border-radius: 6px; padding: 2px 7px; }
.combined-note svg { width: 12px; height: 12px; }
/* Overdue-dispatch service upgrade recommendation */
.late-rec { border: 2px solid var(--c-amber, #e6952a); background: #fff7ea; border-radius: 8px; padding: 7px 9px; margin-bottom: 8px; }
.late-rec__hd { display: flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 700; color: #b4700f; }
.late-rec__hd svg { width: 13px; height: 13px; }
.late-rec__body { font-size: 11px; color: var(--txt-2); margin-top: 4px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.late-rec__btn { border: 0; background: var(--c-amber, #e6952a); color: #fff; font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 6px; cursor: pointer; }
.late-rec__btn:hover { filter: brightness(1.05); }
/* Order-line summary under "Ship to" in the create-label modal */
.ship-lines { font-size: 10.5px; color: var(--txt-2); margin-top: 4px; line-height: 1.35;
  overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.rm-del { border: 0; background: transparent; color: var(--txt-3); cursor: pointer; font-size: 16px; line-height: 1; padding: 0 4px; }
.rm-del:hover { color: #c0392b; }

/* Draft order — editable items grid */
.dft-items { width: 100%; border-collapse: collapse; font-size: 13px; }
.dft-items thead th { text-align: left; font-size: 10px; letter-spacing: .04em; text-transform: uppercase; color: var(--txt-3); font-weight: 700; padding: 0 10px 8px; border-bottom: 1px solid var(--rule); }
.dft-items thead th.num { text-align: right; }
.dft-items tbody td { padding: 9px 10px; border-bottom: 1px solid var(--rule); vertical-align: top; }
.dft-items tbody tr:last-child td { border-bottom: 0; }
.dft-items td.num { text-align: right; white-space: nowrap; }
.dft-items .dft-amt { font-family: var(--font-mono); font-weight: 600; padding-top: 5px; }
.dft-items .rm-in { width: 100%; }
.dft-items .rm-in.num { width: 100%; text-align: right; font-family: var(--font-mono); }
.dft-items .rm-in:disabled { background: var(--paper-2, #f7f5f0); color: var(--txt-2); border-color: transparent; padding-left: 0; }
.dft-items .rm-in--name:disabled { font-weight: 600; }
.dft-items .dft-tag { display: inline-flex; align-items: center; gap: 5px; margin-top: 4px; font-size: 10px; letter-spacing: .02em; text-transform: uppercase; font-weight: 600; }
.dft-items .dft-tag--sku { color: var(--mint-ink, #0b6b4f); }
.dft-items .dft-tag--custom { color: var(--txt-3); }
.dft-items .rm-del { font-size: 18px; }
.dft-addrow { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.dft-totals { margin: 16px 0 2px auto; width: 280px; }
.dft-disc-in { width: 96px !important; text-align: right; font-family: var(--font-mono); }

/* Catalogue / customer picker rows */
.pick-row:hover { background: var(--paper-2, #f4f2ec); }
.pick-panel { border: 1px solid var(--rule); border-radius: 10px; padding: 12px; margin-top: 12px; background: var(--paper-2, #faf9f5); }

/* Link email-only contact to a Shopify customer */
.link-box { background: #fff8e6; border: 1px solid #f0e0a8; border-radius: var(--radius); padding: 12px; margin-bottom: 16px; }
.link-box__hd { display: flex; align-items: center; gap: 6px; font-weight: 700; font-size: 12.5px; color: #9a7d1a; }
.link-box__hd svg { width: 14px; height: 14px; }
.link-box__sub { font-size: 11.5px; color: var(--txt-2); margin: 4px 0 8px; line-height: 1.4; }
.link-box__in { width: 100%; border: 1px solid var(--rule); border-radius: 8px; padding: 6px 9px; font: inherit; font-size: 12px; background: #fff; }
.link-box__results { margin-top: 6px; max-height: 220px; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.link-box__row { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; text-align: left; border: 0; background: transparent; cursor: pointer; padding: 6px 8px; border-radius: 6px; }
.link-box__row:hover { background: #fff; }
.link-box__name { font-weight: 600; font-size: 12.5px; }
.link-box__email { font-size: 10.5px; color: var(--txt-3); }
.assign-pop { position: absolute; top: calc(100% + 6px); right: 0; z-index: 40; width: 300px; max-width: 86vw; background: #fff; border: 1px solid var(--rule); border-radius: 10px; box-shadow: 0 12px 32px rgba(0,0,0,.16); padding: 12px; }
.assign-pop .link-box__hd { color: var(--txt-1); margin-bottom: 8px; }
.assign-pop .link-box__in { margin-bottom: 4px; }
/* Artwork */
.art-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 4px; }
.art-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; padding: 8px; border: 1px solid var(--rule); border-radius: 10px; }
.art-thumb { width: 38px; height: 38px; flex: 0 0 38px; border: 1px solid var(--rule); border-radius: 8px; background: #fafafa; display: flex; align-items: center; justify-content: center; overflow: hidden; color: var(--txt-3); text-decoration: none; }
.art-thumb img { width: 100%; height: 100%; object-fit: cover; }
.art-thumb svg { width: 18px; height: 18px; }
.art-check { display: inline-flex; align-items: center; flex: 0 0 auto; cursor: pointer; }
.art-check input { width: 16px; height: 16px; cursor: pointer; accent-color: var(--mint-ink); }
.art-row.is-sel { background: var(--mint-wash); border-color: var(--mint-ink); }
/* The one file the shop should print — made unmistakable vs the per-item design links */
.art-row--print { background: #ecfdf3; border-color: #18a565; box-shadow: inset 3px 0 0 #18a565; }
.badge--print { background: #18a565; color: #fff; border-color: transparent; margin-left: 6px; font-weight: 700; letter-spacing: .03em; }
.badge--print svg { width: 12px; height: 12px; }
.art-printbanner { display: flex; align-items: center; gap: 8px; padding: 9px 12px; margin-bottom: 10px;
  background: #ecfdf3; border: 1px solid #9be3bf; border-radius: 10px; font-size: 13px; color: #0f7a52; }
.art-printbanner svg { width: 16px; height: 16px; flex: none; }
.gs-seg button { padding: 4px 9px; font-size: 11px; }
.gs-card .gs-preview svg { max-width: 100%; }
/* .gs-grid layout (flex-wrap: controls | preview, stacks when narrow) is set
   inline in views-gangsheet.jsx so it never depends on this file being fresh. */
.art-meta { flex: 1 1 120px; min-width: 0; }
.art-name { display: block; font-size: 12.5px; font-weight: 600; white-space: normal; overflow-wrap: anywhere; line-height: 1.35; color: inherit; text-decoration: none; cursor: pointer; }
.art-name:hover { color: var(--mint-ink); text-decoration: underline; }
.art-sub { font-size: 10.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.art-actions { display: flex; gap: 6px; margin-left: auto; flex: 0 0 auto; }
/* In a narrow column the buttons wrap to their own full-width line and split evenly. */
@media (max-width: 1100px) {
  .art-actions { flex: 1 1 100%; margin-left: 0; flex-wrap: wrap; }
  .art-actions .btn { flex: 1 1 auto; justify-content: center; }
}
/* Per-file artwork-services dropdown (make print-ready / remove bg / upscale ×N). */
.art-menu-wrap { position: relative; }
.art-menu { position: absolute; right: 0; top: calc(100% + 4px); z-index: 30; min-width: 176px; background: #fff; border: 1px solid var(--rule-2); border-radius: 9px; box-shadow: 0 10px 28px rgba(0,0,0,.14); padding: 4px; max-height: calc(100vh - 84px); overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.art-menu__item { display: block; width: 100%; text-align: left; padding: 8px 10px; font-size: 12.5px; border: 0; background: transparent; border-radius: 6px; cursor: pointer; color: var(--txt-1); white-space: nowrap; }
.art-menu__item:hover { background: var(--paper-2, #f2f1ec); }
/* Mobile artwork card (≤560px): hidden by default so desktop is unchanged. */
.art-mob-only, .art-more-lbl, .art-menu__mob, .art-menu-wrap--mob { display: none; }
.art-menu__label { padding: 8px 10px 4px; font: 600 10.5px var(--font-mono); letter-spacing: .03em; text-transform: uppercase; color: var(--txt-3); border-top: 1px solid var(--rule-2); margin-top: 4px; }
.art-menu__item--danger { color: var(--c-red); border-top: 1px solid var(--rule-2); border-radius: 0 0 6px 6px; margin-top: 4px; }
.art-menu__adj { padding: 8px 10px; border-top: 1px solid var(--rule-2); margin-top: 4px; }
.art-menu__adj-label { font-size: 12.5px; color: var(--txt-1); margin-bottom: 6px; }
.art-menu__adj-row { display: flex; align-items: center; gap: 8px; }
.art-menu__adj-row input[type=range] { flex: 1; min-width: 96px; accent-color: var(--mint, #18f4af); }
.art-menu__adj-row .art-menu__adj-val { font-size: 11.5px; color: var(--txt-2); min-width: 26px; text-align: right; }
.art-menu__adj-hint { font-size: 10.5px; color: var(--txt-3, #9a978d); margin-top: 5px; }
/* compact factor selector (Upscale ×2/×5/×10) inside the services menu */
.art-menu__seg { flex: 1; }
.art-menu__seg button { flex: 1; padding: 5px 8px; font-size: 11.5px; font-family: var(--font-mono); }
.art-svc-lbl { display: inline-flex; align-items: center; gap: 7px; }
/* Phones: buttons wrap 2-per-row instead of squashing off-screen, and the
   services dropdown becomes a full-width panel under the row (its absolute
   right:0/min-width:176px overflowed the viewport). */
@media (max-width: 640px) {
  .art-row { position: relative; }
  .art-actions { flex-wrap: wrap; }
  .art-actions .btn { flex: 1 1 calc(50% - 3px); min-width: 0; }
  .art-menu-wrap { position: static; }
  .art-menu { left: 8px; right: 8px; min-width: 0; width: auto; max-width: none; box-sizing: border-box; }
  .art-menu__item { white-space: normal; }
  /* Let the adjustment rows shrink/wrap inside the now screen-width menu: the
     slider takes a full row, the value + Apply sit on the next line. */
  .art-menu__adj-row { flex-wrap: wrap; }
  .art-menu__adj-row input[type=range] { flex: 1 1 100%; min-width: 0; }
  .art-menu__adj-row .btn { flex: 1 1 auto; }
  .art-menu__seg { flex: 1 1 100%; }
  .art-menu__adj-val { text-align: left; }
}
@media (max-width: 560px) {
  .art-row { align-items: flex-start; gap: 8px; padding: 10px; }
  .art-check { min-width: 28px; min-height: 48px; justify-content: center; }
  .art-check input { width: 20px; height: 20px; }
  .art-thumb { width: 48px; height: 48px; flex-basis: 48px; }
  .art-meta > .badge { margin: 4px 4px 0 0 !important; }
  .art-sub { white-space: normal; overflow: visible; overflow-wrap: anywhere; margin-top: 4px; line-height: 1.45; }
  .art-mob-only { display: inline-flex; }
  .art-actions { flex: 1 1 100%; flex-wrap: nowrap; gap: 6px; align-items: center; }
  .art-actions .btn { flex: 1 1 0; min-width: 0; min-height: 40px; padding: 6px 8px; }
  .art-actions .art-act-more { display: none; }
  .art-actions .art-act-main svg, .art-actions > .btn:not(.art-act-icon):not(.art-svc-btn) svg { display: none; }
  .art-actions .art-act-icon, .art-actions .art-svc-btn { flex: 0 0 40px; width: 40px; padding: 0; }
  .art-actions .art-act-icon svg, .art-actions .art-svc-btn svg { display: block; width: 18px; height: 18px; }
  .art-act-txt, .art-svc-lbl { display: none; }
  .art-more-lbl { display: inline-flex; }
  .art-menu-wrap, .art-menu-wrap--mob { display: block; flex: 0 0 40px; order: 9; }
  .art-actions > span:not(.kick) { flex: 1 1 0; min-width: 0; display: inline-flex; align-items: center; gap: 6px; }
  .art-actions > span:not(.kick) .btn { flex: 0 0 40px; padding: 0; }
  .art-actions > span.rip-err { flex: 1 1 100%; order: 10; }
  .art-actions .kick { flex: 1 1 100%; order: -1; }
  .art-actions:has(.rip-err), .art-actions:has(.kick) { flex-wrap: wrap; }
  .art-menu__mob { display: block; }
  .art-menu__item { min-height: 40px; }
  .gs-bar { flex-wrap: wrap; gap: 8px 10px !important; }
  .gs-bar > .btn { flex: 1 1 calc(50% - 5px); min-height: 40px; }
  .gs-bar > .linklike { min-height: 40px; display: inline-flex; align-items: center; }
  .gs-bar__hint { flex: 1 1 100%; }
}
.art-proc { display: flex; align-items: center; gap: 6px; margin-top: 3px; font-size: 11px; color: var(--mint-ink); }
.art-proc--err { color: var(--c-red); }
.art-drop { border: 1.5px dashed var(--rule); border-radius: 10px; padding: 14px; text-align: center; font-size: 12.5px; color: var(--txt-2); cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 6px; transition: border-color .15s, background .15s; }
.art-drop:hover { border-color: var(--mint-ink, #1b9e77); background: #f6fffb; }
.art-drop.is-drag { border-color: var(--mint-ink, #1b9e77); background: #ecfdf5; color: var(--mint-ink, #1b9e77); }
.art-drop svg { width: 15px; height: 15px; }
/* Order note */
.order-note { display: flex; gap: 10px; align-items: flex-start; background: #fff8e6; border: 1px solid #f0e0a8; border-radius: var(--radius); padding: 12px 14px; margin-bottom: 16px; }
.order-note svg { width: 16px; height: 16px; color: #b8860b; flex: none; margin-top: 1px; }
.order-note__lbl { font-size: 10px; letter-spacing: .05em; text-transform: uppercase; color: #9a7d1a; font-weight: 700; margin-bottom: 2px; }
.order-note__body { font-size: 13px; color: var(--txt-1); white-space: pre-line; }
/* Internal-notes chat card (shared studio ⇄ shop) */
.notes-card { border: 1px solid var(--rule); border-radius: var(--radius); background: var(--panel); margin-bottom: 16px; overflow: hidden; }
.notes-card__head { display: flex; align-items: center; gap: 6px; padding: 10px 12px; border-bottom: 1px solid var(--rule); }
.notes-card__head svg { width: 15px; height: 15px; color: var(--sub); flex: none; }
.notes-card__lbl { font-size: 10px; letter-spacing: .06em; text-transform: uppercase; color: var(--txt-2); font-weight: 700; }
.notes-chat { display: flex; flex-direction: column; gap: 8px; padding: 12px; max-height: 320px; overflow-y: auto; background: var(--paper-2, #f7f8fa); }
.note-msg { display: flex; }
.note-msg--mine { justify-content: flex-end; }
.note-msg--sys { justify-content: center; }
.note-msg__bubble { max-width: 78%; padding: 7px 11px; border-radius: 12px; background: #fff; border: 1px solid var(--rule); box-shadow: 0 1px 1px rgba(0,0,0,.03); }
.note-msg--mine .note-msg__bubble { background: var(--mint-wash); border-color: var(--mint); }
.note-msg--sys .note-msg__bubble { background: #fff8e6; border-color: #f0e0a8; max-width: 92%; }
.note-msg__meta { font-size: 10px; color: var(--sub); margin-bottom: 2px; font-weight: 600; }
.note-msg__text { font-size: 13px; color: var(--txt-1); white-space: pre-wrap; word-break: break-word; }
.notes-card__compose { display: flex; gap: 8px; align-items: flex-end; padding: 10px 12px; border-top: 1px solid var(--rule); }
.notes-card__compose textarea { flex: 1; resize: vertical; min-height: 36px; font: inherit; font-size: 13px; }
.notes-card__compose .btn { flex: none; }
.ord-note { display: flex; align-items: center; gap: 4px; max-width: 240px; margin-top: 3px; font-size: 10.5px; font-style: italic; color: var(--txt-3); }
.ord-note svg { width: 11px; height: 11px; flex: none; }
.ord-note__t { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.empty-state { padding: 40px 8px; color: var(--txt-3); font-size: 13px; }
.linklike { border: 0; background: transparent; color: var(--mint-ink); cursor: pointer; text-decoration: underline; font: inherit; padding: 0; }

/* Orders grid — item lines with SKU */
.ord-items { display: flex; flex-direction: column; gap: 2px; max-width: 240px; }
.ord-items__row { display: flex; gap: 6px; align-items: baseline; font-size: 12px; line-height: 1.3; }
.ord-items__qty { color: var(--txt-3); font-variant-numeric: tabular-nums; flex: none; }
.ord-items__sku { font-size: 11px; color: var(--txt-1); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ord-items__name { color: var(--txt-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ord-items__sum { font-size: 10.5px; margin-top: 4px; }

/* UV orders — easy to miss, so flag the row and tag the line item. */
.tbl tbody tr.has-uv td:first-child { box-shadow: inset 3px 0 0 var(--c-violet); }
.tbl tbody tr.has-uv:not(.is-sel) { background: var(--c-violet-w); }
.tbl tbody tr.has-uv:not(.is-sel):hover { background: #e9e1ff; }
.ord-items__row.is-uv .ord-items__name,
.ord-items__row.is-uv .ord-items__sku { color: #5a37b3; font-weight: 600; }
.uv-tag { display: inline-block; flex: none; font-family: var(--font-mono); font-size: 9px; font-weight: 700; letter-spacing: .04em; line-height: 1.4; padding: 0 4px; border-radius: 4px; background: var(--c-violet); color: #fff; }

/* DTF metres ordered — material-planning badge on order/production lists. */
.m-badge { display: inline-block; margin-left: 6px; font-family: var(--font-mono); font-size: 10px; font-weight: 700; letter-spacing: .02em; line-height: 1.5; padding: 0 5px; border-radius: 5px; background: var(--c-teal-w); color: #07736a; vertical-align: middle; }
.m-badge--lg { font-size: 11px; padding: 1px 7px; }
.m-badge--solid { background: var(--c-teal); color: #fff; }
.m-badge--uv { background: var(--c-violet); color: #fff; }
/* Hold-until-date control (order actions) */
.hold-ctl { display: inline-flex; align-items: center; gap: 6px; }
.hold-ctl input[type=date] { width: 148px; }
.hold-ctl--on { color: #8a6d1a; font-size: 12px; font-weight: 600; background: #fff8e6; border: 1px solid #f0e0a8; border-radius: 8px; padding: 3px 6px 3px 9px; }
.hold-ctl--on svg { width: 13px; height: 13px; }
/* Lapsed-regular note on the customer profile */
.reactivate-note { display: flex; align-items: center; gap: 6px; margin-top: 12px; padding: 7px 10px; font-size: 12px; font-weight: 600; color: #b45309; background: #fff7ed; border: 1px solid #fed7aa; border-radius: 8px; }
.reactivate-note svg { width: 13px; height: 13px; flex: none; }
.stat--clickable:hover { background: var(--mint-wash); }
/* Pinned internal-notes card (customer profile) + order-view banner */
.cust-notes--has { border-color: #f0e0a8; background: #fffdf5; }
.cust-note-banner { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 12px; padding: 9px 12px; background: #fff8e6; border: 1px solid #f0e0a8; border-radius: 10px; font-size: 13px; color: #5a4a12; }
.cust-note-banner svg { width: 15px; height: 15px; flex: none; color: #b8860b; margin-top: 1px; }
.cust-note-banner__lbl { font-size: 10px; letter-spacing: .05em; text-transform: uppercase; color: #9a7d1a; font-weight: 700; margin-right: 2px; }
.cust-note-banner b { font-weight: 700; }
td.num .m-badge { margin-left: 0; }
/* Per-line-item metres on the order detail — highlighted for RIP comparison. */
.li__metres { margin-top: 5px; text-align: right; }
.li__metres .m-badge { margin-left: 0; font-size: 12px; padding: 1px 8px; }
.totals .row--metres { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; padding-bottom: 6px; border-bottom: 1px dashed var(--rule); font-weight: 600; }
.totals .row--metres .m-badge { margin-left: 0; font-size: 12px; padding: 1px 8px; }

/* Live "printing now" — pulsing badge, row accent, and the print-progress panel. */
.print-badge { display: inline-flex; align-items: center; gap: 4px; font-family: var(--font-mono); font-size: 10px; font-weight: 700; letter-spacing: .02em; padding: 1px 7px; border-radius: 999px; background: var(--c-blue-w); color: #1d4dad; white-space: nowrap; }
.print-badge--sm { font-size: 9px; padding: 0 5px; margin-left: 6px; vertical-align: middle; }
.print-badge__dot { width: 6px; height: 6px; border-radius: 50%; background: var(--c-blue); flex: none; animation: pp-pulse 1.2s ease-in-out infinite; }
@keyframes pp-pulse { 0%,100% { opacity: 1; box-shadow: 0 0 0 0 rgba(47,109,240,.5); } 50% { opacity: .5; box-shadow: 0 0 0 4px rgba(47,109,240,0); } }
.tbl tbody tr.is-printing td:first-child { box-shadow: inset 3px 0 0 var(--c-blue); }
.tbl tbody tr.is-printing:not(.is-sel) { background: var(--c-blue-w); }
.tbl tbody tr.is-printing:not(.is-sel):hover { background: #dfe9ff; }

.pp-card { border: 1px solid var(--c-blue); box-shadow: 0 0 0 3px rgba(47,109,240,.08); }
.pp-card .card__head h3 { color: #1d4dad; }
.pp-printer { color: var(--txt-2); }
.pp-top { display: flex; align-items: baseline; gap: 10px; margin-bottom: 8px; }
.pp-order { font-family: var(--font-mono); font-weight: 700; font-size: 14px; }
.pp-metres { color: var(--txt-2); font-size: 13px; }
.pp-pct { margin-left: auto; font-weight: 800; font-size: 16px; color: #1d4dad; }
.pp-bar { height: 8px; border-radius: 999px; background: var(--paper-2, #eee); overflow: hidden; }
.pp-bar__fill { height: 100%; background: linear-gradient(90deg, var(--c-blue), #5b8cff); border-radius: 999px; transition: width .6s ease; }
.pp-line { margin-top: 10px; font-size: 12.5px; color: var(--txt-1); }
.pp-sub { margin-top: 3px; font-size: 11.5px; color: var(--txt-3); }
/* Live print-progress row on the production board (one card per printing job). */
.prod-live { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; margin-bottom: 14px; }
.prod-live .pp-card { margin: 0; }

/* Inline print-progress on a production-board row — read progress without opening the order. */
.prow-prog { display: flex; align-items: center; gap: 6px; margin-top: 5px; }
.prow-prog .print-badge__dot { width: 6px; height: 6px; }
.prow-prog__pct { font-family: var(--font-mono); font-size: 10px; font-weight: 700; color: #1d4dad; white-space: nowrap; }
.prow-prog__bar { flex: 1; min-width: 56px; max-width: 140px; height: 5px; border-radius: 999px; background: var(--c-blue-w); overflow: hidden; }
.prow-prog__fill { display: block; height: 100%; background: linear-gradient(90deg, var(--c-blue), #5b8cff); border-radius: 999px; transition: width .6s ease; }
.prow-prog__eta { font-family: var(--font-mono); font-size: 9.5px; color: var(--txt-3); white-space: nowrap; }

/* Completed-print details (mode · metres · duration · rates · printer). */
.print-result { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-family: var(--font-mono); font-size: 12px; color: var(--txt-1); }
.print-result--sm { margin-top: 4px; font-size: 10px; color: var(--txt-2); }
.print-result__tick { flex: none; }
.print-result__bits { color: var(--c-green, #1f9d54); font-weight: 600; }
.print-result--sm .print-result__bits { color: #137a40; }
.print-result__printer { color: var(--txt-3); }
.print-result--sm .print-result__printer { display: none; }

/* Design-preview image + its print pipeline CTAs (print-ready / upscale / remove-bg). */
.dpp { display: flex; gap: 12px; align-items: flex-start; }
.dpp__thumb { flex: none; line-height: 0; }
.dpp__thumb img { width: 56px; height: 56px; object-fit: contain; border-radius: 6px; border: 1px solid var(--rule); background: #fff; display: block; }
.dpp__body { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.dpp__namerow { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-width: 0; }
/* inline <a> ignores max-width/ellipsis — make it inline-block + cap at the
   container so long filenames truncate instead of overflowing the screen. */
.dpp__name { font-size: 11px; color: var(--mint-ink); text-decoration: underline; display: inline-block; max-width: 100%; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }
.dpp__dl { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; color: var(--mint-ink); text-decoration: none; white-space: nowrap; flex: none; }
.dpp__dl:hover { text-decoration: underline; }
.dpp__dl svg { width: 13px; height: 13px; }
.dpp__meta { font-size: 10.5px; color: var(--txt-3); letter-spacing: .01em; }
.dpp__actions { display: flex; gap: 6px; flex-wrap: wrap; }
.dpp__status { display: flex; gap: 8px; align-items: center; }
.dpp__status:empty { display: none; }
.fileprop { display: inline-flex; align-items: center; gap: 10px; flex-wrap: wrap; min-width: 0; max-width: 100%; }
.fileprop__name { font-size: 12px; display: inline-block; max-width: 100%; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }

.li__name { font-weight: 600; font-size: 13px; }
.li__meta { font-family: var(--font-mono); font-size: 11px; color: var(--txt-3); margin-top: 2px; }
.li__props { margin-top: 9px; display: flex; flex-direction: column; gap: 5px; border-top: 1px dashed var(--rule); padding-top: 9px; }
.li__prop { display: grid; grid-template-columns: 140px 1fr; gap: 10px; font-size: 12px; align-items: baseline; }
.li__propk { font-family: var(--font-mono); font-size: 9.5px; letter-spacing: .05em; text-transform: uppercase; color: var(--txt-3); }
.li__propv { color: var(--txt-2); word-break: break-word; min-width: 0; }
.li__price { font-family: var(--font-mono); font-size: 13px; text-align: right; }
.li__qty { font-family: var(--font-mono); font-size: 11px; color: var(--txt-2); text-align: right; }
/* quantity > 1 — make it impossible to miss (e.g. on RIP) */
.li__qtytag { display: inline-block; margin-right: 7px; padding: 1px 7px; border-radius: 999px; background: var(--c-amber, #f59e0b); color: #1a1206; font-family: var(--font-mono); font-weight: 800; font-size: 11px; vertical-align: middle; }
.li__qty--multi { color: #9a6a00; font-weight: 800; font-size: 13px; background: rgba(245,158,11,.16); border-radius: 6px; padding: 1px 6px; }
/* Compact line item (designer spec 2026-11-21): head row + body of spec chips, file tiles, link chips. */
.li__head { display: grid; grid-template-columns: 46px minmax(0, 1fr) auto; gap: 13px; align-items: start; }
.li__sum { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; text-align: right; }
.li__sum .m-badge { margin-left: 0; font-size: 12px; padding: 1px 8px; }
.li__body { margin-left: 59px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.li__props2 { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.li__specs { display: flex; flex-wrap: wrap; gap: 4px 6px; }
.li__spec { display: inline-flex; gap: 5px; align-items: baseline; padding: 2px 8px; border-radius: 6px; background: #f2f1ec; font-size: 12px; max-width: 100%; min-width: 0; }
.li__spec-k { font: 600 9.5px var(--font-mono); letter-spacing: .05em; text-transform: uppercase; color: #6b6f75; flex: none; }
.li__spec-v { overflow-wrap: anywhere; min-width: 0; }
.li-file { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px; padding: 7px 8px; border: 1px solid var(--rule); border-radius: 9px; background: #fbfaf7; max-width: 640px; min-width: 0; box-sizing: border-box; }
.li-file__thumb { flex: none; width: 44px; height: 44px; border-radius: 6px; border: 1px solid var(--rule); background: #fff; display: grid; place-items: center; overflow: hidden; color: var(--txt-3); }
.li-file__thumb img { width: 100%; height: 100%; object-fit: contain; }
.li-file__thumb svg { width: 18px; height: 18px; }
.li-file__thumb--none { background: repeating-linear-gradient(45deg,#f0eee7,#f0eee7 6px,#f6f5f1 6px,#f6f5f1 12px); }
.li-file__body { flex: 1 1 160px; min-width: 0; }
.li-file__label { display: flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700; color: var(--txt); text-decoration: none; }
a.li-file__label:hover { color: var(--mint-ink); text-decoration: underline; }
.li-file__ext { font: 700 9.5px var(--font-mono); padding: 0 5px; border-radius: 4px; background: var(--mint-wash, #e3fbf2); color: var(--mint-ink); text-decoration: none; }
.li-file__ext--pdf { background: var(--c-red-w, #fdecec); color: #b32a1f; }
.li-file__sub { font: 400 10.5px var(--font-mono); color: #6b6f75; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.li-file__err { font-size: 11.5px; color: #b32a1f; margin-top: 2px; }
.li-file__acts { display: flex; align-items: center; gap: 6px; flex: none; margin-left: auto; flex-wrap: wrap; justify-content: flex-end; max-width: 100%; }
.li-file__acts .rip-err, .li-file__note, .li-file__more { flex-basis: 100%; }
.li-file__more { display: flex; gap: 6px; flex-wrap: wrap; }
.li-file__note { font: 400 10.5px var(--font-mono); color: #6b6f75; }
.li-file--raw .li-file__body { flex-basis: 100%; }
.li-file--raw .li-file__label { margin-bottom: 6px; }
.li__chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0; }
.li-chip { display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--rule); background: #fff; font: inherit; font-size: 12px; font-weight: 600; color: var(--mint-ink); text-decoration: none; white-space: nowrap; cursor: pointer; box-sizing: border-box; }
.li-chip:hover { border-color: var(--rule-2); }
.li-chip:disabled { opacity: .7; cursor: default; }
.li-chip svg { width: 13px; height: 13px; }
.li-chip--quiet { color: var(--txt-2); font-weight: 500; }
.li-chip--dark { color: var(--txt); }
.li-chip--ok { background: var(--mint-wash, #e3fbf2); border-color: transparent; color: var(--mint-ink); }
.li-chip--grey { background: #f2f1ec; color: var(--txt-2); }
.li-chip--err { color: #b32a1f; border-color: #f3c2c2; }
.li__make { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.li__make label { font: 600 9.5px var(--font-mono); letter-spacing: .05em; text-transform: uppercase; color: #6b6f75; }
.li__details > summary { cursor: pointer; font-size: 12px; list-style: none; }
.li__details > summary::-webkit-details-marker { display: none; }
.li__details[open] > summary { margin-bottom: 8px; }
.li__det-hide, .li__details[open] .li__det-show { display: none; }
.li__details[open] .li__det-hide { display: inline; }
.li__make .rm-in { width: auto; max-width: 220px; }
.lineitem .li__stock { margin-top: 0; }

.totals { padding: 14px 16px; }
.totals .row { display:flex; justify-content: space-between; font-size: 13px; padding: 5px 0; }
.totals .row.grand { border-top: 1px solid var(--rule); margin-top: 6px; padding-top: 12px; font-family: var(--font-display); font-weight: 800; font-size: 16px; }
.totals .row span:last-child { font-family: var(--font-mono); }

/* timeline */
.timeline { position: relative; padding-left: 6px; }
.tl { position: relative; padding: 0 0 18px 24px; }
.tl:last-child { padding-bottom: 0; }
.tl::before { content:""; position:absolute; left: 5px; top: 4px; bottom: -4px; width: 2px; background: var(--rule); }
.tl:last-child::before { display: none; }
.tl__dot { position:absolute; left: 0; top: 2px; width: 12px; height: 12px; border-radius: 50%; background:#fff; border: 2px solid var(--rule-2); }
.tl__dot.on { background: var(--mint); border-color: var(--mint-deep); }
.tl__t { font-size: 13px; font-weight: 600; }
.tl__m { font-family: var(--font-mono); font-size: 10.5px; color: var(--txt-3); margin-top: 1px; }

/* fulfillment progress steps */
.steps { display:flex; gap: 0; margin: 4px 0 0; }
.step { flex:1; text-align:center; position: relative; }
.step__bar { height: 4px; background: var(--rule); }
.step.done .step__bar { background: var(--mint-deep); }
.step.cur .step__bar { background: var(--mint); }
.step__lbl { font-family: var(--font-mono); font-size: 9px; letter-spacing:.06em; text-transform: uppercase; color: var(--txt-3); margin-top: 6px; }
.step.done .step__lbl, .step.cur .step__lbl { color: var(--txt); }
.step:first-child .step__bar { border-radius: 3px 0 0 3px; }
.step:last-child .step__bar { border-radius: 0 3px 3px 0; }

/* ============================ CUSTOMER PROFILE ============================ */
.prof { display: grid; grid-template-columns: 320px 1fr; gap: 18px; padding: 18px 20px 60px; align-items: start; }
.prof__side { position: sticky; top: 18px; display:flex; flex-direction: column; gap: 16px; }
.prof__main { display:flex; flex-direction: column; gap: 16px; min-width: 0; }
.avatar-lg { width: 56px; height: 56px; border-radius: 50%; background: var(--ink); color: var(--mint); display:grid; place-items:center; font-family: var(--font-display); font-weight: 800; font-size: 18px; flex: none; }
.av { flex: none; }
.statline { display:grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--rule); border: 1px solid var(--rule); border-radius: 8px; overflow: hidden; }
.statline > div { background: #fff; padding: 11px 13px; }
.statline .k { font-family: var(--font-mono); font-size: 9.5px; letter-spacing:.08em; text-transform:uppercase; color: var(--txt-3); }
.statline .v { font-family: var(--font-display); font-weight: 800; font-size: 18px; margin-top: 2px; }

.viewed { display:flex; flex-direction: column; }
.viewed__row { display:flex; align-items:center; gap: 11px; padding: 10px 16px; border-bottom: 1px solid var(--rule); color: inherit; text-decoration: none; }
.viewed__row:last-child { border-bottom: 0; }
.viewed__row:hover { background: #fbfaf7; }
.viewed__ic { width: 34px; height: 34px; border-radius: 7px; border:1px solid var(--rule); display:grid; place-items:center; flex:none; background: repeating-linear-gradient(45deg,#f0eee7,#f0eee7 5px,#f8f7f3 5px,#f8f7f3 10px); }
.viewed__ic svg { width:15px; height:15px; color: var(--txt-3); }
.viewed__t { font-weight: 600; font-size: 13px; }
.viewed__m { font-family: var(--font-mono); font-size: 10.5px; color: var(--txt-3); margin-top: 1px; }
.viewed__time { margin-left: auto; font-family: var(--font-mono); font-size: 10.5px; color: var(--txt-3); white-space: nowrap; }

/* ============================ INBOX ============================ */
.inbox { display: grid; grid-template-columns: 300px 1fr 300px; height: 100%; min-height: 0; }
.inbox__list { border-right: 1px solid var(--rule); overflow-y: auto; background: var(--paper-2); }
.inbox__listhead { padding: 12px 16px; border-bottom: 1px solid var(--rule); position: sticky; top:0; background: var(--paper-2); z-index: 2; display:flex; align-items:center; gap:8px; }
.inbox__seg { display:flex; gap: 4px; }
.inbox__seg button { font-family: var(--font-mono); font-size: 11px; padding: 5px 9px; border-radius: 6px; color: var(--txt-2); }
.inbox__seg button.is-active { background: var(--ink); color: #fff; }
.thread-item { padding: 12px 16px; border-bottom: 1px solid var(--rule); cursor: pointer; }
.thread-item:hover { background: #fbfaf7; }
.thread-item.is-active { background: var(--mint-wash); box-shadow: inset 3px 0 0 var(--mint); }
.thread-item.unread .ti__subj { font-weight: 700; }
.thread-item.unread .ti__from::after { content:""; display:inline-block; width:6px; height:6px; border-radius:50%; background: var(--mint-deep); margin-left:6px; vertical-align: middle; }
.ti__top { display:flex; align-items:center; gap:8px; margin-bottom: 3px; }
.ti__from { font-weight: 600; font-size: 13px; flex: 1; min-width:0; overflow:hidden; text-overflow: ellipsis; white-space: nowrap; }
.ti__time { font-family: var(--font-mono); font-size: 10px; color: var(--txt-3); flex:none; }
.ti__subj { font-size: 12.5px; color: var(--txt); margin-bottom: 2px; overflow:hidden; text-overflow: ellipsis; white-space: nowrap; }
.ti__prev { font-size: 11.5px; color: var(--txt-3); overflow:hidden; text-overflow: ellipsis; white-space: nowrap; }
.ti__labels { display:flex; gap:4px; margin-top: 6px; }

.conv { display:flex; flex-direction: column; min-width: 0; overflow: hidden; }
.conv__head { padding: 13px 18px; border-bottom: 1px solid var(--rule); background: var(--paper-2); flex: none; }
.conv__subj { font-family: var(--font-display); font-weight: 800; font-size: 16px; letter-spacing: -.01em; }
.conv__meta { display:flex; align-items:center; gap:10px; margin-top: 5px; font-family: var(--font-mono); font-size: 11px; color: var(--txt-3); }
.conv__scroll { flex: 1; overflow-y: auto; padding: 18px; background: var(--paper); }
.msg { background: #fff; border: 1px solid var(--rule); border-radius: 10px; margin-bottom: 14px; }
.msg.out { background: var(--mint-wash); border-color: #c6efe0; }
.msg__head { display:flex; align-items:center; gap:10px; padding: 11px 15px; border-bottom: 1px solid var(--rule); }
.msg.out .msg__head { border-bottom-color: #c6efe0; }
.msg__av { width: 30px; height: 30px; border-radius: 50%; display:grid; place-items:center; font-family: var(--font-mono); font-weight:700; font-size: 11px; flex:none; }
.msg__av.cust { background: var(--ink); color: var(--mint); }
.msg__av.us { background: var(--mint); color: #00271a; }
.msg__who { font-weight: 600; font-size: 13px; }
.msg__addr { font-family: var(--font-mono); font-size: 10px; color: var(--txt-3); }
.msg__time { margin-left:auto; font-family: var(--font-mono); font-size: 10px; color: var(--txt-3); }
.msg__body { padding: 14px 15px; font-size: 13.5px; line-height: 1.62; white-space: pre-wrap; overflow-wrap: anywhere; word-break: break-word; }
.msg__atts { padding: 0 15px 14px; display:flex; flex-wrap:wrap; gap:8px; }
.email-html { white-space: normal; font-size: 13.5px; line-height: 1.6; color: var(--txt); overflow-x: auto; }
.email-html img { max-width: 100%; height: auto; border-radius: 6px; }
.email-html * { max-width: 100%; box-sizing: border-box; overflow-wrap: anywhere; }
.email-html a { color: var(--mint-ink); text-decoration: underline; }
.email-html table { max-width: 100%; border-collapse: collapse; }
.email-html blockquote { border-left: 3px solid var(--rule-2); margin: 8px 0; padding-left: 12px; color: var(--txt-2); }
.email-html svg { width: auto; height: auto; }
.img-att { display:inline-block; border:1px solid var(--rule); border-radius:8px; overflow:hidden; max-width:240px; }
.img-att img { display:block; max-width:240px; height:auto; }
.ti__count { color: var(--txt-3); font-weight: 400; }
.att-chip { display:flex; align-items:center; gap:8px; border:1px solid var(--rule); border-radius: 8px; padding: 7px 10px; background:#fff; font-size: 12px; }
.att-chip svg { width: 14px; height: 14px; color: var(--txt-3); flex:none; }
.att-chip .at__t { font-weight: 600; } .att-chip .at__m { font-family: var(--font-mono); font-size:10px; color: var(--txt-3); }

/* composer */
.composer { border-top: 1px solid var(--rule); background: var(--paper-2); padding: 12px 16px 14px; flex: none; }
.composer__bar { display:flex; align-items:center; gap: 8px; margin-bottom: 9px; flex-wrap: wrap; }
.composer textarea { width: 100%; border: 1px solid var(--rule); border-radius: 9px; padding: 11px 13px; font-size: 13.5px; line-height: 1.55; resize: vertical; min-height: 92px; outline: none; background:#fff; }
.composer textarea:focus { border-color: var(--ink-3); box-shadow: 0 0 0 3px rgba(11,12,14,.05); }
.composer__foot { display:flex; align-items:center; gap: 8px; margin-top: 9px; }
.composer__atts { display:flex; gap:6px; flex-wrap: wrap; margin-top: 9px; }
.ai-btn { display:flex; align-items:center; gap:7px; padding: 8px 13px; border-radius: 8px; font-size: 12.5px; font-weight: 700; background: var(--ink); color:#fff; }
.ai-btn:hover { background: var(--ink-2); }
.ai-btn .spark { color: var(--mint); }
.ai-btn:disabled { opacity:.6; cursor: default; }
.ai-tone { display:flex; gap:0; border:1px solid var(--rule); border-radius:8px; overflow:hidden; }
.ai-tone button { font-family:var(--font-mono); font-size:10.5px; padding:6px 10px; color:var(--txt-2); border-right:1px solid var(--rule); }
.ai-tone button:last-child{ border-right:0; }
.ai-tone button.on { background: var(--ink); color:#fff; }

.ai-ask { display:flex; align-items:center; gap:8px; margin-bottom: 9px; }
.ai-ask input { flex:1; border:1px solid var(--rule); border-radius:8px; padding:9px 11px; font-size:13px; outline:none; background:#fff; }
.ai-ask input:focus { border-color: var(--ink-3); box-shadow: 0 0 0 3px rgba(11,12,14,.05); }

.ai-banner { display:flex; align-items:center; gap:10px; padding: 9px 13px; background: var(--mint-wash); border:1px solid #c6efe0; border-radius: 8px; font-size: 12.5px; margin-bottom: 9px; color: var(--mint-ink); }
.ai-banner .x { margin-left:auto; }
.ai-banner.thinking { color: var(--txt-2); background: #f2f1ec; border-color: var(--rule); }

/* context side panel in conversation */
.ctx { border-left: 1px solid var(--rule); overflow-y: auto; background: var(--paper-2); }
.ctx__sec { padding: 14px 16px; border-bottom: 1px solid var(--rule); }
.ctx__sec h4 { font-family: var(--font-mono); font-size: 10px; letter-spacing:.12em; text-transform:uppercase; color: var(--txt-3); margin: 0 0 10px; font-weight:600; }

/* attach popover */
.pop { position: absolute; bottom: calc(100% + 8px); left: 0; width: 360px; background:#fff; border:1px solid var(--rule); border-radius: 11px; box-shadow: var(--shadow-lg); z-index: 30; overflow: hidden; }
.pop__tabs { display:flex; border-bottom:1px solid var(--rule); }
.pop__tabs button { flex:1; padding: 10px; font-size:12px; font-weight:600; color: var(--txt-2); border-right:1px solid var(--rule); }
.pop__tabs button:last-child{ border-right:0; }
.pop__tabs button.on { color: var(--txt); box-shadow: inset 0 -2px 0 var(--mint); }
.pop__search { padding: 10px 12px; border-bottom:1px solid var(--rule); }
.pop__search input { width:100%; border:1px solid var(--rule); border-radius:7px; padding:8px 10px; font-size:12.5px; outline:none; }
.pop__list { max-height: 280px; overflow-y:auto; }
.pop__item { display:flex; align-items:center; gap:11px; padding: 10px 12px; border-bottom:1px solid var(--rule); cursor:pointer; }
.pop__item:hover { background:#fbfaf7; }
.pop__item:last-child{ border-bottom:0; }
.pop__thumb { width:38px; height:38px; border-radius:6px; border:1px solid var(--rule); background: repeating-linear-gradient(45deg,#f0eee7,#f0eee7 5px,#f8f7f3 5px,#f8f7f3 10px); flex:none; display:grid; place-items:center; }
.pop__thumb svg { width:15px; height:15px; color:var(--txt-3); }
.pop__t { font-weight:600; font-size:12.5px; } .pop__m { font-family:var(--font-mono); font-size:10px; color:var(--txt-3); }
.pop__price { margin-left:auto; font-family:var(--font-mono); font-size:12px; font-weight:600; }

/* ============================ LOGIN ============================ */
.login { height: 100vh; height: 100dvh; display: grid; grid-template-columns: 1fr 1fr; background: var(--ink); }
@media (max-width: 880px){ .login { grid-template-columns: 1fr; } .login__art { display:none; } }
.login__art { position: relative; overflow: hidden; background: var(--ink); color:#fff; padding: 48px; display:flex; flex-direction:column; justify-content: space-between; }
.login__art::before { content:""; position:absolute; inset:0; background-image: linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px); background-size: 44px 44px; }
.login__brand { position: relative; display:flex; align-items:center; gap:12px; }
.login__brand .m { width:40px; height:40px; border-radius:9px; background:var(--mint); color:#00271a; display:grid; place-items:center; font-family:var(--font-display); font-weight:900; font-size:13px; }
.login__brand .t { font-family:var(--font-display); font-weight:800; font-size:18px; }
.login__big { position: relative; }
.login__big h2 { font-family:var(--font-display); font-weight:900; font-size: clamp(30px,4vw,48px); line-height:.98; letter-spacing:-.02em; text-transform:uppercase; margin:0; }
.login__big h2 .hl { color: var(--mint); }
.login__big p { font-family: var(--font-mono); font-size: 12px; letter-spacing:.04em; color:#9aa1a9; margin-top: 16px; max-width: 380px; line-height:1.7; }
.login__stats { position:relative; display:flex; gap: 34px; }
.login__stats .s .v { font-family:var(--font-display); font-weight:800; font-size: 26px; color: var(--mint); }
.login__stats .s .k { font-family:var(--font-mono); font-size:10px; letter-spacing:.1em; text-transform:uppercase; color:#7e848b; margin-top:2px; }

.login__form { background: var(--paper); display:flex; align-items:center; justify-content:center; padding: 40px; }
.login__card { width: 100%; max-width: 380px; }
.login__card h1 { font-family: var(--font-display); font-weight: 900; font-size: 26px; letter-spacing:-.02em; margin: 0 0 6px; }
.login__card .lede { font-size: 13.5px; color: var(--txt-2); margin: 0 0 26px; }
.field { margin-bottom: 15px; }
.field label { font-family: var(--font-mono); font-size: 10px; letter-spacing:.1em; text-transform:uppercase; color: var(--txt-3); display:block; margin-bottom: 6px; }
.field input { width: 100%; border:1px solid var(--rule-2); border-radius: 9px; padding: 12px 13px; font-size: 14px; background:#fff; outline:none; }
.field input:focus { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(11,12,14,.06); }
.field__row { display:flex; justify-content: space-between; align-items:center; }
.field__row a { font-size: 12px; color: var(--mint-ink); font-weight:600; }
.login__row { display:flex; align-items:center; justify-content:space-between; margin: 4px 0 20px; font-size: 12.5px; color: var(--txt-2); }
.login__sso { display:flex; align-items:center; gap:10px; justify-content:center; margin-top:16px; padding:11px; border:1px solid var(--rule-2); border-radius:9px; background:#fff; font-size:13px; font-weight:600; }
.login__sso:hover { background:#fbfaf7; }
.login__divider { display:flex; align-items:center; gap:12px; margin:20px 0; color: var(--txt-3); font-family:var(--font-mono); font-size:10px; letter-spacing:.1em; }
.login__divider::before,.login__divider::after { content:""; flex:1; height:1px; background:var(--rule-2); }
.login__err { margin-top: 12px; padding: 9px 12px; border:1px solid #f3c0c0; background:#fde8e8; color:#8a2b2b; border-radius:8px; font-size:12.5px; }
.login__hint { margin-top: 20px; padding: 11px 13px; border:1px dashed var(--rule-2); border-radius:8px; font-family:var(--font-mono); font-size:11px; color: var(--txt-2); background:#fff; }
.login__hint b { color: var(--txt); }

/* empty state */
.empty { display:flex; flex-direction:column; align-items:center; justify-content:center; height:100%; color: var(--txt-3); gap: 12px; padding: 40px; text-align:center; }
.empty svg { width: 40px; height: 40px; opacity:.4; }
.empty .t { font-family: var(--font-display); font-weight: 700; font-size: 16px; color: var(--txt-2); }
.empty .m { font-size: 13px; max-width: 280px; }

/* misc */
.copybtn { display:inline-grid; place-items:center; width:18px; height:18px; border-radius:4px; color:var(--txt-3); vertical-align:middle; flex:none; }
.copybtn:hover { background: var(--paper); color: var(--txt); }
.copybtn svg { width:12px; height:12px; }

.dim { color: var(--txt-3); }
.right { margin-left: auto; }
.spin { display:inline-block; flex:none; box-sizing:border-box; vertical-align:middle; width:14px; height:14px; border:2px solid rgba(255,255,255,.3); border-top-color:#fff; border-radius:50%; animation: spin .7s linear infinite; }
.spin--mint { border-color: rgba(24,244,175,.25); border-top-color: #18f4af; }
.spin--dark { border-color: rgba(11,12,14,.2); border-top-color: var(--ink); }
@keyframes spin { to { transform: rotate(360deg); } }
.fade-in { animation: fade .28s ease; }
@keyframes fade { from { transform: translateY(5px);} to { transform: none; } }

/* ============================================================
   Mobile / responsive
   ============================================================ */
.topbar__menu { display: grid; }     /* burger on all sizes: collapse on desktop, drawer on mobile */
.sidebar__backdrop { display: none; }

/* Desktop: burger collapses the sidebar (reflow, main goes full width). */
@media (min-width: 861px) {
  .app.is-collapsed { grid-template-columns: 1fr; }
  .app.is-collapsed .sidebar { display: none; }
}

@media (max-width: 860px) {
  /* iOS: inputs <16px make Safari zoom on focus → looks broken. Force 16px. */
  input, select, textarea { font-size: 16px; }
  .content { -webkit-overflow-scrolling: touch; }

  /* off-canvas sidebar */
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; top: 0; left: 0; height: 100vh; height: 100dvh; width: 84vw; max-width: 300px; z-index: 60;
    transform: translateX(-100%); transition: transform .22s ease;
    padding-left: env(safe-area-inset-left);
  }
  .sidebar.is-open { transform: translateX(0); box-shadow: 0 0 40px rgba(0,0,0,.45); }
  .sidebar__backdrop { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 55; }

  /* topbar (respect the notch / safe areas) */
  .topbar { padding: 0 max(12px, env(safe-area-inset-right)) 0 max(12px, env(safe-area-inset-left)); gap: 8px; }
  .topbar__menu { display: grid; }
  .topbar__search { display: none; }
  .topbar__title h1 { font-size: 15px; }
  .topbar__title .sub { display: none; }

  /* content padding */
  .board { padding: 12px 12px 60px; }

  /* stack two-column layouts */
  .detail, .prof { grid-template-columns: 1fr; padding: 14px 12px 60px; gap: 14px; }
  .detail__side, .prof__side { position: static; top: auto; }

  /* stats wrap to 2-up */
  .stats { grid-template-columns: 1fr 1fr; gap: 8px; }

  /* any inline 1fr/1fr card grid (recently viewed, etc.) -> single column */
  div[style*="grid-template-columns: 1fr 1fr"] { grid-template-columns: 1fr !important; }

  /* wide tables scroll horizontally inside their wrapper (keeps column alignment) */
  .tbl-wrap > .tbl { min-width: 720px; }

  /* inbox: list on top, conversation below, hide the context rail */
  .inbox { display: flex; flex-direction: column; height: 100%; }
  .inbox__list { max-height: 42vh; border-right: 0; border-bottom: 1px solid var(--rule); }
  .conv { flex: 1; min-height: 0; }
  .ctx { display: none; }

  /* modals full width */
  .modal-overlay { padding: 10px; }
  .modal, .modal--wide { max-width: 100%; }

  /* misc */
  .ord-search { min-width: 0; flex: 1 1 180px; }
  .kv { grid-template-columns: 92px 1fr; }
}

@media (max-width: 480px) {
  .stats { grid-template-columns: 1fr; }
  .statline { grid-template-columns: 1fr; }
  .topbar__title .sub { display: none; }
}

/* ============================ PRODUCTION BOARD (imported design) ============================ */
.prod { padding: 18px 20px 80px; }
.prod .stats { grid-template-columns: repeat(5, 1fr); }
.stat--accent { background: var(--ink); border-color: var(--ink); }
.stat--accent .stat__k { color: #8b9096; }
.stat--accent .stat__v { color: var(--mint); }
.stat--accent .stat__d { color: #9aa1a9; }

.prodnote { display: flex; align-items: center; gap: 10px; background: var(--c-amber-w); border: 1px solid #f0dcae; color: #8a5e00; border-radius: var(--radius); padding: 10px 14px; margin-bottom: 18px; font-size: 12.5px; }
.prodnote svg { width: 16px; height: 16px; flex: none; }
.prodnote b { font-weight: 700; }

.prodbar { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.prodbar h2 { font-family: var(--font-display); font-weight: 800; font-size: 15px; letter-spacing: -.01em; margin: 0; display:flex; align-items:center; gap: 9px; }
.prodbar h2 svg { width: 17px; height: 17px; color: var(--txt-2); }
.prodbar .right { margin-left: auto; display:flex; gap: 8px; }

.lane { margin-bottom: 18px; background: var(--panel); border: 1px solid var(--rule); border-radius: var(--radius); overflow: hidden; }
.lane__head { display:flex; align-items:center; gap: 10px; padding: 11px 15px; border-bottom: 1px solid var(--rule); background: #fbfaf7; }
.lane__ic { width: 26px; height: 26px; border-radius: 7px; display:grid; place-items:center; flex:none; }
.lane__ic svg { width: 15px; height: 15px; }
.lane__ic--design { background: var(--c-violet-w); color: var(--c-violet); }
.lane__ic--press  { background: var(--c-amber-w);  color: var(--c-amber); }
.lane__ic--ready  { background: var(--mint-wash);  color: var(--mint-ink); }
.lane__t { font-family: var(--font-display); font-weight: 800; font-size: 13px; letter-spacing: -.005em; text-transform: uppercase; }
.lane__sub { font-family: var(--font-mono); font-size: 10.5px; color: var(--txt-3); }
.lane__count { margin-left: auto; font-family: var(--font-mono); font-size: 11px; color: var(--txt-2); background: var(--paper); border:1px solid var(--rule); padding: 2px 9px; border-radius: 20px; }
.lane__track { display: flex; gap: 10px; padding: 13px 15px; overflow-x: auto; min-height: 92px; transition: background .12s; }
.lane__track.is-drop { background: var(--mint-wash); box-shadow: inset 0 0 0 2px var(--mint-deep); }
.lane__track .jobcard { width: 268px; flex: none; }
.lane__empty { font-family: var(--font-mono); font-size: 11.5px; color: var(--txt-3); align-self: center; padding: 8px 4px; }

.printers { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 8px; align-items: flex-start; }
.prodcol { width: 278px; flex: none; background: var(--panel); border: 1px solid var(--rule); border-radius: var(--radius); display: flex; flex-direction: column; }
.prodcol--unassigned { background: #faf9f5; border-style: dashed; border-color: var(--rule-2); }
.prodcol__head { display:flex; align-items:center; gap: 9px; padding: 11px 13px; border-bottom: 1px solid var(--rule); }
.prodcol__status { width: 9px; height: 9px; border-radius: 50%; flex:none; }
.prodcol__status.on { background: var(--c-green); box-shadow: 0 0 0 3px var(--c-green-w); }
.prodcol__status.off { background: var(--txt-3); box-shadow: 0 0 0 3px var(--c-grey-w); }
.prodcol__name { font-family: var(--font-display); font-weight: 700; font-size: 12.5px; line-height: 1.15; min-width: 0; flex: 1; }
.prodcol__name small { display:block; font-family: var(--font-mono); font-weight: 500; font-size: 9px; letter-spacing: .08em; text-transform: uppercase; color: var(--txt-3); margin-top: 2px; }
.prodcol__cnt { font-family: var(--font-mono); font-size: 10.5px; color: var(--txt-2); background: var(--paper); border:1px solid var(--rule); padding: 1px 7px; border-radius: 20px; flex:none; }
.prodcol__menu { display:flex; gap: 4px; flex:none; }
.iconmini { width: 24px; height: 24px; border-radius: 6px; display:grid; place-items:center; color: var(--txt-3); border:1px solid transparent; }
.iconmini:hover { background: var(--paper); border-color: var(--rule); color: var(--txt); }
.iconmini svg { width: 13px; height: 13px; }
.iconmini.danger:hover { background: var(--c-red-w); color: var(--c-red); border-color: #f3c9c5; }
.prodcol__rename { flex: 1; display:flex; gap: 6px; align-items:center; }
.prodcol__rename input { flex:1; min-width: 0; border:1px solid var(--ink); border-radius: 6px; padding: 5px 8px; font-size: 12.5px; font-weight: 600; outline:none; }
.prodcol__confirm { display:flex; align-items:center; gap: 7px; flex:1; font-size: 11.5px; color: var(--c-red); font-weight: 600; }
.prodcol__confirm .sp { margin-left:auto; display:flex; gap:4px; }
.prodcol__body { padding: 11px; display: flex; flex-direction: column; gap: 9px; flex: 1; min-height: 84px; transition: background .12s; }
.prodcol__body.is-drop { background: var(--mint-wash); box-shadow: inset 0 0 0 2px var(--mint-deep); border-radius: 0 0 var(--radius) var(--radius); }
.prodcol__body.is-blocked.is-drop { background: var(--c-red-w); box-shadow: inset 0 0 0 2px var(--c-red); }
.prodcol__empty { font-family: var(--font-mono); font-size: 11px; color: var(--txt-3); text-align:center; padding: 16px 8px; border: 1px dashed var(--rule); border-radius: 7px; }
.prodcol__paused { font-family: var(--font-mono); font-size: 10px; letter-spacing:.06em; text-transform:uppercase; color: var(--txt-3); text-align:center; padding: 8px; }

.addprinter { width: 150px; flex: none; align-self: stretch; min-height: 120px; border: 1.5px dashed var(--rule-2); border-radius: var(--radius); display:flex; flex-direction: column; align-items:center; justify-content:center; gap: 8px; color: var(--txt-2); font-size: 12.5px; font-weight: 600; background: transparent; }
.addprinter:hover { border-color: var(--mint-deep); color: var(--mint-ink); background: var(--mint-wash); }
.addprinter svg { width: 20px; height: 20px; }

.jobcard { background: #fff; border: 1px solid var(--rule); border-radius: 8px; padding: 11px 12px; display: flex; flex-direction: column; gap: 9px; cursor: grab; box-shadow: var(--shadow-sm); position: relative; user-select: none; -webkit-user-select: none; }
.jobcard:active { cursor: grabbing; }
.jobcard.is-drag { opacity: .4; }
.jobcard.vip { border-left: 3px solid var(--mint); }
.jobcard__top { display:flex; align-items:center; gap: 8px; }
.jobcard__rail { width: 4px; height: 26px; border-radius: 3px; flex:none; }
.jobcard__no { font-family: var(--font-mono); font-weight: 600; font-size: 12px; }
.jobcard__vip { color: var(--mint-ink); font-size: 12px; }
.jobcard__units { margin-left:auto; font-family: var(--font-mono); font-size: 10.5px; color: var(--txt-2); background: var(--paper); border:1px solid var(--rule); padding: 2px 7px; border-radius: 20px; white-space:nowrap; }
.jobcard__cust { font-weight: 600; font-size: 13px; line-height: 1.2; }
.jobcard__svc { display:flex; flex-wrap:wrap; gap: 5px; }
.svcchip { font-family: var(--font-mono); font-size: 9.5px; letter-spacing: .04em; text-transform: uppercase; padding: 2px 7px; border-radius: 5px; font-weight: 600; }
.svcchip--print { background: var(--c-blue-w); color: #1d4dad; }
.svcchip--design { background: var(--c-violet-w); color: #5a37b3; }
.svcchip--press { background: var(--c-amber-w); color: #9a6300; }
.svcchip--gang { background: var(--c-teal-w); color: #07736a; }
.jobcard__due { font-family: var(--font-mono); font-size: 10px; color: var(--txt-3); display:flex; align-items:center; gap:6px; }
.jobcard__due .due-today { color: var(--c-red); font-weight: 600; }
.jobcard__foot { display:flex; align-items:center; gap: 7px; border-top: 1px solid var(--rule); padding-top: 9px; }
.hold, .cleared { display:inline-flex; align-items:center; gap: 5px; font-family: var(--font-mono); font-size: 9.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; padding: 3px 7px; border-radius: 5px; }
.hold { background: var(--c-grey-w); color: var(--txt-2); }
.hold svg { width: 11px; height: 11px; }
.cleared { background: var(--mint-wash); color: var(--mint-ink); }
.cleared svg { width: 11px; height: 11px; }
.jobbtn { margin-left:auto; display:inline-flex; align-items:center; gap: 5px; font-size: 11.5px; font-weight: 700; padding: 6px 10px; border-radius: 7px; background: var(--ink); color:#fff; white-space:nowrap; }
.jobbtn:hover { background: var(--ink-2); }
.jobbtn svg { width: 12px; height: 12px; }
.jobbtn + .jobbtn { margin-left: 0; }
.jobbtn--ghost { background:#fff; border:1px solid var(--rule); color: var(--txt); }
.jobbtn--ghost:hover { background: var(--paper); border-color: var(--rule-2); }
.jobback { width: 26px; height: 26px; border-radius:6px; display:grid; place-items:center; color: var(--txt-3); border:1px solid var(--rule); background:#fff; flex:none; }
.jobback:hover { color: var(--txt); border-color: var(--rule-2); }
.jobback svg { width: 13px; height: 13px; }
.jobcard__art { display:flex; align-items:center; gap:6px; flex-wrap:wrap; font-size:10.5px; color:var(--txt-3); border-top:1px dashed var(--rule); padding-top:8px; }
.jobcard__art svg { width:13px; height:13px; flex:none; color:var(--txt-3); }
.jobcard__artlink { color: var(--mint-ink); font-weight:600; background:#f0fbf6; border:1px solid #cdeede; border-radius:6px; padding:1px 6px; max-width:100%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.jobcard__artlink:hover { text-decoration:underline; }
.jobcard__art--empty { color: var(--txt-3); font-size: 11px; }
/* production — table view (grouped by stage) */
.prodtbl td { vertical-align: middle; }
.prodtbl .svccell { display:flex; gap: 5px; flex-wrap:wrap; }
.prodtbl .tvip { color: var(--mint-ink); margin-left: 6px; font-size: 11px; vertical-align: 1px; }
.prodtbl .tdue { font-family: var(--font-mono); font-size: 11.5px; color: var(--txt-2); white-space: nowrap; }
.prodtbl .tdue.is-today { color: var(--c-red); font-weight: 600; }
.prodtbl .jobbtn { margin-left: 0; }
.psel { font-family: var(--font-mono); font-size: 11.5px; padding: 5px 8px; border: 1px solid var(--rule); border-radius: 7px; background:#fff; color: var(--txt); max-width: 158px; cursor: pointer; }
.psel:hover { border-color: var(--rule-2); }
.psel:focus { outline: none; border-color: var(--ink); }
.prodrow { cursor: pointer; transition: background .12s, box-shadow .12s; }
.prodrow.is-drag { opacity: .4; }
.prodrow.is-vip { box-shadow: inset 3px 0 0 var(--mint); }
.prodrow .tdrag { cursor: grab; text-align: center; }
.prodrow .grip { display:inline-block; width: 8px; height: 13px; vertical-align: middle; background-image: radial-gradient(currentColor 1px, transparent 1px); background-size: 4px 4px; color: var(--txt-3); opacity: .55; }
.prodrow:hover .grip { opacity: .9; }
.prodgrp { transition: background .12s, box-shadow .12s; }
.prodgrp.is-drop { background: var(--c-blue-w); box-shadow: inset 0 0 0 2px var(--c-blue); }
.prodgrp .grphead td { background: var(--paper-2); padding: 9px 14px; border-top: 1px solid var(--rule); }
.grphead__dot { display:inline-block; width: 9px; height: 9px; border-radius: 3px; vertical-align: middle; margin-right: 9px; }
.grphead__dot.badge--violet { background: var(--c-violet); }
.grphead__dot.badge--teal { background: var(--c-teal); }
.grphead__dot.badge--grey { background: var(--txt-3); }
.grphead__dot.badge--blue { background: var(--c-blue); }
.grphead__dot.badge--amber { background: var(--c-amber); }
.grphead__dot.badge--mint { background: var(--mint-ink); }
.grphead__t { font-weight: 650; font-size: 12.5px; letter-spacing: .01em; }
.grphead__c { display:inline-flex; align-items:center; justify-content:center; min-width: 19px; height: 19px; padding: 0 6px; margin-left: 9px; border-radius: 9px; background: #fff; border: 1px solid var(--rule); font-family: var(--font-mono); font-size: 11px; color: var(--txt-2); }
.grphead__note { float: right; font-family: var(--font-mono); font-size: 10.5px; color: var(--txt-3); text-transform: uppercase; letter-spacing: .05em; }

/* Production focused single-stage lists (sidebar sub-items) */
.prodfocus__head { display:flex; align-items:center; gap: 10px; margin: 2px 0 14px; }
.prodfocus__head .grphead__dot { width: 12px; height: 12px; margin: 0; }
.prodfocus__ttl { display:flex; flex-direction: column; }
.prodfocus__head .lane__count { margin-left: 2px; }
.prodfocus__head .kick.right { margin-left: auto; }
.seg__n { display:inline-flex; align-items:center; justify-content:center; min-width: 18px; padding: 0 5px; margin-left: 4px; border-radius: 8px; background: rgba(0,0,0,.06); font-family: var(--font-mono); font-size: 10.5px; }
.prodtbl td.chk, .prodtbl th.chk { text-align: center; }
.prodtbl td.chk input, .prodtbl th.chk input { width: 16px; height: 16px; cursor: pointer; }
.grpempty td { padding: 14px; text-align: center; color: var(--txt-3); font-size: 12px; font-style: italic; }
/* printer sub-group inside the Printing stage */
.prodsub td { background: #fcfbf8; padding: 6px 14px 6px 30px; border-top: 1px solid var(--rule); }
.prodsub__t { font-family: var(--font-display); font-weight: 700; font-size: 11.5px; }
/* file thumbnails + hover preview */
.thumbs { display: flex; gap: 5px; flex-wrap: wrap; align-items: center; max-width: 168px; }
.thumb { width: 30px; height: 30px; border: 1px solid var(--rule); border-radius: 6px; overflow: hidden; display: block; background: #fafafa; flex: none; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb--ph { display: grid; place-items: center; color: var(--txt-3); cursor: zoom-in; }
.thumb--ph:hover { border-color: var(--mint-deep); color: var(--mint-ink); background: var(--mint-wash); }
.thumb--ph svg { width: 15px; height: 15px; }
.thumb-link { font-family: var(--font-mono); font-size: 10px; color: var(--mint-ink); background: #f0fbf6; border: 1px solid #cdeede; border-radius: 5px; padding: 2px 6px; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thumb-link:hover { text-decoration: underline; }
.art-preview { position: fixed; z-index: 200; background: #fff; border: 1px solid var(--rule-2); border-radius: 10px; box-shadow: var(--shadow-lg); padding: 6px; pointer-events: none; display: grid; place-items: center; }
.art-preview img { display: block; max-width: 320px; max-height: 320px; object-fit: contain; border-radius: 6px; }
.art-preview__spin { display: none; }
.art-preview.is-loading { width: 120px; height: 96px; }
.art-preview.is-loading img { display: none; }
.art-preview.is-loading .art-preview__spin { display: block; }
.riprow__alt { display: flex; align-items: center; gap: 6px; margin-top: 8px; }
.riprow__alt .jobbtn { margin-left: 0; }

.assignrow { display:flex; flex-direction: column; gap: 6px; border-top: 1px solid var(--rule); padding-top: 9px; }
.assignrow__lbl { font-family: var(--font-mono); font-size: 9.5px; letter-spacing:.06em; text-transform:uppercase; color: var(--txt-3); }
.assignchips { display:flex; flex-wrap:wrap; gap: 5px; }
.assignchip { display:inline-flex; align-items:center; gap:5px; font-size: 11px; font-weight: 600; padding: 5px 9px; border-radius: 7px; border:1px solid var(--rule); background:#fff; }
.assignchip:hover { border-color: var(--ink); background: var(--paper); }
.assignchip .pdot { width:7px; height:7px; border-radius:50%; background: var(--c-green); flex:none; }
.assignchip:disabled { opacity: .45; cursor: not-allowed; }
.assignchip:disabled .pdot { background: var(--txt-3); }
@media (max-width: 860px) { .prod .stats { grid-template-columns: 1fr 1fr; } }

/* ===== Per-item fulfilment ===== */
.ff-list { display: flex; flex-direction: column; gap: 2px; }
.ff-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--rule); }
.ff-row:last-child { border-bottom: 0; }
.ff-row.is-done { opacity: .72; }
.ff-row .checkbox { cursor: pointer; flex: none; }
.ff-tick { width: 16px; height: 16px; flex: none; display: grid; place-items: center; color: var(--c-green); }
.ff-tick svg { width: 15px; height: 15px; }
.ff-thumb { width: 34px; height: 34px; flex: none; border: 1px solid var(--rule); border-radius: 6px; overflow: hidden; display: grid; place-items: center; background: #fafafa; color: var(--txt-3); }
.ff-thumb img { width: 100%; height: 100%; object-fit: cover; }
.ff-thumb svg { width: 15px; height: 15px; }
.ff-name { font-weight: 600; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ff-qty { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.ff-qtyin { width: 56px; border: 1px solid var(--rule); border-radius: 6px; padding: 4px 6px; font: inherit; font-size: 12px; }
.ff-foot { display: flex; align-items: center; gap: 12px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--rule); flex-wrap: wrap; }
.ff-notify { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--txt-2); }
.ff-foot .btn { margin-left: auto; }

/* ===== Order prev/next nav ===== */
.ord-nav { display: flex; align-items: center; gap: 4px; }
.ord-nav .icon-btn { width: 30px; height: 30px; }
.ord-nav .icon-btn svg { width: 14px; height: 14px; }
.ord-nav__pos { font-family: var(--font-mono); font-size: 11px; color: var(--txt-3); min-width: 48px; text-align: center; white-space: nowrap; }
/* Prev/next order stepper in the topbar, around the order number. */
.topbar__ordnav { display: flex; align-items: center; gap: 4px; }
.topbar__ordnav h1 { margin: 0; }
.topbar__ordnav .icon-btn { width: 28px; height: 28px; }
.topbar__ordnav .icon-btn svg { width: 15px; height: 15px; }
.topbar__ordpos { font-family: var(--font-mono); font-size: 11px; color: var(--txt-3); white-space: nowrap; margin-left: 2px; }
.icon-btn:disabled { opacity: .4; cursor: default; }

/* ============================ PRINT-SHOP OUTREACH ============================ */
.outreach { display: grid; grid-template-columns: 300px 1fr; height: 100%; min-height: 0; }
.out-list { border-right: 1px solid var(--rule); background: var(--paper-2); display: flex; flex-direction: column; min-height: 0; }
.out-list__head { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--rule); }
.out-list__head .btn { margin-left: auto; }
.out-list__scroll { overflow-y: auto; flex: 1; }
.out-row { display: flex; align-items: center; gap: 8px; padding: 11px 14px; border-bottom: 1px solid var(--rule); cursor: pointer; }
.out-row:hover { background: #fbfaf7; }
.out-row.is-active { background: var(--mint-wash); box-shadow: inset 3px 0 0 var(--mint); }
.out-row__co { font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.out-editor { overflow-y: auto; padding: 18px 20px 60px; }
.out-cols { display: grid; grid-template-columns: 340px 1fr; gap: 16px; align-items: start; }
.out-detail { display: flex; flex-direction: column; gap: 16px; }
.out-email { min-width: 0; }
.out-field { display: block; margin-bottom: 10px; }
.out-field span { display: block; font-family: var(--font-mono); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--txt-3); margin-bottom: 4px; }
.out-field .rm-in { width: 100%; }
.out-mockup { width: 100%; border: 1px solid var(--rule); border-radius: 8px; display: block; background: #151515; }
.out-drop { border: 1.5px dashed var(--rule-2); border-radius: 10px; padding: 22px 14px; text-align: center; font-size: 12.5px; color: var(--txt-2); cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 6px; }
.out-drop:hover { border-color: var(--mint-deep); color: var(--mint-ink); background: var(--mint-wash); }
.out-frame { width: 100%; height: 620px; border: 1px solid var(--rule); border-radius: 8px; background: #050505; }
.out-html { width: 100%; height: 620px; border: 1px solid var(--rule); border-radius: 8px; padding: 12px; font-family: var(--font-mono); font-size: 11.5px; line-height: 1.5; resize: vertical; outline: none; }
.out-html:focus { border-color: var(--ink); }
@media (max-width: 1100px) { .out-cols { grid-template-columns: 1fr; } }
@media (max-width: 860px) { .outreach { grid-template-columns: 1fr; } .out-list { max-height: 240px; } }
.out-import { padding: 10px 14px; border-bottom: 1px solid var(--rule); background: #fbfaf7; }
.out-import__ta { width: 100%; height: 120px; border: 1px solid var(--rule); border-radius: 8px; padding: 9px; font-family: var(--font-mono); font-size: 11px; line-height: 1.45; resize: vertical; outline: none; }
.out-import__ta:focus { border-color: var(--ink); }
/* checkerboard so transparent / white-on-transparent logos are visible */
.out-logo { margin-top: 8px; border: 1px solid var(--rule); border-radius: 8px; padding: 10px; display: grid; place-items: center;
  background-color: #fff;
  background-image: linear-gradient(45deg,#e6e3db 25%,transparent 25%),linear-gradient(-45deg,#e6e3db 25%,transparent 25%),linear-gradient(45deg,transparent 75%,#e6e3db 75%),linear-gradient(-45deg,transparent 75%,#e6e3db 75%);
  background-size: 16px 16px; background-position: 0 0,0 8px,8px -8px,-8px 0; }
.out-logo img { max-width: 100%; max-height: 90px; object-fit: contain; display: block; }
.out-logo-drop { margin-top: 8px; border: 1.5px dashed var(--rule-2); border-radius: 8px; padding: 12px 14px; text-align: center; font-size: 12px; color: var(--txt-2); cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 6px; }
.out-logo-drop:hover { border-color: var(--mint-deep); color: var(--mint-ink); background: var(--mint-wash); }
.out-search { position: relative; display: flex; align-items: center; padding: 8px 14px; border-bottom: 1px solid var(--rule); }
.out-search svg { position: absolute; left: 24px; width: 14px; height: 14px; color: var(--txt-3); pointer-events: none; }
.out-search .rm-in { width: 100%; padding-left: 30px; }
.out-search__clear { position: absolute; right: 22px; border: 0; background: transparent; color: var(--txt-2); font-size: 16px; line-height: 1; cursor: pointer; padding: 2px 4px; }
.out-search__clear:hover { color: var(--ink); }
.out-niches { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 14px; border-bottom: 1px solid var(--rule); }
.out-niche { display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--rule); background: #fff; color: var(--txt-2); border-radius: 999px; padding: 3px 9px; font-size: 11.5px; line-height: 1.4; cursor: pointer; text-transform: capitalize; }
.out-niche:hover { border-color: var(--ink); color: var(--ink); }
.out-niche.is-on { background: var(--ink); border-color: var(--ink); color: #fff; }
.out-niche__n { font-size: 10px; opacity: .7; font-variant-numeric: tabular-nums; }
.out-niche.is-on .out-niche__n { opacity: .85; }
.out-input-row { display: flex; gap: 6px; align-items: center; }
.out-input-row .rm-in { flex: 1; min-width: 0; }
.out-open { flex: 0 0 auto; padding: 0 9px; }
.out-recolor { display: inline-flex; align-items: center; gap: 6px; padding: 2px 8px; border: 1px solid var(--rule); border-radius: 8px; }
.out-swatch { width: 18px; height: 18px; border-radius: 4px; border: 1px solid var(--rule-2); cursor: pointer; padding: 0; }
.out-swatch:hover { outline: 2px solid var(--mint-deep); outline-offset: 1px; }
.out-colorpick { width: 26px; height: 22px; padding: 0; border: 1px solid var(--rule-2); border-radius: 4px; background: none; cursor: pointer; }
.out-products { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.out-fu { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--rule); }
.out-fu:first-of-type { border-top: 0; }
.out-fu__dot { flex: 0 0 auto; width: 9px; height: 9px; border-radius: 50%; background: var(--rule-2); box-shadow: 0 0 0 3px var(--mint-wash); }
.out-fu__dot.is-due { background: var(--c-amber); }
.out-fu__dot.is-done { background: var(--mint-deep); }
.out-track-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 6px; flex: 0 0 auto; }
/* --- loading skeletons --- */
.skel { position: relative; overflow: hidden; background: var(--rule, #e7e4dc); border-radius: 6px; }
.skel::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, rgba(255,255,255,.6), transparent); animation: skel-shimmer 1.3s ease-in-out infinite; }
@keyframes skel-shimmer { 100% { transform: translateX(100%); } }
.skel-list { padding: 8px 0; }
.skel-row { height: 46px; margin: 8px 0; border-radius: 8px; }
.skel-bar { height: 12px; border-radius: 4px; }
.skel-screen { padding: 24px 32px; }
.skel-screen .skel-head { width: 220px; height: 20px; margin-bottom: 22px; }
.out-tmpl { margin-top: 12px; border-top: 1px solid var(--rule); padding-top: 10px; }
.out-tmpl > summary { cursor: pointer; font-size: 11px; letter-spacing: .04em; text-transform: uppercase; color: var(--txt-2); list-style: none; user-select: none; }
.out-tmpl > summary::-webkit-details-marker { display: none; }
.out-tmpl > summary::before { content: "▸ "; color: var(--txt-3); }
.out-tmpl[open] > summary::before { content: "▾ "; }

/* ---- Order grouping (combine orders → tree) ---------------------------- */
.grp-toggle { display:inline-block; width:14px; cursor:pointer; color:var(--txt-3); font-size:11px; margin-right:2px; user-select:none; }
.grp-toggle:hover { color:var(--txt-2); }
.grp-childmark { display:inline-block; width:14px; color:var(--txt-3); font-size:12px; }
.grp-badge { display:inline-flex; align-items:center; gap:3px; margin-left:6px; padding:1px 6px; border-radius:20px;
  background:var(--mint-wash); color:var(--mint-ink); font-size:10px; font-weight:700; white-space:nowrap; vertical-align:middle; }
.grp-badge svg { width:11px; height:11px; }
.grp-childof { margin-left:6px; font-size:10px; color:var(--txt-3); }
/* Partner-shop (location) an order is handed to — tag on the orders list */
.loc-tag { display:inline-flex; align-items:center; gap:4px; margin-left:6px; padding:1px 8px; border-radius:20px;
  background:var(--c-violet, #7c5cff); color:#fff; font-size:10px; font-weight:700; white-space:nowrap; vertical-align:middle; cursor:pointer; }
.loc-tag svg { width:11px; height:11px; }
.loc-tag:hover { filter:brightness(1.08); }
.grp-ungroup { margin-left:6px; border:none; background:none; color:var(--txt-3); font-size:9.5px; letter-spacing:.05em;
  text-transform:uppercase; cursor:pointer; padding:0; text-decoration:underline; }
.grp-ungroup:hover { color:var(--c-red); }
.grp-ungroup:disabled { opacity:.5; cursor:default; }
.grp-addr { margin-top:2px; font-size:10.5px; color:var(--txt-2); }
.grp-addr-more { margin-top:1px; font-size:10px; color:var(--mint-ink); font-weight:600; }
tr.ord-row--parent > td { border-top:2px solid var(--rule-2); }
tr.ord-row--parent { background:var(--mint-wash); }
tr.ord-row--parent:hover { background:#daf7ec; }
tr.ord-row--child > td { background:var(--rule-2-wash, #f6f4ef); }
tr.ord-row--child > td:nth-child(3) { padding-left:18px; }

.grp-suggests { display:flex; flex-direction:column; gap:6px; margin:8px 0 2px; }
.grp-suggest { display:flex; align-items:center; gap:10px; padding:8px 12px; border:1px dashed var(--rule-2);
  border-radius:var(--radius); background:var(--mint-wash); font-size:12.5px; color:var(--txt-2); }
.grp-suggest svg { width:14px; height:14px; color:var(--mint-ink); flex:0 0 auto; }
.grp-suggest > span { flex:1; }
.grp-suggest b { color:var(--txt-1, #222); }

.combine-list { display:flex; flex-direction:column; gap:6px; margin-top:8px; }
.combine-row { display:flex; align-items:center; gap:10px; padding:9px 11px; border:1px solid var(--rule-2);
  border-radius:var(--radius); cursor:pointer; }
.combine-row.is-parent { border-color:var(--mint-ink); background:var(--mint-wash); }
.combine-row input { flex:0 0 auto; }
.combine-row__main { flex:1; min-width:0; }
.combine-row__meta { font-size:11px; color:var(--txt-3); white-space:nowrap; }
.form-err { color:#b32a1f; background:var(--c-red-w); border:1px solid #f3c5bf; border-radius:6px; padding:6px 9px; font-size:12px; }
.grp-childlink { display:inline-block; width:16px; text-align:center; color:var(--txt-3); font-size:13px; cursor:default; }
.combine-row__method { font-size:10px; font-weight:700; letter-spacing:.03em; text-transform:uppercase; color:var(--txt-2);
  background:var(--rule-2-wash, #f1efe9); border:1px solid var(--rule-2); border-radius:4px; padding:1px 6px; white-space:nowrap; }

/* ---- Multi-select status filter (popover) ------------------------------ */
.status-multi { position: relative; }
.status-multi__btn { display: flex; align-items: center; gap: 6px; height: 30px; padding: 0 9px; font: inherit; font-size: 12px;
  color: var(--txt-1); background: var(--surface-2, #f4f4f1); border: 1px solid var(--rule); border-radius: 8px; cursor: pointer; white-space: nowrap; }
.status-multi__btn svg { width: 14px; height: 14px; color: var(--txt-3); flex: none; }
.status-multi__chev { color: var(--txt-3); font-size: 10px; }
.status-multi.is-on .status-multi__btn { border-color: var(--mint-ink); color: var(--mint-ink); background: var(--mint-wash); }
.status-multi__pop { position: absolute; z-index: 40; top: calc(100% + 5px); left: 0; min-width: 210px; max-height: 340px; overflow-y: auto;
  background: var(--panel, #fff); border: 1px solid var(--rule-2); border-radius: 10px; box-shadow: 0 12px 30px rgba(0,0,0,.14); padding: 6px; }
.status-multi__head { display: flex; align-items: center; justify-content: space-between; padding: 4px 8px 6px; font-size: 10.5px;
  letter-spacing: .05em; text-transform: uppercase; color: var(--txt-3); border-bottom: 1px solid var(--rule); margin-bottom: 4px; }
.status-multi__opt { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 6px; font-size: 12.5px; color: var(--txt-1); cursor: pointer; }
.status-multi__opt:hover { background: var(--rule-2-wash, #f4f2ec); }
.status-multi__dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.status-multi__code { flex: none; min-width: 40px; text-align: center; font-family: var(--font-mono); font-size: 10px; font-weight: 700; padding: 1px 5px; border-radius: 4px; background: var(--rule-2-wash, #f4f2ec); color: var(--txt-2); }
.combine-credit { display:flex; align-items:flex-start; gap:8px; margin-top:10px; padding:9px 11px; border:1px solid var(--mint-ink);
  background:var(--mint-wash); border-radius:var(--radius); font-size:12.5px; color:var(--txt-1); cursor:pointer; line-height:1.4; }
.combine-credit input { margin-top:2px; flex:0 0 auto; }

/* ---------------- Conversions & attribution ---------------- */
.cvr { padding: 16px 18px; gap: 0; overflow: auto; }
.cvr__bar { flex-wrap: wrap; gap: 10px; align-items: center; }
.cvr__bar .seg button.is-active { background: var(--ink); color: #fff; }
.cvr__note { font-size: 12px; margin: 10px 2px 4px; }
.cvr__kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 12px; }
.kpi { background: var(--paper-2); border: 1px solid var(--rule); border-radius: 10px; padding: 12px 14px; }
.kpi__k { font-size: 11px; letter-spacing: .04em; text-transform: uppercase; color: var(--txt-3); }
.kpi__v { font-family: var(--font-display); font-weight: 800; font-size: 22px; letter-spacing: -.02em; margin-top: 4px; }
@media (max-width: 720px) { .cvr__kpis { grid-template-columns: repeat(2, 1fr); } }

.cvr__tbl td { vertical-align: middle; }
.cvr__row:hover { background: var(--paper-2); }
.cvr__row--muted td { color: var(--txt-2); }
.cvr__srccell { display: flex; align-items: center; }
.cvr__revbar { height: 5px; border-radius: 3px; background: var(--rule); margin-top: 6px; max-width: 320px; overflow: hidden; }
.cvr__revbar span { display: block; height: 100%; border-radius: 3px; min-width: 2px; }
.cvr__modal { max-width: 720px; }

.src-badge { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; white-space: nowrap; }
.src-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; display: inline-block; }

/* order-detail attribution panel */
.attr-grid { display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: start; }
.attr-k { font-size: 11px; letter-spacing: .03em; text-transform: uppercase; color: var(--txt-3); margin-bottom: 6px; }
.attr-camp { font-size: 11px; margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 220px; }
.attr-credit { margin-top: 14px; }
.attr-creditbar { display: flex; height: 8px; border-radius: 4px; overflow: hidden; background: var(--rule); }
.attr-creditbar span { display: block; height: 100%; }
.attr-creditkeys { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.attr-creditkey { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; color: var(--txt-2); }
.attr-timeline { margin-top: 12px; border-left: 2px solid var(--rule); padding-left: 12px; display: flex; flex-direction: column; gap: 12px; }
.attr-tl { position: relative; display: flex; gap: 8px; }
.attr-tl__dot { position: absolute; left: -18px; top: 3px; width: 9px; height: 9px; border-radius: 50%; border: 2px solid var(--paper); }
.attr-tl__src { font-size: 12px; }
.attr-tl__meta { font-size: 11px; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 340px; }

/* conversions — grouped/expandable channel tree */
.cvr__twist { display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; margin-right: 6px; color: var(--txt-3); flex: none; }
.cvr__twist:hover { color: var(--txt); }
.cvr__twist svg { width: 14px; height: 14px; }
.cvr__row--sub { background: var(--paper-2); }
.cvr__row--sub:hover { background: var(--rule-2-wash, var(--paper-2)); }
.cvr__row--sub2 td { background: var(--paper); }
.cvr__srcname { font-size: 13px; font-weight: 600; }
.cvr__campname { font-size: 12px; font-family: var(--font-mono); color: var(--txt-2); word-break: break-word; }

/* conversions — business-health strip + LTV */
.cvr__health { margin: 12px 0 4px; }
.cvr__alert { display: flex; align-items: center; gap: 8px; background: #fff4e5; color: #8a4b00; border: 1px solid #f0c48a; border-radius: 8px; padding: 8px 12px; font-size: 12.5px; font-weight: 600; margin-bottom: 8px; }
.cvr__alert svg { width: 15px; height: 15px; flex: none; }
.cvr__healthrow { display: flex; align-items: center; gap: 22px; background: var(--paper-2); border: 1px solid var(--rule); border-radius: 10px; padding: 10px 14px; }
.cvr__hstat .cvr__hk { font-size: 11px; letter-spacing: .03em; text-transform: uppercase; color: var(--txt-3); }
.cvr__hstat .cvr__hv { font-family: var(--font-display); font-weight: 800; font-size: 18px; display: flex; align-items: baseline; gap: 7px; }
.cvr__delta { font-size: 11px; font-weight: 700; font-family: var(--font-body); }
.cvr__delta.neg { color: #c0392b; }
.cvr__delta.pos { color: var(--mint-ink); }
.cvr__spark { display: flex; align-items: flex-end; gap: 3px; height: 34px; margin-left: auto; }
.cvr__bar2 { width: 8px; background: var(--mint, #8fd6bd); border-radius: 2px 2px 0 0; }
.cvr__neg { color: #c0392b; }

/* email funnel */
.efunnel { display: flex; flex-direction: column; gap: 10px; }
.efunnel__stage { display: flex; align-items: center; gap: 12px; }
.efunnel__bar { min-width: 34px; height: 30px; border-radius: 6px; color: #fff; font-weight: 700; font-size: 13px; display: flex; align-items: center; padding: 0 10px; transition: width .3s; }
.efunnel__lbl { font-size: 12.5px; color: var(--txt-2); white-space: nowrap; }

/* ===========================================================
   Location (shop) shell — external shop user (e.g. DTF Studio)
   =========================================================== */
.loc-app { min-height: 100vh; background: var(--bg, #f6f5f1); }
.loc-header { display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 22px; background: var(--ink, #0B0C0E); color: #fff; }
.loc-header .right { display: flex; align-items: center; }
.loc-header__brand { display: flex; align-items: center; gap: 12px; }
.loc-header__brand .m { width: 40px; height: 40px; border-radius: 9px; background: var(--mint, #18f4af);
  color: #05130d; font-weight: 800; letter-spacing: .04em; display: grid; place-items: center; font-size: 15px; }
.loc-header__shop { font-weight: 700; font-size: 15px; }
.loc-header .dim { color: rgba(255,255,255,.6); }
.loc-header .btn { color: #fff; border-color: rgba(255,255,255,.25); }

.loc-wrap { max-width: 1100px; margin: 0 auto; padding: 22px; }
.loc-toolbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.loc-toolbar__title { font-weight: 700; }
.loc-toolbar .right { display: flex; gap: 8px; align-items: center; }

.loc-table { width: 100%; border-collapse: collapse; background: var(--panel, #fff);
  border: 1px solid var(--rule, #e7e4dc); border-radius: 12px; overflow: hidden; }
.loc-table th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .04em;
  color: var(--txt-3, #8A8E94); font-weight: 600; padding: 10px 12px; border-bottom: 1px solid var(--rule, #e7e4dc); }
.loc-table td { padding: 11px 12px; border-bottom: 1px solid var(--rule-2, #f0ede6); font-size: 13.5px; vertical-align: middle; }
.loc-row:hover { background: var(--rule-2-wash, #faf9f5); }
.loc-table a { color: inherit; text-decoration: none; font-weight: 600; }
.loc-table a:hover { text-decoration: underline; }

.loc-detail-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.loc-detail-head h2 { margin: 0; font-size: 20px; font-family: var(--font-mono, monospace); }
.loc-detail-head .right { margin-left: auto; }
.loc-detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.loc-detail-grid .card:first-child { grid-column: 1 / -1; }
@media (max-width: 820px) { .loc-detail-grid { grid-template-columns: 1fr; } }

.loc-items { display: flex; flex-direction: column; gap: 10px; }
.loc-item { display: flex; gap: 12px; }
.loc-item__thumb { width: 56px; height: 56px; border-radius: 8px; overflow: hidden; flex: none;
  background: var(--rule-2, #f0ede6); display: grid; place-items: center; }
.loc-item__thumb img { width: 100%; height: 100%; object-fit: cover; }
.loc-item__title { font-weight: 600; font-size: 13.5px; }
.loc-ship { line-height: 1.5; font-size: 13.5px; }

.loc-label-actions { display: inline-flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.loc-label-links { display: inline-flex; gap: 8px; align-items: center; }

/* ============ Partner shop view (location-limited access) ============ */
/* The partner shell renders straight into #root (which is height:100vh with
   body overflow hidden), so it must be its OWN scroll region — otherwise tall
   pages (order detail) get clipped with no scrollbar and users have to zoom out. */
.shopapp { height: 100vh; height: 100dvh; overflow-y: auto; -webkit-overflow-scrolling: touch;
  background: var(--paper); display: flex; flex-direction: column; }
.shop-top { display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 12px 22px; background: #000; color: #fff; position: sticky; top: 0; z-index: 20; }
.shop-brand { display: flex; align-items: center; gap: 12px; }
.shop-mark { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px;
  font-family: var(--font-display); font-weight: 900; color: #00271a; font-size: 14px; }
.shop-title { font-family: var(--font-display); font-weight: 800; font-size: 16px; line-height: 1.1; }
.shop-sub { font-size: 11px; color: #9aa1a8; }
.shop-top__right { display: flex; align-items: center; gap: 12px; }
.shop-user { font-size: 12px; color: #c7ccd1; max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shop-main { flex: 1; max-width: 1080px; width: 100%; margin: 0 auto; padding: 22px; }
/* Admin preview renders inside the normal shell body (.content has no padding),
   so give it the same breathing room + centred column as the partner shell. */
.shop-preview-wrap { max-width: 1080px; width: 100%; margin: 0 auto; padding: 22px 26px 40px; }
.shop-list, .shop-detail { animation: fade .2s ease; }

.shop-tabs { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.shop-tab { border: 1px solid var(--rule); background: var(--panel); color: var(--sub);
  padding: 7px 14px; border-radius: 999px; font-weight: 600; font-size: 13px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.shop-tab:hover { color: var(--txt); }
.shop-tab.is-active { background: var(--mint); border-color: var(--mint); color: #00271a; }
.shop-tab .cnt { font-family: var(--font-mono); font-size: 11px; background: rgba(0,0,0,.12); padding: 0 6px; border-radius: 8px; }

.shop-bulk { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 12px;
  background: var(--mint-wash); border: 1px solid var(--mint); border-radius: var(--radius); margin-bottom: 12px; }

.shop-tbl { width: 100%; border-collapse: collapse; background: var(--panel); border: 1px solid var(--rule); border-radius: var(--radius); overflow: hidden; }
.shop-tbl th { text-align: left; font-family: var(--font-mono); font-size: 10px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--sub); padding: 10px 12px; border-bottom: 1px solid var(--rule); }
.shop-tbl td { padding: 12px; border-bottom: 1px solid var(--rule); font-size: 13px; vertical-align: middle; }
.shop-tbl tr:last-child td { border-bottom: none; }
.shop-row { cursor: pointer; }
.shop-row:hover td { background: var(--mint-wash); }
.shop-row .icon-btn, .shop-tbl svg { width: 16px; height: 16px; color: var(--sub); }
.shop-daterow td { background: var(--wash, #f6f8fa); padding: 7px 12px !important; }
.shop-daterow__label { font-family: var(--font-mono); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--sub); font-weight: 600; }
.shop-daterow__cnt { margin-left: 8px; font-size: 11px; color: var(--sub); }
.shop-daterow__m { margin-left: 10px; }
.shop-daterow:hover td { background: var(--wash, #f6f8fa); }
.shop-total-m { display: inline-flex; align-items: center; gap: 6px; }
/* Same-day cutoff flag (placed before 11:00, still to dispatch) */
.shop-row--cutoff td { background: #fff7ed; }
.shop-row--cutoff:hover td { background: #ffedd5; }
.shop-row--cutoff td:first-child { box-shadow: inset 3px 0 0 #f59e0b; }
.badge--cutoff { background: #fff1dd; color: #b45309; border-color: transparent; margin-left: 4px; }
.badge--cutoff svg { width: 12px; height: 12px; }
.shop-track { font-size: 11px; margin-top: 4px; }
.shop-track a { color: var(--mint-ink); text-decoration: underline; }

.shop-flow { display: flex; align-items: center; gap: 8px; margin: 4px 0 16px; font-family: var(--font-mono); font-size: 11px; }
.shop-flow__step { color: #aeb4bb; letter-spacing: .04em; text-transform: uppercase; }
.shop-flow__step.is-on { font-weight: 700; }
.shop-flow__bar { width: 26px; height: 2px; background: #d6dade; border-radius: 2px; }
.shop-flow__bar.is-on { background: var(--mint); }

/* fixed layout so a long filename in a cell can't stretch the table past the
   screen; the middle (content) column takes the remaining width and wraps. */
.shop-items { width: 100%; border-collapse: collapse; table-layout: fixed; }
.shop-items td { padding: 8px 6px; border-bottom: 1px solid var(--rule); vertical-align: middle; overflow-wrap: anywhere; }
.shop-items td:first-child { width: 52px; }
.shop-items td:last-child { width: 92px; }
.shop-items tr:last-child td { border-bottom: none; }
.shop-item__title { font-weight: 600; word-break: break-word; }
.shop-thumb { width: 44px; height: 44px; object-fit: cover; border-radius: 8px; border: 1px solid var(--rule); background: #fff; }
.shop-thumb--ph { display: grid; place-items: center; color: var(--ph); }
.shop-thumb--ph svg { width: 20px; height: 20px; }

.shop-art-head { margin: 16px 0 2px; font-size: 11px; letter-spacing: .04em; text-transform: uppercase; color: var(--sub); font-family: var(--font-mono); }
.shop-prop--pr { display: flex; align-items: center; gap: 10px; margin-top: 6px; }
.shop-pr-dl { text-decoration: none; }
.handover { display: inline-flex; align-items: center; gap: 6px; }
.handover svg { width: 15px; height: 15px; color: var(--sub); }
.rm-in--sm { padding: 4px 8px; font-size: 12px; }

/* UV / DTF print-type tags */
.kind-tag { display: inline-block; font-family: var(--font-mono); font-size: 9px; font-weight: 700; letter-spacing: .05em;
  line-height: 1.5; padding: 0 5px; border-radius: 4px; vertical-align: middle; margin-right: 4px; }
.kind-tag--uv { background: var(--c-violet); color: #fff; }
.kind-tag--dtf { background: var(--mint-wash); color: var(--mint-ink); border: 1px solid var(--mint); }
/* Shipping service badge — shop double-checks this before making a label. */
.svc-badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; border: 1px solid transparent; white-space: nowrap; vertical-align: middle; }
.svc--sd { background: #fff4d6; color: #8a6d1a; border-color: #e7c86a; }   /* Special Delivery — stands out */
.svc--24 { background: #e3efff; color: #1f5fae; }
.svc--48 { background: #eef1f4; color: #5b6673; }
.svc--collect { background: #e6fbf3; color: #0f7a52; }
.svc--intl { background: #fdecec; color: #c0392b; }
.svc--std { background: #eef1f4; color: #5b6673; }

/* clickable line-item properties (artwork / file / url) */
.shop-prop { display: flex; gap: 8px; align-items: baseline; font-size: 12px; margin-top: 3px; }
.shop-prop__k { flex: none; color: var(--sub); min-width: 96px; font-size: 11px; }
.shop-prop__v { min-width: 0; word-break: break-word; }
.shop-fileprop { display: inline-flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.shop-dl { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; color: var(--mint-ink); white-space: nowrap; }
.shop-dl svg { width: 13px; height: 13px; }
.shop-propimg { display: inline-block; }
.shop-propimg img { max-width: 120px; max-height: 90px; border-radius: 6px; border: 1px solid var(--rule); background: #fff; }

/* Create-label modal — clean labelled form (replaces cramped fixed-width inputs) */
.shop-lbl { display: flex; flex-direction: column; gap: 14px; }
.shop-lbl__all { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 12px;
  background: var(--mint-wash); border: 1px solid var(--mint); border-radius: var(--radius); }
.shop-lbl__all .shop-lin { flex: 1; min-width: 120px; }
.shop-lbl__row { border: 1px solid var(--rule); border-radius: var(--radius); padding: 12px; }
.shop-lbl__ord { font-weight: 700; margin-bottom: 8px; }
.shop-lbl__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.shop-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.shop-field > span { font-size: 11px; color: var(--sub); font-weight: 600; }
.shop-lin { width: 100%; border: 1px solid var(--rule); border-radius: 8px; padding: 8px 10px; font-size: 13px;
  background: var(--panel); color: var(--txt); font-family: inherit; }
.shop-lin:focus { outline: none; border-color: var(--mint); box-shadow: 0 0 0 3px var(--mint-wash); }
select.shop-lin { appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%235b6673' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat; background-position: right 10px center; padding-right: 28px; }

@media (max-width: 720px) {
  .shop-main { padding: 14px; }
  .shop-top { padding: 10px 14px; }
  .shop-user { display: none; }
}

/* --- Stock (internal blank-garment inventory) — editable table cells --- */
.stk-tbl tbody tr { cursor: default; }
.stk-tbl tbody td { vertical-align: middle; }
/* Gang-sheet queue: actions on ONE line (icon-btn is display:grid → used to wrap below the links). */
.gq-tbl td, .gq-tbl th { padding-top: 10px; padding-bottom: 10px; }
.gq-actions { display: flex; align-items: center; justify-content: flex-end; gap: 12px; white-space: nowrap; }
.gq-actions .icon-btn { width: 30px; height: 30px; }
.stk-in {
  width: 100%; border: 1px solid transparent; background: transparent;
  border-radius: 6px; padding: 4px 6px; font-size: 13px; color: inherit;
  font-family: inherit; box-sizing: border-box; transition: border-color .1s, background .1s;
}
.stk-in:hover { border-color: var(--rule); }
.stk-in:focus { outline: none; border-color: var(--mint); background: #fff; box-shadow: 0 0 0 2px var(--mint-wash); }
.stk-in::placeholder { color: #b7b2a6; }
.stk-in.stk-qty { width: 48px; text-align: center; -moz-appearance: textfield; }
.stk-in.stk-qty::-webkit-outer-spin-button,
.stk-in.stk-qty::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.btn.stk-step { min-width: 26px; padding: 2px 0; text-align: center; font-weight: 700; line-height: 1; }

/* Per-line stock availability on the order detail */
.li__stock { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 5px; font-size: 11px; }
.li__stock--load { color: #8a857a; }
.li__stock-link { font-family: var(--font-mono); font-size: 10.5px; color: #6b6559; }
.li__stock-note { color: #b45309; }

/* SKU picker dropdown (grouped by product) */
.stk-skus {
  position: absolute; z-index: 40; top: 100%; left: 0; margin-top: 3px;
  min-width: 340px; max-width: 460px; max-height: 340px; overflow: auto;
  background: #fff; border: 1px solid var(--rule); border-radius: 8px;
  box-shadow: 0 10px 28px rgba(0,0,0,.14); padding: 4px;
}
.stk-skus__hint, .stk-skus__none { padding: 8px 10px; font-size: 12px; color: #8a857a; }
.stk-skus__none { text-align: center; }
.stk-skus__grp:not(:first-child) { border-top: 1px solid var(--rule); margin-top: 2px; padding-top: 2px; }
.stk-skus__ghead { padding: 6px 10px 3px; font-size: 11px; font-weight: 700; color: var(--mint-ink); text-transform: none; position: sticky; top: 0; background: #fff; }
.stk-skus__row { display: flex; align-items: center; gap: 8px; padding: 5px 10px; border-radius: 6px; cursor: pointer; font-size: 12.5px; }
.stk-skus__row:hover { background: var(--mint-wash); }
.stk-skus__opt { flex: 1; min-width: 0; }
.stk-skus__sku { font-family: var(--font-mono); font-size: 11px; color: #6b6559; white-space: nowrap; }
.stk-skus__stk { font-family: var(--font-mono); font-size: 11px; min-width: 34px; text-align: right; color: #057a54; }
.stk-skus__unlink { color: #b91c1c; border-bottom: 1px solid var(--rule); border-radius: 0; margin-bottom: 2px; }

/* Notification centre (top-bar bell) */
.notif__panel { position: absolute; top: calc(100% + 8px); right: 0; z-index: 50; width: 340px; max-width: 88vw; max-height: 70vh; overflow: auto; background: #fff; border: 1px solid var(--rule); border-radius: 10px; box-shadow: 0 12px 32px rgba(0,0,0,.16); }
.notif__head { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid var(--rule); font-size: 13px; position: sticky; top: 0; background: #fff; }
.notif__list { padding: 4px; }
.notif__empty { padding: 22px 14px; text-align: center; color: #8a857a; font-size: 13px; }
.notif__item { display: flex; gap: 10px; padding: 9px 10px; border-radius: 8px; }
.notif__item.is-link { cursor: pointer; }
.notif__item.is-link:hover { background: var(--mint-wash); }
.notif__item.is-unread { background: #f4fbf8; }
.notif__dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; flex: none; }
.notif__title { font-size: 13px; font-weight: 600; color: #1b1b1b; }
.notif__body { font-size: 12px; color: #666; margin-top: 1px; }
.notif__time { font-size: 11px; color: #a8a29a; margin-top: 3px; }
.notif__arrow { color: #b7b2a6; font-size: 12px; align-self: center; }
/* Stacked notification cards: each item is a raised card, layered with a slight
   overlap so the panel reads as a stack rather than a flat list. */
.notif__list { padding: 10px 10px 12px; display: flex; flex-direction: column; }
.notif__item { position: relative; background: #fff; border: 1px solid var(--rule); border-radius: 10px; padding: 11px 12px; box-shadow: 0 2px 6px rgba(0,0,0,.06); margin-top: -6px; transition: transform .12s ease, box-shadow .12s ease; }
.notif__item:first-child { margin-top: 0; }
.notif__item:hover { transform: translateY(-2px); box-shadow: 0 8px 18px rgba(0,0,0,.12); z-index: 2; }
.notif__item.is-unread { background: #f4fbf8; border-color: color-mix(in srgb, var(--c-mint, #18f4af) 45%, var(--rule)); }
.notif__item.is-unread::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 3px; background: var(--c-mint, #18f4af); }
.notif__acts { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.notif__act { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; padding: 4px 9px; border-radius: 7px; border: 1px solid var(--rule); background: #fff; color: #333; cursor: pointer; }
.notif__act svg { width: 13px; height: 13px; }
.notif__act:hover { background: var(--mint-wash); border-color: color-mix(in srgb, var(--c-mint, #18f4af) 50%, var(--rule)); }
.notif__act--reprint { border-color: color-mix(in srgb, var(--c-mint, #18f4af) 55%, var(--rule)); color: #0b6b4f; }
.notif__act--reprint:hover { background: var(--c-mint, #18f4af); color: #08281d; }

/* --- Customer artwork library modal (~70% fullscreen) --------------------- */
.modal.lib { max-width: 74vw; width: 74vw; height: 84vh; max-height: 84vh; }
.lib__body { flex: 1; min-height: 0; display: flex; }
.lib__side { width: 216px; flex: none; border-right: 1px solid var(--rule); padding: 12px 10px; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.lib__side-h { font-size: 10px; text-transform: uppercase; letter-spacing: .04em; color: var(--txt-3); margin: 12px 6px 4px; }
.lib__folder { display: flex; align-items: center; gap: 8px; padding: 7px 9px; border-radius: 8px; cursor: pointer; font-size: 13px; color: var(--txt-2); position: relative; }
.lib__folder:hover { background: var(--mint-wash); }
.lib__folder.is-sel { background: var(--mint-wash); color: var(--mint-ink); font-weight: 600; }
.lib__folder svg { width: 15px; height: 15px; flex: none; }
.lib__fname, .lib__folder span:not(.lib__n):not(.lib__fx) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lib__n { margin-left: auto; font-size: 11px; color: var(--txt-3); }
.lib__fx { display: none; margin-left: auto; gap: 2px; }
.lib__folder:hover .lib__fx { display: flex; }
.lib__folder:hover .lib__n { display: none; }
.icon-btn--xs { width: 22px; height: 22px; padding: 0; }
.icon-btn--xs svg { width: 13px; height: 13px; }
.lib__main { flex: 1; min-width: 0; display: flex; flex-direction: column; overflow: hidden; }
.lib__bar { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--rule); }
.lib__search { flex: 1; display: flex; align-items: center; gap: 7px; border: 1px solid var(--rule); border-radius: 9px; padding: 7px 11px; }
.lib__search svg { width: 15px; height: 15px; color: var(--txt-3); flex: none; }
.lib__search input { border: none; outline: none; width: 100%; font-size: 13px; background: transparent; }
.lib__sort { border: 1px solid var(--rule); border-radius: 8px; padding: 7px 9px; font-size: 12.5px; background: #fff; }
.lib__err { margin: 10px 16px 0; padding: 8px 11px; border-radius: 8px; background: var(--c-red-w, #fdecec); color: var(--c-red, #b91c1c); font-size: 12.5px; }
.lib__busy { margin: 10px 16px 0; display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--txt-2); }
/* Forgotten baskets */
.bk__list { display: flex; flex-direction: column; gap: 12px; }
.bk-card { display: flex; gap: 14px; border: 1px solid var(--rule); border-radius: 12px; background: #fff; padding: 12px; }
.bk-card.is-off { opacity: .6; }
.bk-card__thumb { width: 92px; height: 92px; flex: none; border-radius: 9px; overflow: hidden; background: #eceff2 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16'%3E%3Crect width='8' height='8' fill='%23e0e4e8'/%3E%3Crect x='8' y='8' width='8' height='8' fill='%23e0e4e8'/%3E%3C/svg%3E"); display: grid; place-items: center; }
.bk-card__thumb img { width: 100%; height: 100%; object-fit: contain; display: block; }
.bk-card__noimg { color: var(--txt-3); }
.bk-card__main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.bk-card__top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.bk-card__name { font-weight: 700; font-size: 14px; }
.bk-card__email { font-size: 12px; color: var(--txt-3); }
.bk-card__meta { font-size: 12px; color: var(--txt-2); }
.bk-seq { display: flex; flex-wrap: wrap; gap: 6px; margin: 2px 0; }
.bk-step { display: flex; align-items: center; gap: 6px; font-size: 11px; padding: 4px 9px; border-radius: 20px; background: var(--c-grey-w); color: #5a5f66; text-decoration: none; cursor: pointer; }
.bk-step:hover { filter: brightness(0.96); box-shadow: 0 0 0 1px var(--rule) inset; }
.bk-step__dot { width: 7px; height: 7px; border-radius: 50%; background: #c2c6cc; flex: none; }
.bk-step.is-sent { background: var(--mint-wash); color: var(--mint-ink); }
.bk-step.is-sent .bk-step__dot { background: var(--mint-ink); }
.bk-step.is-skipped { opacity: .5; text-decoration: line-through; }
.bk-step.is-next { outline: 2px solid var(--mint-ink); outline-offset: 1px; }
.bk-step__code { font-family: var(--font-mono); font-weight: 600; background: #fff; border: 1px solid var(--rule); padding: 0 5px; border-radius: 5px; }
.bk-card__actions { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 4px; }
.bk-card__actions .bk-stop { color: var(--c-red, #b32a1f); }
@media (max-width: 640px) { .bk-card__thumb { width: 64px; height: 64px; } }

.lib__grid { flex: 1; overflow-y: auto; padding: 14px 16px; display: grid; grid-template-columns: repeat(auto-fill, 180px); grid-auto-rows: max-content; justify-content: space-between; gap: 14px; align-content: start; }
.lib-card { border: 1px solid var(--rule); border-radius: 10px; overflow: hidden; background: #fff; display: flex; flex-direction: column; }
.lib-card.is-sel { border-color: var(--mint-ink); box-shadow: 0 0 0 2px var(--mint-wash); }
.lib-card__thumb { position: relative; flex: none; height: 178px; overflow: hidden; cursor: pointer;
  background-color: #eceff2;
  background-image: linear-gradient(45deg,#e0e4e8 25%,transparent 25%),linear-gradient(-45deg,#e0e4e8 25%,transparent 25%),linear-gradient(45deg,transparent 75%,#e0e4e8 75%),linear-gradient(-45deg,transparent 75%,#e0e4e8 75%);
  background-size: 18px 18px; background-position: 0 0,0 9px,9px -9px,-9px 0; }
.lib-card__thumb img { position: absolute; inset: 0; margin: auto; max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; display: block; }
.lib-card__ck { position: absolute; top: 7px; left: 7px; width: 17px; height: 17px; accent-color: var(--mint-ink); z-index: 2; }
.lib-card__more { position: absolute; top: 6px; right: 6px; width: 26px; height: 26px; border: none; border-radius: 50%; background: rgba(20,22,26,.55); color: #fff; display: grid; place-items: center; cursor: pointer; z-index: 2; }
.lib-card__more:hover { background: rgba(20,22,26,.8); }
.lib-card__more svg { width: 15px; height: 15px; }
.lib-menu-scrim { position: fixed; inset: 0; z-index: 1290; }
.lib-menu { position: fixed; z-index: 1300; background: #fff; border: 1px solid var(--rule); border-radius: 10px; box-shadow: var(--shadow-lg, 0 12px 32px rgba(0,0,0,.18)); padding: 5px; min-width: 200px; display: flex; flex-direction: column; }
.lib-menu button, .lib-menu a { display: flex; align-items: center; gap: 9px; padding: 8px 10px; border: none; background: none; text-align: left; font-size: 13px; color: var(--txt); border-radius: 7px; cursor: pointer; text-decoration: none; }
.lib-menu button:hover, .lib-menu a:hover { background: var(--mint-wash); }
.lib-menu svg { width: 15px; height: 15px; color: var(--txt-2); }
.lib-menu .is-danger { color: var(--c-red, #b91c1c); border-top: 1px solid var(--rule); border-radius: 0 0 7px 7px; margin-top: 3px; }
.lib-menu .is-danger svg { color: var(--c-red, #b91c1c); }
.lib-card__name { font-size: 12.5px; font-weight: 600; padding: 8px 9px 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lib-card__meta { font-size: 11px; color: var(--txt-3); padding: 2px 9px 0; }
.lib-card__tags { display: flex; flex-wrap: wrap; gap: 4px; padding: 7px 9px 9px; }
.lib-tag { display: inline-flex; align-items: center; gap: 3px; font-size: 10.5px; background: var(--mint-wash); color: var(--mint-ink); border: none; padding: 2px 6px; border-radius: 5px; }
.lib-tag button { border: none; background: none; color: inherit; cursor: pointer; font-size: 12px; line-height: 1; padding: 0; }
.lib-tag--add { background: #f2f1ec; color: var(--txt-3); cursor: pointer; }
.lib-tag--add svg { width: 10px; height: 10px; }
.lib-pick { border: 1px solid var(--rule); border-radius: 10px; max-height: 46vh; overflow-y: auto; }
.lib-pick__row { display: flex; align-items: center; gap: 9px; padding: 10px 12px; cursor: pointer; font-size: 13.5px; border: 2px solid transparent; border-radius: 8px; }
.lib-pick__row:hover { background: var(--mint-wash); }
.lib-pick__row.is-sel { border-color: var(--mint-ink); }
.lib-pick__row svg { width: 16px; height: 16px; color: var(--txt-2); flex: none; }
@media (max-width: 900px) { .modal.lib { width: 96vw; max-width: 96vw; height: 90vh; } .lib__side { width: 150px; } }
/* Centered ~60% preview panel */
.lib-lightbox { position: fixed; inset: 0; z-index: 1400; background: rgba(10,11,13,.6); display: flex; align-items: center; justify-content: center; padding: 24px; }
.lib-lightbox__panel { position: relative; width: 60vw; height: 74vh; max-width: 60vw; background: #fff; border-radius: 12px; display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 24px 70px rgba(0,0,0,.4); }
.lib-lightbox__stage { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; overflow: hidden;
  background-color: #eceff2;
  background-image: linear-gradient(45deg,#dfe3e8 25%,transparent 25%),linear-gradient(-45deg,#dfe3e8 25%,transparent 25%),linear-gradient(45deg,transparent 75%,#dfe3e8 75%),linear-gradient(-45deg,transparent 75%,#dfe3e8 75%);
  background-size: 22px 22px; background-position: 0 0,0 11px,11px -11px,-11px 0; }
.lib-lightbox__stage img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
.lib-lightbox__stage.is-dark { background-color: #1b1d20;
  background-image: linear-gradient(45deg,#33363b 25%,transparent 25%),linear-gradient(-45deg,#33363b 25%,transparent 25%),linear-gradient(45deg,transparent 75%,#33363b 75%),linear-gradient(-45deg,transparent 75%,#33363b 75%); }
.lib-lightbox__x { position: absolute; top: 12px; right: 12px; width: 34px; height: 34px; border-radius: 50%; border: none; background: rgba(20,22,26,.55); color: #fff; display: grid; place-items: center; cursor: pointer; z-index: 2; }
.lib-lightbox__x:hover { background: rgba(20,22,26,.8); }
.lib-lightbox__x svg { width: 17px; height: 17px; }
.lib-lightbox__bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--rule); }
.lib-lightbox__name { font-size: 13px; color: var(--txt-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lib-lightbox__edit { padding: 12px 16px; border-top: 1px solid var(--rule); display: flex; flex-direction: column; gap: 10px; }
.lib-lightbox__row { display: flex; align-items: center; gap: 10px; }
.lib-lightbox__name-in { flex: 1; min-width: 0; border: 1px solid var(--rule); border-radius: 8px; padding: 8px 11px; font-size: 14px; font-weight: 600; outline: none; }
.lib-lightbox__name-in:focus { border-color: var(--mint-ink); }
.lib-lightbox__tags { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.lib-lightbox__tag-in { border: 1px dashed var(--rule); border-radius: 6px; padding: 5px 9px; font-size: 12px; min-width: 96px; outline: none; }
.lib-lightbox__tag-in:focus { border-color: var(--mint-ink); border-style: solid; }
@media (max-width: 900px) { .lib-lightbox__panel { width: 94vw; max-width: 94vw; height: 82vh; } }
/* Shopify-style tag editor popover */
.lib-te { position: fixed; z-index: 1310; width: 268px; background: #fff; border: 1px solid var(--rule); border-radius: 11px; box-shadow: var(--shadow-lg, 0 12px 32px rgba(0,0,0,.18)); display: flex; flex-direction: column; overflow: hidden; }
.lib-te__chips { display: flex; flex-wrap: wrap; gap: 5px; padding: 10px 10px 8px; border-bottom: 1px solid var(--rule); }
.lib-te__search { display: flex; align-items: center; gap: 7px; padding: 9px 11px; border-bottom: 1px solid var(--rule); }
.lib-te__search svg { width: 15px; height: 15px; color: var(--txt-3); flex: none; }
.lib-te__search input { border: none; outline: none; width: 100%; font-size: 13px; background: transparent; }
.lib-te__list { max-height: 240px; overflow-y: auto; padding: 5px; }
.lib-te__h { font-size: 10px; text-transform: uppercase; letter-spacing: .04em; color: var(--txt-3); padding: 8px 8px 4px; }
.lib-te__row { display: flex; align-items: center; gap: 9px; padding: 7px 8px; border-radius: 7px; cursor: pointer; font-size: 13px; }
.lib-te__row:hover { background: var(--mint-wash); }
.lib-te__row input { accent-color: var(--mint-ink); width: 15px; height: 15px; }
.lib-te__add { display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px; border: none; background: none; text-align: left; font-size: 13px; font-weight: 600; color: var(--mint-ink); border-radius: 7px; cursor: pointer; }
.lib-te__add:hover { background: var(--mint-wash); }
.lib-te__add svg { width: 14px; height: 14px; }
.lib-te__empty { font-size: 12px; color: var(--txt-3); padding: 8px; }
.lib-te__foot { padding: 8px 10px; border-top: 1px solid var(--rule); display: flex; justify-content: flex-end; }

/* ---- Analytics Dashboard ------------------------------------------------- */
.an-board { padding-bottom: 40px; }
.an-bar { gap: 10px; flex-wrap: wrap; }
.an-nav { display: flex; align-items: center; gap: 4px; }
.an-nav .icon-btn { width: 28px; height: 28px; border: 1px solid var(--rule); border-radius: 7px; }
.an-nav__label { font-size: 12.5px; font-weight: 600; color: var(--txt-2); min-width: 160px; text-align: center; white-space: nowrap; }

/* KPI cards grid */
.an-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 16px 0 4px; }
@media (max-width: 1100px) { .an-kpis { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 800px)  { .an-kpis { grid-template-columns: repeat(2, 1fr); } }

.an-kpi {
  background: var(--paper-2, #f8f9fa); border: 1px solid var(--rule);
  border-radius: 12px; padding: 12px 14px 10px; text-align: left;
  cursor: default; transition: border-color .12s, box-shadow .12s;
  position: relative; overflow: hidden;
}
.an-kpi[onclick], .an-kpi[class*="is-active"] { cursor: pointer; }
.an-kpi:hover { border-color: color-mix(in srgb, var(--accent, #18f4af) 50%, var(--rule)); }
.an-kpi.is-active { border-color: var(--accent, #18f4af); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent, #18f4af) 18%, transparent); background: color-mix(in srgb, var(--accent, #18f4af) 5%, var(--paper-2)); }

.an-kpi__label { font-size: 10.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--txt-3); margin-bottom: 3px; }
.an-kpi__val   { font-family: var(--font-display); font-weight: 800; font-size: 22px; letter-spacing: -.02em; line-height: 1.1; color: var(--txt); }
.an-kpi__delta { display: flex; align-items: center; gap: 3px; font-size: 11.5px; font-weight: 600; margin-top: 4px; }
.an-kpi__arrow { font-size: 10px; }
.an-kpi__prev  { font-size: 11px; color: var(--txt-3); font-weight: 400; margin-left: 2px; }
.an-kpi__bar   { position: absolute; bottom: 0; left: 0; right: 0; height: 3px; background: var(--rule); }
.an-kpi__bar span { display: block; height: 100%; background: var(--accent, #18f4af); opacity: .6; }

/* Line chart */
.an-card-chart { margin-top: 14px; overflow: visible; }
.an-chart-wrap { position: relative; padding: 8px 0 0; }
.an-chart-svg  { width: 100%; height: auto; display: block; }
.an-chart-svg--sm { max-height: 140px; }
.an-chart--empty { padding: 32px; text-align: center; color: var(--txt-3); font-size: 13px; }

/* Chart tooltip */
.an-tooltip {
  position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  background: var(--panel, #fff); border: 1px solid var(--rule);
  border-radius: 10px; padding: 9px 12px; pointer-events: none;
  box-shadow: 0 8px 24px rgba(0,0,0,.13); font-size: 12.5px; z-index: 10;
  white-space: nowrap;
}
.an-tooltip__label { font-weight: 700; font-size: 12px; margin-bottom: 6px; color: var(--txt-2); }
.an-tooltip__row   { display: flex; align-items: center; gap: 6px; margin-top: 3px; }
.an-tooltip__dot   { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.an-tooltip__name  { flex: 1; color: var(--txt-2); }
.an-tooltip__val   { font-weight: 700; font-family: var(--font-mono); margin-left: 12px; }

/* Chart legend toggles */
.an-legend { display: flex; flex-wrap: wrap; gap: 8px; padding: 4px 0 12px; }
.an-legend__item {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 600; color: var(--txt-2);
  padding: 4px 10px; border: 1px solid var(--rule);
  border-radius: 20px; background: var(--paper-2); cursor: pointer;
  transition: border-color .1s, background .1s;
}
.an-legend__item.is-active { background: var(--paper); border-color: var(--txt-2); color: var(--txt); }
.an-legend__item:hover { border-color: var(--txt-3); }
.an-legend__dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }

/* Customer growth + retention row */
.an-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 14px; }
@media (max-width: 720px) { .an-row2 { grid-template-columns: 1fr; } }
.an-card-cust, .an-card-ret { min-height: 180px; }

/* Retention mini-stats */
.an-ret { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 14px; text-align: center; }
.an-ret__big    { font-family: var(--font-display); font-weight: 800; font-size: 36px; letter-spacing: -.02em; }
.an-ret__label  { font-size: 12px; color: var(--txt-2); }
.an-ret__delta  { font-size: 12px; font-weight: 700; }
.an-ret__breakdown { display: flex; gap: 32px; margin-top: 10px; }
.an-ret__num    { font-family: var(--font-display); font-weight: 800; font-size: 20px; }
.an-ret__sublabel { font-size: 11px; color: var(--txt-3); margin-top: 2px; }

/* AI insights panel */
.an-ai { margin-top: 14px; }
.an-ai .btn svg { width: 14px; height: 14px; }
.an-ai--open { }
.an-ai__loading { display: flex; align-items: center; gap: 8px; color: var(--txt-2); font-size: 13px; padding: 6px 0; }
.an-ai__err     { color: #c0392b; font-size: 13px; padding: 6px 0; }
.an-ai__text p  { font-size: 13.5px; line-height: 1.6; margin: 0 0 8px; color: var(--txt); }
.an-ai__text p:last-child { margin-bottom: 0; }
.an-ai__ts      { font-size: 11px; margin-top: 8px; }

/* Spam exclusion */
.an-spam { position: relative; }
.an-spam__panel {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 30;
  width: 360px; max-width: 92vw;
  box-shadow: 0 12px 32px rgba(0,0,0,.16);
}
.an-spam__list { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.an-spam__row  { display: flex; align-items: center; justify-content: space-between; font-size: 12.5px; padding: 4px 0; }
.an-spam__add  { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.an-spam__add .input--sm { flex: 1; min-width: 120px; }
.cnt--sm { font-size: 10px; background: var(--mint, #18f4af); color: #08281d; border-radius: 9px; padding: 1px 5px; }

/* Analytics custom date range */
.an-custom-range { display:flex; align-items:center; gap:6px; }
.an-date-in { width:136px; padding:6px 9px; font-size:13px; }
.an-kpi--btn { cursor:pointer; }
.an-kpi--btn:hover { border-color:color-mix(in srgb, var(--accent) 60%, var(--rule)); }
.an-kpi__accent { position:absolute; bottom:0; left:0; right:0; height:3px; opacity:0.5; }

/* Reusable bulk-selection bar (LibSelectionBar) — floats bottom-centre of its positioned parent */
.lib__main { position: relative; }
.lib-selbar { position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 20; display: flex; align-items: center; gap: 4px; max-width: calc(100% - 32px); overflow-x: auto; padding: 8px 10px 8px 18px; background: var(--panel); border: 1px solid var(--rule); border-radius: 999px; box-shadow: 0 14px 40px rgba(11,12,14,.22); animation: libSelIn .16s ease-out; white-space: nowrap; }
@keyframes libSelIn { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }
.lib-selbar__n { font-weight: 700; font-size: 14px; margin-right: 6px; }
.lib-selbar__sep { width: 1px; height: 22px; background: var(--rule); margin: 0 6px; flex: none; }
.lib-selbar__btn { display: inline-flex; align-items: center; gap: 7px; padding: 8px 12px; border: none; background: none; border-radius: 999px; font-size: 13.5px; color: var(--txt); cursor: pointer; flex: none; }
.lib-selbar__btn:hover:not(:disabled) { background: var(--paper); }
.lib-selbar__btn:disabled { opacity: .45; cursor: default; }
.lib-selbar__btn svg { width: 16px; height: 16px; }
.lib-selbar__btn.is-primary { background: var(--mint); color: var(--ink); font-weight: 600; }
.lib-selbar__btn.is-primary:hover:not(:disabled) { background: var(--mint-deep); }
.lib-selbar__btn.is-danger { color: var(--c-red); }
.lib-selbar__btn.is-danger:hover:not(:disabled) { background: var(--c-red-w); }
.lib-selbar__x { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border: none; background: none; border-radius: 50%; cursor: pointer; color: var(--txt-3); flex: none; margin-left: 4px; }
.lib-selbar__x:hover { background: var(--paper); color: var(--txt); }
.lib-card.is-sel { outline: 2px solid var(--mint); outline-offset: -2px; }
.lib__grid { padding-bottom: 84px; }

/* ---- CropTool (crm/views-croptool.jsx; same as headless crop-tool.css) ---- */
/* Shared CropTool (src/components/shared/CropTool.jsx). Scoped to .crt; fallbacks for every var. */
.crt.crt :where(button, input, select, textarea) { font:inherit; color:inherit; margin:0; box-sizing:border-box; }
.crt.crt { position:fixed; inset:0; z-index:1400; background:rgba(10,12,14,.62); display:grid; place-items:center; padding:16px; }
.crt .crt__panel { width:min(920px, 100%); max-height:calc(100vh - 32px); display:flex; flex-direction:column; background:var(--paper, #fff); color:var(--txt, #13161a); border-radius:14px; box-shadow:0 24px 70px rgba(0,0,0,.35); overflow:hidden; font-family:var(--font-body, "Inter Tight", system-ui, sans-serif); }
.crt .crt__hd { display:flex; align-items:center; justify-content:space-between; padding:14px 16px 8px; font-family:var(--font-display, "Archivo", sans-serif); font-size:16px; }
.crt .crt__x { width:30px; height:30px; border:0; border-radius:8px; background:transparent; color:var(--txt-3, #8b929b); display:grid; place-items:center; cursor:pointer; }
.crt .crt__x:hover { background:var(--paper-3, #eef0f3); color:var(--txt, #13161a); }
.crt .crt__presets { display:flex; flex-wrap:wrap; gap:6px; padding:0 16px 10px; }
.crt .crt__presets button { border:1px solid var(--line-2, #d3d7dd); background:var(--paper, #fff); color:var(--txt, #13161a); border-radius:999px; padding:5px 12px; font-size:12px; font-weight:600; cursor:pointer; font-family:var(--font-mono, "JetBrains Mono", monospace); }
.crt .crt__presets button.on { background:var(--txt, #13161a); border-color:var(--txt, #13161a); color:var(--paper, #fff); }
.crt .crt__stage { position:relative; flex:1 1 auto; min-height:280px; height:min(62vh, 640px); margin:0 16px; display:grid; place-items:center; touch-action:none; user-select:none;
  background-color:#fff; background-image:conic-gradient(#e6e8eb 25%,transparent 0 50%,#e6e8eb 0 75%,transparent 0); background-size:16px 16px; border-radius:10px; overflow:hidden; }
.crt .crt__imgwrap { position:absolute; left:50%; top:50%; transform:translate(-50%,-50%); } /* out of flow: the image never sizes the stage; fit() keeps a 36px margin for the handles */
.crt .crt__imgwrap img { display:block; max-width:calc(100% - 72px); max-height:calc(min(62vh, 640px) - 72px); object-fit:contain; pointer-events:none; }
.crt .crt__imgwrap.is-fit img { width:100%; height:100%; max-width:none; max-height:none; }
.crt .crt__rect { position:absolute; box-shadow:0 0 0 9999px rgba(12,14,16,.55); outline:2px solid #fff; cursor:move; }
.crt .crt__grid { position:absolute; inset:0; pointer-events:none;
  background-image:linear-gradient(to right, rgba(255,255,255,.55) 1px, transparent 1px), linear-gradient(to bottom, rgba(255,255,255,.55) 1px, transparent 1px);
  background-size:33.333% 33.333%; background-position:-1px -1px; opacity:.7; }
.crt .crt__h { position:absolute; width:16px; height:16px; background:#fff; border:2px solid var(--accent, #18f4af); border-radius:4px; transform:translate(-50%,-50%); }
.crt .crt__h--nw { left:0; top:0; cursor:nwse-resize; } .crt .crt__h--n { left:50%; top:0; cursor:ns-resize; } .crt .crt__h--ne { left:100%; top:0; cursor:nesw-resize; }
.crt .crt__h--e { left:100%; top:50%; cursor:ew-resize; } .crt .crt__h--se { left:100%; top:100%; cursor:nwse-resize; } .crt .crt__h--s { left:50%; top:100%; cursor:ns-resize; }
.crt .crt__h--sw { left:0; top:100%; cursor:nesw-resize; } .crt .crt__h--w { left:0; top:50%; cursor:ew-resize; }
.crt .crt__ft { display:flex; flex-wrap:wrap; align-items:center; gap:10px; padding:12px 16px 16px; }
.crt .crt__info { font-family:var(--font-mono, "JetBrains Mono", monospace); font-size:12px; color:var(--txt, #13161a); flex:1; min-width:200px; }
.crt .crt__info span { color:var(--txt-3, #8b929b); }
.crt .crt__err { width:100%; order:3; color:#d63c3c; font-size:12px; }
.crt .crt__btns { display:flex; gap:8px; margin-left:auto; }
.crt .crt__btn { border:1px solid var(--line-2, #d3d7dd); background:var(--paper, #fff); color:var(--txt, #13161a); border-radius:9px; padding:9px 14px; font-weight:700; font-size:13px; cursor:pointer; font-family:var(--font-display, "Archivo", sans-serif); display:inline-flex; align-items:center; gap:8px; }
.crt .crt__btn:disabled { opacity:.45; cursor:not-allowed; }
.crt .crt__btn--primary { background:var(--txt, #13161a); border-color:var(--txt, #13161a); color:var(--paper, #fff); }
.crt .crt__spin { width:12px; height:12px; border:2px solid rgba(255,255,255,.4); border-top-color:#fff; border-radius:50%; animation:crt-spin .8s linear infinite; }
@keyframes crt-spin { to { transform:rotate(360deg); } }
@media (max-width:600px) { .crt .crt__stage { height:52vh; margin:0 10px; } .crt .crt__btns { width:100%; } .crt .crt__btn { flex:1; justify-content:center; } }

.lib-card.is-new { animation: libNew 2.4s ease-out; }
@keyframes libNew { 0%,40% { box-shadow: 0 0 0 4px var(--mint); } 100% { box-shadow: 0 0 0 0 transparent; } }

.pp-note { margin: 0 0 12px; padding: 10px 14px; border-radius: 10px; background: var(--c-amber-w); color: #6b4a00; font-size: 13px; }

/* CRM gang-sheet builder — semi-transparency check (mirrors storefront SEMI_COLOR #d61fd6) */
.gs-thumb { position: relative; width: 44px; height: 44px; border-radius: 6px; background: #fafafa; }
.gs-thumb > img:first-child { width: 44px; height: 44px; object-fit: contain; display: block; border-radius: 6px; }
.gs-thumb.is-semi { box-shadow: 0 0 0 2px #d61fd6; }
.gs-semimask { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; pointer-events: none; animation: gsSemiPulse 1.1s infinite; }
@keyframes gsSemiPulse { 0%,100% { opacity: .9 } 50% { opacity: .35 } }
.gs-thumb__busy { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(255,255,255,.7); border-radius: 6px; }
.gs-semi-pop { position: absolute; left: 52px; top: -8px; z-index: 30; background: var(--panel); border: 1px solid var(--rule); border-radius: 10px; box-shadow: 0 12px 32px rgba(0,0,0,.2); padding: 8px; width: 260px; }
.gs-semi-pop__img { position: relative; background-color: #fff; background-image: conic-gradient(#e6e8eb 25%,transparent 0 50%,#e6e8eb 0 75%,transparent 0); background-size: 14px 14px; border-radius: 6px; }
.gs-semi-pop__img > img:first-child { width: 100%; height: 220px; object-fit: contain; display: block; }
.gs-semi-pop__cap { font-size: 11px; color: var(--txt-3); margin-top: 6px; }
.gs-semi-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 11.5px; margin: 0 0 5px; }
.gs-semi-badge { color: #d61fd6; font-weight: 700; }
.gs-semi-banner { display: flex; align-items: center; gap: 12px; justify-content: space-between; padding: 10px 12px; margin: 0 0 10px; border-radius: 10px; background: #fbe9fb; border: 1px solid #f0c2f0; color: #5d0d5d; font-size: 12.5px; }
/* Order page on phones (QA 2026-11-20): nothing may push the page wider than the screen.
   Kept at the END of the file so it beats every base rule. */
@media (max-width: 560px) {
  .detail__side { min-width: 0; }
  .lineitem { padding: 12px 14px; }
  .li__head { grid-template-columns: 44px minmax(0, 1fr) auto; gap: 11px; }
  .li__body { margin-left: 0; }
  .li-file { max-width: none; }
  .li-file__body { flex: 1 1 120px; }
  .li-file__acts .btn--sm { min-height: 40px; }
  .li-file__acts .btn--sm:has(.li-file__dl-txt) { width: 40px; padding: 0; justify-content: center; }
  .li-file__dl-txt { display: none; }
  .li-chip { height: 40px; }
  .li__make { flex: 1 1 100%; }
  .li__make .rm-in { flex: 1 1 auto; min-width: 0; max-width: 100%; min-height: 40px; }
  .li-file__acts { flex-basis: 100%; justify-content: flex-start; margin-left: 0; }
  .li-file__acts .icon-btn { width: 40px; height: 40px; }
  .li__details > summary { display: inline-flex; align-items: center; min-height: 40px; }
  .li__props .li__prop { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .dpp__body { flex: 1 1 auto; min-width: 0; }
  .pagehead .actions { margin-left: 0; justify-content: flex-start; }
  .card__head, .card__head .right { flex-wrap: wrap; }
  .art-printbanner .btn { white-space: normal; overflow-wrap: anywhere; text-align: left; max-width: 100%; height: auto; }
  .ff-row { flex-wrap: wrap; }
  .ff-row .ff-qty { flex: 1 1 100%; margin-left: 0; }
  .ff-foot .btn { margin-left: 0; flex: 1 1 auto; }
  .detail .btn--sm { min-height: 40px; }
  .art-actions { min-width: 0; }
  .art-actions .btn { white-space: normal; line-height: 1.15; }
  .modal__foot { flex-wrap: wrap; }
  .modal__foot > div { flex: 1 1 100%; }
  .modal__foot > div:last-child { justify-content: flex-end; }
  .composer-foot { flex-wrap: wrap; }
  .composer-foot .kbd-hint { display: none; }
  .detail textarea { white-space: pre-wrap !important; }
}
/* Desktop with sidebar + side column: the artwork action row wraps inside the card. */
@media (min-width: 1101px) {
  .art-actions { flex: 1 1 auto; flex-wrap: wrap; justify-content: flex-end; min-width: 0; }
}
.art-menu { max-width: 320px; }

/* ===== Orders list on phones (#/neworders · #/dispatch · #/orders) =====
   ≤720px: OrdersTable renders OrderCard list instead of the table.
   Append at the very END of styles.css (after line 2087) so it beats base rules. */
.stat__d--phone, .status-multi__scrim, .status-multi__done { display: none; }
.empty-state--err { color: #8f2218; }
.ord-err { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 8px 12px; margin: 0 0 10px; border: 1px solid #f3c5bf; border-radius: var(--radius); background: var(--c-red-w); color: #8f2218; font-size: 12.5px; }

/* "In production" tile became a <button>: keep the desktop tile looking like the other div tiles */
button.stat { display: block; width: 100%; font: inherit; color: inherit; text-align: left; cursor: pointer; }
@media (max-width: 720px) {
  .hide-phone { display: none !important; }

  /* stats: 2-up, compact; production breakdown collapses to a link line */
  .board .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
  .board .stat { padding: 9px 11px; min-width: 0; text-align: left; width: 100%; }
  .board .stat__k { font-size: 9.5px; color: var(--txt-2); }
  .board .stat__v { font-size: 20px; }
  .board .stat__d { color: var(--txt-2); }
  .board .stat--prod .prod-break { display: none; }
  .board .stat--prod .stat__d--phone { display: block; }

  /* toolbar */
  .board .toolbar { gap: 8px; margin-bottom: 12px; }
  .board .toolbar .seg { display: flex; flex: 1 1 100%; }
  .board .toolbar .seg button { flex: 1 1 0; min-height: 40px; padding: 0 6px; font-size: 13px; }
  .board .ord-search { flex: 1 1 100%; min-width: 0; height: 44px; padding: 0 2px 0 10px; }
  .board .ord-search input { font-size: 16px; }
  .board .ord-search__clear { width: 40px; height: 40px; font-size: 20px; }
  .board .chip-filter, .board .status-multi__btn, .board .status-select { height: 40px; min-height: 40px; font-size: 13px; }
  .board .status-select select { font-size: 16px; }
  .board .toolbar .kick { flex: 0 1 auto; min-width: 0; overflow-wrap: anywhere; }
  .board .toolbar .right { margin-left: auto; }
  .board .toolbar .icon-btn { width: 40px; height: 40px; }

  /* Status / Delivery pickers: popover becomes a bottom sheet */
  .status-multi__scrim { display: block; position: fixed; inset: 0; z-index: 70; background: rgba(20,22,26,.45); }
  .status-multi__pop { position: fixed; top: auto; left: 0; right: 0; bottom: 0; z-index: 71; min-width: 0; max-height: 75vh; max-height: 75dvh;
    border-radius: 14px 14px 0 0; padding: 10px max(12px, env(safe-area-inset-right, 0px)) calc(14px + env(safe-area-inset-bottom, 0px)) max(12px, env(safe-area-inset-left, 0px)); }
  .status-multi__head { min-height: 40px; color: var(--txt-2); }
  .status-multi__head .linklike { min-height: 40px; }
  .status-multi__opt { min-height: 48px; font-size: 15px; }
  .status-multi__opt input { width: 20px; height: 20px; }
  .status-multi__done { display: flex; width: 100%; min-height: 44px; margin-top: 8px; }

  /* same-address combine suggestion */
  .grp-suggest { flex-wrap: wrap; }
  .grp-suggest > span { flex: 1 1 200px; min-width: 0; }
  .grp-suggest .btn { flex: 1 1 100%; min-height: 40px; }

  /* order cards */
  .ocards { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
  .ocard { background: var(--panel); border: 1px solid var(--rule); border-radius: var(--radius); overflow: hidden; cursor: pointer; min-width: 0; }
  .ocard.is-overdue  { box-shadow: inset 3px 0 0 var(--c-red); }
  .ocard.has-uv      { background: var(--c-violet-w); box-shadow: inset 3px 0 0 var(--c-violet); }
  .ocard.is-printing { background: var(--c-blue-w); box-shadow: inset 3px 0 0 var(--c-blue); }
  .ocard--parent     { background: var(--mint-wash); border-color: #9fe9cf; }
  .ocard.is-sel      { background: var(--mint-wash); border-color: var(--mint-deep); }
  .ocard--child      { margin: -4px 0 0 18px; background: var(--rule-2-wash, #f6f4ef); border-style: dashed; }
  .ocard__top { display: flex; align-items: center; gap: 6px; min-height: 44px; padding-right: 12px; }
  .ocard__chk { width: 44px; height: 44px; flex: none; display: grid; place-items: center; }
  .ocard__chk .checkbox { width: 20px; height: 20px; border-radius: 5px; }
  .ocard__childmark { width: 32px; flex: none; text-align: center; color: var(--txt-2); font-size: 14px; }
  .ocard__id { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; flex: 1 1 auto; min-width: 0; }
  .ocard__no { font: 700 15px var(--font-mono); color: var(--txt); text-decoration: none; }
  .ocard__of { font: 11px var(--font-mono); color: var(--txt-2); }
  .ocard__total { margin-left: auto; flex: none; font: 700 15px var(--font-mono); }
  .ocard--child .ocard__no, .ocard--child .ocard__total { font-size: 14px; }
  .ocard__body { padding: 0 12px 12px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
  .ocard__tags { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
  .ocard__tags .grp-badge, .ocard__tags .loc-tag { margin-left: 0; font-size: 11px; }
  .ocard__tags .loc-tag { min-height: 28px; padding: 0 10px; border: 0; }
  .ocard__tagbtn { min-height: 28px; padding: 0 8px; border: 1px solid var(--rule-2); border-radius: 6px; background: #fff; font-size: 11px; font-weight: 600; color: var(--txt-2); }
  /* 28px-tall chips/links keep a 40px hit area */
  .hit40 { position: relative; }
  .hit40::after { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 40px; transform: translateY(-50%); }
  .ocard__who { display: flex; align-items: flex-start; gap: 8px; }
  .ocard__whom { flex: 1 1 auto; min-width: 0; }
  .ocard__name { font-weight: 600; font-size: 14px; line-height: 1.3; overflow-wrap: anywhere;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .ocard__loc { font: 11px var(--font-mono); color: var(--txt-2); margin-top: 1px; overflow-wrap: anywhere; }
  .ocard .grp-addr { overflow-wrap: anywhere; }
  .ocard__when { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: 12.5px; }
  .ocard__when .urg-rail { height: 18px; }
  .ocard__rel { font: 11px var(--font-mono); color: var(--txt-2); }
  .ocard__rel.is-late { color: #b32a1f; font-weight: 700; }
  .ocard__placed { font: 11px var(--font-mono); color: var(--txt-2); }
  .ocard .ord-items { max-width: none; gap: 3px; }
  .ocard .ord-items__row { font-size: 12.5px; min-width: 0; }
  .ocard .ord-items__qty { color: var(--txt-2); }
  .ocard .ord-items__sku, .ocard .ord-items__name { min-width: 0; color: var(--txt); }
  .ocard .ord-items__sum { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; font-size: 11.5px; color: var(--txt-2); margin-top: 2px; }
  .ocard .ord-items__sum .m-badge { margin-left: 0; }
  .ocard__more { font-size: 12px; font-weight: 600; }
  .ocard .ord-note { max-width: none; font-size: 12px; color: var(--txt-2); }
  .ocard__mail { display: inline-flex; align-items: center; min-height: 28px; font: 600 11px var(--font-mono); color: var(--mint-ink); text-decoration: underline; align-self: flex-start; }
  .ocard__foot { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
  .ocard__foot .prog { margin-left: auto; }
  .ocard__track { font: 600 11.5px var(--font-mono); color: var(--mint-ink); text-decoration: underline; overflow-wrap: anywhere; min-height: 28px; display: inline-flex; align-items: center; }
  .ocard__acts { display: flex; gap: 8px; align-items: stretch; }
  .ocard__acts .rm-in { flex: 1 1 0; width: auto; min-width: 0; min-height: 40px; font-size: 16px; border-radius: 8px; }
  .ocard__acts .btn { flex: 1 1 0; min-height: 40px; min-width: 0; }

  /* loading / empty / error / load more */
  .board .skel-row { height: 112px; border-radius: var(--radius); }
  .board .empty-state { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; padding: 24px 16px;
    background: var(--panel); border: 1px solid var(--rule); border-radius: var(--radius); color: var(--txt-2); font-size: 14px; }
  .board .empty-state b { color: var(--txt); font-size: 15px; }
  .board .empty-state .linklike, .board .empty-state .btn { min-height: 40px; }
  .board .empty-state--err { background: var(--c-red-w); border-color: #f3c5bf; color: #8f2218; }
  .board .empty-state--err b { color: #8f2218; }
  .board .ord-err .btn { min-height: 40px; }
  .board .load-more { flex-direction: column; gap: 6px; }
  .board .load-more .btn { width: 100%; min-height: 44px; }

  /* bulk-select bar (phone only, rendered while sel.size > 0) */
  .board.has-bulkbar { padding-bottom: calc(150px + env(safe-area-inset-bottom, 0px)); }
  .ord-bulkbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; display: flex; flex-direction: column; gap: 8px;
    background: var(--ink); color: #fff; border-radius: 14px 14px 0 0; box-shadow: 0 -8px 24px rgba(11,12,14,.25);
    padding: 10px max(12px, env(safe-area-inset-right, 0px)) calc(10px + env(safe-area-inset-bottom, 0px)) max(12px, env(safe-area-inset-left, 0px)); }
  .ord-bulkbar__row { display: flex; align-items: center; gap: 8px; min-width: 0; }
  .ord-bulkbar__count { font-weight: 700; font-size: 14px; white-space: nowrap; }
  .ord-bulkbar__meta { font: 11px var(--font-mono); color: #c9ccd1; min-width: 0; }
  .ord-bulkbar .m-badge { background: var(--c-teal); color: #fff; }
  .ord-bulkbar .btn, .ord-bulkbar .rm-in { min-height: 44px; }
  .ord-bulkbar .btn--ghost, .ord-bulkbar .rm-in, .ord-bulkbar .icon-btn { background: var(--ink-2); border: 1px solid #2c3038; color: #fff; }
  .ord-bulkbar .btn--ghost { margin-left: auto; }
  .ord-bulkbar .rm-in { flex: 1 1 0; width: auto; min-width: 0; font-size: 16px; border-radius: 8px; }
  .ord-bulkbar .btn--primary { flex: 1 1 0; min-width: 0; }
  .ord-bulkbar .icon-btn { width: 44px; height: 44px; flex: none; }

  /* action sheet (bulk ⋯ and list ⋯) */
  .ord-sheet__scrim { position: fixed; inset: 0; z-index: 70; background: rgba(20,22,26,.45); }
  .ord-sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 71; display: flex; flex-direction: column; gap: 2px; max-height: 80vh; max-height: 80dvh; overflow-y: auto;
    background: var(--panel); border-radius: 14px 14px 0 0; box-shadow: 0 -10px 30px rgba(11,12,14,.3);
    padding: 8px max(12px, env(safe-area-inset-right, 0px)) calc(16px + env(safe-area-inset-bottom, 0px)) max(12px, env(safe-area-inset-left, 0px)); }
  .ord-sheet__head { display: flex; align-items: center; justify-content: space-between; padding: 0 4px 6px; margin-bottom: 4px; border-bottom: 1px solid var(--rule); }
  .ord-sheet__head .icon-btn { width: 40px; height: 40px; }
  .ord-sheet__item { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 48px; padding: 0 6px; border-radius: 8px; font-size: 15px; font-weight: 600; color: var(--txt); text-align: left; }
  .ord-sheet__item svg { width: 18px; height: 18px; flex: none; color: var(--txt-2); }
  .ord-sheet__label { padding: 10px 6px 4px; font: 600 10.5px var(--font-mono); letter-spacing: .05em; text-transform: uppercase; color: var(--txt-2); }
  .ord-sheet .rm-in { width: 100%; min-height: 44px; font-size: 16px; border-radius: 8px; }
}
/* Draft "Change with AI" card */
.dai__in { width: 100%; box-sizing: border-box; resize: vertical; font-size: 14px; }
.dai__row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.dai__hint { font-size: 11.5px; }
.dai__done { margin-top: 10px; color: var(--mint-ink); font-size: 13px; font-weight: 600; }
.dai__q { margin-top: 10px; padding: 9px 11px; border-radius: 8px; background: #fff7e6; font-size: 13px; }
.dai__res { margin-top: 12px; border-top: 1px dashed var(--rule); padding-top: 10px; display: flex; flex-direction: column; gap: 8px; }
.dai__sum { font-size: 13px; font-weight: 600; }
.dai__d { display: flex; gap: 10px; align-items: flex-start; }
.dai__dbody { min-width: 0; flex: 1; }
.dai__prod { font-size: 12.5px; font-weight: 600; overflow-wrap: anywhere; }
.dai__was { font: 400 11.5px var(--font-mono); color: #6b6f75; text-decoration: line-through; }
.dai__now { font: 600 11.5px var(--font-mono); color: var(--txt); }
.dai__warn { color: #b32a1f; font-weight: 600; }
.dai__probs { font-size: 12px; color: #9a5b00; }
@media (max-width: 560px) { .dai__row .btn { min-height: 40px; } }


/* ===== Partner shop view on phones (#/shop/<slug>) =====
   Desktop is untouched: the helper spans/classes below are hidden or inert above 720px.
   ≤720px the orders table becomes stacked cards (CSS only, same markup), the items table
   becomes a grid (thumb · title · qty, then the shared ItemProps full width), toolbars wrap
   and tap targets are ≥40px. Kept at the END of the file so it beats the base rules. */
.shop-selall__txt { display: none; }
.shop-selall, .shop-chk { cursor: pointer; }
@media (max-width: 720px) {
  /* header */
  .shop-top { gap: 10px; }
  .shop-brand { flex: 1 1 auto; min-width: 0; gap: 10px; }
  .shop-brand > div { min-width: 0; }
  .shop-mark { flex: none; }
  .shop-title { overflow-wrap: anywhere; }
  .shop-top__right { flex: none; gap: 8px; }
  .shop-top__right .rm-in { width: auto; max-width: 38vw; min-height: 40px; font-size: 16px; }
  .shop-top__right .btn { min-height: 40px; }
  .shop-preview-wrap { padding: 14px 14px 40px; }
  .shop-list, .shop-detail { min-width: 0; overflow-wrap: anywhere; }
  .shop-list .warn-banner, .shop-detail .warn-banner { flex-wrap: wrap; }
  .shop-list .warn-banner > span[style] { margin-left: 0 !important; }
  .shopapp .rm-in, .shop-preview-wrap .rm-in { min-height: 40px; font-size: 16px; max-width: 100%; }
  .shopapp input[type="email"].rm-in, .shop-preview-wrap input[type="email"].rm-in { flex: 1 1 180px; }

  /* tabs + filters + bulk bar */
  .shop-tabs { flex-wrap: wrap; }
  .shop-tab { min-height: 40px; }
  .shop-list .btn--sm, .shop-detail .btn--sm { min-height: 40px; }
  .shop-filters { flex-wrap: wrap; gap: 8px !important; }
  .shop-filters .seg { display: flex; flex: 1 1 100%; }
  .shop-filters .seg button { flex: 1 1 0; min-width: 0; min-height: 40px; padding: 0 6px; font-size: 13px; }
  .shop-bulk .kick { flex: 1 1 100%; }
  .shop-bulk .btn { flex: 1 1 auto; }

  /* orders table → stacked cards */
  table.shop-tbl, .shop-tbl thead, .shop-tbl tbody { display: block; }
  .shop-tbl thead tr { display: block; }
  .shop-tbl th { display: none; }
  .shop-tbl th:first-child { display: block; width: auto !important; padding: 0; }
  .shop-selall { display: flex; align-items: center; gap: 14px; min-height: 44px; padding: 0 12px 0 14px; font-family: var(--font-body, inherit); font-size: 12px; letter-spacing: 0; text-transform: none; font-weight: 600; color: var(--txt-2); }
  .shop-selall__txt { display: inline; }
  .shop-tbl input[type="checkbox"] { width: 20px; height: 20px; margin: 0; }
  .shop-tbl tr.shop-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; position: relative;
    padding: 11px 12px 12px 48px; border-bottom: 1px solid var(--rule); }
  .shop-tbl tbody > tr:last-child { border-bottom: 0; }
  .shop-tbl tr.shop-row td { display: block; padding: 0; border: 0; background: transparent; box-shadow: none; min-width: 0; font-size: 13px; }
  .shop-tbl tr.shop-row:hover { background: var(--mint-wash); }
  .shop-tbl tr.shop-row--cutoff { background: #fff7ed; box-shadow: inset 3px 0 0 #f59e0b; }
  .shop-tbl tr.shop-row td.shop-c-chk { position: absolute; left: 0; top: 0; bottom: 0; width: 48px; }
  .shop-chk { display: flex; align-items: center; justify-content: center; width: 48px; height: 46px; }
  .shop-tbl tr.shop-row td.shop-c-ord { order: 1; flex: 1 1 0; font-size: 15px; font-weight: 700; line-height: 1.6; }
  .shop-tbl tr.shop-row td.shop-c-st { display: contents; }
  .shop-c-st > .badge { order: 2; flex: none; align-self: flex-start; }
  .shop-c-st > .shop-track { order: 6; flex: 1 1 100%; margin-top: 0; }
  .shop-tbl tr.shop-row td.shop-c-items { order: 3; flex: 1 1 100%; line-height: 1.45; }
  .shop-c-items .m-badge { white-space: nowrap; }
  .shop-tbl tr.shop-row td.shop-c-svc { order: 4; }
  .shop-tbl tr.shop-row td.shop-c-date { order: 5; font-size: 12px; }
  .shop-tbl tr.shop-row td.shop-c-go { display: none; }
  .shop-track { overflow-wrap: anywhere; }
  .shop-track a { display: inline-flex; align-items: center; min-height: 40px; }
  .shop-tbl tr.shop-daterow { display: block; }
  .shop-tbl tr.shop-daterow td { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 0; }

  /* order detail */
  .shop-detail .crumbs { flex-wrap: wrap; min-height: 32px; }
  .shop-detail .crumbs a { display: inline-flex; align-items: center; min-height: 40px; }
  .shop-detail .pagehead { gap: 8px 10px; }
  .shop-detail .pagehead .icon-btn { width: 40px; height: 40px; }
  .shop-detail .pagehead h2 { min-width: 0; overflow-wrap: anywhere; }
  .shop-detail .pagehead .svc-badge { white-space: normal; }
  .shop-detail .pagehead .actions { flex: 1 1 100%; margin-left: 0; justify-content: flex-start; }
  .shop-detail .pagehead .actions .btn { flex: 1 1 auto; min-height: 44px; }
  .shop-flow { flex-wrap: wrap; row-gap: 6px; }
  .shop-detail .notes-card__compose textarea { font-size: 16px; }
  .shop-detail .notes-card__compose .btn { min-height: 40px; }
  .shop-detail .notes-card__head { flex-wrap: wrap; }
  .shop-detail .note-msg__bubble { max-width: 88%; }
  .shop-detail textarea { white-space: pre-wrap !important; }

  /* items table → grid rows: thumb | title | qty, then variant, then ItemProps full width */
  table.shop-items, .shop-items tbody { display: block; }
  .shop-items tr { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; column-gap: 10px; align-items: start;
    padding: 10px 0; border-bottom: 1px solid var(--rule); }
  .shop-items tr:last-child { border-bottom: 0; }
  .shop-items td { display: block; padding: 0; border: 0; width: auto !important; min-width: 0; }
  .shop-items td.shop-item__img { grid-column: 1; grid-row: 1 / span 2; }
  .shop-items td.shop-item__main { display: contents; }
  .shop-items .shop-item__title { grid-column: 2; grid-row: 1; min-width: 0; }
  .shop-items .shop-item__variant { grid-column: 2 / -1; grid-row: 2; min-width: 0; }
  .shop-items td.shop-item__qty { grid-column: 3; grid-row: 1; }
  .shop-items td.shop-item__main > :not(.shop-item__title):not(.shop-item__variant) { grid-column: 1 / -1; min-width: 0; margin-top: 8px; }

  /* create-label modal */
  .shop-lblmodal { max-height: calc(100vh - 20px); max-height: calc(100dvh - 20px); }
  .shop-lblmodal .modal__head { gap: 8px; }
  .shop-lblmodal .modal__head h3 { min-width: 0; overflow-wrap: anywhere; }
  .shop-lblmodal .modal__head .icon-btn { width: 40px; height: 40px; flex: none; }
  .shop-lblmodal .modal__body { padding: 14px; }
  .shop-lbl__all .shop-lin { flex: 1 1 100%; }
  .shop-lin { min-height: 44px; font-size: 16px; }
  .shop-lblmodal .modal__foot { flex-wrap: wrap; padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px)); }
  .shop-lblmodal .modal__foot .btn { flex: 1 1 0; min-height: 44px; }
}
@media (max-width: 400px) {
  .shop-refresh__txt { display: none; }
  .shop-refresh { width: 40px; padding: 0; }
  .shop-sub { display: none; }
}

/* ===== Shipments on phones (#/shipments) + Create-label modal (ShipModal, shared with orders/dispatch) =====
   Desktop is untouched: the classes/data-labels these rules hang on have no desktop styles.
   ≤720px ShipmentsTable renders .scards (useIsPhone) instead of the 12-column table, the manifests
   table and the label modal's order table stack into cards, tap targets are ≥40px and the modal
   footer (options + primary button) stays on screen. Kept at the END of the file to beat base rules. */
@media (max-width: 720px) {
  /* stats: all three tiles on one row */
  .ship-board .stats.ship-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ship-board .ship-stats .stat__k { overflow-wrap: anywhere; line-height: 1.25; }

  /* toolbar: tabs full width, then filter + refresh, then message + End of day */
  .ship-board .ship-toolbar .ship-tabs { flex: 1 1 100%; }
  .ship-board .ship-tab { flex: 1 1 0; justify-content: center; min-height: 40px; padding: 0 6px; font-size: 13px; }
  .ship-board .ship-toolbar .status-select { flex: 1 1 auto; }
  .ship-board .ship-toolbar .status-select { height: 44px; }
  .ship-board .ship-toolbar .status-select select { flex: 1 1 auto; align-self: stretch; }
  .ship-board .ship-refresh { min-height: 40px; }
  .ship-board .ship-toolbar .ship-toolbar__right { flex: 1 1 100%; margin-left: 0; flex-wrap: wrap; }
  .ship-board .ship-msg { flex: 1 1 100%; overflow-wrap: anywhere; font-size: 12.5px; }
  .ship-board .ship-eod { flex: 1 1 100%; min-height: 44px; white-space: normal; font-size: 13px; }

  /* shipment cards */
  .scards { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
  .scard { background: var(--panel); border: 1px solid var(--rule); border-radius: var(--radius); padding: 10px 12px 12px; min-width: 0;
    display: flex; flex-direction: column; gap: 6px; overflow-wrap: anywhere; }
  .scard__top { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 8px; }
  .scard__no { font: 700 15px var(--font-mono); color: var(--txt); min-width: 0; }
  .scard__date { margin-left: auto; font: 11px var(--font-mono); color: var(--txt-2); white-space: nowrap; }
  .scard__name { font-weight: 600; font-size: 14px; line-height: 1.3; }
  .scard__loc { font-size: 12px; color: var(--txt-2); margin-top: 1px; }
  .scard__track { margin: -6px 0; }
  .scard__track a { display: inline-flex; align-items: center; min-height: 40px; font: 600 13px var(--font-mono); color: var(--mint-ink); text-decoration: underline; word-break: break-all; }
  .scard__track .dim { font-size: 12px; }
  .scard__meta { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12px; color: var(--txt-2); }
  .scard__acts { display: flex; gap: 8px; margin-top: 2px; }
  .scard__acts .btn { flex: 1 1 0; min-width: 0; min-height: 40px; }
  .scard__acts .btn:disabled { opacity: .45; }

  /* manifests table → cards: number + PDF button, then created / orders */
  table.ship-mft, .ship-mft tbody { display: block; }
  .ship-mft thead { display: none; }
  .ship-mft tbody { display: flex; flex-direction: column; gap: 8px; }
  .ship-mft tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: 10px; row-gap: 2px;
    background: var(--panel); border: 1px solid var(--rule); border-radius: var(--radius); padding: 10px 12px; }
  .ship-mft td { display: block; padding: 0; width: auto !important; min-width: 0 !important; font-size: 12.5px; overflow-wrap: anywhere; }
  .ship-mft td:nth-child(1) { grid-column: 1; grid-row: 1; font-size: 15px; font-weight: 700; }
  .ship-mft td:nth-child(2) { grid-column: 1; grid-row: 2; }
  .ship-mft td:nth-child(3) { grid-column: 1; grid-row: 3; }
  .ship-mft td:nth-child(4) { grid-column: 2; grid-row: 1 / span 3; text-align: right; }
  .ship-mft td:nth-child(2)::before, .ship-mft td:nth-child(3)::before { content: attr(data-label) " "; color: var(--txt-2); }
  .ship-mft .btn { min-height: 40px; }

  /* ---- Create-label modal ---- */
  .modal.ship-mdl { max-height: calc(100vh - 20px); max-height: calc(100dvh - 20px); }
  .ship-mdl .modal__head { gap: 8px; padding: 10px 12px 10px 14px; }
  .ship-mdl .modal__head h3 { min-width: 0; overflow-wrap: anywhere; }
  .ship-mdl .modal__head .icon-btn { width: 40px; height: 40px; flex: none; }
  .ship-mdl .modal__body { padding: 12px; min-height: 0; }
  .ship-mdl .ship-applyall { flex-wrap: wrap; }
  .ship-mdl .ship-applyall .kick { flex: 1 1 100%; }
  .ship-mdl .ship-applyall .rm-in { flex: 1 1 100px; min-width: 0; }
  .ship-mdl .ptype-btn--sm { min-height: 40px; padding: 0 12px; font-size: 13px; }
  .ship-mdl .rm-in, .ship-mdl select.rm-in { min-height: 40px; font-size: 16px; border-radius: 8px; }

  /* order table → one card per order */
  .ship-mdl table.ship-tbl, .ship-mdl .ship-tbl tbody { display: block; }
  .ship-mdl .ship-tbl thead { display: none; }
  .ship-mdl .ship-tbl tr { display: block; border: 1px solid var(--rule); border-radius: var(--radius); padding: 12px; margin-bottom: 10px; }
  .ship-mdl .ship-tbl td { display: block; padding: 0; border: 0; width: auto !important; min-width: 0 !important; max-width: none !important; overflow-wrap: anywhere; }
  .ship-mdl .ship-tbl td + td { margin-top: 12px; }
  .ship-mdl .ship-tbl td[data-label]::before { content: attr(data-label); display: block; margin-bottom: 4px;
    font: 700 10px var(--font-mono); letter-spacing: .05em; text-transform: uppercase; color: var(--txt-2); }
  .ship-mdl .ship-tbl td.ship-mdl__hs.is-na { display: flex; align-items: baseline; gap: 8px; }
  .ship-mdl .ship-tbl td.ship-mdl__hs.is-na::before { display: inline; margin: 0; }
  .ship-mdl__ord { font-size: 15px; font-weight: 700; }
  .ship-mdl__to > div:first-child { font-size: 14px !important; }
  .ship-mdl__to > div { font-size: 12px !important; }
  .ship-mdl .ship-lines { display: block; -webkit-line-clamp: unset; overflow: visible; font-size: 12px; }
  .ship-mdl .combined-note { display: flex; flex-wrap: wrap; font-size: 12px; }
  .ship-mdl .late-rec__btn { min-height: 40px; }
  .ship-mdl .req-svc { font-size: 12px; }
  .ship-mdl .ptype-btn:not(.ptype-btn--sm) { min-width: 0; min-height: 84px; flex: 1 1 0; font-size: 13px; }
  .ship-mdl .ptype-btn:not(.ptype-btn--sm) svg { width: 40px; height: 40px; }
  .ship-mdl .ptype-picker__svcs { row-gap: 14px; margin-top: 14px; }
  .ship-mdl .svc-chip { flex: 1 1 88px; min-height: 60px; padding: 10px 12px; }
  .ship-mdl__def, .ship-mdl__chk { min-height: 40px; font-size: 12px !important; }
  .ship-mdl input[type="checkbox"] { width: 20px; height: 20px; flex: none; margin: 0; }
  .ship-mdl__hsrow .rm-in { width: auto !important; min-width: 0; flex: 1 1 90px; }
  .ship-mdl__hsrow .rm-in:nth-child(2) { flex-basis: 100%; order: 3; }
  .ship-mdl__biz { flex-wrap: wrap; font-size: 12px !important; }
  .ship-mdl__biz select.rm-in { width: 90px !important; }

  /* footer: options stacked, then Cancel + primary side by side; stays visible below the scrolling body */
  .ship-mdl .modal__foot { flex-direction: column; align-items: stretch; gap: 8px; padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px)); }
  .ship-mdl .modal__foot > div { flex: none; }
  .ship-mdl__opts { gap: 2px !important; }
  .ship-mdl__opts > .kick { font-family: inherit; text-transform: none; letter-spacing: 0; color: var(--txt-2); }
  .ship-mdl__chk { color: var(--txt) !important; font-weight: 600; }
  .ship-mdl__print { flex-wrap: wrap; font-size: 12px; }
  .ship-mdl__print select.rm-in { flex: 1 1 160px; width: auto; min-width: 0; }
  .ship-mdl__opts > .kick:last-child { font-size: 11px; }
  .ship-mdl__btns .btn { min-height: 44px; font-size: 14px; white-space: normal; }
  .ship-mdl__btns .btn--ghost { flex: 0 1 auto; }
  .ship-mdl__btns .btn--primary { flex: 1 1 0; min-width: 0; }
}

/* ===== Google Reviews on phones (#/reviews, views-reviews.jsx) =====
   Desktop is untouched: the rv-* classes have no desktop styles (the view is inline-styled),
   so every rule here sits inside the 720px query and uses !important to beat the inline styles.
   ≤720px the 4-column review rows stack into cards, header buttons/banners/tabs wrap,
   tap targets are ≥40px, long names/emails/codes wrap and the modals scroll with 16px inputs.
   Kept at the END of the file so it beats the base rules. */
.rv-card__more { display: inline-flex; align-items: center; min-height: 40px; padding: 0; background: none; border: 0;
  color: var(--mint-ink, #047857); font-size: 13px; font-weight: 600; cursor: pointer; text-decoration: underline; }
@media (max-width: 720px) {
  .rv-page { padding: 12px 12px 60px !important; min-width: 0; overflow-wrap: anywhere; }

  /* header: title, then the action buttons wrap 2-up, Sync full width */
  .rv-head { flex-wrap: wrap; gap: 12px; margin-bottom: 14px !important; }
  .rv-head__title { flex: 1 1 100%; min-width: 0; }
  .rv-head__acts { flex: 1 1 100%; margin-left: 0 !important; flex-wrap: wrap; }
  .rv-head__acts > * { flex: 1 1 calc(50% - 4px); min-width: 0; }
  .rv-hbtn { justify-content: center; min-height: 44px; padding: 8px 10px !important; white-space: normal; text-align: center; line-height: 1.2; }
  .rv-hbtn--sync { flex: 1 1 100% !important; order: -1; }
  .rv-share { display: flex !important; }
  .rv-share__copy { flex: 1 1 auto; justify-content: center; min-height: 44px; min-width: 0; padding: 8px 10px !important; }
  .rv-share__open { flex: none; justify-content: center; min-width: 44px; padding: 0 !important; }

  /* GBP / info banners: text, then the button full width */
  .rv-banner { flex-wrap: wrap; align-items: flex-start !important; }
  .rv-banner > span[style*="flex: 1"] { flex: 1 1 0 !important; min-width: 0; }
  .rv-banner__btn { flex: 1 1 100%; display: inline-flex !important; align-items: center; justify-content: center;
    min-height: 40px; white-space: normal !important; text-align: center; }

  /* filter tabs wrap */
  .rv-tabs { flex-wrap: wrap; gap: 0 !important; }
  .rv-tab { flex: 1 1 auto; min-height: 44px; padding: 6px 3px !important; font-size: 13px !important; }
  .rv-tab > span { margin-left: 3px !important; padding: 1px 5px !important; }

  /* review rows -> stacked cards */
  .rv-colhead { display: none !important; }
  .rv-card { grid-template-columns: minmax(0, 1fr) !important; gap: 10px !important; padding: 12px 12px 10px !important; margin-bottom: 10px !important; }
  .rv-card > * { min-width: 0; }
  .rv-card__who { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
  .rv-card__name { flex: 1 1 100%; font-size: 15px !important; line-height: 1.3; margin: 0 !important; }
  .rv-card__date, .rv-card__pill, .rv-card__fu { margin: 0 !important; }
  .rv-card__date { font-size: 12px !important; }
  .rv-card__fu { flex: 1 1 100%; font-size: 11px !important; }
  .rv-card__text { font-size: 14px !important; }
  .rv-card__cust, .rv-card__disc { border-top: 1px solid #f3f4f6; padding-top: 10px; }
  .rv-card__cust[data-label]::before, .rv-card__disc[data-label]::before { content: attr(data-label); display: block; margin-bottom: 4px;
    font-size: 10px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: #9ca3af; }
  .rv-card__cname { font-size: 14px !important; }
  .rv-card__cust .rv-ghost { margin-left: -10px; }
  .rv-card__linkbtn { min-height: 44px; font-size: 14px !important; }
  .rv-card__coderow { gap: 6px !important; }
  .rv-card__code { font-size: 14px !important; word-break: break-all; }
  .rv-card__coderow .copybtn { display: inline-flex; align-items: center; gap: 5px; width: auto; height: 40px; padding: 0 10px;
    border: 1px solid var(--rule, #e5e7eb); border-radius: 8px; color: var(--txt-2, #6b7280); font-size: 13px; }
  .rv-card__coderow .copybtn svg { width: 15px; height: 15px; }
  /* the two copy buttons are icon-only on desktop (title tooltips); on touch there is no tooltip, so name them */
  .rv-card__coderow .copybtn:nth-of-type(1)::after { content: "Code"; }
  .rv-card__coderow .copybtn:nth-of-type(2)::after { content: "Link"; }
  .rv-card__admin { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px;
    font-size: 15px !important; border: 1px solid var(--rule, #e5e7eb); border-radius: 8px; text-decoration: none !important; }
  .rv-card__primary .rv-mint { width: 100%; justify-content: center; min-height: 44px; font-size: 14px !important; }
  .rv-card__acts { gap: 6px !important; margin-top: 4px !important; }
  .rv-ghost { min-height: 40px; padding: 0 10px !important; font-size: 13px !important; border-radius: 8px !important; }
  .rv-card__acts .rv-ghost { flex: 1 1 auto; justify-content: center; border: 1px solid var(--rule, #e5e7eb) !important; }
  .rv-card__acts .rv-ghost--danger { border-color: #fecaca !important; }

  /* inline note editor */
  .rv-note { flex-direction: column; padding: 10px !important; }
  .rv-note textarea { font-size: 16px !important; min-height: 80px; }
  .rv-note .btn { min-height: 44px; align-self: stretch !important; font-size: 14px !important; }

  /* modals (Link customer, Add review): fit the screen and scroll, 16px inputs, 44px buttons */
  .modal.rv-mdl { padding: 14px 14px 0 !important; max-height: calc(100vh - 20px); max-height: calc(100dvh - 20px); overflow-y: auto; overscroll-behavior: contain; }
  .rv-mdl__manual { margin-bottom: calc(14px + env(safe-area-inset-bottom, 0px)); }
  .rv-mdl__head { gap: 8px; margin-bottom: 14px !important; }
  .rv-mdl__head > :first-child { min-width: 0; overflow-wrap: anywhere; }
  .rv-mdl__head .icon-btn { width: 40px; height: 40px; flex: none; }
  .rv-mdl input, .rv-mdl textarea, .rv-mdl select { font-size: 16px !important; min-height: 44px; }
  .rv-mdl textarea { min-height: 88px; }
  .rv-mdl .btn { min-height: 44px; font-size: 14px !important; }
  .rv-mdl__search .input { min-width: 0; }
  .rv-mdl__go { flex: none; min-width: 84px; }
  .rv-mdl__results { max-height: 40vh !important; }
  .rv-mdl__res { flex-wrap: wrap; }
  .rv-mdl__resname { white-space: normal !important; overflow-wrap: anywhere; font-size: 14px !important; }
  .rv-mdl__resmail { overflow-wrap: anywhere; font-size: 12px !important; }
  .rv-mdl__res .rv-mint { min-height: 40px; min-width: 64px; justify-content: center; font-size: 13px !important; }
  .rv-mdl__manual { gap: 8px !important; }
  .rv-mdl__manual .input { flex: 1 1 100% !important; min-width: 0 !important; }
  .rv-mdl__manual .rv-mint { flex: 1 1 100%; justify-content: center; min-height: 44px; font-size: 14px !important; }
  .rv-mdl__stars { gap: 2px !important; }
  .rv-mdl__stars button { min-width: 44px; min-height: 44px; font-size: 26px !important; padding: 0 !important; }
  /* Save / Cancel stay reachable at the bottom of the scrolling modal */
  .rv-mdl__foot { position: sticky; bottom: 0; background: #fff; margin: 4px -14px 0 !important; padding: 10px 14px calc(14px + env(safe-area-inset-bottom, 0px)) !important; border-top: 1px solid #f3f4f6; }
  .rv-mdl__foot > * { flex: 1 1 0; justify-content: center; min-height: 44px; font-size: 14px !important; }
}

/* ---- Kai draft replies (inbox thread view) ---- */
.kai-drafts { margin: 4px 0 14px; display: flex; flex-direction: column; gap: 10px; }
.kai-card { background: #fff; border: 1.5px dashed #e3b341; border-radius: 10px; }
.kai-card--err { padding: 8px 12px; font-size: 12px; color: #c0392b; }
.kai-card--done { border: 1px solid var(--rule); border-style: solid; }
.kai-card--done summary { cursor: pointer; display: flex; align-items: center; gap: 8px; padding: 9px 12px; font-size: 12.5px; list-style: none; flex-wrap: wrap; }
.kai-card--done summary::-webkit-details-marker { display: none; }
.kai-card__hd { display: flex; align-items: center; gap: 10px; padding: 10px 14px 0; flex-wrap: wrap; }
.kai-pill { display: inline-block; font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 999px; background: #fff4d6; color: #8a5a00; }
.kai-pill--sent { background: var(--mint-wash); color: var(--mint-ink); }
.kai-pill--discarded { background: var(--paper-2); color: var(--txt-2); border: 1px solid var(--rule); }
.kai-card__who { font-size: 11.5px; color: var(--txt-2); }
.kai-card__subj { font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.kai-card__meta { padding: 8px 14px 0; font-size: 12.5px; display: flex; flex-direction: column; gap: 4px; }
.kai-card__meta .k { display: inline-block; min-width: 64px; color: var(--txt-2); font-size: 11px; text-transform: uppercase; letter-spacing: .03em; }
.kai-card__subjin { width: 100%; font: inherit; font-weight: 600; padding: 6px 8px; border: 1px solid var(--rule); border-radius: 6px; }
.kai-card__body { padding: 10px 14px; font-size: 13.5px; line-height: 1.6; overflow-wrap: anywhere; }
.kai-card__text { white-space: pre-wrap; }
.kai-card__editor { min-height: 140px; border: 1px solid var(--mint-ink); border-radius: 6px; padding: 8px 10px; outline: none; background: #fff; }
.kai-card__ta { width: 100%; min-height: 180px; font: inherit; line-height: 1.55; padding: 8px 10px; border: 1px solid var(--mint-ink); border-radius: 6px; resize: vertical; }
.kai-card__atts { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 14px 10px; }
.kai-card__atts a.att-chip { text-decoration: none; color: inherit; }
.kai-card__err { margin: 0 14px 8px; font-size: 12px; color: #c0392b; white-space: pre-wrap; }
.kai-card__foot { display: flex; align-items: center; gap: 8px; padding: 10px 14px 12px; border-top: 1px solid var(--rule); flex-wrap: wrap; }
.kai-card__foot .right { margin-left: auto; }
.kai-card__discard { color: #c0392b; }
.kai-tag { background: #fff4d6 !important; color: #8a5a00 !important; border-color: #f0d68a !important; }
@media (max-width: 640px) {
  .kai-card__foot .btn { flex: 1 1 auto; justify-content: center; min-height: 40px; }
  .kai-card__foot .right { margin-left: 0; width: 100%; text-align: center; }
  .kai-card__meta .k { min-width: 0; margin-right: 4px; }
  .kai-card--done summary .kai-card__who { width: 100%; }
}
/* Hand to Kai */
.kai-hand { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 10px 0; }
.kai-hand__meta { font-size: 11.5px; }
.kai-hand__err { font-size: 12px; color: var(--c-red); }
@media (max-width: 560px) { .kai-hand .btn { min-height: 40px; } }


/* Inbox "Handed to Kai" filter + per-row Kai status chips */
.inbox__seg { flex-wrap: wrap; }
.kai-seg__n { display: inline-block; margin-left: 5px; min-width: 16px; padding: 0 4px; border-radius: 999px; background: var(--paper-3, #e8e5dc); color: var(--txt); font-size: 10px; line-height: 16px; text-align: center; }
.inbox__seg button.is-active .kai-seg__n { background: rgba(255,255,255,.22); color: #fff; }
.inbox__seg button.kai-seg--attn .kai-seg__n { background: var(--c-amber); color: #fff; }
.ti__labels { flex-wrap: wrap; }
.tag.kai-st { font-weight: 600; border: 1px solid transparent; }
.tag.kai-st--pending { background: var(--c-amber-w) !important; color: #8a5a00 !important; border-color: #f0d68a !important; }
.tag.kai-st--working { background: var(--c-blue-w) !important; color: #1d4dad !important; border-color: #c9d9fb !important; }
.tag.kai-st--replied { background: var(--c-red-w) !important; color: #b32a1f !important; border-color: #f6c3be !important; }
.tag.kai-st--sent    { background: var(--c-green-w) !important; color: #137a40 !important; border-color: #bfe6cc !important; }
@media (max-width: 560px) {
  .inbox__seg { gap: 6px; }
  .inbox__seg button { padding: 8px 10px; font-size: 12px; }
}

/* ===== Inbox v2 ===== */
/* Spec: dtfukheadless/.claude/specs/crm-inbox-spec.md. Everything is scoped to .inbox--v2 (or
   inbox-only classes) so desktop elsewhere in the CRM is unchanged. Inside the inbox the muted
   text token is raised to AA (#6b7077, 4.9:1 on white) instead of --txt-3 (#8A8E94, 3.4:1). */
.inbox--v2 {
  --txt-3: #6b7077; --meta: #6b7077;
  --blue-ink: #1d4dad; --red-ink: #b32a1f; --green-ink: #137a40; --amber-ink: #8a5a00; --note: #fff8e6;
  display: grid; grid-template-columns: 340px minmax(0,1fr) 300px; height: 100%; min-height: 0; position: relative;
}
.inbox--v2 .dim, .inbox--v2 .kick { color: var(--meta); }
.inbox--v2 > .inbox__list { display: flex; flex-direction: column; min-height: 0; min-width: 0; overflow: hidden; position: relative; max-height: none; border-bottom: 0; border-right: 1px solid var(--rule); }
.inbox--v2 .inbox__listhead { position: static; padding: 10px 12px 8px; display: flex; flex-direction: column; align-items: stretch; gap: 8px; flex: none; z-index: auto; }
.inbox__search { display: flex; align-items: center; gap: 8px; background: var(--paper); border: 1px solid var(--rule); border-radius: 8px; padding: 0 10px; height: 36px; color: var(--txt-2); }
.inbox__search:focus-within { border-color: var(--ink-3); box-shadow: 0 0 0 3px rgba(11,12,14,.05); }
.inbox__search input { border: 0; background: none; outline: none; font-size: 13px; width: 100%; min-width: 0; }
.inbox__search .kbd-hint { flex: none; }
.inbox__filters { display: flex; gap: 6px; flex-wrap: wrap; }
.inbox__filters::-webkit-scrollbar { display: none; }
.inbox--v2 .chip-filter { white-space: nowrap; min-height: 32px; }
.inbox--v2 .chip-filter .seg__n { margin-left: 0; }
.inbox--v2 .chip-filter.is-on .seg__n { background: rgba(255,255,255,.22); color: #fff; }
.seg__n--attn { background: var(--c-amber-w); color: #8a5a00; border: 1px solid #f0d68a; }
.inbox--v2 .chip-filter.is-on .seg__n--attn { background: #fff1c2; color: #8a5a00; }
.inbox__tools { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--txt-2); }
.inbox__tools .right { margin-left: auto; display: flex; gap: 10px; align-items: center; white-space: nowrap; }
.inbox__sel-all { display: inline-flex; align-items: center; gap: 6px; min-height: 28px; cursor: pointer; }
.inbox__sort { font-family: var(--font-mono); font-size: 11px; font-weight: 600; border: 1px solid var(--rule); border-radius: 6px; padding: 4px 8px; background: #fff; min-height: 28px; }
.inbox__rows { overflow-y: auto; flex: 1; min-height: 0; position: relative; }
.inbox__bulk { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; background: var(--ink); color: #fff; border-radius: 9px; padding: 6px 6px 6px 12px; font-size: 12.5px; font-weight: 600; }
.inbox__bulk .btn--ghost { background: #22262c; border-color: #33383f; color: #fff; }
.inbox__bulk .icon-btn { background: #22262c; border-color: #33383f; color: #fff; }
.inbox__bulk .right { margin-left: auto; }
.inbox__banner { display: flex; align-items: center; gap: 8px; padding: 8px 12px; font-size: 12px; border-bottom: 1px solid var(--rule); flex: none; }
.inbox__banner--offline { background: #f2f1ec; color: var(--txt); }
.inbox__banner--err { background: var(--c-red-w); color: #b32a1f; }
.inbox__banner .right { margin-left: auto; }
.ibx-link { color: var(--mint-ink); font-weight: 700; font-size: 12px; text-decoration: underline; text-underline-offset: 2px; background: none; border: 0; padding: 0; cursor: pointer; }
.ibx-right { margin-left: auto; }
.ibx-grow { flex: 1; min-width: 0; }
.ibx-minw { min-width: 0; }
.ibx-col { display: flex; flex-direction: column; min-width: 0; text-align: left; }
.ibx-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ibx-rel { position: relative; display: inline-flex; }
.ibx-rel--block { display: block; }
.ibx-gap { gap: 8px; }
.ibx-mt { margin-top: 8px; }
.ibx-small { font-size: 11.5px; }
.ibx-err { color: #b32a1f; }
.ibx-trunc { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ibx-kick { margin: 10px 0 4px; }
.ibx-errline { font-size: 11.5px; }
.ibx-check { display: flex; gap: 7px; align-items: center; font-size: 12px; cursor: pointer; margin-top: 8px; }
.ibx-check--sub { margin-left: 22px; margin-top: 4px; }
.ibx-block { display: flex; width: 100%; text-align: left; }

/* thread rows */
.inbox--v2 .ti-swipe { position: relative; overflow: hidden; border-bottom: 1px solid var(--rule); }
.inbox--v2 .thread-item { position: relative; display: flex; gap: 10px; padding: 11px 12px 11px 14px; border-bottom: 0; background: #fff; transition: transform .18s ease; }
.inbox--v2 .thread-item:hover { background: #fbfaf7; }
.inbox--v2 .thread-item.is-active { background: var(--mint-wash); box-shadow: inset 3px 0 0 var(--mint-ink); }
.inbox--v2 .thread-item.is-selected { background: #f3f7ff; }
.inbox--v2 .thread-item.is-cursor { box-shadow: inset 0 0 0 2px var(--ink-3); }
.inbox--v2 .thread-item.unread .ti__from::after { display: none; }
.inbox--v2 .thread-item.unread .ti__from, .inbox--v2 .thread-item.unread .ti__subj { font-weight: 700; }
.inbox--v2 .thread-item.unread .ti__time { color: var(--txt); font-weight: 600; }
.ti__rail { position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; }
.ti__rail.urg--sd { background: var(--c-red); }
.ti__rail.urg--rm24 { background: var(--c-amber); }
.inbox--v2 .thread-item.is-active .ti__rail { display: none; }
.ti__sel { flex: none; width: 20px; display: grid; place-items: start center; padding-top: 1px; cursor: pointer; }
.ti__sel input { width: 16px; height: 16px; margin: 0; accent-color: var(--ink); cursor: pointer; }
.ti__main { flex: 1; min-width: 0; }
.inbox--v2 .ti__top { display: flex; align-items: center; gap: 6px; margin-bottom: 2px; min-width: 0; }
.ti__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--mint-ink); flex: none; }
.inbox--v2 .ti__from { font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; flex: 0 1 auto; }
.ti__co { font-size: 12px; color: var(--meta); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; flex: 1 1 0; }
.ti__icons { display: flex; gap: 4px; color: var(--meta); flex: none; }
.ti__icons svg { width: 13px; height: 13px; }
.inbox--v2 .ti__time { font-family: var(--font-mono); font-size: 10.5px; color: var(--meta); flex: none; }
.inbox--v2 .ti__subj { font-size: 12.5px; margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.inbox--v2 .ti__count { color: var(--meta); font-weight: 400; }
.inbox--v2 .ti__prev { font-size: 12px; color: var(--txt-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.inbox--v2 .ti__labels { display: flex; gap: 4px; margin-top: 6px; flex-wrap: wrap; }
.inbox--v2 .ti__labels:empty { display: none; }
.ti-chip { display: inline-flex; align-items: center; gap: 4px; font-family: var(--font-mono); font-size: 10px; font-weight: 600; padding: 2px 6px; border-radius: 5px; background: #fff; border: 1px solid var(--rule-2); color: var(--txt); white-space: nowrap; }
.ti-chip svg { width: 11px; height: 11px; color: var(--meta); }
.ti-chip--unlinked { border-style: dashed; color: var(--txt-2); background: transparent; }
.ti-urg { display: inline-flex; align-items: center; gap: 4px; font-family: var(--font-mono); font-size: 10px; font-weight: 700; padding: 2px 6px; border-radius: 5px; white-space: nowrap; }
.ti-urg--red { background: var(--c-red-w); color: #b32a1f; }
.ti-urg--amber { background: var(--c-amber-w); color: #8a5a00; }
.ti-urg svg { width: 11px; height: 11px; }
@media (min-width: 721px) {
  .inbox--v2 .inbox__rows:not(.has-sel) .thread-item:not(:hover):not(:focus-within) .ti__sel input { opacity: 0; }
}
/* swipe (phone) */
.ti-swipe__acts { position: absolute; right: 0; top: 0; bottom: 0; display: flex; }
.ti-swipe__lead { position: absolute; left: 0; top: 0; bottom: 0; display: flex; }
.ti-swipe:not([data-dir="right"]) .ti-swipe__lead, .ti-swipe[data-dir="right"] .ti-swipe__acts { visibility: hidden; }
.ti-swipe__act { width: 88px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-size: 11.5px; font-weight: 700; color: #fff; border: 0; }
.ti-swipe__act svg { width: 18px; height: 18px; }
.ti-swipe__act--kai { background: var(--ink); }
.ti-swipe__act--link { background: #3d4249; }
.ti-swipe__act--read { background: var(--mint-ink); width: 120px; }
.ti-swipe.is-open .thread-item { box-shadow: 8px 0 16px -10px rgba(0,0,0,.25); }
.skel-trow { padding: 12px 14px; border-bottom: 1px solid var(--rule); display: flex; flex-direction: column; gap: 7px; }
.inbox--v2 .empty { height: auto; flex: 1; padding: 32px 20px; color: var(--txt-2); gap: 10px; }
.inbox--v2 .empty > svg { width: 36px; height: 36px; opacity: .55; }
.inbox--v2 .empty .t { color: var(--txt); }
.inbox--v2 .empty .m { line-height: 1.5; }
.inbox--v2 .empty .acts { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.inbox--v2 .empty .btn svg { width: 15px; height: 15px; opacity: 1; }
.inbox--v2 .btn:disabled, .ibx-overlay .btn:disabled { background: #eeeeec; color: #5a5f66; box-shadow: none; border: 1px solid var(--rule); cursor: default; transform: none; opacity: 1; }
.btn--danger { background: #fff; border: 1px solid #f6c3be; color: #b32a1f; }
.btn--danger:hover { background: var(--c-red-w); }
.icon-btn--bare { border-color: transparent; background: transparent; }
.icon-btn:focus-visible, .chip-filter:focus-visible, .inbox--v2 button:focus-visible { outline: 2px solid var(--ink-3); outline-offset: 2px; }

/* conversation */
.inbox--v2 .conv { display: flex; flex-direction: column; min-width: 0; min-height: 0; overflow: hidden; background: var(--paper); }
.inbox--v2 .conv__head { padding: 10px 16px; border-bottom: 1px solid var(--rule); background: var(--paper-2); flex: none; position: relative; z-index: 3; }
.conv__row1 { display: flex; align-items: center; gap: 8px; min-width: 0; }
.conv__back { flex: none; }
.inbox--v2 .conv__subj { margin: 0; font-family: var(--font-display); font-weight: 800; font-size: 16px; letter-spacing: -.01em; min-width: 0; overflow: hidden; flex: 1; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.25; overflow-wrap: anywhere; }
.conv__tools { display: flex; gap: 6px; align-items: center; flex: none; position: relative; }
.conv__panelbtn { display: none; }
.conv__panelbtn.is-on { background: var(--ink); color: #fff; border-color: var(--ink); }
.conv__ctx { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: 8px; min-width: 0; }
.conv__ctx::-webkit-scrollbar { display: none; }
.ctx-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 30px; padding: 3px 9px 3px 4px; border: 1px solid var(--rule-2); border-radius: 999px; background: #fff; font-size: 12px; font-weight: 600; max-width: 100%; min-width: 0; color: var(--txt); }
.ctx-chip:hover { border-color: var(--ink-3); }
.ctx-chip .av { width: 22px; height: 22px; border-radius: 50%; background: var(--ink); color: var(--mint); display: grid; place-items: center; font-family: var(--font-mono); font-size: 9.5px; font-weight: 700; flex: none; }
.ctx-chip .nm { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.ctx-chip .m { font-family: var(--font-mono); font-size: 10.5px; color: var(--meta); font-weight: 500; white-space: nowrap; }
.ctx-chip .urg-rail { width: 4px; height: 14px; border-radius: 3px; display: inline-block; }
.ctx-chip--order { padding-left: 9px; }
.ctx-chip--missing { border-style: dashed; color: var(--txt-2); background: transparent; padding-left: 9px; }
.ctx-chip--missing svg { width: 13px; height: 13px; }
.conv__email { font-family: var(--font-mono); font-size: 11px; color: var(--meta); overflow-wrap: anywhere; }
.conv__suggest { margin-top: 6px; font-size: 12px; color: var(--txt-2); }
.inbox--v2 .conv__scroll { flex: 1; overflow-y: auto; padding: 14px 16px; min-height: 0; background: var(--paper); }
.inbox--v2 .msg { margin-bottom: 10px; }
.inbox--v2 .msg__head { padding: 10px 14px; }
.inbox--v2 .msg__body { padding: 12px 14px; }
.inbox--v2 .msg__addr, .inbox--v2 .msg__time { font-size: 10.5px; color: var(--meta); overflow-wrap: anywhere; }
.inbox--v2 .msg__time { flex: none; }
.msg__av.kai { background: #fff1c2; color: #8a5a00; }
.msg--collapsed { display: flex; align-items: center; gap: 10px; padding: 9px 14px; min-height: 44px; width: 100%; text-align: left; background: #fff; border: 1px solid var(--rule); border-radius: 10px; cursor: pointer; }
.msg--collapsed.out { background: var(--mint-wash); border-color: #c6efe0; }
.msg--collapsed .msg__av { width: 24px; height: 24px; font-size: 9.5px; }
.msg__snip { flex: 1; min-width: 0; font-size: 12.5px; color: var(--txt-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.msg__snip b { color: var(--txt); font-weight: 600; }
.msg__older { display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; min-height: 36px; font-size: 12px; font-weight: 600; color: var(--txt-2); border: 1px dashed var(--rule-2); border-radius: 8px; margin-bottom: 10px; background: transparent; cursor: pointer; }
.msg__quote { display: inline-flex; align-items: center; gap: 6px; min-height: 28px; padding: 2px 10px; border-radius: 6px; background: #f2f1ec; border: 1px solid var(--rule); font-family: var(--font-mono); font-size: 11px; font-weight: 600; color: var(--txt-2); cursor: pointer; white-space: nowrap; }
.att-thumbs { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 14px 12px; }
.att-thumb { width: 112px; border: 1px solid var(--rule); border-radius: 8px; overflow: hidden; background: #fff; display: flex; flex-direction: column; padding: 0; text-align: left; cursor: zoom-in; }
.att-thumb__img { height: 84px; background: repeating-linear-gradient(45deg,#f0eee7,#f0eee7 6px,#f8f7f3 6px,#f8f7f3 12px); display: grid; place-items: center; position: relative; overflow: hidden; }
.att-thumb__img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.att-thumb__nm { font-size: 11px; font-weight: 600; padding: 5px 7px 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.att-thumb__m { font-family: var(--font-mono); font-size: 10px; color: var(--meta); padding: 0 7px 6px; display: block; }
.att-thumb__more { position: absolute; inset: 0; background: rgba(11,12,14,.6); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 15px; }

/* Kai */
.kai-card--pinned { border: 1.5px solid #e3b341; box-shadow: 0 8px 24px -14px rgba(138,90,0,.45); margin-bottom: 12px; }
.inbox--v2 .kai-pill { display: inline-flex; align-items: center; gap: 5px; }
.inbox--v2 .kai-pill svg { width: 12px; height: 12px; }
.kai-card__why { margin: 8px 14px 0; padding: 8px 10px; border-radius: 8px; background: #fffaf0; border: 1px solid #f3e2b3; font-size: 12.5px; line-height: 1.45; display: flex; gap: 10px; align-items: flex-start; }
.kai-card__why .lbl { font-family: var(--font-mono); font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #8a5a00; flex: none; padding-top: 2px; }
.kai-conf { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-mono); font-size: 10.5px; font-weight: 700; color: var(--txt); white-space: nowrap; }
.kai-conf__bar { width: 44px; height: 6px; border-radius: 3px; background: var(--rule); overflow: hidden; display: inline-block; }
.kai-conf__bar i { display: block; height: 100%; background: var(--mint-ink); }
.kai-conf--low .kai-conf__bar i { background: var(--c-amber); }
.kai-card__stale { margin: 8px 14px 0; padding: 8px 10px; border-radius: 8px; background: var(--c-red-w); color: #b32a1f; font-size: 12.5px; font-weight: 600; display: flex; gap: 8px; align-items: flex-start; }
.kai-card__stale svg { flex: none; margin-top: 1px; }
.ibx-modal .kai-card__stale { margin: 10px 0 0; }
.kai-card__body--clamp { max-height: 132px; overflow: hidden; position: relative; }
.kai-card__body--clamp::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 40px; background: linear-gradient(transparent, #fff); }
.kai-card__more { margin: 0 14px 8px; font-size: 12px; font-weight: 700; color: var(--mint-ink); min-height: 32px; display: inline-flex; align-items: center; background: none; border: 0; padding: 0; cursor: pointer; }
.kai-card__keys { font-size: 11.5px; color: var(--txt-2); display: inline-flex; gap: 5px; align-items: center; }
.kai-card__err { color: #b32a1f; }
.kai-diff { line-height: 1.7; }
.kai-diff ins { background: #d9f7e8; color: #0a5a3e; text-decoration: none; border-radius: 3px; padding: 0 2px; }
.kai-diff del { background: #fde3e0; color: #b32a1f; border-radius: 3px; padding: 0 2px; }
.kai-seg { display: inline-flex; border: 1px solid var(--rule); border-radius: 7px; overflow: hidden; background: #fff; }
.kai-seg button { font-family: var(--font-mono); font-size: 11px; font-weight: 600; padding: 5px 9px; color: var(--txt-2); min-height: 28px; }
.kai-seg button.on { background: var(--ink); color: #fff; }
.kai-history { border: 1px solid var(--rule); border-radius: 10px; background: #fff; margin-bottom: 12px; }
.kai-history > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; padding: 9px 12px; font-size: 12.5px; font-weight: 600; min-height: 40px; }
.kai-history > summary::-webkit-details-marker, .kai-history__row > summary::-webkit-details-marker { display: none; }
.kai-history[open] > summary svg:last-child { transform: rotate(180deg); }
.kai-history__row { display: block; padding: 8px 12px; border-top: 1px solid var(--rule); font-size: 12px; }
.kai-history__row > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.kai-history__row.ibx-col { gap: 4px; }
.kai-hand-state { display: inline-flex; align-items: center; gap: 6px; position: relative; }
.kai-hand-chip { display: inline-flex; align-items: center; gap: 4px; cursor: pointer; min-height: 30px; font-size: 10.5px; }
.kai-hand-chip svg { width: 12px; height: 12px; }

/* Kai queue */
.kq__head { padding: 12px 16px; background: var(--paper-2); border-bottom: 1px solid var(--rule); display: flex; align-items: center; gap: 10px; flex-wrap: wrap; flex: none; }
.kq__head h2 { font-family: var(--font-display); font-weight: 800; font-size: 16px; margin: 0; }
.kq__head .right { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.kq__prog { height: 4px; background: var(--rule); border-radius: 2px; overflow: hidden; width: 120px; display: inline-block; }
.kq__prog i { display: block; height: 100%; background: var(--mint-ink); }
.kq__prog--full { width: 100%; flex-basis: 100%; }
.kq__cust { background: #fff; border: 1px solid var(--rule); border-radius: 10px; padding: 10px 14px; margin-bottom: 12px; font-size: 13px; line-height: 1.55; }
.kq__cust .hd { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; flex-wrap: wrap; }
.kq__cust .msg__av { width: 24px; height: 24px; font-size: 9.5px; }
.kq__custbody { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 220px; overflow: auto; }
.kq__keys { display: flex; gap: 12px; flex-wrap: wrap; font-size: 11.5px; color: var(--txt-2); padding: 8px 16px; border-top: 1px solid var(--rule); background: var(--paper-2); flex: none; }
.kq__keys > span { display: inline-flex; gap: 4px; align-items: center; }
.kq__sort { display: flex; align-items: center; gap: 6px; padding: 6px 12px; font-size: 11.5px; border-bottom: 1px solid var(--rule); }
.inbox--v2 .kq__item { border-bottom: 1px solid var(--rule); cursor: pointer; }
.kq__item .ti__prev { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.kq__item.is-done { opacity: .7; cursor: default; }

/* composer */
.inbox--v2 .composer { border-top: 1px solid var(--rule); background: var(--paper-2); padding: 10px 16px 12px; flex: none; }
.composer--min { display: flex; align-items: center; gap: 8px; }
.composer--v2 { position: relative; }
.composer__fake { flex: 1; min-width: 0; min-height: 40px; border: 1px solid var(--rule); border-radius: 9px; display: flex; align-items: center; padding: 0 12px; color: var(--txt-2); font-size: 13px; background: #fff; text-align: left; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; cursor: text; }
.inbox--v2 .ai-btn { display: inline-flex; flex: none; min-height: 34px; }
.inbox--v2 .ai-btn svg { color: var(--mint); }
.ai-btn--icon { width: 40px; justify-content: center; padding: 0; }
.composer__hdr { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.composer__line { display: flex; align-items: center; gap: 8px; font-size: 12.5px; min-width: 0; }
.composer__line .k { font-family: var(--font-mono); font-size: 10.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--txt-2); width: 40px; flex: none; }
.composer__from { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--rule-2); border-radius: 7px; padding: 4px 8px; background: #fff; font-family: var(--font-mono); font-size: 12px; font-weight: 600; min-height: 30px; max-width: 100%; cursor: pointer; }
.composer__from svg { width: 12px; height: 12px; }
.inbox--v2 .composer textarea { display: block; min-height: 96px; }
.inbox--v2 .composer__bar { display: flex; align-items: center; gap: 6px; margin: 8px 0 0; flex-wrap: wrap; }
.composer__bar .right { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.composer__err { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 8px; background: var(--c-red-w); color: #b32a1f; font-size: 12.5px; margin-bottom: 8px; }
.composer__err svg { flex: none; }
.inbox--v2 .ai-ask { flex-wrap: wrap; }
.inbox--v2 .ai-ask input { min-width: 200px; }
.ibx-kbd-dark { background: rgba(0,39,26,.12); border-color: rgba(0,39,26,.2); color: #00271a; margin-left: 2px; }
.inbox--v2 .pop.ibx-uppop { bottom: calc(100% + 8px); left: 0; width: 320px; }
.inbox--v2 .pop.ibx-attpop { width: 360px; }
.ibx-frompop { bottom: calc(100% + 6px) !important; top: auto; left: 0; width: 320px !important; }
.ibx-tplpop { bottom: calc(100% + 6px) !important; left: 0; width: 320px !important; }
.inbox--v2 .pop .pop__item { width: 100%; text-align: left; background: #fff; border: 0; border-bottom: 1px solid var(--rule); }
.inbox--v2 .pop .pop__item:last-child { border-bottom: 0; }
.inbox--v2 .pop .pop__item.on { background: var(--mint-wash); }
.inbox--v2 .pop .pop__item svg { width: 15px; height: 15px; flex: none; }
.pop__hd { padding: 9px 12px; font-family: var(--font-mono); font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--txt-2); font-weight: 600; border-bottom: 1px solid var(--rule); background: #fbfaf7; }
.pop__note { padding: 9px 12px; font-size: 11.5px; line-height: 1.45; background: #fff8e6; color: #8a5a00; }
.ibx-check-ic { width: 16px; flex: none; display: inline-grid; place-items: center; }
.ibx-upload { border-bottom: 1px solid var(--rule) !important; }
.ibx-menu { top: calc(100% + 6px); right: 0; left: auto !important; bottom: auto !important; width: 240px !important; z-index: 45; }
.ibx-menu .pop__item:disabled { color: var(--meta); }
.ibx-linkpop { top: calc(100% + 6px); width: 340px; max-width: calc(100vw - 32px); }
.ibx-link-panel .link-box__hd { color: var(--txt); }
.ibx-link-panel .link-box__in { font-size: 13px; padding: 8px 10px; }
.ibx-link-panel .link-box__results { max-height: 240px; }
.ibx-link-panel .link-box__row { flex-direction: row; align-items: center; gap: 10px; width: 100%; min-height: 44px; }
.ibx-link-panel .link-box__row.hi { background: var(--mint-wash); }
.ibx-link-panel .link-box__email { color: var(--meta); }
.ibx-link-panel .msg__av { width: 28px; height: 28px; font-size: 10px; }
.ibx-ordno { font-weight: 700; font-size: 12.5px; min-width: 64px; }

/* customer panel */
.inbox--v2 .ctx { min-height: 0; overflow-y: auto; background: var(--paper-2); border-left: 1px solid var(--rule); }
.inbox--v2 .ctx__sec { padding: 13px 16px; }
.inbox--v2 .ctx__sec h4 { display: flex; align-items: center; gap: 6px; color: var(--txt-2); }
.inbox--v2 .ctx__sec h4 .right { margin-left: auto; text-transform: none; letter-spacing: 0; font-size: 11px; color: var(--mint-ink); font-weight: 700; font-family: var(--font-mono); }
.ctx__close { display: none; }
.ibx-cust { display: flex; gap: 11px; align-items: center; margin-bottom: 12px; }
.ibx-cust__nm { font-weight: 700; font-size: 14px; }
.ibx-stat3 { grid-template-columns: repeat(3, 1fr) !important; }
.ibx-stat3 > div { padding: 8px 10px; }
.ibx-stat3 .v { font-size: 16px; }
.ibx-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.ctx-ord { display: flex; align-items: center; gap: 8px; padding: 7px 0; font-size: 12px; min-height: 36px; background: none; border: 0; cursor: pointer; }
.ctx-ord .ordno { font-family: var(--font-mono); font-weight: 600; font-size: 12px; }
.ctx-ord .amt { margin-left: auto; font-family: var(--font-mono); font-weight: 600; font-size: 11.5px; }
.ibx-ordmeta { display: flex; align-items: center; gap: 6px; font-size: 12px; margin: 2px 0 4px; }
.ibx-ordmeta .urg-rail { width: 4px; height: 14px; border-radius: 3px; display: inline-block; }
.ctx-note { background: #fff8e6; border: 1px solid #f0e0a8; border-radius: 8px; padding: 8px 10px; font-size: 12.5px; line-height: 1.45; margin-bottom: 6px; white-space: pre-wrap; overflow-wrap: anywhere; }
.ctx-note .by { display: block; font-family: var(--font-mono); font-size: 10px; color: var(--txt-2); margin-top: 3px; white-space: normal; }
.ctx-add { width: 100%; border: 1px dashed var(--rule-2); border-radius: 8px; padding: 8px 10px; font-size: 12.5px; color: var(--txt-2); min-height: 36px; text-align: left; background: #fff; cursor: pointer; }
.ibx-notein { width: 100%; min-height: 90px; border: 1px solid var(--rule); border-radius: 8px; padding: 8px 10px; font: inherit; font-size: 13px; resize: vertical; }
.ibx-scrim--ctx { display: none; }

/* sheets, scrims, modal, toast, fab, selbar */
.ibx-scrim { position: fixed; inset: 0; background: rgba(20,22,26,.45); z-index: 80; }
.ibx-scrim--ctx { z-index: 64; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; background: #fff; border-radius: 16px 16px 0 0; z-index: 81; box-shadow: 0 -10px 30px rgba(0,0,0,.18); display: flex; flex-direction: column; max-height: 78vh; max-height: 78dvh; padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px)); }
.sheet__grab { width: 40px; height: 5px; border-radius: 3px; background: var(--rule-2); margin: 8px auto 4px; flex: none; }
.sheet__hd { display: flex; align-items: center; gap: 8px; padding: 6px 16px 10px; border-bottom: 1px solid var(--rule); flex: none; }
.sheet__hd h3 { margin: 0; font-size: 15px; font-family: var(--font-display); font-weight: 800; }
.sheet__body { overflow-y: auto; min-height: 0; }
.sheet__item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 0 18px; min-height: 52px; font-size: 15px; font-weight: 600; border: 0; border-bottom: 1px solid var(--rule); text-align: left; background: #fff; color: var(--txt); }
.sheet__item svg { width: 20px; height: 20px; color: var(--txt-2); }
.sheet__item .m { margin-left: auto; font-size: 12px; font-weight: 500; color: #6b7077; }
.sheet__foot { display: flex; gap: 8px; padding: 10px 16px 0; flex: none; }
.sheet__foot .btn { flex: 1; min-height: 44px; font-size: 14px; }
.ibx-sheetpad { padding: 12px 16px; }
.sheet .ctx.ctx--sheet { display: block !important; position: static; transform: none; visibility: visible; box-shadow: none; width: auto; max-width: none; border: 0; overflow: visible; }
.ibx-modal { max-width: 460px; }
.ibx-modal--sm { max-width: 380px; }
.ibx-modal .modal__body { font-size: 13px; line-height: 1.5; }
.ibx-modal .modal__foot { justify-content: space-between; flex-wrap: wrap; }
.ibx-kv { display: grid; grid-template-columns: 64px 1fr; gap: 6px 10px; font-size: 12.5px; }
.ibx-kv .k { font-family: var(--font-mono); font-size: 10.5px; text-transform: uppercase; color: var(--txt-2); padding-top: 2px; }
.ibx-kv .v { overflow-wrap: anywhere; }
.ibx-toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 1100; background: var(--ink); color: #fff; border-radius: 12px; padding: 8px 8px 8px 14px; display: flex; gap: 10px; align-items: center; font-size: 13px; font-weight: 600; box-shadow: 0 14px 30px -10px rgba(0,0,0,.5); max-width: calc(100vw - 24px); }
.ibx-toast > svg { color: var(--mint); flex: none; }
.ibx-toast--err > svg { color: #ff8a80; }
.ibx-toast span { min-width: 0; overflow-wrap: anywhere; }
.ibx-toast .icon-btn { color: #fff; width: 32px; height: 32px; }
.fab { position: absolute; right: 16px; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); z-index: 5; display: inline-flex; align-items: center; gap: 8px; padding: 0 16px; height: 48px; border-radius: 24px; background: var(--ink); color: #fff; font-weight: 700; font-size: 14px; box-shadow: 0 10px 24px -8px rgba(0,0,0,.5); border: 0; }
.fab svg { color: var(--mint); }
.fab .seg__n { background: var(--mint); color: #00271a; margin-left: 0; }
.selbar { position: fixed; top: 0; left: 0; right: 0; height: 56px; z-index: 70; display: flex; align-items: center; gap: 8px; padding: 0 10px; padding-top: env(safe-area-inset-top, 0px); background: var(--ink); color: #fff; }
.selbar b { font-size: 15px; }
.selbar .icon-btn { background: #22262c; border-color: #33383f; color: #fff; }
.selbar .right { margin-left: auto; display: flex; gap: 6px; }

/* tablet/narrow desktop: two panes, customer panel as a slide-over drawer */
@media (max-width: 1279px) {
  .inbox--v2 { grid-template-columns: 320px minmax(0,1fr); }
  .inbox--v2 > .ctx { display: block; position: fixed; top: 0; right: 0; bottom: 0; width: 320px; max-width: 90vw; z-index: 65; box-shadow: var(--shadow-lg); transform: translateX(105%); visibility: hidden; transition: transform .2s ease, visibility .2s; }
  .inbox--v2 > .ctx.is-open { transform: none; visibility: visible; }
  .inbox--v2 > .ctx .ctx__close { display: grid; position: sticky; top: 8px; margin: 8px 8px -42px auto; z-index: 2; }
  .inbox--v2 .conv__panelbtn { display: grid; }
  .ibx-scrim--ctx { display: block; }
}
@media (min-width: 1100px) and (max-width: 1279px) {
  .app.is-collapsed .inbox--v2 { grid-template-columns: 340px minmax(0,1fr) 300px; }
  .app.is-collapsed .inbox--v2 > .ctx { position: static; transform: none; visibility: visible; box-shadow: none; width: auto; max-width: none; z-index: auto; transition: none; }
  .app.is-collapsed .inbox--v2 > .ctx .ctx__close, .app.is-collapsed .ibx-scrim--ctx, .app.is-collapsed .inbox--v2 .conv__panelbtn { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .inbox--v2 > .ctx, .inbox--v2 .thread-item { transition: none; }
}

/* phone: one pane, push navigation (neutralises the old 860px list-above-thread stacking) */
@media (max-width: 720px) {
  .inbox--v2 { display: flex; flex-direction: column; height: 100%; }
  .inbox--v2.is-thread { height: var(--vvh, 100%); }
  .inbox--v2 > .inbox__list { max-height: none; border: 0; flex: 1; }
  .inbox--v2.is-thread > .inbox__list, .inbox--v2.is-list > .conv { display: none; }
  .inbox--v2 > .ctx { display: none !important; }
  .inbox--v2 .inbox__listhead { padding: 8px 12px; }
  .inbox__search { height: 44px; }
  .inbox__search input { font-size: 16px; }
  .inbox--v2 .inbox__filters { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -12px; padding: 0 12px; }
  .inbox--v2 .chip-filter { min-height: 40px; padding: 8px 12px; font-size: 13px; flex: none; }
  .inbox--v2 .thread-item { padding: 12px 14px 12px 16px; min-height: 72px; touch-action: pan-y; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
  .inbox--v2 .ti__from { font-size: 14.5px; }
  .inbox--v2 .ti__co { font-size: 12.5px; }
  .inbox--v2 .ti__subj { font-size: 13.5px; }
  .inbox--v2 .ti__prev { font-size: 13px; }
  .inbox--v2 .ti__time { font-size: 11.5px; }
  .ti__sel input { width: 20px; height: 20px; }
  .inbox--v2 .inbox__rows { padding-bottom: 84px; }
  .inbox--v2 .conv { flex: 1; min-height: 0; }
  .inbox--v2 .conv__head { padding: 6px 8px 8px; padding-top: max(6px, env(safe-area-inset-top, 0px)); }
  .inbox--v2 .conv__subj { font-size: 15px; }
  .inbox--v2 .conv__ctx { padding-left: 4px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-right: -8px; padding-right: 8px; }
  .inbox--v2 .ctx-chip { min-height: 36px; flex: none; }
  .conv__suggest { padding-left: 4px; }
  .inbox--v2 .conv__scroll { padding: 10px 10px 12px; }
  .inbox--v2 .msg__head { padding: 9px 12px; }
  .inbox--v2 .msg__body { padding: 10px 12px; font-size: 15px; line-height: 1.55; }
  .inbox--v2 .email-html { font-size: 15px; }
  .att-thumbs { padding: 0 12px 12px; }
  .att-thumb { width: calc(50% - 4px); }
  .att-thumb__img { height: 110px; }
  .inbox--v2 .kai-card__body { font-size: 15px; }
  .inbox--v2 .kai-card__foot { position: sticky; bottom: 0; background: #fff; border-radius: 0 0 10px 10px; z-index: 1; }
  .inbox--v2 .kai-card__foot .btn { flex: 1 1 40%; min-height: 44px; font-size: 14px; justify-content: center; }
  .inbox--v2 .kai-card__foot .btn--primary { flex: 1 1 100%; }
  .inbox--v2 .kai-card__why { flex-wrap: wrap; }
  .kq__head { padding: 8px 10px; padding-top: max(8px, env(safe-area-inset-top, 0px)); }
  .kq__head h2 { font-size: 15px; }
  .inbox--v2 .composer { padding: 8px 10px calc(8px + env(safe-area-inset-bottom, 0px)); }
  .composer__fake { min-height: 44px; font-size: 16px; }
  .inbox--v2 .composer textarea { font-size: 16px; min-height: 120px; }
  .composer__line .k { width: 36px; }
  .composer__from { min-height: 36px; }
  .inbox--v2 .composer__bar { flex-wrap: nowrap; }
  .inbox--v2 .composer__bar .btn--primary { min-height: 44px; }
  .inbox--v2 .composer__bar .icon-btn, .inbox--v2 .composer__bar .ai-btn { width: 40px; height: 40px; min-height: 40px; }
  .inbox--v2 .ai-ask input { font-size: 16px; min-width: 0; flex: 1 1 100%; }
  .inbox--v2 .btn { min-height: 40px; }
  .inbox--v2 .icon-btn { width: 40px; height: 40px; }
  .inbox--v2 .link-box__in { font-size: 16px; min-height: 44px; }
  .composer--v2 .ibx-rel { position: static; }
  .inbox--v2 .composer--v2 .pop.ibx-uppop, .inbox--v2 .composer--v2 .ibx-tplpop, .inbox--v2 .composer--v2 .ibx-frompop { left: 8px; right: 8px; width: auto !important; bottom: calc(100% + 6px) !important; top: auto; max-height: 60vh; overflow-y: auto; }
  .ibx-notein { font-size: 16px; }
  .sheet .ctx__sec { padding: 12px 16px; }
  .ibx-toast { bottom: calc(76px + env(safe-area-inset-bottom, 0px)); }
  .ibx-modal .modal__foot .ibx-row { width: 100%; }
  .ibx-modal .modal__foot .ibx-row .btn { flex: 1; min-height: 44px; }
  .inbox__search input { height: 100%; }
  .kai-card__more { min-height: 40px; }
  .composer--min .ai-btn--icon { width: 44px; height: 44px; }
  .conv__suggest .ibx-link { display: inline-flex; align-items: center; min-height: 36px; }
  .msg__quote { min-height: 36px; }
  .kai-seg button { min-height: 36px; padding: 6px 11px; }
  .ibx-check { min-height: 40px; margin-top: 4px; }
  .ibx-check input { width: 20px; height: 20px; }
  .inbox--v2 .pop__tabs button { min-height: 44px; }
  .inbox--v2 .pop__search input { font-size: 16px; min-height: 40px; }
  .inbox--v2 .kai-card__subjin { font-size: 16px; min-height: 40px; }
  .inbox--v2 .kai-card__ta { font-size: 16px; }
  .ctx__sec h4 .ibx-link { min-height: 36px; display: inline-flex; align-items: center; padding: 0 4px; }
}

/* ===== Live chat (views-chat.jsx) ===== */
.chat { display: grid; grid-template-columns: 340px 1fr; height: calc(100vh - var(--topbar-h)); background: var(--paper); }
.chat__list { border-right: 1px solid var(--rule); display: flex; flex-direction: column; min-height: 0; background: var(--panel); }
.chat__tabs { display: flex; flex-wrap: wrap; gap: 4px; padding: 10px; border-bottom: 1px solid var(--rule); }
.chat__tab { border: 1px solid var(--rule); background: var(--panel); border-radius: 999px; padding: 3px 10px; font-size: 12px; cursor: pointer; color: var(--txt); }
.chat__tab.is-active { background: var(--ink); color: var(--txt-inv); border-color: var(--ink); }
.chat__tabn { margin-left: 6px; font-weight: 700; }
.chat__search { display: flex; gap: 6px; padding: 8px 10px; border-bottom: 1px solid var(--rule); }
.chat__search input { flex: 1; min-width: 0; border: 1px solid var(--rule); border-radius: var(--radius); padding: 6px 10px; font: inherit; font-size: 13px; }
.chat__pendbar { margin: 8px 10px 0; padding: 6px 10px; background: var(--c-amber-w); color: var(--c-amber); border-radius: var(--radius); font-size: 12px; font-weight: 600; display: flex; gap: 6px; align-items: center; }
.chat__rows { overflow-y: auto; flex: 1; min-height: 0; }
.chat__row { display: block; width: 100%; text-align: left; border: 0; border-bottom: 1px solid var(--rule); background: transparent; padding: 10px 12px; cursor: pointer; font: inherit; color: var(--txt); }
.chat__row:hover { background: var(--paper); }
.chat__row.is-active { background: var(--mint-wash); }
.chat__row.is-unread .chat__who { font-weight: 700; }
.chat__rowtop { display: flex; justify-content: space-between; gap: 8px; }
.chat__who { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat__time { font-size: 11px; color: var(--c-grey); white-space: nowrap; }
.chat__prev { font-size: 12px; color: var(--c-grey); margin: 3px 0 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat__rowbadges { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.chat__mini { font-size: 11px; color: var(--c-grey); }
.chat__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--mint-deep); }
.chat__main { min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.chat__conv { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.chat__head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; padding: 12px 16px; border-bottom: 1px solid var(--rule); background: var(--panel); }
.chat__title { font-weight: 700; font-size: 15px; display: flex; gap: 8px; align-items: center; }
.chat__sub { font-size: 12px; color: var(--c-grey); margin-top: 3px; }
.chat__actions { display: flex; gap: 6px; flex-shrink: 0; }
.chat__banner { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 8px 16px; font-size: 13px; background: var(--c-blue-w); border-bottom: 1px solid var(--rule); }
.chat__banner--ck { background: var(--c-amber-w); }
.chat__err { color: var(--c-red); }
.chat__msgs { flex: 1; min-height: 0; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.chat__msg { max-width: 72%; padding: 8px 12px; border-radius: 12px; background: var(--panel); border: 1px solid var(--rule); align-self: flex-start; }
.chat__msg--customer { align-self: flex-start; }
.chat__msg--kai, .chat__msg--staff { align-self: flex-end; background: var(--mint-wash); border-color: var(--mint); }
.chat__msg--staff { background: var(--c-blue-w); border-color: var(--c-blue-w); }
.chat__msg--system { align-self: center; background: transparent; border: 0; color: var(--c-grey); font-size: 12px; text-align: center; max-width: 90%; }
.chat__msg.is-pending { background: var(--c-amber-w); border: 1px dashed var(--c-amber); }
.chat__msg.is-discarded { opacity: .45; text-decoration: line-through; }
.chat__msg.is-internal { font-style: italic; color: var(--c-violet); }
.chat__meta { font-size: 11px; color: var(--c-grey); margin-bottom: 3px; }
.chat__text { white-space: pre-wrap; font-size: 14px; line-height: 1.45; overflow-wrap: anywhere; }
.chat__edit { width: 100%; font: inherit; font-size: 14px; border: 1px solid var(--rule); border-radius: 8px; padding: 6px 8px; }
.chat__pendact { display: flex; gap: 6px; margin-top: 8px; }
.chat__card { margin-top: 6px; padding: 8px 10px; border: 1px solid var(--rule); border-radius: 8px; background: var(--panel); font-size: 13px; }
.chat__card img { display: block; max-width: 220px; max-height: 160px; margin-top: 6px; border-radius: 6px; background: repeating-conic-gradient(#eee 0 25%, #fff 0 50%) 0 0 / 16px 16px; }
.chat__card pre, .chat__ctx pre { font-family: var(--font-mono); font-size: 11px; white-space: pre-wrap; margin: 6px 0 0; max-height: 220px; overflow: auto; }
.chat__ctx { margin-top: 6px; font-size: 12px; color: var(--c-grey); }
.chat__atts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.chat__att { display: flex; flex-direction: column; gap: 4px; font-size: 12px; }
.chat__att a { display: flex; flex-direction: column; gap: 4px; color: inherit; text-decoration: none; }
.chat__att img { width: 120px; height: 90px; object-fit: contain; border-radius: 6px; border: 1px solid var(--rule); background: repeating-conic-gradient(#eee 0 25%, #fff 0 50%) 0 0 / 16px 16px; }
.chat__composer { display: flex; gap: 8px; padding: 10px 16px; border-top: 1px solid var(--rule); background: var(--panel); align-items: flex-end; }
.chat__composer textarea { flex: 1; font: inherit; font-size: 14px; border: 1px solid var(--rule); border-radius: var(--radius); padding: 8px 10px; resize: vertical; }
.chat__muted { font-size: 13px; color: var(--c-grey); padding: 6px 0; }
.chat__modalbg { position: fixed; inset: 0; background: rgba(11,12,14,.35); display: flex; align-items: center; justify-content: center; z-index: 200; }
.chat__modal { background: var(--panel); border-radius: 12px; padding: 20px; width: min(520px, 94vw); max-height: 90vh; overflow-y: auto; box-shadow: var(--shadow-lg); }
.chat__modal h3 { margin: 0 0 12px; font-family: var(--font-display); }
.chat__field { margin-bottom: 14px; display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.chat__field > label:first-child { font-weight: 600; }
.chat__field input[type=number], .chat__field input:not([type]) { border: 1px solid var(--rule); border-radius: 8px; padding: 6px 8px; font: inherit; }
.chat__daysel { display: flex; gap: 10px; flex-wrap: wrap; }
.chat__times { display: flex; gap: 8px; align-items: center; }
.chat__lbl { font-size: 12px; color: var(--c-grey); }
.chat__hint { font-size: 12px; color: var(--c-grey); }
.chat__modalact { display: flex; justify-content: flex-end; gap: 8px; }
@media (max-width: 760px) {
  .chat { grid-template-columns: 1fr; height: auto; }
  .chat__list { max-height: 45vh; }
  .chat__msg { max-width: 92%; }
  .chat__composer textarea, .chat__search input { font-size: 16px; }
}

/* ===== Live chat v2 (views-chat.jsx, spec crm-livechat/livechat-ux-spec.md 2026-11-25) =====
   Scoped to .chat.lc. Reuses inbox v2 pieces (inbox__search, chip-filter, ti-chip, ctx__sec,
   ibx-*). State colours: Kai violet, staff mint, needs-person red, pending amber; all text
   colours are the darker "ink" shades so they pass 4.5:1 on their tinted backgrounds. */
.chat.lc {
  --meta: #6b7077; --txt-3: #6b7077;
  --kai: #7c6cf0; --kai-w: #f1effe; --kai-ink: #5a49d6;
  --staff: #11a36b; --staff-w: #e8f8f1; --staff-ink: #057a54;
  --np: #d4483b; --np-w: #fdeceb; --np-ink: #b32a1f;
  --pend: #b7791f; --pend-w: #fff6e0; --pend-ink: #8a5a00;
  --cust-b: #f3f4f6;
  display: grid; grid-template-columns: 340px minmax(0,1fr) 340px;
  height: calc(100vh - var(--topbar-h)); height: calc(100dvh - var(--topbar-h));
  background: var(--paper); min-height: 0; position: relative;
}
.chat.lc .dim { color: var(--meta); }
.lc-list { display: flex; flex-direction: column; min-height: 0; min-width: 0; background: #fff; border-right: 1px solid var(--rule); }
.lc-list__head { padding: 10px 12px 8px; display: flex; flex-direction: column; gap: 8px; border-bottom: 1px solid var(--rule); flex: none; }
.lc-list__search { display: flex; gap: 6px; align-items: center; }
.lc-list__search .inbox__search { flex: 1; min-width: 0; }
.lc-list__search .icon-btn { width: 36px; height: 36px; flex: none; }
.lc-chips { display: flex; gap: 6px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -12px; padding: 0 12px 2px; }
.lc-chips::-webkit-scrollbar { display: none; }
.lc-chips .chip-filter { flex: none; white-space: nowrap; min-height: 32px; }
.lc-chips .chip-filter.is-on .seg__n { background: rgba(255,255,255,.22); color: #fff; }
.seg__n.lc-n--red { background: var(--np); color: #fff; font-weight: 700; }
.lc-chips .chip-filter.is-on .seg__n.lc-n--red { background: #ff6a5c; color: #fff; }
.lc-pendbar { display: flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 8px; background: var(--pend-w); color: var(--pend-ink); font-size: 12px; font-weight: 600; border: 1px solid #f0d68a; }
.lc-pendbar svg { width: 14px; height: 14px; flex: none; }
.lc-rows { flex: 1; min-height: 0; overflow-y: auto; }
.lc-row { display: flex; gap: 10px; padding: 10px 12px 10px 14px; min-height: 72px; border-bottom: 1px solid var(--rule); color: var(--txt); text-decoration: none; position: relative; background: #fff; }
.lc-row:hover { background: #fbfaf7; }
.lc-row.is-active { background: var(--mint-wash); box-shadow: inset 3px 0 0 var(--mint-ink); }
.lc-row.is-cursor { box-shadow: inset 0 0 0 2px var(--ink-3); }
.lc-row.is-urgent:not(.is-active)::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; background: var(--np); }
.lc-row__main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.lc-row__top { display: flex; align-items: center; gap: 6px; min-width: 0; }
.lc-row__name { font-weight: 600; font-size: 13px; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lc-row.is-unread .lc-row__name, .lc-row.is-unread .lc-row__prev { font-weight: 700; color: var(--txt); }
.lc-row__time { font-family: var(--font-mono); font-size: 10.5px; color: var(--meta); flex: none; }
.lc-row__prev { font-size: 12px; color: var(--txt-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lc-row__prev.is-sys { font-style: italic; color: var(--meta); }
.lc-row__meta { display: flex; gap: 5px; align-items: center; min-width: 0; flex-wrap: nowrap; overflow: hidden; }
.lc-pagechip { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.lc-unread { flex: none; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--ink); color: #fff; font-family: var(--font-mono); font-size: 10.5px; font-weight: 700; display: inline-grid; place-items: center; }
.lc-dot { width: 8px; height: 8px; border-radius: 50%; background: #c9ccd1; flex: none; display: inline-block; }
.lc-dot.is-on { background: var(--staff); box-shadow: 0 0 0 2px rgba(17,163,107,.18); }
.lc-av { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; flex: none; color: #2b2f36; font-family: var(--font-mono); font-size: 12px; font-weight: 700; }
.lc-av svg { width: 20px; height: 20px; }
.lc-av--lg { width: 48px; height: 48px; font-size: 15px; }
.lc-av--lg svg { width: 26px; height: 26px; }
.lc-st { display: inline-flex; align-items: center; font-family: var(--font-mono); font-size: 10px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; padding: 2px 6px; border-radius: 5px; white-space: nowrap; flex: none; border: 1px solid transparent; }
.lc-st--kai { background: var(--kai-w); color: var(--kai-ink); border-color: #dcd6fb; }
.lc-st--red { background: var(--np-w); color: var(--np-ink); border-color: #f6c3be; }
.lc-st--staff { background: var(--staff-w); color: var(--staff-ink); border-color: #bfe8d6; }
.lc-st--amber { background: var(--pend-w); color: var(--pend-ink); border-color: #f0d68a; }
.lc-st--grey { background: var(--c-grey-w); color: #4f545b; }
.lc-emptylink { display: block; width: 100%; padding: 12px; min-height: 44px; font-size: 12px; font-weight: 700; color: var(--mint-ink); text-decoration: underline; text-underline-offset: 2px; background: none; border: 0; cursor: pointer; text-align: center; }

/* thread */
.lc-main { min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.lc-main > .empty { flex: 1; }
.lc-conv { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.lc-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: #fff; border-bottom: 1px solid var(--rule); flex: none; position: relative; z-index: 3; }
.lc-head__who { flex: 1; min-width: 0; }
.lc-head__name { font-family: var(--font-display); font-weight: 800; font-size: 16px; display: flex; align-items: center; gap: 8px; min-width: 0; }
.lc-head__name .lc-st { font-family: var(--font-mono); font-weight: 700; }
.lc-head__name > .ibx-trunc { min-width: 3.5em; flex: 0 1 auto; }
.lc-picklist .lc-ck__foot { font-size: 12.5px; padding: 4px 8px; }
.lc-head__tag { font-family: var(--font-mono); font-size: 10px; font-weight: 600; color: var(--meta); border: 1px solid var(--rule-2); border-radius: 5px; padding: 1px 5px; text-transform: uppercase; flex: none; }
.lc-head__sub { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--txt-2); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lc-head__acts { display: flex; align-items: center; gap: 6px; flex: none; }
.lc-head__acts .btn--sm { min-height: 34px; }
.lc-ctxbtn { display: none; }
.lc-ctxbtn.is-on { background: var(--ink); color: #fff; border-color: var(--ink); }
.lc-i { font-family: Georgia, serif; font-style: italic; font-weight: 700; font-size: 15px; line-height: 1; }
.lc-menu { width: 230px !important; }
.lc-banner { display: flex; align-items: center; gap: 8px; padding: 8px 14px; font-size: 12.5px; background: #f2f1ec; border-bottom: 1px solid var(--rule); flex: none; flex-wrap: wrap; }
.lc-banner svg { width: 15px; height: 15px; flex: none; }
.lc-msgs { flex: 1; min-height: 0; overflow-y: auto; padding: 14px 18px; display: flex; flex-direction: column; gap: 10px; background: var(--paper); }
.lc-day { display: flex; align-items: center; gap: 10px; color: var(--meta); font-family: var(--font-mono); font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; margin: 4px 0; }
.lc-day::before, .lc-day::after { content: ""; flex: 1; height: 1px; background: var(--rule); }
.lc-sys { align-self: center; text-align: center; max-width: 90%; font-size: 11.5px; color: var(--meta); }
.lc-sys span { display: inline-block; padding: 3px 10px; border-radius: 999px; background: #eeede7; }
.lc-sys.is-internal span { background: #fff; border: 1px dashed var(--rule-2); }
.lc-evt { align-self: center; max-width: 92%; }
.lc-evt__btn { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--meta); background: transparent; border: 1px solid var(--rule); border-radius: 6px; padding: 3px 8px; text-align: left; cursor: pointer; }
.lc-evt__type { font-family: var(--font-mono); font-size: 9.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: #4f545b; background: #eeede7; border-radius: 4px; padding: 1px 5px; flex: none; }
.lc-msg { display: flex; flex-direction: column; max-width: min(72%, 640px); }
.lc-msg--in { align-self: flex-start; align-items: flex-start; }
.lc-msg--out { align-self: flex-end; align-items: flex-end; }
.lc-msg__meta { font-size: 11px; color: var(--meta); margin: 0 4px 3px; display: flex; align-items: center; gap: 2px; }
.lc-msg__meta b { color: var(--txt); font-weight: 600; }
.lc-kai { display: inline-flex; align-items: center; gap: 4px; color: var(--kai-ink); font-weight: 700; }
.lc-kai svg { width: 12px; height: 12px; }
.lc-bubble { padding: 9px 13px; border-radius: 14px; font-size: 14px; line-height: 1.45; background: var(--cust-b); color: var(--txt); border: 1px solid #e7e8eb; max-width: 100%; }
.lc-msg--in .lc-bubble { border-top-left-radius: 4px; }
.lc-msg--out .lc-bubble { border-top-right-radius: 4px; }
.lc-msg--kai .lc-bubble { background: var(--kai-w); border-color: #dcd6fb; }
.lc-msg--staff .lc-bubble { background: var(--staff-w); border-color: #bfe8d6; }
.lc-msg.is-pending .lc-bubble { background: var(--pend-w); border: 1px dashed var(--pend); }
.lc-msg.is-discarded .lc-bubble { opacity: .55; }
.lc-msg.is-discarded .lc-text { text-decoration: line-through; }
.lc-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.lc-edit { width: min(560px, 60vw); max-width: 100%; font: inherit; font-size: 14px; border: 1px solid var(--rule-2); border-radius: 8px; padding: 7px 9px; background: #fff; resize: vertical; }
.lc-appr { margin: 4px 4px 0; font-size: 11px; color: var(--staff-ink); font-weight: 600; }
.lc-appr--auto { color: var(--meta); font-weight: 500; }
.lc-appr--rej { color: var(--np-ink); }
.lc-pend { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.lc-pend__lbl { font-family: var(--font-mono); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--pend-ink); background: var(--pend-w); border: 1px solid #f0d68a; border-radius: 5px; padding: 3px 7px; }
.lc-ctxchip { margin-top: 5px; font-family: var(--font-mono); font-size: 10.5px; color: var(--kai-ink); background: #fff; border: 1px solid #dcd6fb; border-radius: 6px; padding: 3px 8px; cursor: pointer; text-align: left; }
.lc-note { align-self: stretch; background: var(--pend-w); border: 1px solid #f0d68a; border-radius: 10px; padding: 8px 12px; font-size: 13.5px; line-height: 1.45; }
.lc-note__hd { font-family: var(--font-mono); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--pend-ink); margin-bottom: 3px; }
.lc-note--whisper { background: #fff; border: 1px dashed var(--kai); }
.lc-note--whisper .lc-note__hd { color: var(--kai-ink); }
.lc-typing { align-self: flex-end; display: inline-flex; align-items: center; gap: 8px; font-size: 12px; color: var(--kai-ink); }
.lc-typing__dots { display: inline-flex; gap: 3px; padding: 7px 10px; background: var(--kai-w); border-radius: 12px; }
.lc-typing__dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--kai); animation: lcBlink 1.2s infinite ease-in-out; }
.lc-typing__dots i:nth-child(2) { animation-delay: .2s; } .lc-typing__dots i:nth-child(3) { animation-delay: .4s; }
@keyframes lcBlink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
.lc-card { margin-top: 6px; padding: 8px 10px; border: 1px solid var(--rule); border-radius: 9px; background: #fff; font-size: 12.5px; }
.lc-card img { display: block; max-width: 220px; max-height: 160px; margin-top: 6px; border-radius: 6px; background: repeating-conic-gradient(#eee 0 25%, #fff 0 50%) 0 0 / 16px 16px; }
.lc-card--prod { display: flex; gap: 10px; align-items: center; }
.lc-card--prod img { width: 48px; height: 48px; object-fit: cover; margin: 0; }
.lc-card__opts { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 5px; }
.lc-thumbs { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.lc-thumbs img { width: 64px; height: 64px; object-fit: contain; margin: 0; }
.lc-atts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.lc-att { display: flex; flex-direction: column; gap: 3px; font-size: 11.5px; }
.lc-att a { display: flex; flex-direction: column; gap: 3px; color: inherit; text-decoration: none; }
.lc-att img, .lc-att__doc { width: 120px; height: 90px; object-fit: contain; border-radius: 6px; border: 1px solid var(--rule); background: repeating-conic-gradient(#eee 0 25%, #fff 0 50%) 0 0 / 16px 16px; display: grid; place-items: center; }
.lc-att__doc { background: #fff; color: var(--meta); }
.lc-att__nm { max-width: 120px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lc-ck { align-self: stretch; max-width: 560px; margin: 0 auto; width: 100%; background: #fff; border: 1px solid var(--rule); border-radius: 10px; padding: 10px 12px; font-size: 12.5px; }
.lc-ck.is-pending { border-color: var(--pend); box-shadow: 0 0 0 3px var(--pend-w); }
.lc-ck__hd { display: flex; align-items: center; gap: 6px; }
.lc-ck__hd svg { width: 15px; height: 15px; }
.lc-ck__items { margin: 6px 0 0; padding-left: 18px; }
.lc-ck__foot { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 6px; }
.lc-err { margin: 6px 14px; }

/* composer */
.lc-composer { border-top: 1px solid var(--rule); background: #fff; padding: 8px 14px 12px; flex: none; position: relative; }
.lc-composer.is-note { background: var(--pend-w); }
.lc-cbanner { display: flex; gap: 8px; align-items: flex-start; font-size: 12px; line-height: 1.4; color: #4f545b; background: #f2f1ec; border-radius: 8px; padding: 7px 10px; margin-bottom: 8px; }
.lc-cbanner svg { width: 14px; height: 14px; flex: none; margin-top: 1px; }
.lc-tabs { display: flex; align-items: center; gap: 2px; margin-bottom: 6px; }
.lc-tabs button { font-size: 12.5px; font-weight: 700; color: var(--txt-2); padding: 6px 10px; border-radius: 7px; background: none; border: 0; min-height: 32px; cursor: pointer; }
.lc-tabs button.on { background: var(--ink); color: #fff; }
.lc-composer.is-note .lc-tabs button.on { background: var(--pend-ink); }
.lc-tabs__hint { margin-left: auto; font-size: 11.5px; color: var(--meta); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.lc-composer textarea { display: block; width: 100%; font: inherit; font-size: 14px; line-height: 1.45; border: 1px solid var(--rule); border-radius: 9px; padding: 8px 10px; resize: vertical; min-height: 64px; max-height: 40vh; background: #fff; }
.lc-composer textarea:focus { outline: none; border-color: var(--ink-3); box-shadow: 0 0 0 3px rgba(11,12,14,.05); }
.lc-composer.is-note textarea { border-color: #f0d68a; }
.lc-cbar { display: flex; align-items: center; gap: 6px; margin-top: 8px; }
.lc-cbar .right { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.lc-cbar .btn--sm { min-height: 34px; }
.lc-whisper { color: var(--kai-ink) !important; border-color: #dcd6fb !important; }
.lc-whisper svg { color: var(--kai); }
.lc-notebtn { background: var(--pend-ink); color: #fff; }
.lc-attrow { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 6px; }
.lc-pop { bottom: calc(100% + 6px) !important; top: auto; left: 0; width: 320px !important; }
.lc-pop .pop__item { width: 100%; text-align: left; background: #fff; border: 0; border-bottom: 1px solid var(--rule); font-size: 12.5px; min-height: 40px; }
.lc-pop .pop__item svg { width: 15px; height: 15px; flex: none; }

/* modal */
.lc-modalbg { position: fixed; inset: 0; background: rgba(11,12,14,.4); display: flex; align-items: center; justify-content: center; z-index: 200; padding: 16px; }
.lc-modal { background: #fff; border-radius: 12px; width: min(460px, 100%); max-height: 86vh; display: flex; flex-direction: column; box-shadow: var(--shadow-lg); }
.lc-modal--wide { width: min(620px, 100%); }
.lc-modal__hd { display: flex; align-items: center; padding: 12px 14px 8px 18px; }
.lc-modal__hd h3 { margin: 0; font-family: var(--font-display); font-size: 16px; flex: 1; }
.lc-modal__body { padding: 4px 18px 14px; overflow-y: auto; min-height: 0; display: flex; flex-direction: column; gap: 10px; }
.lc-modal__foot { display: flex; align-items: center; gap: 10px; justify-content: space-between; padding: 10px 18px 14px; border-top: 1px solid var(--rule); }
.lc-picklist { display: flex; flex-direction: column; gap: 2px; max-height: 320px; overflow-y: auto; }
.lc-pickrow { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 8px; border: 0; background: none; text-align: left; cursor: pointer; min-height: 44px; font-size: 13px; color: var(--txt); }
.lc-pickrow:hover:not(.is-static) { background: var(--mint-wash); }
.lc-pickrow img, .lc-pickrow__ph { width: 34px; height: 34px; object-fit: cover; border-radius: 5px; flex: none; background: var(--rule); }
.lc-lbl { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 600; color: var(--txt-2); }
.lc-in { border: 1px solid var(--rule); border-radius: 8px; padding: 8px 10px; font: inherit; font-size: 13px; }
.lc-qty { width: 70px; flex: none; }

/* context panel */
.lc-ctx { min-height: 0; min-width: 0; overflow-y: auto; background: var(--paper-2); border-left: 1px solid var(--rule); }
.lc-ctxin { position: relative; }
.lc-ctx__close { display: none; }
.lc-sec { padding: 13px 16px; border-bottom: 1px solid var(--rule); }
.lc-sec h4 { display: flex; align-items: center; gap: 6px; color: var(--txt-2); }
.lc-sec h4 .right { margin-left: auto; text-transform: none; letter-spacing: 0; font-size: 11px; color: var(--mint-ink); font-weight: 700; font-family: var(--font-mono); }
.lc-kv { display: grid; grid-template-columns: 64px minmax(0,1fr); gap: 5px 10px; font-size: 12.5px; margin-top: 10px; }
.lc-kv > span:nth-child(odd) { font-family: var(--font-mono); font-size: 10px; text-transform: uppercase; letter-spacing: .05em; color: var(--meta); padding-top: 2px; }
.lc-browse { margin-top: 10px; }
.lc-steps { display: flex; gap: 0; list-style: none; margin: 0 0 10px; padding: 0; counter-reset: s; }
.lc-steps li { flex: 1; font-size: 10px; font-weight: 600; color: var(--meta); text-align: center; padding-top: 14px; position: relative; white-space: nowrap; }
.lc-steps li::before { content: ""; position: absolute; top: 3px; left: 50%; width: 8px; height: 8px; margin-left: -4px; border-radius: 50%; background: #d9d9de; z-index: 1; }
.lc-steps li::after { content: ""; position: absolute; top: 6px; left: -50%; width: 100%; height: 2px; background: #e4e4e8; }
.lc-steps li:first-child::after { display: none; }
.lc-steps li.is-done::before, .lc-steps li.is-on::before { background: var(--kai); }
.lc-steps li.is-done::after, .lc-steps li.is-on::after { background: var(--kai); }
.lc-steps li.is-on { color: var(--kai-ink); font-weight: 800; }
.lc-steps li.is-on::before { box-shadow: 0 0 0 3px var(--kai-w); }
.lc-arts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 10px; }
.lc-art { position: relative; aspect-ratio: 1; border: 1px solid var(--rule); border-radius: 7px; overflow: hidden; background: repeating-conic-gradient(#eee 0 25%, #fff 0 50%) 0 0 / 12px 12px; display: block; }
.lc-art img { width: 100%; height: 100%; object-fit: contain; display: block; }
.lc-art.is-picked { border: 2px solid var(--kai); }
.lc-art__tick { position: absolute; right: 3px; top: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--kai); color: #fff; font-size: 10px; font-weight: 800; display: grid; place-items: center; }
.lc-sizes { width: 100%; border-collapse: collapse; font-size: 12px; margin-bottom: 10px; table-layout: fixed; }
.lc-sizes th { text-align: left; font-family: var(--font-mono); font-size: 9.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--meta); font-weight: 600; padding: 3px 4px; border-bottom: 1px solid var(--rule); }
.lc-sizes td { padding: 4px; border-bottom: 1px solid var(--rule); }
.lc-sizes th:nth-child(2), .lc-sizes td:nth-child(2) { width: 96px; }
.lc-sizes th:nth-child(3), .lc-sizes td:nth-child(3) { width: 36px; text-align: right; }
.lc-sheetmini { display: flex; flex-direction: column; gap: 5px; }
.lc-sheetmini__bar { height: 22px; border-radius: 4px; background: repeating-linear-gradient(90deg, #f3f2ee 0 9px, #e9e7e0 9px 10px); border: 1px solid var(--rule-2); overflow: hidden; }
.lc-sheetmini__bar i { display: block; height: 100%; background: linear-gradient(90deg, #b9b0f7, var(--kai)); }
.lc-flow { margin-top: 12px; border-top: 1px dashed var(--rule-2); padding-top: 8px; }
.lc-flow__hd { font-family: var(--font-mono); font-size: 9.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--meta); font-weight: 600; margin-bottom: 4px; }
.lc-flow__row summary { display: flex; align-items: center; gap: 6px; font-size: 12px; cursor: pointer; list-style: none; padding: 3px 0; min-width: 0; }
.lc-flow__row summary::-webkit-details-marker { display: none; }
.lc-flow__row pre { font-family: var(--font-mono); font-size: 10.5px; white-space: pre-wrap; max-height: 180px; overflow: auto; background: #f7f6f2; padding: 6px; border-radius: 6px; margin: 2px 0 6px; }
.lc-sec .lc-ck { margin: 0 0 6px; }
.lc-scrim { display: none; }

@media (min-width: 1280px) and (max-width: 1439px) {
  .chat.lc { grid-template-columns: 300px minmax(0,1fr) 320px; }
}
/* below 1280: two panes, context panel as a drawer opened from the header "i" */
@media (max-width: 1279px) {
  .chat.lc { grid-template-columns: 320px minmax(0,1fr); }
  .lc-ctx { position: fixed; top: 0; right: 0; bottom: 0; width: 340px; max-width: 90vw; z-index: 65; box-shadow: var(--shadow-lg); transform: translateX(105%); visibility: hidden; transition: transform .2s ease, visibility .2s; }
  .lc-ctx.is-open { transform: none; visibility: visible; }
  .lc-ctx__close { display: grid; position: sticky; top: 8px; margin: 8px 8px -42px auto; z-index: 2; }
  .lc-ctxbtn { display: grid; }
  .lc-scrim { display: block; z-index: 64; }
}
@media (max-width: 1279px) { .lc-head__name .lc-st { display: none; } }
@media (max-width: 1100px) {
  .chat.lc { grid-template-columns: 290px minmax(0,1fr); }
}
@media (prefers-reduced-motion: reduce) { .lc-ctx { transition: none; } .lc-typing__dots i { animation: none; } }
/* phone: list → full-screen thread (back arrow); context as a bottom sheet */
@media (max-width: 720px) {
  .chat.lc { display: flex; flex-direction: column; height: calc(100vh - var(--topbar-h)); height: calc(100dvh - var(--topbar-h)); }
  .chat.lc.is-thread { height: calc(var(--vvh, 100dvh) - var(--topbar-h)); }
  .chat.lc.is-thread > .lc-list, .chat.lc.is-list > .lc-main { display: none; }
  .lc-list { flex: 1; border-right: 0; }
  .lc-main { flex: 1; }
  .lc-ctxbtn { display: grid; }
  .lc-chips .chip-filter { min-height: 40px; padding: 8px 12px; font-size: 13px; }
  .lc-list__search .inbox__search { height: 44px; }
  .lc-list__search input { font-size: 16px; }
  .lc-list__search .icon-btn { width: 44px; height: 44px; }
  .lc-row { padding: 12px 14px 12px 16px; }
  .lc-row__name { font-size: 14.5px; }
  .lc-row__prev { font-size: 13px; }
  .lc-head { padding: 6px 8px; gap: 6px; }
  .lc-head .lc-av { width: 32px; height: 32px; }
  .lc-head__name { font-size: 15px; }
  .lc-head__acts { gap: 4px; }
  .lc-head__acts .btn--sm { min-height: 40px; padding: 6px 10px; }
  .lc-head__acts .icon-btn { width: 40px; height: 40px; }
  .lc-back { width: 40px; height: 40px; }
  .lc-msgs { padding: 10px 10px 12px; }
  .lc-msg { max-width: 88%; }
  .lc-bubble { font-size: 15px; }
  .lc-edit { width: 100%; font-size: 16px; }
  .lc-pend .btn { min-height: 40px; }
  .lc-composer { padding: 6px 10px calc(8px + env(safe-area-inset-bottom, 0px)); }
  .lc-composer textarea { font-size: 16px; min-height: 48px; }
  .lc-tabs button { min-height: 36px; }
  .lc-cbar .icon-btn { width: 40px; height: 40px; }
  .lc-cbar .btn--sm { min-height: 40px; }
  .lc-whisper { padding: 6px 9px; }
  .lc-pop { left: 0; right: 0; width: auto !important; max-height: 50vh; overflow-y: auto; }
  .lc-sheet { max-height: 86vh; max-height: 86dvh; }
  .lc-sheet .lc-sec { padding: 12px 16px; }
  .lc-in { font-size: 16px; }
  .lc-modal { max-height: 92vh; }
  .lc-pickrow { min-height: 48px; }
}
@media (max-width: 720px) {
  .lc-head__name .lc-st { display: none; }
  .lc-ctxchip, .lc-evt__btn { min-height: 36px; }
  .lc-att .ibx-link { min-height: 36px; display: inline-flex; align-items: center; }
  .lc-pend__lbl { display: none; }
  .lc-ctxin .ibx-cust .icon-btn { width: 40px; height: 40px; }
}

/* Live chat v2: formatted text, guide/choice chips, auto-send + flag (2026-11-25) */
.lc-md .lc-md__p { min-height: 1em; }
.lc-md ul, .lc-md ol { margin: 2px 0 4px; padding-left: 20px; }
.lc-md li { margin: 1px 0; }
.lc-md a { color: var(--mint-ink); text-decoration: underline; text-underline-offset: 2px; }
.lc-chiprow { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 7px; }
.lc-guide { color: var(--mint-ink); text-decoration: none; border-color: #bfe8d6; background: #fff; }
.lc-guide svg { color: var(--mint-ink); }
.lc-choice { background: #fff; border-color: #dcd6fb; color: var(--kai-ink); }
.lc-choice.is-rec { border-color: var(--kai); }
.lc-chosen { margin-top: 4px; font-size: 10.5px; color: var(--meta); font-family: var(--font-mono); }
.lc-autotag { font-family: var(--font-mono); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--kai-ink); background: var(--kai-w); border: 1px solid #dcd6fb; border-radius: 5px; padding: 1px 6px; margin-right: 4px; }
.lc-flagbtn { margin: 2px 4px 0; font-size: 11px; color: var(--meta); background: none; border: 0; padding: 2px 0; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.lc-flagbtn:hover { color: var(--np-ink); }
@media (max-width: 720px) {
  .lc-flagbtn { min-height: 36px; }
  .lc-guide, .lc-choice { min-height: 32px; font-size: 11px; }
}

/* Live chat v2 polish (designer review 2026-11-25) */
.lc-chips { scroll-snap-type: x proximity; -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent); padding-right: 28px; }
.lc-chips .chip-filter { scroll-snap-align: start; }
.lc-msg__wait { color: var(--pend-ink); font-weight: 700; }
.lc-pend--row { flex-wrap: nowrap; justify-content: flex-end; align-self: flex-end; }
.lc-pend--row .btn { flex: none; }
.lc-ck .lc-pend--row { justify-content: flex-start; align-self: auto; }
.lc-filerow { display: flex; align-items: center; gap: 10px; min-width: 240px; max-width: 100%; padding: 8px 10px; border: 1px solid var(--rule); border-radius: 9px; background: #fff; font-size: 12.5px; }
.lc-filerow__ic { position: relative; width: 34px; height: 40px; flex: none; display: grid; place-items: center; border-radius: 6px; background: var(--np-w); color: var(--np-ink); }
.lc-filerow__ic svg { width: 20px; height: 20px; }
.lc-filerow__ic b { position: absolute; bottom: -5px; left: 50%; transform: translateX(-50%); font-family: var(--font-mono); font-size: 8.5px; background: var(--np-ink); color: #fff; border-radius: 3px; padding: 0 3px; }
.lc-filerow__main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.lc-filerow__nm { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lc-filerow__m { font-family: var(--font-mono); font-size: 10.5px; color: var(--meta); }
.lc-ck.is-compact { box-shadow: none; }
.lc-jump { display: inline-block; margin-top: 6px; }
.lc-ck.is-flash, .lc-msg.is-flash { animation: lcFlash 1.5s ease; }
@keyframes lcFlash { 0%, 60% { box-shadow: 0 0 0 4px rgba(24,244,175,.55); } 100% { box-shadow: 0 0 0 0 rgba(24,244,175,0); } }
.lc-composer textarea { resize: none; min-height: 0; overflow-y: hidden; }
.lc-row__typing { color: var(--staff-ink); font-style: italic; font-weight: 600; }
.lc-typing--cust { align-self: flex-start; color: var(--txt-2); }
.lc-typing--cust .lc-typing__dots { background: var(--cust-b); }
.lc-typing--cust .lc-typing__dots i { background: #8a8e94; }
.lc-dev { font-family: var(--font-mono); font-size: 10px; color: var(--meta); white-space: nowrap; flex: none; }
.lc-head__state { margin-top: 2px; }
@media (max-width: 720px) {
  .chat.lc.is-thread { height: var(--vvh, 100dvh); }
  .lc-head { padding-top: max(6px, env(safe-area-inset-top, 0px)); align-items: flex-start; }
  .lc-head > .lc-av, .lc-head > .lc-back { margin-top: 2px; }
  .lc-head__acts { align-self: center; }
  .lc-head__acts .btn--primary.btn--sm, .lc-head__acts .btn--ghost.btn--sm { height: 40px; min-height: 40px; padding: 0 12px; font-size: 12.5px; }
  .lc-head__state .lc-st { font-size: 9.5px; }
  .lc-filerow { min-width: 0; width: 100%; }
  .lc-filerow .ibx-link { min-height: 36px; display: inline-flex; align-items: center; }
  .lc-pend--row { flex-wrap: wrap; }
  .lc-jump { min-height: 36px; display: inline-flex; align-items: center; }
}

/* Live chat v2: phone header second line + device icon (designer nits 2026-11-25) */
.lc-dev { font-family: inherit; font-size: 12px; line-height: 1; }
@media (max-width: 720px) {
  .lc-head { flex-wrap: wrap; row-gap: 4px; align-items: center; }
  .lc-head > .lc-av, .lc-head > .lc-back { margin-top: 0; }
  .lc-head__line2 { flex: 0 0 100%; display: flex; align-items: center; gap: 6px; min-width: 0; font-size: 12px; color: var(--txt-2); padding: 0 2px 2px; }
  .lc-head__line2 .lc-st { font-size: 9.5px; }
}
/* Artwork zip download link disabled state */
.btn.is-disabled { opacity: .45; pointer-events: none; }

/* ---- Customer backlog (views-backlog.jsx) ---- */
.fb__toolbar .rm-in { height: 32px; font-size: 12px; }
.fb__search { flex: 1 1 180px; min-width: 140px; }
.fb__page-sel { max-width: 220px; }
.fb__mergebar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 12px; margin-bottom: 12px; background: var(--mint-wash); border: 1px solid var(--rule); border-radius: 8px; font-size: 12.5px; }
.fb__group { font-size: 13px; margin: 4px 0 6px; }
.fb__tbl td.fb__sum { max-width: 520px; word-break: break-word; }
.fb__tbl td.fb__sum svg { width: 12px; height: 12px; vertical-align: -1px; }
.fb__detail { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 14px; align-items: start; }
.fb__main, .fb__side { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.fb__shot { display: block; max-width: 100%; max-height: 260px; border: 1px solid var(--rule); border-radius: 8px; cursor: zoom-in; background: #f3f3f3; }
.fb__shot.is-open { max-height: none; cursor: zoom-out; }
.fb__note { padding: 8px 0; border-bottom: 1px solid var(--rule); }
.fb__note:last-of-type { border-bottom: 0; }
.fb__form { display: flex; flex-direction: column; gap: 10px; }
.fb__form label { display: flex; flex-direction: column; gap: 4px; font-size: 11.5px; font-weight: 600; color: var(--txt-2); }
.fb__form .rm-in { width: 100%; box-sizing: border-box; }
.fb__meta { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.fb__meta th { text-align: left; font-weight: 600; color: var(--txt-3); padding: 4px 10px 4px 0; vertical-align: top; white-space: nowrap; width: 1%; }
.fb__meta td { padding: 4px 0; word-break: break-word; }
@media (max-width: 900px) {
  .fb__detail { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .fb__tbl .fb-hide-sm { display: none; }
  .fb__toolbar { gap: 6px; }
  .fb__toolbar .rm-in, .fb__page-sel { flex: 1 1 45%; max-width: none; }
  .fb__tbl td.fb__sum { max-width: none; }
}
/* Chat header: guest linked to a customer from an unverified chat email */
.lc-head__tag--linked { background: #e8f7f0; color: #0b6b47; text-decoration: none; }
.lc-head__tag--linked:hover { text-decoration: underline; }
/* Customer "Comment for our team" on order lines / gang designs */
.li__comment { display:flex; flex-direction:column; gap:2px; background:#fff7e6; border:1px solid #f3d38a; border-radius:8px; padding:8px 10px; margin:4px 0 6px; font-size:13px; color:#5c4300; white-space:pre-wrap; }
.li__comment b { font-size:11px; letter-spacing:.04em; text-transform:uppercase; }
.li__comment--sm { font-size:12px; padding:6px 8px; margin-top:6px; }
/* Print queue rows: customer comment */
.prow-cmt { margin-top:3px; font-size:12px; color:#7a5600; background:#fff7e6; border:1px solid #f3d38a; border-radius:6px; padding:2px 6px; max-width:340px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
/* Live chat list filters (2026-11-27): chips no longer clipped at the panel edge. Desktop:
   compact chips that wrap onto two rows so every filter (Waiting/Closed/All) is visible.
   Phones keep one swipeable row with a fade. */
.lc-chips { margin: 0; padding: 0 0 2px; gap: 6px; }
.lc-chips .chip-filter { min-height: 30px; padding: 5px 11px; font-size: 13px; line-height: 1.2; }
.lc-chips .chip-filter .seg__n { margin-left: 6px; min-width: 18px; height: 18px; line-height: 18px; font-size: 11px; padding: 0 5px; }
@media (min-width: 761px) {
  .lc-chips { flex-wrap: wrap; overflow: visible; -webkit-mask-image: none; mask-image: none; padding-right: 0; scroll-snap-type: none; }
}
@media (max-width: 760px) {
  .lc-chips { margin: 0 -12px; padding: 0 28px 2px 12px; }
  .lc-chips .chip-filter { min-height: 36px; padding: 7px 12px; }
}

/* ---- Builder funnels (#/funnels, views-funnels.jsx) ---- */
.fnl { padding: 16px 18px 60px; overflow: auto; }
.fnl__bar { align-items: center; }
.fnl__dates { display: inline-flex; align-items: center; gap: 6px; }
.fnl__dates input, .fnl__select { height: 31px; border: 1px solid var(--rule); border-radius: 8px; padding: 0 8px; font-size: 12.5px; background: var(--panel); color: var(--txt); }
.fnl__meta { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.fnl-banner { display: flex; align-items: flex-start; gap: 8px; background: var(--c-amber-w); border: 1px solid #f1d9a6; color: #7a5200; border-radius: var(--radius); padding: 10px 14px; margin-bottom: 12px; font-size: 12.5px; line-height: 1.45; }
.fnl-banner svg { width: 15px; height: 15px; flex: none; margin-top: 1px; }
.fnl__note { font-size: 12px; margin: 0 0 12px; }
.fnl__card { margin-bottom: 14px; }
.fnl__foot { font-size: 11.5px; padding: 8px 16px 12px; }
.fnl__notes { font-size: 11.5px; margin: 4px 0 0; padding-left: 18px; line-height: 1.5; }
.fnl__tbl td, .fnl__tbl th { white-space: nowrap; }
.fnl__bname { font-weight: 600; }
.fnl-drop { font-size: 12px; font-weight: 600; color: var(--c-red); }
.fnl-drop.is-low { color: var(--txt-3); font-weight: 500; }
.fnl-tag { display: inline-block; margin-left: 6px; padding: 1px 6px; border-radius: 5px; font-size: 10.5px; font-weight: 600; vertical-align: 1px; white-space: nowrap; }
.fnl-tag--nt { background: var(--paper-2); color: var(--txt-3); border: 1px dashed var(--rule); }
.fnl-tag--part { background: var(--c-amber-w); color: #9a6300; }
.fnl-tag--grey { background: var(--paper-2); color: var(--txt-3); }

.fnl-health { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; padding: 12px 14px; }
.fnl-health__item { border: 1px solid var(--rule); border-radius: 8px; padding: 8px 10px; min-width: 0; }
.fnl-health__name { font-size: 12.5px; font-weight: 600; margin-bottom: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fnl-health__cells { display: flex; align-items: center; gap: 6px; font-size: 11.5px; flex-wrap: wrap; }
.fnl-hc { font-family: var(--font-mono); font-weight: 700; padding: 1px 6px; border-radius: 5px; margin-right: 4px; }
.fnl-hc.is-ok { background: var(--mint-wash); color: var(--mint-ink); }
.fnl-hc.is-bad { background: var(--c-red-w); color: #b32a1f; }
.fnl-hc.is-na { color: var(--txt-3); }

.fnl-rows { display: flex; flex-direction: column; }
.fnl-row { display: grid; grid-template-columns: minmax(220px, 1fr) repeat(6, 78px); gap: 8px; align-items: center; padding: 9px 16px; border-bottom: 1px solid var(--rule); font-size: 13px; cursor: pointer; }
.fnl-row:last-child { border-bottom: 0; }
.fnl-row:hover { background: #fbfaf7; }
.fnl-row .num { font-family: var(--font-mono); text-align: right; }
.fnl-row--head { cursor: default; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--txt-3); padding-top: 8px; padding-bottom: 8px; }
.fnl-row--head:hover { background: none; }
.fnl-row.is-big { background: var(--c-red-w); box-shadow: inset 3px 0 0 var(--c-red); }
.fnl-row.is-nt { cursor: default; color: var(--txt-3); }
.fnl-row.is-grey .fnl-bar span { background: #c9ccd1; }
.fnl-row__stage { min-width: 0; }
.fnl-row__label { font-weight: 600; }
.fnl-row__n { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--paper-2); font-family: var(--font-mono); font-size: 10.5px; margin-right: 7px; }
.fnl-row__sub { font-size: 11px; margin-top: 3px; }
.fnl-row__v { font-weight: 700; }
.fnl-bar { height: 6px; background: var(--paper-2); border-radius: 4px; margin-top: 6px; overflow: hidden; }
.fnl-bar span { display: block; height: 100%; background: var(--mint-deep); border-radius: 4px; }
.fnl-big { background: var(--c-red-w); }
.fnl__split tbody tr { cursor: default; }
.fnl__split tr.is-nt td { color: var(--txt-3); }

.fnl__modal { max-width: 860px; }
.fnl__modalbody { max-height: 70vh; overflow: auto; padding: 0; }
.fnl__drillnote { font-size: 12px; padding: 10px 14px; }
.fnl__landing { max-width: 260px; overflow: hidden; text-overflow: ellipsis; }
.fnl-dots { display: inline-flex; gap: 3px; }
.fnl-dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--paper-2); border: 1px solid var(--rule); }
.fnl-dots i.on { background: var(--mint-deep); border-color: var(--mint-deep); }

@media (max-width: 760px) {
  .fnl { padding: 12px 10px 60px; }
  .fnl__bar .seg { max-width: 100%; overflow-x: auto; }
  .fnl__meta { margin-left: 0; }
  .fnl-row { grid-template-columns: repeat(3, 1fr); gap: 4px 10px; padding: 10px 12px; }
  .fnl-row__stage { grid-column: 1 / -1; }
  .fnl-row--head { display: none; }
  .fnl-row .num { text-align: left; font-size: 12px; }
  .fnl-row .num::before { content: attr(data-k) " "; color: var(--txt-3); font-family: var(--font-sans, inherit); font-size: 10.5px; display: block; }
  .fnl-health { grid-template-columns: 1fr; }
  .fnl__modal { max-width: 100%; }
}

/* ---- Funnels: visual funnel (designer spec crm-funnels/funnels-spec.md §8 tokens) ---- */
:root {
  --fnl-node:#0fb880; --fnl-node-line:#057a54; --fnl-flow:rgba(15,184,128,.30);
  --fnl-drop:#ddd8cd; --fnl-drop-line:#b5ae9f;
  --fnl-big:#e0392b; --fnl-big-ink:#b32a1f; --fnl-big-w:#fdeceb;
  --fnl-nt:#f1f0ec; --fnl-nt-line:#8a8e94;
  --fnl-part:#fdf3df; --fnl-part-line:#d98a00; --fnl-part-ink:#8a5a00;
  --fnl-pre:#b9bcc2; --fnl-pre-flow:#e2e3e6; --fnl-pre-ink:#565a60;
  --fnl-byp:rgba(47,109,240,.18); --fnl-byp-line:#2f6df0; --fnl-byp-ink:#1d4dad;
  --fnl-auto:#e6fbf3; --fnl-auto-line:#057a54;
  --fnl-muted:#5f646b; --fnl-low-op:.38;
}
.fnl .sr-only { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }
.fnl :focus-visible, .fnl-drawer :focus-visible { outline:2px solid var(--c-blue); outline-offset:2px; }
.fnl .mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.fnl-muted { color: var(--fnl-muted); }
.fnl-card { position: relative; min-width: 0; }
.fnl-card__head { flex-wrap: wrap; }
.fnl-banner--in { margin: 10px 16px 0; }
.fnl-empty { padding: 24px 16px; color: var(--fnl-muted); }

/* builder chips */
.fnl-chips { display:flex; gap:8px; overflow-x:auto; padding:2px 2px 8px; margin-bottom:6px; scrollbar-width:thin; }
.fnl-chip { flex:none; display:grid; grid-template-columns:auto auto; grid-template-rows:auto auto; column-gap:10px; align-items:center; text-align:left;
  background:var(--panel); border:1px solid var(--rule); border-radius:9px; padding:8px 11px; min-width:140px; cursor:pointer; }
.fnl-chip[aria-pressed="true"] { border-color:var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.fnl-chip__name { font-weight:700; font-size:12.5px; grid-column:1/3; white-space:nowrap; }
.fnl-chip__cr { font-family:var(--font-mono); font-weight:700; font-size:13px; font-variant-numeric:tabular-nums; }
.fnl-chip__cr small { font-weight:500; color:var(--fnl-muted); font-size:10.5px; margin-left:4px; }
.fnl-chip__low { font-size:11px; color:var(--fnl-muted); font-weight:600; }
.fnl-chip svg { width:52px; height:18px; justify-self:end; }

/* tabs */
.fnl-tabs { display:flex; gap:2px; border-bottom:1px solid var(--rule); margin:6px 0 14px; }
.fnl-tabs button { padding:9px 14px; font-size:13px; font-weight:600; color:var(--txt-2); border-bottom:2px solid transparent; margin-bottom:-1px; background:none; cursor:pointer; }
.fnl-tabs button[aria-selected="true"] { color:var(--txt); border-bottom-color:var(--ink); }

/* KPI strip, pill, legend */
.fnl-kpis { display:grid; grid-template-columns:repeat(6,minmax(0,1fr)); border-bottom:1px solid var(--rule); }
.fnl-kpi { padding:10px 16px; border-right:1px solid var(--rule); min-width:0; }
.fnl-kpi:last-child { border-right:0; }
.fnl-kpi .k { font-size:11px; color:var(--fnl-muted); font-weight:600; }
.fnl-kpi .v { font-family:var(--font-mono); font-size:17px; font-weight:700; margin-top:2px; font-variant-numeric:tabular-nums; }
.fnl-bigdrop { display:inline-flex; align-items:center; gap:8px; background:var(--fnl-big-w); color:var(--fnl-big-ink); border-radius:7px; padding:5px 10px; font-weight:700; font-size:12.5px; }
.fnl-bigdrop i { width:10px; height:10px; border-radius:2px; background:var(--fnl-big); display:inline-block; flex:none; }
.fnl-bigdrop.is-low { background:var(--paper-2); color:var(--txt-2); border:1px solid var(--rule); }
.fnl-bigdrop.is-low i { background:var(--fnl-drop-line); }
.fnl-legend { display:flex; flex-wrap:wrap; gap:6px 14px; padding:10px 16px; border-bottom:1px solid var(--rule); font-size:11.5px; color:var(--txt-2); }
.fnl-legend span { display:inline-flex; align-items:center; gap:6px; }
.fnl-legend svg { width:22px; height:12px; flex:none; }

/* tags */
.fnl-t { display:inline-block; padding:1px 6px; border-radius:5px; font-size:10.5px; font-weight:700; white-space:nowrap; line-height:1.5; margin-right:3px; }
.fnl-t--nt { background:var(--paper-2); color:var(--fnl-muted); border:1px dashed var(--fnl-nt-line); }
.fnl-t--part { background:var(--fnl-part); color:var(--fnl-part-ink); border:1px solid #f0d68a; background-image:repeating-linear-gradient(135deg,rgba(217,138,0,.18) 0 2px,transparent 2px 6px); cursor:help; }
.fnl-t--pre { background:#eeeeec; color:var(--fnl-pre-ink); }
.fnl-t--low { background:var(--paper-2); color:var(--fnl-muted); border:1px solid var(--rule-2, #d6d2c7); }
.fnl-t--auto { background:var(--fnl-auto); color:var(--fnl-auto-line); }
.fnl-t--big { background:var(--fnl-big-w); color:var(--fnl-big-ink); }
.fnl-tip { position:relative; display:inline-block; }
.fnl-tip [role="tooltip"] { display:none; position:absolute; z-index:20; left:0; top:calc(100% + 6px); width:240px; background:var(--ink); color:#fff; font-size:11.5px; font-weight:500; line-height:1.4; padding:8px 10px; border-radius:7px; box-shadow:0 8px 24px -12px rgba(0,0,0,.4); white-space:normal; }
.fnl-tip:hover [role="tooltip"], .fnl-tip:focus-within [role="tooltip"] { display:block; }

/* horizontal funnel */
.fnl-viz { padding:12px 16px 8px; overflow-x:auto; }
.fnl-viz__in { min-width: calc(var(--cols) * 92px); }
.fnl-viz__heads, .fnl-viz__vals { display:grid; grid-template-columns:repeat(var(--cols),minmax(0,1fr)); }
.fnl-shead { display:flex; flex-direction:column; align-items:flex-start; gap:3px; text-align:left; padding:6px 6px 6px 4px; border-radius:7px; min-height:60px; font-size:12px; line-height:1.25; background:none; cursor:pointer; color:inherit; }
.fnl-shead:hover { background:#f6f5f1; }
.fnl-shead .n { font-family:var(--font-mono); font-size:10.5px; font-weight:700; color:var(--fnl-muted); }
.fnl-shead .l { font-weight:700; }
.fnl-svghost { position:relative; }
.fnl-svghost svg { display:block; overflow:visible; }
.fnl-viz .fnl-svghost svg, .fnl-smx .fnl-svghost svg { width:100%; height:auto; }
.fnl-sval { padding:4px 6px 6px 4px; font-size:11.5px; line-height:1.45; min-width:0; }
.fnl-sval .v { font-family:var(--font-mono); font-weight:700; font-size:15px; font-variant-numeric:tabular-nums; }
.fnl-sval .m { color:var(--txt-2); font-variant-numeric:tabular-nums; }
.fnl-sval .m b { color:var(--txt); }
.fnl-sval .drop.is-big { color:var(--fnl-big-ink); font-weight:700; }
.fnl-sval .byp { color:var(--fnl-byp-ink); }
.fnl-sval .auto { color:var(--fnl-auto-line); }
.fnl-sval.is-low .v, .fnl-sval.is-low .m b { font-weight:500; color:var(--fnl-muted); }
.fnl-sval.is-pass .v { color:var(--fnl-muted); }

/* svg shapes */
.fnl svg .f-node { fill:var(--fnl-node); stroke:var(--fnl-node-line); stroke-width:1; }
.fnl svg .f-node.is-part { fill:url(#fnl-hatch); stroke:var(--fnl-part-line); }
.fnl svg .f-flow { fill:var(--fnl-flow); }
.fnl svg .f-node.is-pre { fill:var(--fnl-pre); stroke:#8d9097; }
.fnl svg .f-flow.is-pre { fill:var(--fnl-pre-flow); }
.fnl svg .f-drop { fill:var(--fnl-drop); stroke:var(--fnl-drop-line); stroke-width:.75; }
.fnl svg .f-drop.is-big { fill:var(--fnl-big); stroke:var(--fnl-big-ink); }
.fnl svg .f-drop.is-na { fill:#f4f3ef; stroke:var(--fnl-nt-line); stroke-dasharray:3 2; }
.fnl svg .f-nt { fill:var(--fnl-nt); stroke:var(--fnl-nt-line); stroke-width:1; stroke-dasharray:4 3; }
.fnl svg .f-part { fill:url(#fnl-hatch); stroke:var(--fnl-part-line); stroke-width:1; }
.fnl svg .f-ghost { stroke:var(--fnl-nt-line); stroke-width:1.25; stroke-dasharray:3 3; fill:none; }
.fnl svg .f-ghost.is-part { stroke:var(--fnl-part-line); }
.fnl svg .f-byp { fill:var(--fnl-byp); stroke:var(--fnl-byp-line); stroke-width:1; }
.fnl svg .f-auto { fill:var(--fnl-auto); stroke:var(--fnl-auto-line); stroke-width:.75; }
.fnl svg .f-autoline { stroke:var(--fnl-auto-line); stroke-width:1.5; stroke-dasharray:2 3; fill:none; }
.fnl svg .is-low { opacity:var(--fnl-low-op); }
.fnl svg .f-lab { font-family:var(--font-mono); font-size:11px; font-weight:600; fill:var(--txt-2); font-variant-numeric:tabular-nums; }
.fnl svg .f-lab.is-big { fill:var(--fnl-big-ink); font-weight:700; }
.fnl svg .f-lab.is-byp { fill:var(--fnl-byp-ink); font-family:var(--font-body, inherit); font-size:10.5px; }
.fnl svg .f-lab.is-sub { font-family:var(--font-body, inherit); font-size:10px; font-weight:500; fill:var(--fnl-muted); }
.fnl svg .f-hit { fill:transparent; cursor:pointer; }
.fnl svg .f-hit:hover { fill:rgba(11,12,14,.03); }

/* splits */
.fnl-smx { display:grid; grid-template-columns:repeat(var(--segs),minmax(0,1fr)); gap:12px; padding:14px 16px; }
.fnl-smx__item { border:1px solid var(--rule); border-radius:8px; padding:10px 10px 8px; min-width:0; }
.fnl-smx__item h4 { margin:0; font-size:13px; font-weight:700; display:flex; gap:6px; align-items:baseline; flex-wrap:wrap; }
.fnl-smx__item h4 small { font-family:var(--font-mono); font-weight:500; color:var(--fnl-muted); font-size:11px; }
.fnl-smx__foot { display:flex; justify-content:space-between; gap:8px; font-size:11.5px; color:var(--txt-2); margin-top:4px; flex-wrap:wrap; }
.fnl-smx__foot b { font-family:var(--font-mono); }
.fnl-cmphead { padding:0 16px; margin:4px 0 6px; }
.fnl-cmpwrap { overflow-x:auto; padding:0 16px 14px; position:relative; }
.fnl-cmp { width:100%; border-collapse:collapse; font-size:12px; }
.fnl-cmp th, .fnl-cmp td { padding:7px 8px; border-bottom:1px solid var(--rule); text-align:right; white-space:nowrap; font-variant-numeric:tabular-nums; }
.fnl-cmp th:first-child, .fnl-cmp td:first-child { text-align:left; }
.fnl-cmp tbody th { font-weight:600; }
.fnl-cmp thead th { font-size:10.5px; color:var(--fnl-muted); font-weight:700; text-transform:uppercase; letter-spacing:.03em; vertical-align:bottom; }
.fnl-cmp td.win { background:var(--mint-wash); color:var(--mint-ink); font-weight:700; }
.fnl-cmp td.low, .fnl-cmp td.na { color:var(--fnl-muted); }
.fnl-cmp td.low small { margin-left:3px; font-size:10px; }
.fnl-cmp tr.best td { font-weight:700; border-bottom:0; font-size:11.5px; }
.fnl-segbar { padding:10px 12px 0; }
.fnl-segs { display:inline-flex; max-width:100%; overflow-x:auto; background:var(--paper-2); border:1px solid var(--rule); border-radius:8px; }
.fnl-segs button { padding:7px 12px; font-size:12px; font-weight:600; color:var(--txt-2); border-right:1px solid var(--rule); white-space:nowrap; background:none; cursor:pointer; }
.fnl-segs button:last-child { border-right:0; }
.fnl-segs button[aria-pressed="true"] { background:var(--ink); color:#fff; }

/* drawer */
.fnl-ovl { position:fixed; inset:0; background:rgba(11,12,14,.32); z-index:1000; }
.fnl-drawer { position:fixed; top:0; right:0; bottom:0; width:min(440px,100vw); background:var(--panel); z-index:1001; box-shadow:-20px 0 60px -30px rgba(0,0,0,.4); display:flex; flex-direction:column; }
.fnl-drawer__head { display:flex; align-items:flex-start; gap:10px; padding:16px 18px; border-bottom:1px solid var(--rule); }
.fnl-drawer__head h2 { font-family:var(--font-display); font-size:16px; margin:0; font-weight:800; }
.fnl-drawer__tags { margin-top:6px; }
.fnl-drawer__body { padding:14px 18px 24px; overflow:auto; font-size:12.5px; }
.fnl-drawer h3 { font-size:11px; text-transform:uppercase; letter-spacing:.06em; color:var(--fnl-muted); margin:18px 0 8px; }
.fnl-why { margin:0 0 8px; line-height:1.5; }
.fnl-xbtn { margin-left:auto; width:32px; height:32px; border-radius:8px; border:1px solid var(--rule); display:grid; place-items:center; background:var(--panel); cursor:pointer; flex:none; }
.fnl-xbtn svg { width:16px; height:16px; }
.fnl-dl { display:grid; grid-template-columns:1fr auto; gap:6px 12px; margin:0; }
.fnl-dl dt { color:var(--txt-2); white-space:pre-wrap; }
.fnl-dl dd { margin:0; font-family:var(--font-mono); font-weight:700; text-align:right; font-variant-numeric:tabular-nums; }
.fnl-tbar { position:relative; height:34px; margin-top:8px; }
.fnl-tbar .track { position:absolute; left:0; right:0; top:10px; height:8px; background:#eeeeec; border-radius:4px; }
.fnl-tbar .wide { position:absolute; top:12px; height:4px; background:var(--fnl-flow); border-radius:2px; }
.fnl-tbar .iqr { position:absolute; top:10px; height:8px; background:var(--fnl-flow); border:1px solid var(--fnl-node-line); border-radius:4px; }
.fnl-tbar .med { position:absolute; top:6px; width:3px; height:16px; background:var(--ink); border-radius:2px; }
.fnl-tbar .ticks { position:absolute; left:0; right:0; top:22px; font-family:var(--font-mono); font-size:10px; color:var(--fnl-muted); }
.fnl-tbar .ticks span { position:absolute; transform:translateX(-50%); }
.fnl-hist { display:grid; grid-template-columns:repeat(6,1fr); gap:6px; align-items:end; margin-top:12px; }
.fnl-hist__b { display:flex; flex-direction:column; align-items:center; gap:2px; font-size:10px; color:var(--fnl-muted); }
.fnl-hist__b .bar { width:100%; max-width:34px; background:var(--fnl-node); border-radius:3px 3px 0 0; min-height:1px; }
.fnl-hist__b .n { font-family:var(--font-mono); color:var(--txt); font-weight:700; }
.fnl-emptybox { border:1px dashed var(--rule-2, #d6d2c7); border-radius:8px; padding:10px 12px; color:var(--txt-2); line-height:1.45; }
.fnl-links { display:flex; flex-direction:column; gap:8px; }
.fnl-links a { display:block; padding:9px 12px; border:1px solid var(--rule); border-radius:8px; color:var(--txt); text-decoration:none; font-weight:600; }
.fnl-links a:hover { background:#f6f5f1; }

/* vertical (mobile) */
.fnl-vert { display:grid; grid-template-columns:148px minmax(0,1fr); gap:6px; padding:12px 12px 4px; }
.fnl-vlist { display:flex; flex-direction:column; min-width:0; }
.fnl-vrow { display:flex; flex-direction:column; justify-content:center; gap:1px; text-align:left; padding:0 4px; border-bottom:1px solid var(--rule); font-size:11.5px; line-height:1.35; min-width:0; background:none; cursor:pointer; color:inherit; }
.fnl-vrow:last-child { border-bottom:0; }
.fnl-vrow .t1 { font-weight:700; font-size:12px; display:flex; gap:5px; align-items:baseline; flex-wrap:wrap; }
.fnl-vrow .t1 .n { font-family:var(--font-mono); color:var(--fnl-muted); font-size:10.5px; }
.fnl-vrow .t2 { font-variant-numeric:tabular-nums; color:var(--txt-2); }
.fnl-vrow .t2 b { font-family:var(--font-mono); color:var(--txt); font-size:13px; }
.fnl-vrow .drop.is-big { color:var(--fnl-big-ink); font-weight:700; }
.fnl-vrow .byp { color:var(--fnl-byp-ink); }
.fnl-vrow .auto { color:var(--fnl-auto-line); }
.fnl-vrow.is-low .t2 b { font-weight:500; color:var(--fnl-muted); }

@media (max-width: 1279px) { .fnl-smx { grid-template-columns:repeat(auto-fill,minmax(220px,1fr)); } }
@media (max-width: 760px) {
  .fnl-kpis { grid-template-columns:repeat(3,minmax(0,1fr)); }
  .fnl-kpi { border-bottom:1px solid var(--rule); padding:8px 10px; }
  .fnl-kpi .v { font-size:14px; }
  .fnl-legend { padding:8px 12px; font-size:11px; }
  .fnl-drawer { top:auto; left:0; width:100%; max-height:86vh; border-radius:14px 14px 0 0; padding-bottom:env(safe-area-inset-bottom,0px); }
  .fnl-cmpwrap { padding:0 12px 12px; }
  .fnl-cmphead { padding:0 12px; }
}
.fnl-sval .pre { color: var(--fnl-pre-ink); }
.fnl svg .f-drop.is-pre { fill: var(--fnl-pre-flow); stroke: var(--fnl-pre); stroke-width: .75; }
.fnl svg .f-lab.is-pre { fill: var(--fnl-pre-ink); font-family: var(--font-body, inherit); font-size: 10.5px; font-weight: 600; }
.fnl-vrow .pre { color: var(--fnl-pre-ink); }
.fnl-swaptoggle { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--txt-2); background: var(--panel); border: 1px solid var(--rule); border-radius: 8px; padding: 0 10px; height: 31px; cursor: pointer; white-space: nowrap; }
.fnl-swaptoggle input { margin: 0; accent-color: var(--ink); }
.fnl-swaptoggle__hint { color: var(--muted, #6b7280); font-size: 12px; }
/* Gang sheet rebuilding (re-saved ordered design) */
.li-file__thumb--building { display: flex; align-items: center; justify-content: center; background: #f4f3ef; }
.gs-build { display: grid; grid-template-columns: repeat(3, 8px); gap: 3px; }
.gs-build span { width: 8px; height: 22px; border-radius: 2px; background: #18f4af; animation: gsb 1.1s ease-in-out infinite; }
.gs-build span:nth-child(2) { animation-delay: .15s; } .gs-build span:nth-child(3) { animation-delay: .3s; }
@keyframes gsb { 0%, 100% { transform: scaleY(.35); opacity: .5; } 50% { transform: scaleY(1); opacity: 1; } }
.li-file__prev { display: flex; align-items: center; gap: 6px; color: var(--c-amber, #b45309); font-weight: 600; }
.li-file__prev img { width: 30px; height: 30px; object-fit: contain; opacity: .5; filter: grayscale(1); border: 1px dashed currentColor; border-radius: 4px; }
.li-file__sub.li-file__quality { white-space: normal; overflow: visible; text-overflow: clip; font-family: inherit; font-size: 12px; line-height: 1.4; }
.li-file__quality .q-ok { color: #0a7a55; font-weight: 600; }
.li-file__quality .q-warn { color: var(--c-amber, #b45309); font-weight: 600; }
.li-file__quality .q-was { color: var(--muted, #8a8a8a); }
