/* ============================================================
   THE MONEY DUCK — internal desk
   One stylesheet for every page. Sections, in order:
     1. tokens        6. dashboard
     2. base          7. product specs
     3. controls      8. settings
     4. login        8b. brand & assets
     5. shell         9. overlays
                     10. responsive
   Every colour resolves through a token. If you add one, add it
   to BOTH the light block and the dark block below it.
   ============================================================ */

/* ---------- 1. tokens ---------- */
:root{
  --bg:#f5f5f3;
  --surface:#ffffff;
  --surface-2:#fafaf9;
  --border:#e6e4e0;
  --border-strong:#d6d3cd;
  --border-hover:#c4c0b8;
  --press:#f0efec;
  --track:#eceae5;
  --wash:rgba(0,0,0,.035);
  --topbar:rgba(255,255,255,.86);
  --float:rgba(255,255,255,.94);
  --login-glow:#fdf6e3;
  --scrim:rgba(31,29,26,.42);

  --text:#1f1d1a;
  --text-2:#6b6560;
  --text-3:#9a938c;
  --on-invert:#ffffff;

  --accent:#e8a319;
  --accent-hover:#dc9812;
  --accent-line:#c98f10;
  --accent-soft:#fdf6e3;
  --accent-text:#8a5f04;
  --accent-edge:#f0e2bd;
  --on-accent:#3d2a02;
  --ring:0 0 0 3px rgba(232,163,25,.28);

  --green-soft:#e9f5ee;  --green-text:#2c7150;  --green-edge:#cfe7da;
  --blue-soft:#eaf2f9;   --blue-text:#356a99;   --blue-edge:#cfe0ee;
  --violet-soft:#f1eefa; --violet-text:#61519b; --violet-edge:#ded5f2;
  --slate-soft:#f0f0ee;  --slate-text:#63696f;  --slate-edge:#dedddb;
  --red-soft:#fbeeeb;    --red-text:#c9563f;    --red-edge:#eecec4;

  --pos:#2c7150;
  --neg:#c9563f;

  --r-sm:8px; --r:12px; --r-lg:16px;
  --sh-1:0 1px 2px rgba(28,25,23,.05), 0 1px 3px rgba(28,25,23,.04);
  --sh-2:0 2px 4px rgba(28,25,23,.05), 0 4px 12px rgba(28,25,23,.06);
  --sh-3:0 4px 8px rgba(28,25,23,.06), 0 12px 28px rgba(28,25,23,.09);

  --display:'Space Grotesk','Instrument Sans',-apple-system,BlinkMacSystemFont,sans-serif;
}

[data-theme="dark"]{
  --bg:#151417;
  --surface:#1d1c20;
  --surface-2:#26242a;
  --border:#302e36;
  --border-strong:#403d47;
  --border-hover:#524e5b;
  --press:#2c2a31;
  --track:#2a282f;
  --wash:rgba(255,255,255,.05);
  --topbar:rgba(29,28,32,.86);
  --float:rgba(38,36,42,.94);
  --login-glow:#2a2418;
  --scrim:rgba(8,7,10,.62);

  --text:#eceae6;
  --text-2:#a8a29b;
  --text-3:#78726c;
  --on-invert:#151417;

  --accent:#e8a319;
  --accent-hover:#f0b132;
  --accent-line:#8a6512;
  --accent-soft:#332a15;
  --accent-text:#f2c669;
  --accent-edge:#4a3c19;
  --on-accent:#2a1d02;
  --ring:0 0 0 3px rgba(232,163,25,.32);

  --green-soft:#17291f;  --green-text:#82d1a5;  --green-edge:#27412f;
  --blue-soft:#16242f;   --blue-text:#8dc1e6;   --blue-edge:#253c4d;
  --violet-soft:#221c33; --violet-text:#b6a4e6; --violet-edge:#362c4d;
  --slate-soft:#25242a;  --slate-text:#a3a7ad;  --slate-edge:#37363e;
  --red-soft:#2f1c18;    --red-text:#e79b86;    --red-edge:#4a2b24;

  --pos:#82d1a5;
  --neg:#e79b86;

  --sh-1:0 1px 2px rgba(0,0,0,.3), 0 1px 3px rgba(0,0,0,.22);
  --sh-2:0 2px 4px rgba(0,0,0,.3), 0 4px 12px rgba(0,0,0,.3);
  --sh-3:0 4px 8px rgba(0,0,0,.34), 0 12px 28px rgba(0,0,0,.44);
}

/* ---------- 2. base ---------- */
*{box-sizing:border-box;margin:0;padding:0}
html{color-scheme:light}
html[data-theme="dark"]{color-scheme:dark}
body{
  font-family:'Instrument Sans',-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;
  background:var(--bg);color:var(--text);line-height:1.55;font-size:15px;
  -webkit-font-smoothing:antialiased;transition:background .18s ease, color .18s ease;
}
h1,h2,h3,h4{font-weight:600;line-height:1.25;letter-spacing:-.011em}
button{font-family:inherit;cursor:pointer;border:none;background:none;color:inherit}
input,textarea,select{font-family:inherit;font-size:14px;color:var(--text)}
.hidden{display:none !important}
.spacer{flex:1}
.display{font-family:var(--display);font-weight:700;letter-spacing:-.015em}
.tabular{font-variant-numeric:tabular-nums}

/* ---------- 3. controls ---------- */
.btn{
  display:inline-flex;align-items:center;justify-content:center;gap:6px;
  background:var(--surface);border:1px solid var(--border-strong);border-radius:var(--r-sm);
  padding:8px 14px;font-size:13.5px;font-weight:500;color:var(--text);
  box-shadow:var(--sh-1);transition:background .13s, border-color .13s, box-shadow .13s;
  white-space:nowrap;line-height:1.4;
}
.btn:hover{background:var(--surface-2);border-color:var(--border-hover);box-shadow:var(--sh-2)}
.btn:active{background:var(--press);box-shadow:none}
.btn:focus-visible{outline:none;box-shadow:var(--ring)}
.btn.primary{background:var(--accent);border-color:var(--accent-line);color:var(--on-accent);font-weight:600}
.btn.primary:hover{background:var(--accent-hover);border-color:var(--accent-line)}
.btn.subtle{background:transparent;border-color:transparent;box-shadow:none;color:var(--text-2)}
.btn.subtle:hover{background:var(--wash);color:var(--text);border-color:transparent}
.btn.danger{color:var(--red-text)}
.btn.danger:hover{background:var(--red-soft);border-color:var(--red-edge)}
.btn.sm{padding:5px 10px;font-size:12.5px;border-radius:6px}
.btn[disabled]{opacity:.5;cursor:default}
.icon-btn{width:32px;height:32px;border-radius:var(--r-sm);display:flex;align-items:center;
  justify-content:center;color:var(--text-2);border:1px solid transparent;transition:.13s}
.icon-btn:hover{background:var(--wash);color:var(--text);border-color:var(--border)}
.icon-btn:focus-visible{outline:none;box-shadow:var(--ring)}
.icon-btn.on{background:var(--accent-soft);color:var(--accent-text);border-color:var(--accent-edge)}
.icon-btn[disabled]{opacity:.3;cursor:default}
.icon-btn[disabled]:hover{background:none;color:var(--text-2);border-color:transparent}
.icon-btn svg{width:17px;height:17px;display:block}

.field{margin-bottom:14px}
.field label{display:block;font-size:12.5px;font-weight:500;color:var(--text-2);margin-bottom:5px}
.field input,.field select,.field textarea{
  width:100%;border:1px solid var(--border-strong);border-radius:var(--r-sm);
  padding:9px 11px;background:var(--surface);transition:border-color .13s, box-shadow .13s}
.field input:focus,.field select:focus,.field textarea:focus{
  outline:none;border-color:var(--accent);box-shadow:var(--ring)}
.field textarea{resize:vertical;line-height:1.55}
.field .help{font-size:12px;color:var(--text-3);margin-top:5px;line-height:1.5}
.field .help a{color:var(--accent-text)}

/* ---------- 4. login ---------- */
#login{min-height:100vh;display:flex;align-items:center;justify-content:center;padding:24px;
  background:radial-gradient(ellipse at 50% 0%, var(--login-glow) 0%, var(--bg) 62%)}
.login-card{background:var(--surface);border:1px solid var(--border);border-radius:var(--r-lg);
  box-shadow:var(--sh-3);padding:34px 32px;width:100%;max-width:370px;text-align:center}
.login-card img{width:82px;height:auto;margin:0 auto 14px;display:block}
.login-card h1{font-family:var(--display);font-size:21px;letter-spacing:-.02em}
.login-card .sub{color:var(--text-3);font-size:13.5px;margin:3px 0 24px}
.login-card .field{text-align:left}
.err{background:var(--red-soft);border:1px solid var(--red-edge);color:var(--red-text);
  border-radius:var(--r-sm);padding:9px 12px;font-size:13px;font-weight:500;
  margin-bottom:14px;text-align:left}

/* ---------- 5. shell ---------- */
.topbar{position:sticky;top:0;z-index:40;background:var(--topbar);backdrop-filter:blur(10px);
  border-bottom:1px solid var(--border);padding:0 20px;height:60px;display:flex;
  align-items:center;gap:8px}
.brand{display:flex;align-items:center;gap:11px;cursor:pointer;padding:5px 9px 5px 5px;
  border-radius:var(--r-sm);transition:background .13s;text-decoration:none;color:inherit}
.brand:hover{background:var(--wash)}
/* The mascot is portrait and already transparent — no tile behind it, or the
   yellow duck sits on a yellow square. Height-constrained, width follows. */
.brand .mark{height:36px;width:auto;display:block;object-fit:contain;flex-shrink:0}
.brand b{font-family:var(--display);font-size:15px;font-weight:700;letter-spacing:-.015em;display:block}
.brand span{font-size:11.5px;color:var(--text-3);display:block;margin-top:-2px}
.userchip{display:flex;align-items:center;gap:8px;font-size:13.5px;font-weight:500;
  color:var(--text-2);margin-right:4px}
.avatar{width:28px;height:28px;border-radius:50%;display:flex;align-items:center;
  justify-content:center;font-size:12px;font-weight:600;color:#fff;flex-shrink:0}

.wrap{width:100%;max-width:1240px;margin:0 auto;padding:28px 20px 72px}
.wrap.narrow{max-width:1120px}
.page-head{display:flex;align-items:center;gap:12px;margin-bottom:20px;flex-wrap:wrap}
.page-head h2{font-family:var(--display);font-size:23px;letter-spacing:-.02em}
.page-head .count{color:var(--text-3);font-size:14px}

/* segmented control — the dashboard timeframe switcher */
.segmented{display:flex;background:var(--track);border-radius:11px;padding:3px;gap:2px}
.segmented button{border-radius:8px;padding:6px 13px;font-size:13px;font-weight:500;
  color:var(--text-2);transition:background .14s, color .14s}
.segmented button:hover{color:var(--text)}
.segmented button.on{background:var(--surface);color:var(--text);font-weight:600;box-shadow:var(--sh-1)}
.segmented button:focus-visible{outline:none;box-shadow:var(--ring)}

/* ---------- 6. dashboard ---------- */
.dash{display:flex;flex-direction:column;gap:26px}
.card{background:var(--surface);border:1px solid var(--border);border-radius:var(--r-lg);
  box-shadow:var(--sh-1);padding:20px 22px}
.card-head{display:flex;justify-content:space-between;align-items:center;gap:10px;flex-wrap:wrap}
.card-head h3{font-family:var(--display);font-size:16px;font-weight:700;letter-spacing:-.01em}
.card-head .sub{font-size:12.5px;color:var(--text-2);font-weight:400}
.src-badge{font-size:9.5px;font-weight:700;letter-spacing:.07em;color:var(--text-3);
  border:1px solid var(--border);border-radius:999px;padding:3px 8px;white-space:nowrap}
.section-label{font-size:11.5px;font-weight:700;letter-spacing:.09em;color:var(--text-3)}

.greet{display:flex;align-items:flex-end;gap:16px;flex-wrap:wrap}
.greet h1{font-family:var(--display);font-weight:700;font-size:clamp(22px,2.4vw,27px);letter-spacing:-.02em}
.greet p{font-size:14px;color:var(--text-2);margin-top:2px}

.kpi-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(215px,1fr));gap:14px}
.kpi{display:flex;flex-direction:column;gap:10px;padding:18px 20px 14px}
.kpi .label{font-size:13px;font-weight:600;color:var(--text-2)}
.kpi .value{font-family:var(--display);font-weight:700;font-size:29px;letter-spacing:-.01em;
  line-height:1;font-variant-numeric:tabular-nums}
.kpi .value.none{color:var(--text-3);font-size:22px}
.kpi .move{display:flex;align-items:baseline;gap:7px;font-size:12.5px;color:var(--text-3)}
.kpi .move b{font-weight:700}
.kpi .move .up{color:var(--pos)}
.kpi .move .down{color:var(--neg)}
.kpi svg{width:100%;height:32px;display:block;opacity:.9}

.dash-row{display:flex;gap:14px;flex-wrap:wrap;align-items:stretch}
.dash-row > .chart-card{flex:2 1 380px}
.dash-row > .audience-card{flex:1 1 300px}
.chart-card,.audience-card{display:flex;flex-direction:column;gap:14px}
.chart-card svg{width:100%;height:150px;display:block}
.audience-card{gap:16px}
.audience .big{font-family:var(--display);font-weight:700;font-size:29px;line-height:1;
  font-variant-numeric:tabular-nums}
.audience .mid{font-family:var(--display);font-weight:700;font-size:22px;line-height:1;
  font-variant-numeric:tabular-nums}
.audience .cap{font-size:13px;color:var(--text-2)}
.hr{height:1px;background:var(--border)}
.meter{height:8px;border-radius:999px;background:var(--track);overflow:hidden}
.meter > i{display:block;height:100%;border-radius:999px;background:var(--accent)}

/* the shared empty state for anything waiting on an integration */
.nodata{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;
  text-align:center;padding:26px 16px;color:var(--text-3);min-height:110px}
.nodata .big{font-family:var(--display);font-weight:700;font-size:16px;color:var(--text-2)}
.nodata .why{font-size:12.5px;max-width:290px;line-height:1.5}
.nodata a{color:var(--accent-text);font-weight:500}

/* workspace tiles — the links out to the other pages */
.tile-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(250px,1fr));gap:14px}
.tile{background:var(--surface);border:1px solid var(--border);border-radius:var(--r-lg);
  box-shadow:var(--sh-1);padding:22px;display:flex;align-items:center;gap:16px;
  text-decoration:none;color:var(--text);text-align:left;width:100%;
  transition:transform .15s, border-color .15s, box-shadow .15s}
.tile:hover{transform:translateY(-2px);border-color:var(--accent);box-shadow:var(--sh-2)}
.tile:focus-visible{outline:none;box-shadow:var(--ring)}
.tile .t{font-family:var(--display);font-weight:700;font-size:19px;letter-spacing:-.01em}
.tile .d{font-size:13px;color:var(--text-2);margin-top:3px;line-height:1.45}
.tile .go{width:36px;height:36px;border-radius:999px;background:var(--accent-soft);
  color:var(--accent-text);display:flex;align-items:center;justify-content:center;
  font-size:16px;flex:none}

/* tools row: tasks / upcoming / quick links.
   Cards stretch to a common height (grid's default), so the row reads as one
   band rather than three ragged blocks. */
.tool-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(300px,1fr));gap:14px}
.tool{display:flex;flex-direction:column;gap:12px}
.pill-count{font-size:12px;font-weight:600;color:var(--accent-text);background:var(--accent-soft);
  border-radius:999px;padding:3px 10px}

.task{display:flex;align-items:center;gap:11px;padding:8px 0;border-bottom:1px solid var(--border)}
.task:last-of-type{border-bottom:none}
.task input[type=checkbox]{width:16px;height:16px;accent-color:var(--accent);cursor:pointer;flex:none}
.task .t{flex:1;font-size:14px;word-break:break-word}
.task.done .t{color:var(--text-3);text-decoration:line-through}
.task .x{opacity:0;color:var(--text-3);font-size:15px;padding:2px 6px;border-radius:4px;transition:.12s}
.task:hover .x,.task:focus-within .x{opacity:1}
.task .x:hover{color:var(--red-text);background:var(--red-soft)}
/* margin-top:auto pins the composer to the bottom of a stretched card, so the
   extra height lands between the list and the input rather than below it. */
.add-row{display:flex;gap:8px;margin-top:auto;padding-top:4px}
.add-row input{flex:1;min-width:0;border:1px solid var(--border);background:var(--bg);
  border-radius:10px;padding:9px 12px;font-size:13.5px;transition:border-color .13s, box-shadow .13s}
.add-row input:focus{outline:none;border-color:var(--accent);box-shadow:var(--ring)}

.event{display:flex;align-items:center;gap:13px}
.event .date{min-width:52px;text-align:center;background:var(--accent-soft);color:var(--accent-text);
  border-radius:11px;padding:6px 4px;flex:none}
.event .date .m{font-size:9.5px;font-weight:700;letter-spacing:.08em}
.event .date .d{font-family:var(--display);font-weight:700;font-size:17px;line-height:1.1}
.event .t{flex:1;font-size:14px;word-break:break-word}
.event .tag-mini{font-size:10.5px;font-weight:700;letter-spacing:.05em;color:var(--text-3);
  border:1px solid var(--border);border-radius:999px;padding:3px 9px;white-space:nowrap}
/* Always visible, not hover-only — a control you can't see is a control that
   doesn't exist. */
.event .ops{display:flex;gap:2px;flex:none}
.event .ops .icon-btn{width:26px;height:26px;font-size:12.5px;border-radius:6px}
.event .ops .icon-btn:last-child:hover{color:var(--red-text);
  background:var(--red-soft);border-color:var(--red-edge)}

.ql-grid{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.ql{display:flex;align-items:center;gap:10px;padding:9px 11px;border:1px solid var(--border);
  border-radius:11px;font-size:13.5px;font-weight:500;text-decoration:none;color:var(--text);
  transition:border-color .13s, background .13s;min-width:0}
.ql:hover{border-color:var(--accent);background:var(--surface-2)}
.ql:focus-visible{outline:none;box-shadow:var(--ring)}
.ql .badge{width:26px;height:26px;border-radius:8px;background:var(--accent-soft);
  color:var(--accent-text);display:flex;align-items:center;justify-content:center;
  font-size:12px;font-weight:700;flex:none;text-transform:uppercase}
.ql .lbl{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}

/* ---------- 7. product specs ---------- */
.grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(240px,1fr));gap:16px}
.prod-card{background:var(--surface);border:1px solid var(--border);border-radius:var(--r);
  box-shadow:var(--sh-1);padding:16px;cursor:pointer;display:flex;flex-direction:column;gap:12px;
  transition:box-shadow .16s, transform .16s, border-color .16s}
.prod-card:hover{box-shadow:var(--sh-2);transform:translateY(-2px);border-color:var(--border-strong)}
.prod-card:focus-visible{outline:none;box-shadow:var(--ring)}
.prod-thumb{height:92px;border-radius:var(--r-sm);display:flex;align-items:center;
  justify-content:center;font-size:36px;background-size:cover;background-position:center}
.prod-card h3{font-size:15.5px}
.prod-meta{display:flex;gap:7px;flex-wrap:wrap;align-items:center;margin-top:auto}

.tag{font-size:11.5px;font-weight:500;border-radius:999px;padding:2.5px 9px;
  display:inline-flex;align-items:center;gap:4px;line-height:1.5;border:1px solid transparent}
.tag.live,.tag.batch{background:var(--green-soft);color:var(--green-text);border-color:var(--green-edge)}
.tag.prelaunch{background:var(--accent-soft);color:var(--accent-text);border-color:var(--accent-edge)}
.tag.sampling,.tag.sample{background:var(--blue-soft);color:var(--blue-text);border-color:var(--blue-edge)}
.tag.shelved,.tag.other{background:var(--slate-soft);color:var(--slate-text);border-color:var(--slate-edge)}
.tag.reference{background:var(--violet-soft);color:var(--violet-text);border-color:var(--violet-edge)}
.tag.neutral{background:var(--surface-2);color:var(--text-2);border-color:var(--border)}

.add-tile{border:1px dashed var(--border-strong);background:transparent;border-radius:var(--r);
  min-height:190px;display:flex;flex-direction:column;align-items:center;justify-content:center;
  gap:9px;cursor:pointer;color:var(--text-3);font-size:13.5px;font-weight:500;
  transition:background .14s, border-color .14s, color .14s;text-align:center;padding:16px;line-height:1.45}
.add-tile:hover{background:var(--surface);border-color:var(--accent);color:var(--text-2)}
.add-tile:focus-visible{outline:none;box-shadow:var(--ring)}
.add-tile .plus{width:36px;height:36px;border-radius:50%;background:var(--accent-soft);
  color:var(--accent-text);display:flex;align-items:center;justify-content:center;
  font-size:20px;line-height:1;font-weight:400}
.add-tile.dragging{background:var(--accent-soft);border-color:var(--accent);
  border-style:solid;color:var(--accent-text)}

.detail-head{background:var(--surface);border:1px solid var(--border);border-radius:var(--r);
  box-shadow:var(--sh-1);padding:18px 20px;margin-bottom:22px;display:flex;gap:16px;
  align-items:center;flex-wrap:wrap}
.detail-head .big-thumb{width:64px;height:64px;border-radius:var(--r-sm);display:flex;
  align-items:center;justify-content:center;font-size:32px;flex-shrink:0}
.detail-head .info{flex:1;min-width:200px}
.detail-head h2{font-family:var(--display);font-size:19px;display:flex;align-items:center;
  gap:9px;flex-wrap:wrap}
.detail-head .desc{color:var(--text-2);font-size:13.5px;margin-top:3px;max-width:620px}
.detail-head .desc.empty{color:var(--text-3);font-style:italic}

.section{margin-bottom:30px}
.section-head{display:flex;align-items:center;gap:10px;margin-bottom:12px;flex-wrap:wrap}
.section-head h3{font-size:15px;font-weight:600}
.section-head .hint{font-size:12.5px;color:var(--text-3)}

.mfr-layout{display:grid;grid-template-columns:248px 1fr;gap:16px;align-items:start}
.mfr-list{display:flex;flex-direction:column;gap:7px}
.mfr-item{background:var(--surface);border:1px solid var(--border);border-radius:var(--r-sm);
  padding:11px 13px;cursor:pointer;transition:border-color .13s, background .13s, box-shadow .13s}
.mfr-item:hover{border-color:var(--border-strong);box-shadow:var(--sh-1)}
.mfr-item.on{border-color:var(--accent);background:var(--accent-soft);box-shadow:var(--sh-1)}
.mfr-item:focus-visible{outline:none;box-shadow:var(--ring)}
.mfr-item .name{font-size:13.5px;font-weight:600;display:flex;align-items:center;gap:6px}
.mfr-item .contact{font-size:12px;color:var(--text-3);margin-top:2px;word-break:break-word;line-height:1.45}
.main-badge{font-size:10px;font-weight:600;letter-spacing:.04em;background:var(--green-soft);
  color:var(--green-text);border:1px solid var(--green-edge);border-radius:4px;
  padding:1px 5px;margin-left:auto;flex-shrink:0}

.panel{background:var(--surface);border:1px solid var(--border);border-radius:var(--r);
  box-shadow:var(--sh-1);padding:18px}
.panel-head{display:flex;align-items:center;gap:9px;flex-wrap:wrap;margin-bottom:14px}
.panel-head h4{font-size:15px}

.tabs{display:flex;gap:2px;border-bottom:1px solid var(--border);margin-bottom:16px}
.tab{padding:7px 12px;font-size:13px;font-weight:500;color:var(--text-3);
  border-radius:6px 6px 0 0;border-bottom:2px solid transparent;margin-bottom:-1px;
  transition:color .13s, border-color .13s}
.tab:hover{color:var(--text-2)}
.tab.on{color:var(--text);border-bottom-color:var(--accent)}
.tab .n{font-size:11px;color:var(--text-3);margin-left:4px}

.stats{display:grid;grid-template-columns:repeat(auto-fit,minmax(112px,1fr));gap:10px;margin-bottom:18px}
.stat{border:1px solid var(--border);border-radius:var(--r-sm);padding:10px 12px;background:var(--surface-2)}
.stat label{font-size:11px;font-weight:500;letter-spacing:.03em;text-transform:uppercase;
  color:var(--text-3);display:block;margin-bottom:2px}
.stat .val{font-size:16px;font-weight:600;cursor:text;border-radius:4px;padding:1px 3px;margin:0 -3px}
.stat .val:hover{background:var(--wash)}
.stat .val:focus{outline:none;background:var(--accent-soft);box-shadow:var(--ring)}

.sub-head{font-size:11.5px;font-weight:600;text-transform:uppercase;letter-spacing:.05em;
  color:var(--text-3);margin-bottom:9px;display:flex;align-items:center;gap:8px}

.spec-row{display:flex;align-items:center;gap:10px;padding:8px 0;border-bottom:1px solid var(--border)}
.spec-row:last-of-type{border-bottom:none}
.spec-row .k{font-size:13px;font-weight:500;width:170px;flex-shrink:0;color:var(--text-2)}
.spec-row .v{flex:1;font-size:13.5px}
.spec-row .k,.spec-row .v{border-radius:4px;padding:2px 5px;margin:-2px 0}
.spec-row .k:focus,.spec-row .v:focus{outline:none;background:var(--accent-soft);box-shadow:var(--ring)}
.spec-row .x{opacity:0;color:var(--text-3);font-size:15px;padding:2px 6px;border-radius:4px;transition:.12s}
.spec-row:hover .x{opacity:1}
.spec-row .x:hover{color:var(--red-text);background:var(--red-soft)}

.tier-table{width:100%;border-collapse:collapse;font-size:13.5px}
.tier-table th{text-align:left;font-size:11px;font-weight:600;text-transform:uppercase;
  letter-spacing:.04em;color:var(--text-3);padding:0 8px 7px;border-bottom:1px solid var(--border)}
.tier-table th.num{text-align:right}
.tier-table td{padding:3px 4px;border-bottom:1px solid var(--border)}
.tier-table tr:last-child td{border-bottom:none}
.tier-table input{width:100%;border:1px solid transparent;border-radius:6px;padding:6px 7px;
  background:transparent;font-size:13.5px;transition:border-color .12s, background .12s}
.tier-table input:hover{background:var(--surface-2)}
.tier-table input:focus{outline:none;background:var(--surface);border-color:var(--accent);box-shadow:var(--ring)}
.tier-table input.n{text-align:right;font-variant-numeric:tabular-nums}
.tier-table .calc{text-align:right;font-variant-numeric:tabular-nums;color:var(--text-2);
  padding-right:11px;white-space:nowrap}
.tier-table .calc.strong{color:var(--text);font-weight:600}
.tier-table .del{opacity:0;color:var(--text-3);padding:4px 6px;border-radius:4px;font-size:14px;transition:.12s}
.tier-table tr:hover .del{opacity:1}
.tier-table .del:hover{color:var(--red-text);background:var(--red-soft)}
.tier-note{font-size:12px;color:var(--text-3);margin-top:10px}

/* variation pricing — the collapsible drawer under the quantity breaks */
.var-cur{border-radius:4px;padding:1px 5px;margin:-1px -5px;cursor:text;min-width:14px}
.var-cur:hover{background:var(--wash)}
.var-cur:focus{outline:none;background:var(--accent-soft);box-shadow:var(--ring);color:var(--text)}
.var-cur:empty::before{content:attr(data-ph);font-style:italic;opacity:.6}
.var-wrap{margin-top:16px;border:1px solid var(--border);border-radius:var(--r-sm);
  background:var(--surface-2);overflow:hidden}
.var-toggle{width:100%;display:flex;align-items:center;gap:9px;padding:10px 13px;
  font-size:13px;font-weight:600;color:var(--text-2);transition:background .13s, color .13s}
.var-toggle:hover{background:var(--wash);color:var(--text)}
.var-toggle:focus-visible{outline:none;box-shadow:var(--ring)}
.var-toggle .caret{font-size:10px;color:var(--text-3);transition:transform .15s}
.var-toggle.open .caret{transform:rotate(90deg)}
.var-toggle .n{font-size:11px;font-weight:600;color:var(--text-3);background:var(--surface);
  border:1px solid var(--border);border-radius:999px;padding:0 7px;line-height:16px}
.var-best{margin-left:auto;font-size:12px;font-weight:500;color:var(--text-3)}
.var-body{padding:2px 12px 12px;display:flex;flex-direction:column;gap:12px;align-items:flex-start}
.var-body > .empty{padding:4px 2px}
.var-block{background:var(--surface);border:1px solid var(--border);border-radius:var(--r-sm);
  box-shadow:var(--sh-1);padding:12px 14px;width:100%}
.var-head{display:flex;align-items:center;gap:8px;margin-bottom:6px}
.var-name{font-size:13.5px;font-weight:600;cursor:text;border-radius:4px;
  padding:2px 6px;margin:-2px -6px;min-width:0}
.var-name:hover{background:var(--wash)}
.var-name:focus{outline:none;background:var(--accent-soft);box-shadow:var(--ring)}
.var-head .x{opacity:0;color:var(--text-3);font-size:15px;padding:2px 6px;border-radius:4px;transition:.12s}
.var-block:hover .var-head .x,.var-head .x:focus-visible{opacity:1}
.var-head .x:hover{color:var(--red-text);background:var(--red-soft)}
.var-foot{display:flex;align-items:flex-start;gap:10px;margin-top:6px}
.var-note{flex:1;min-width:0;font-size:12px;line-height:1.5;color:var(--text-3);cursor:text;
  border-radius:4px;padding:2px 5px;margin-left:-5px}
.var-note:hover{background:var(--wash)}
.var-note:focus{outline:none;background:var(--accent-soft);box-shadow:var(--ring);color:var(--text-2)}
.var-note:empty::before{content:attr(data-ph);font-style:italic;opacity:.7}
.var-foot .btn{flex:none}

.chiprow{display:flex;gap:6px;flex-wrap:wrap;align-items:center}
.chiprow + .chiprow{margin-top:8px}
.chip{font-size:12.5px;font-weight:500;border:1px solid var(--border-strong);border-radius:999px;
  padding:4px 12px;background:var(--surface);color:var(--text-2);transition:.13s;
  display:inline-flex;align-items:center;gap:5px}
.chip:hover{border-color:var(--border-hover);color:var(--text)}
.chip.on{background:var(--text);border-color:var(--text);color:var(--on-invert)}
.chip:focus-visible{outline:none;box-shadow:var(--ring)}
.chip .n{font-size:11px;opacity:.7;font-variant-numeric:tabular-nums}
.chip.scope.on{background:var(--accent);border-color:var(--accent-line);color:var(--on-accent)}
.scope-label{font-size:12px;color:var(--text-3);margin-right:2px}

.img-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(178px,1fr));gap:14px;margin-top:14px}
.img-card{border:1px solid var(--border);border-radius:var(--r);background:var(--surface);
  box-shadow:var(--sh-1);overflow:hidden;position:relative;transition:box-shadow .16s, transform .16s}
.img-card:hover{box-shadow:var(--sh-2);transform:translateY(-2px)}
.img-face{height:132px;background-size:cover;background-position:center;background-color:var(--surface-2);
  position:relative;cursor:zoom-in;border-bottom:1px solid var(--border)}
.img-face .tag{position:absolute;top:8px;left:8px;background:var(--float)}
.img-actions{position:absolute;top:7px;right:7px;display:flex;gap:4px;opacity:0;transition:opacity .14s}
.img-card:hover .img-actions,.img-card:focus-within .img-actions{opacity:1}
.img-actions a,.img-actions button{width:27px;height:27px;border-radius:6px;background:var(--float);
  border:1px solid var(--border);display:flex;align-items:center;justify-content:center;
  font-size:12.5px;color:var(--text-2);text-decoration:none;box-shadow:var(--sh-1)}
.img-actions a:hover,.img-actions button:hover{background:var(--surface);color:var(--text)}
.img-actions .rm:hover{background:var(--red-soft);color:var(--red-text);border-color:var(--red-edge)}
.img-body{padding:10px 12px}
.img-body .lab{font-size:13px;font-weight:500;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.img-body .m{font-size:11.5px;color:var(--text-3);margin-top:2px;display:flex;
  justify-content:space-between;gap:6px}

/* Document sections: Specs / Certificates / Invoices / Quotes / Other. Only
   non-empty ones render, so the page never shows five hollow headings. */
.doc-group{margin-top:16px}
.doc-group .sub-head{margin-bottom:7px}
.doc-group .sub-head .n{font-size:11px;font-weight:600;color:var(--text-3);
  background:var(--surface-2);border:1px solid var(--border);border-radius:999px;
  padding:0 7px;line-height:16px}
.doc-group .doc-list{margin-top:0}

.doc-list{background:var(--surface);border:1px solid var(--border);border-radius:var(--r);
  box-shadow:var(--sh-1);overflow:hidden;margin-top:14px}
.doc-row{display:flex;align-items:center;gap:12px;padding:11px 14px;
  border-bottom:1px solid var(--border);transition:background .12s}
.doc-row:last-child{border-bottom:none}
.doc-row:hover{background:var(--surface-2)}
.doc-icon{width:34px;height:34px;border-radius:var(--r-sm);display:flex;align-items:center;
  justify-content:center;font-size:10.5px;flex-shrink:0;font-weight:700;letter-spacing:.02em}
.doc-info{flex:1;min-width:0}
.doc-info .lab{font-size:13.5px;font-weight:500;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.doc-info .m{font-size:11.5px;color:var(--text-3);margin-top:1px;overflow:hidden;
  text-overflow:ellipsis;white-space:nowrap}
.doc-actions{display:flex;gap:5px;flex-shrink:0}
.doc-actions a,.doc-actions button{width:29px;height:29px;border-radius:6px;
  border:1px solid transparent;display:flex;align-items:center;justify-content:center;
  font-size:13px;color:var(--text-3);text-decoration:none;transition:.12s}
.doc-actions a:hover,.doc-actions button:hover{background:var(--surface-2);
  border-color:var(--border);color:var(--text)}
.doc-actions .rm:hover{background:var(--red-soft);color:var(--red-text);border-color:var(--red-edge)}
.dropzone{border:1px dashed var(--border-strong);border-radius:var(--r);padding:22px;
  text-align:center;color:var(--text-3);font-size:13.5px;cursor:pointer;transition:.14s;
  background:transparent;margin-top:12px}
.dropzone:hover{background:var(--surface);border-color:var(--accent);color:var(--text-2)}
.dropzone.dragging{background:var(--accent-soft);border-color:var(--accent);
  border-style:solid;color:var(--accent-text)}
.dropzone .big{font-size:20px;display:block;margin-bottom:5px}
.dropzone:focus-visible{outline:none;box-shadow:var(--ring)}

.notes-box{background:var(--surface);border:1px solid var(--border);border-radius:var(--r);
  box-shadow:var(--sh-1);padding:16px 18px}
.note{display:flex;gap:11px;padding:12px 0;border-bottom:1px solid var(--border)}
.note:last-of-type{border-bottom:none}
.note .body{flex:1;min-width:0}
.note .nhead{display:flex;align-items:baseline;gap:8px;margin-bottom:1px}
.note .nhead b{font-size:13px;font-weight:600}
.note .nhead .t{font-size:11.5px;color:var(--text-3)}
.note .txt{font-size:13.5px;white-space:pre-wrap;word-break:break-word}
.note-compose{display:flex;gap:11px;margin-top:14px;padding-top:14px;border-top:1px solid var(--border)}
.note-compose textarea{flex:1;border:1px solid var(--border-strong);border-radius:var(--r-sm);
  padding:9px 11px;resize:vertical;min-height:40px;line-height:1.5;background:var(--surface)}
.note-compose textarea:focus{outline:none;border-color:var(--accent);box-shadow:var(--ring)}

.empty{color:var(--text-3);font-size:13.5px;padding:14px 2px;font-style:italic}

/* ---------- 8. settings ---------- */
/* A form column reads badly at full page width, so it's capped — and centred,
   heading included, so it doesn't look shoved against the left edge. */
.settings{display:flex;flex-direction:column;gap:18px;max-width:760px;width:100%;margin:0 auto}
.settings .page-head{margin-bottom:0}
.settings .card{padding:22px 24px}
.settings h3{font-family:var(--display);font-size:17px;font-weight:700;letter-spacing:-.01em}
.settings .lede{font-size:13.5px;color:var(--text-2);margin:4px 0 18px;line-height:1.55;max-width:560px}
.conn{display:inline-flex;align-items:center;gap:6px;font-size:12px;font-weight:600;
  border-radius:999px;padding:3px 11px;border:1px solid transparent}
.conn.on{background:var(--green-soft);color:var(--green-text);border-color:var(--green-edge)}
.conn.off{background:var(--slate-soft);color:var(--slate-text);border-color:var(--slate-edge)}
.conn .dot{width:6px;height:6px;border-radius:50%;background:currentColor}
.form-row{display:grid;grid-template-columns:1fr 1fr;gap:14px}
.settings .actions{display:flex;gap:8px;align-items:center;flex-wrap:wrap;
  margin-top:4px;padding-top:16px;border-top:1px solid var(--border)}
.test-out{font-size:12.5px;font-weight:500}
.test-out.ok{color:var(--green-text)}
.test-out.bad{color:var(--red-text)}

.ql-edit{display:flex;align-items:center;gap:10px;padding:10px 0;border-bottom:1px solid var(--border)}
.ql-edit:last-of-type{border-bottom:none}
.ql-edit .badge{width:30px;height:30px;border-radius:9px;background:var(--accent-soft);
  color:var(--accent-text);display:flex;align-items:center;justify-content:center;
  font-size:12.5px;font-weight:700;flex:none;text-transform:uppercase}
.ql-edit .meta{flex:1;min-width:0}
.ql-edit .meta b{font-size:13.5px;font-weight:600;display:block}
.ql-edit .meta span{font-size:12px;color:var(--text-3);display:block;overflow:hidden;
  text-overflow:ellipsis;white-space:nowrap}
.ql-edit .ops{display:flex;gap:2px;flex:none}

/* ---------- 8b. brand & assets ----------
   The tile backdrops and the swatches are literal brand colours set inline —
   everything around them still resolves through the theme tokens. */
.bk-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(290px,1fr));gap:14px}
.bk-asset{background:var(--surface);border:1px solid var(--border);border-radius:var(--r-lg);
  box-shadow:var(--sh-1);padding:14px;display:flex;flex-direction:column;gap:12px;
  transition:border-color .14s, box-shadow .14s}
.bk-asset:hover{border-color:var(--border-strong);box-shadow:var(--sh-2)}
.bk-asset.dragging{border-color:var(--accent);box-shadow:var(--ring)}
.bk-face{height:180px;border-radius:var(--r);display:flex;align-items:center;
  justify-content:center;overflow:hidden;border:1px solid var(--border);flex:none}
.bk-face img{max-width:76%;max-height:76%;width:auto;height:auto;object-fit:contain;display:block}
/* Not .empty — that's the page-wide "nothing here yet" line, which is italic. */
.bk-face.blank{flex-direction:column;gap:6px;border-style:dashed;border-color:var(--border-strong);
  background:transparent;color:var(--text-3);font-size:12.5px;font-weight:500;
  transition:background .14s, border-color .14s, color .14s;text-align:center;padding:12px}
.bk-face.blank:hover{background:var(--surface-2);border-color:var(--accent);color:var(--text-2)}
.bk-face.blank:focus-visible{outline:none;box-shadow:var(--ring)}
.bk-face.blank .plus{font-size:21px;line-height:1;color:var(--accent-text)}
.bk-face.blank .fmt{font-size:10.5px;letter-spacing:.04em;color:var(--text-3);opacity:.8}

.bk-text{display:flex;flex-direction:column;gap:2px;min-width:0}
.bk-text .nm{font-family:var(--display);font-weight:700;font-size:15.5px;letter-spacing:-.01em;
  cursor:text;border-radius:4px;padding:1px 5px;margin:0 -5px}
.bk-text .nt{font-size:12.5px;color:var(--text-2);line-height:1.45;cursor:text;
  border-radius:4px;padding:1px 5px;margin:0 -5px}
.bk-asset [contenteditable]:hover,.bk-color [contenteditable]:hover{background:var(--wash)}
.bk-asset [contenteditable]:focus,.bk-color [contenteditable]:focus{
  outline:none;background:var(--accent-soft);box-shadow:var(--ring);color:var(--text)}
.bk-asset [contenteditable]:empty::before,.bk-color [contenteditable]:empty::before{
  content:attr(data-ph);font-style:italic;color:var(--text-3);opacity:.8}

.bk-foot{display:flex;align-items:center;justify-content:space-between;gap:8px;flex-wrap:wrap;
  padding-top:11px;border-top:1px solid var(--border);margin-top:auto}
.bk-dots{display:flex;align-items:center;gap:6px;flex:none;position:relative}
.bk-dot{width:18px;height:18px;border-radius:50%;border:1px solid var(--border-strong);
  transition:box-shadow .13s, border-color .13s}

/* the 4th dot: any colour at all. Rainbow until one is picked, then it wears
   the colour it set, with the glyph kept legible against it. */
.bk-dot.dropper{display:flex;align-items:center;justify-content:center;color:#fff;
  background:conic-gradient(from 210deg,#ff5c89,#f8d111,#5fb947,#2daae2,#a06bff,#ff5c89)}
.bk-dot.dropper svg{width:11px;height:11px;display:block;
  filter:drop-shadow(0 0 1px rgba(0,0,0,.45))}
.bk-dot.dropper.on svg{filter:none}
.bk-dot.dropper.open{border-color:var(--surface);box-shadow:0 0 0 2px var(--accent)}

.bk-bgpop{position:absolute;top:26px;left:0;z-index:30;width:232px;padding:11px 12px 12px;
  background:var(--float);backdrop-filter:blur(10px);border:1px solid var(--border-strong);
  border-radius:var(--r);box-shadow:var(--sh-3);cursor:default;
  display:flex;flex-direction:column;gap:7px;animation:fade .12s ease}
.bk-bgpop .lbl{font-size:10.5px;font-weight:700;letter-spacing:.07em;text-transform:uppercase;
  color:var(--text-3)}
.bk-bgpop .lbl:not(:first-child){margin-top:3px;padding-top:9px;border-top:1px solid var(--border)}
.bk-bgpop .quick{display:grid;grid-template-columns:repeat(6,1fr);gap:6px}
.bk-bgpop .quick button{aspect-ratio:1;border-radius:6px;border:1px solid var(--border-strong);
  transition:transform .11s, box-shadow .11s}
.bk-bgpop .quick button:hover{transform:scale(1.14);box-shadow:var(--sh-2)}
.bk-bgpop .quick button.on{border-color:var(--surface);box-shadow:0 0 0 2px var(--accent)}
.bk-bgpop .quick button:focus-visible{outline:none;box-shadow:var(--ring)}
.bk-bgpop .row{display:flex;align-items:center;gap:6px}
.bk-bgpop .bk-pick{width:28px;height:28px;border-radius:var(--r-sm);flex:none}
.bk-bgpop .hexin{flex:1;min-width:0;width:100%;border:1px solid var(--border-strong);
  border-radius:var(--r-sm);padding:5px 8px;font-size:12.5px;background:var(--surface);
  text-transform:uppercase}
.bk-bgpop .hexin:focus{outline:none;border-color:var(--accent);box-shadow:var(--ring)}
.bk-bgpop .row .btn{flex:none}
/* A cream dot on a white card needs the gap ring, or "selected" reads as
   "slightly different border" — the surface-coloured ring separates the two. */
.bk-dot.on{border-color:var(--surface);box-shadow:0 0 0 2px var(--accent)}
.bk-dot:focus-visible{outline:none;box-shadow:var(--ring)}
.bk-ops{display:flex;align-items:center;gap:4px;flex-wrap:wrap}
.bk-ops .btn.sm{text-decoration:none}
.bk-ops .icon-btn{width:27px;height:27px;font-size:13px}
.icon-btn.rm:hover{background:var(--red-soft);color:var(--red-text);border-color:var(--red-edge)}
.bk-meta{font-size:11px;letter-spacing:.02em;color:var(--text-3);font-variant-numeric:tabular-nums}

.bk-cgroup{margin-bottom:22px}
.bk-cgroup:last-child{margin-bottom:0}
.bk-ghead{display:flex;align-items:baseline;gap:10px;flex-wrap:wrap;margin-bottom:10px}
.bk-ghead b{font-family:var(--display);font-size:15px;font-weight:700;letter-spacing:-.01em}
.bk-ghead span{font-size:12.5px;color:var(--text-3)}
.bk-swatches{display:grid;grid-template-columns:repeat(auto-fill,minmax(186px,1fr));gap:12px}
/* position:relative, not overflow:hidden — the Pantone panel has to escape the
   card. The swatch clips its own top corners instead. */
.bk-color{background:var(--surface);border:1px solid var(--border);border-radius:var(--r);
  box-shadow:var(--sh-1);display:flex;flex-direction:column;position:relative;
  transition:border-color .14s, box-shadow .14s}
.bk-color:hover{border-color:var(--border-strong);box-shadow:var(--sh-2)}
.bk-chipwrap{position:relative;height:98px;flex:none;overflow:hidden;
  border-bottom:1px solid var(--border);border-radius:var(--r) var(--r) 0 0}
.bk-chip{position:absolute;inset:0;width:100%;height:100%}
.bk-chip:focus-visible{outline:none;box-shadow:var(--ring) inset}

/* Pantone lives in the corner of the swatch — 98px of flat colour that was
   doing nothing, so the card costs no more height than before. */
.bk-pms{position:absolute;top:7px;right:7px;max-width:calc(100% - 14px);
  display:inline-flex;align-items:center;gap:4px;padding:3px 8px;border-radius:999px;
  font-size:10.5px;font-weight:700;letter-spacing:.02em;line-height:1.5;
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
  transition:opacity .13s, transform .13s}
.bk-pms:hover{transform:scale(1.05)}
.bk-pms i{font-style:normal;font-size:9.5px;opacity:.72}
/* Empty ones stay out of the way until you go looking, like the ✕ on a task. */
.bk-pms.ghost{opacity:0}
.bk-color:hover .bk-pms.ghost,.bk-pms.ghost:focus-visible,.bk-pms.ghost.open{opacity:1}
.bk-pms:focus-visible{outline:none;box-shadow:var(--ring)}

/* Centred on the swatch, then nudged back inside the viewport by clampPanel()
   — a card in the last column would otherwise hang off the right edge. */
.bk-pmspop{position:absolute;top:88px;left:50%;transform:translateX(-50%);z-index:30;
  width:280px;max-width:calc(100vw - 24px);padding:11px 12px 12px;
  background:var(--float);backdrop-filter:blur(10px);border:1px solid var(--border-strong);
  border-radius:var(--r);box-shadow:var(--sh-3);cursor:default;
  display:flex;flex-direction:column;gap:6px;animation:fade .12s ease}
.bk-pmspop .lbl{font-size:10.5px;font-weight:700;letter-spacing:.07em;text-transform:uppercase;
  color:var(--text-3);display:flex;gap:6px;min-width:0}
.bk-pmspop .lbl span{font-weight:600;letter-spacing:.02em;text-transform:none;color:var(--text-2);
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.bk-pmspop .empty{padding:2px 0 3px;font-size:12px}
.bk-pmspop > .btn{align-self:flex-start}
.pms-row{display:flex;align-items:center;gap:5px}
.pms-row input{border:1px solid var(--border-strong);border-radius:var(--r-sm);
  padding:5px 7px;font-size:12px;background:var(--surface);min-width:0;
  transition:border-color .12s, box-shadow .12s}
.pms-row input:focus{outline:none;border-color:var(--accent);box-shadow:var(--ring)}
.pms-row .kind{width:88px;flex:none;color:var(--text-2)}   /* fits "Uncoated" */
.pms-row .code{flex:1;font-weight:600;letter-spacing:.02em;text-transform:uppercase}
.pms-row .icon-btn{width:23px;height:23px;font-size:11.5px;flex:none;border-radius:6px}
.bk-cbody{padding:10px 12px 12px;display:flex;flex-direction:column;gap:3px}
.bk-cbody .nm{font-size:14px;font-weight:600;cursor:text;border-radius:4px;padding:1px 5px;margin:0 -5px}
.bk-cbody .rl{font-size:12px;color:var(--text-2);line-height:1.45;cursor:text;
  border-radius:4px;padding:1px 5px;margin:0 -5px}
.bk-crow{display:flex;align-items:center;justify-content:space-between;gap:8px}
.bk-crow .hex{font-size:12.5px;font-weight:500;color:var(--text-2);letter-spacing:.02em}
.bk-cops{display:flex;align-items:center;gap:2px;flex:none}
.bk-pick{width:18px;height:18px;border-radius:5px;cursor:pointer;display:block;position:relative;
  border:1px solid var(--border-strong)}
.bk-pick input{opacity:0;width:0;height:0;position:absolute}
.bk-cops .icon-btn{width:24px;height:24px;font-size:12px}
.add-tile.bk-addcolor{min-height:0;gap:6px}
.add-tile.bk-addcolor .plus{width:30px;height:30px;font-size:18px}

.bk-two{display:grid;grid-template-columns:repeat(auto-fit,minmax(300px,1fr));gap:14px}
.bk-three{display:grid;grid-template-columns:repeat(auto-fit,minmax(280px,1fr));gap:14px;
  align-items:start}
.bk-aa{font-size:52px;line-height:1;margin-bottom:12px}
.bk-samp{color:var(--text);margin-bottom:16px}
.bk-fmeta{display:flex;flex-direction:column;gap:4px;padding-top:14px;
  border-top:1px solid var(--border);font-size:12.5px;color:var(--text-2)}
.bk-fmeta b{font-size:13px;font-weight:600;color:var(--text)}
.bk-fmeta code{font-size:11.5px;color:var(--text-3);word-break:break-word}
.bk-rh{font-family:var(--display);font-size:15px;font-weight:700;letter-spacing:-.01em;
  margin-bottom:12px}
.bk-rules{list-style:none;display:flex;flex-direction:column;gap:8px;
  font-size:13px;line-height:1.5;color:var(--text-2)}
.bk-rules li.swatched{display:flex;align-items:center;gap:9px}
.bk-rules li.swatched i{width:12px;height:12px;border-radius:4px;flex:none;
  border:1px solid var(--border)}
.bk-rfoot{font-size:12.5px;color:var(--text-3);margin-top:11px;padding-top:10px;
  border-top:1px solid var(--border);line-height:1.5}
.bk-voice{display:flex;flex-direction:column;gap:7px;font-size:13px;line-height:1.5}
.bk-voice .yes{color:var(--green-text)}
.bk-voice .no{color:var(--text-3)}

/* ---------- 9. overlays ---------- */
.modal-bg{position:fixed;inset:0;background:var(--scrim);z-index:80;display:flex;
  align-items:center;justify-content:center;padding:20px;animation:fade .14s ease}
@keyframes fade{from{opacity:0}to{opacity:1}}
.modal{background:var(--surface);border:1px solid var(--border);border-radius:var(--r-lg);
  box-shadow:var(--sh-3);width:100%;max-width:420px;padding:22px;max-height:88vh;overflow:auto}
.modal h3{font-family:var(--display);font-size:16.5px;margin-bottom:16px}
.modal-actions{display:flex;gap:8px;justify-content:flex-end;margin-top:20px;align-items:center}
.checkline{display:flex;align-items:center;gap:8px;font-size:13.5px;cursor:pointer;color:var(--text-2)}
.checkline input{width:16px;height:16px;accent-color:var(--accent)}
.lightbox{position:fixed;inset:0;background:rgba(10,9,12,.86);z-index:90;display:flex;
  align-items:center;justify-content:center;padding:34px;cursor:zoom-out;animation:fade .14s ease}
.lightbox img{max-width:100%;max-height:100%;border-radius:var(--r);box-shadow:var(--sh-3);background:#fff}
.toast{position:fixed;bottom:22px;left:50%;transform:translateX(-50%);background:var(--text);
  color:var(--on-invert);padding:9px 17px;border-radius:999px;z-index:100;font-size:13.5px;
  font-weight:500;box-shadow:var(--sh-3)}

/* skeleton shimmer while the first metrics call is in flight */
.skel{background:var(--track);border-radius:6px;color:transparent;animation:pulse 1.4s ease-in-out infinite}
@keyframes pulse{0%,100%{opacity:1}50%{opacity:.45}}

/* ---------- 10. responsive ---------- */
@media(max-width:800px){
  .mfr-layout{grid-template-columns:1fr}
  .brand span{display:none}
  .userchip span{display:none}
  .spec-row{flex-wrap:wrap}
  .spec-row .k{width:100%}
  .form-row{grid-template-columns:1fr}
  .hide-sm{display:none}
}
@media(max-width:420px){
  .ql-grid{grid-template-columns:1fr}
}
@media(prefers-reduced-motion:reduce){*{transition:none !important;animation:none !important}}
