/* The Butcher's Ledger: dark workbench theme with a cream light mode. */
:root {
  --teal: #009D8E; --mustard: #E9A825; --cream: #F3F1E8; --ink: #020202;
  --bg: #0D0E0E; --bg2: #121414; --surface: #171A19; --surface2: #1E2221; --surface3: #262B2A;
  --line: #2B302F; --line2: #3A403E;
  --text: #F3F1E8; --muted: #A9A699; --faint: #9C998F;
  --accent: #2EC4B6; --accent-ink: #04201D; --gold: #E9A825; --gold-ink: #1A1200;
  --good: #4FD1A1; --warn: #F2B544; --bad: #F2705C; --info: #8FA8FF;
  --c-shop: #2EC4B6; --c-online: #8FA8FF; --c-markets: #E9A825; --c-wholesale: #E9806A;
  --shadow: 0 10px 40px rgba(0,0,0,.45);
  --radius: 12px;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #F3F1E8; --bg2: #ECE9DC; --surface: #FFFFFF; --surface2: #FAF8F1; --surface3: #F1EEE2;
  --line: #E3DECB; --line2: #D2CCB5;
  --text: #141414; --muted: #5C594E; --faint: #6E6B5C;
  --accent: #007D71; --accent-ink: #FFFFFF; --gold: #E9A825; --gold-ink: #1A1200;
  --good: #137A55; --warn: #9A6400; --bad: #B83A26; --info: #3D56B8;
  --c-shop: #009D8E; --c-online: #4A63C9; --c-markets: #D49412; --c-wholesale: #C4552F;
  --shadow: 0 10px 40px rgba(40,30,0,.14);
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--text);
  font: 14px/1.45 'Space Grotesk', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
h1, h2, h3, .display { font-family: 'Archivo Black', 'Space Grotesk', sans-serif; font-weight: 400; letter-spacing: .2px; margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); }
.num, .tbl td.r, .kpi-val { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.hidden { display: none !important; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
img { max-width: 100%; }

/* Top bar */
.topbar {
  position: sticky; top: 0; z-index: 40; height: 58px;
  display: flex; align-items: center; gap: 14px; padding: 0 20px;
  background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); flex: none; }
.brand img { width: 34px; height: 39px; object-fit: contain; }
.brand b { font-family: 'Archivo Black'; font-weight: 400; font-size: 15px; display: block; line-height: 1.05; }
.brand small { display: block; font-size: 10.5px; color: var(--muted); letter-spacing: 1.6px; text-transform: uppercase; }
.nav { display: flex; gap: 2px; margin-left: 10px; }
.nav a {
  color: var(--muted); text-decoration: none; padding: 8px 12px; border-radius: 8px; font-weight: 500; white-space: nowrap;
  display: flex; align-items: center; gap: 7px;
}
.nav a:hover { color: var(--text); background: var(--surface2); }
.nav a.on { color: var(--text); background: var(--surface3); box-shadow: inset 0 -2px 0 var(--gold); }
.nav kbd { display: none; }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.kbtn {
  display: flex; align-items: center; gap: 10px; height: 34px; padding: 0 8px 0 12px; min-width: 210px;
  border: 1px solid var(--line2); background: var(--surface); color: var(--muted); border-radius: 9px; cursor: pointer;
}
.kbtn:hover { color: var(--text); border-color: var(--accent); }
.kbtn span { flex: 1; text-align: left; }
kbd {
  font: 600 11px/1 'Space Grotesk'; padding: 3px 6px; border-radius: 5px; border: 1px solid var(--line2);
  background: var(--surface2); color: var(--muted); white-space: nowrap;
}
.iconbtn {
  width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--line2); background: var(--surface);
  display: grid; place-items: center; cursor: pointer; color: var(--muted); flex: none; padding: 0;
}
.iconbtn:hover { color: var(--text); border-color: var(--accent); }
.iconbtn svg { width: 17px; height: 17px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; object-position: 50% 20%; border: 2px solid var(--gold); cursor: pointer; flex: none; }
.beta-badge {
  font-size: 11px; font-weight: 700; letter-spacing: .3px; color: var(--gold-ink); background: var(--gold);
  padding: 4px 9px; border-radius: 99px; white-space: nowrap;
}
.menubtn { display: none; }

/* Page */
.page { max-width: 1400px; margin: 0 auto; padding: 22px 24px 60px; }
.page-head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head h1 { font-size: 28px; line-height: 1.1; }
.page-head p { margin: 6px 0 0; color: var(--muted); }
.page-head .spacer { flex: 1; }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.tabs { display: inline-flex; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 3px; gap: 2px; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button, .tabs a {
  border: 0; background: none; padding: 6px 12px; border-radius: 7px; cursor: pointer; color: var(--muted); font-weight: 500; white-space: nowrap; text-decoration: none;
}
.tabs .on { background: var(--surface3); color: var(--text); }
.tabs .count { font-size: 11px; color: var(--faint); margin-left: 4px; }
.tabs .on .count { color: var(--muted); }
.subbar { display: flex; gap: 12px; align-items: center; justify-content: space-between; margin-bottom: 16px; flex-wrap: wrap; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 34px; padding: 0 14px; border-radius: 9px;
  border: 1px solid var(--line2); background: var(--surface2); color: var(--text); font-weight: 600; cursor: pointer; white-space: nowrap; text-decoration: none;
}
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--gold); border-color: var(--gold); color: var(--gold-ink); }
.btn.primary:hover { filter: brightness(1.07); }
.btn.teal { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { color: var(--text); background: var(--surface2); }
.btn.danger { color: var(--bad); }
.btn.sm { height: 28px; padding: 0 10px; font-size: 12.5px; border-radius: 7px; }
.btn svg { width: 15px; height: 15px; }
.btn kbd { margin-left: 2px; }
.btn.primary kbd { background: rgba(0,0,0,.12); border-color: rgba(0,0,0,.18); color: var(--gold-ink); }

/* Cards & grids */
.grid { display: grid; gap: 14px; }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-main { grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; min-width: 0; }
.card-h { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.card-h h3 { font-family: 'Space Grotesk'; font-weight: 700; font-size: 13px; letter-spacing: 1.1px; text-transform: uppercase; color: var(--muted); }
.card-h .spacer { flex: 1; }
.card-h a, .linkbtn { font-size: 12.5px; color: var(--accent); text-decoration: none; background: none; border: 0; cursor: pointer; padding: 0; font-weight: 600; }
.kpi { position: relative; overflow: hidden; }
.kpi-label { color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase; }
.kpi-val { font-family: 'Archivo Black'; font-size: 30px; line-height: 1.1; margin: 8px 0 4px; }
.kpi-sub { color: var(--muted); font-size: 12.5px; }
.delta { font-weight: 700; font-size: 12.5px; }
.delta.up { color: var(--good); } .delta.down { color: var(--bad); }
.kpi .stripe { position: absolute; left: 0; top: 0; bottom: 0; width: 3px; }
.kpi.clickable { cursor: pointer; }
.kpi.clickable:hover { border-color: var(--line2); }
.meter { height: 6px; background: var(--surface3); border-radius: 99px; overflow: hidden; margin-top: 10px; }
.meter i { display: block; height: 100%; background: var(--accent); border-radius: 99px; }

/* Tables */
.table-wrap { overflow-x: auto; margin: 0 -16px; padding: 0 16px; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th { text-align: left; font-size: 11.5px; font-weight: 600; letter-spacing: .9px; text-transform: uppercase; color: var(--faint); padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr.click { cursor: pointer; }
.tbl tbody tr.click:hover td { background: var(--surface2); }
.tbl .r { text-align: right; }
.tbl td.r { font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl .strong { font-weight: 700; }
.tbl tfoot td { border-top: 1px solid var(--line2); font-weight: 700; }

/* Pills */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 99px; font-size: 12px; font-weight: 600; white-space: nowrap; border: 1px solid transparent; }
.pill::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.good { color: var(--good); background: color-mix(in srgb, var(--good) 14%, transparent); }
.pill.warn { color: var(--warn); background: color-mix(in srgb, var(--warn) 14%, transparent); }
.pill.bad { color: var(--bad); background: color-mix(in srgb, var(--bad) 14%, transparent); }
.pill.info { color: var(--info); background: color-mix(in srgb, var(--info) 14%, transparent); }
.pill.neutral { color: var(--muted); background: var(--surface3); }
.pill.accent { color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); }
.chip { display: inline-block; padding: 1px 8px; border-radius: 6px; font-size: 11.5px; background: var(--surface3); color: var(--muted); margin: 0 4px 4px 0; }

/* Lists */
.rows { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); min-width: 0; }
.row:last-child { border-bottom: 0; }
.row .grow { flex: 1; min-width: 0; }
.row .t { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .s { color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thumb { width: 40px; height: 40px; border-radius: 8px; object-fit: contain; background: var(--cream); flex: none; }
.dot { width: 9px; height: 9px; border-radius: 50%; flex: none; display: inline-block; }
.datebox { width: 46px; flex: none; text-align: center; border: 1px solid var(--line2); border-radius: 8px; padding: 4px 0; line-height: 1.1; }
.datebox b { display: block; font-family: 'Archivo Black'; font-weight: 400; font-size: 17px; }
.datebox small { font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; }
.check { width: 20px; height: 20px; border-radius: 6px; border: 2px solid var(--line2); display: grid; place-items: center; cursor: pointer; flex: none; background: transparent; padding: 0; }
.check.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.check svg { width: 12px; height: 12px; }
.empty { text-align: center; padding: 26px 10px; color: var(--muted); }

/* Charts */
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart text { fill: var(--faint); font: 11px 'Space Grotesk'; font-variant-numeric: tabular-nums; }
.chart .grid line { stroke: var(--line); }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12.5px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.tip { position: fixed; z-index: 90; pointer-events: none; max-width: calc(100vw - 16px); background: var(--surface3); border: 1px solid var(--line2); border-radius: 8px; padding: 8px 10px; font-size: 12.5px; box-shadow: var(--shadow); min-width: 150px; }
.tip b { display: block; margin-bottom: 4px; }
.tip div { display: flex; justify-content: space-between; gap: 14px; font-variant-numeric: tabular-nums; }
.hbar { display: grid; grid-template-columns: 130px 1fr 80px; gap: 10px; align-items: center; padding: 6px 0; }
.hbar .track { height: 10px; background: var(--surface3); border-radius: 99px; overflow: hidden; }
.hbar .track i { display: block; height: 100%; border-radius: 99px; }
.hbar .v { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.hbar .n { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Pipeline */
.board { display: grid; grid-template-columns: repeat(6, minmax(200px, 1fr)); gap: 12px; overflow-x: auto; padding-bottom: 8px; }
.col { background: var(--bg2); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; min-height: 380px; display: flex; flex-direction: column; gap: 8px; }
.col.drop { border-color: var(--gold); background: color-mix(in srgb, var(--gold) 6%, var(--bg2)); }
.col-h { display: flex; align-items: center; gap: 8px; padding: 2px 4px 6px; }
.col-h b { font-size: 13px; }
.col-h .n { color: var(--faint); font-size: 12px; }
.col-h .v { margin-left: auto; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.lead { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px; cursor: grab; }
.lead:hover { border-color: var(--line2); }
.lead.dragging { opacity: .45; }
.lead .t { font-weight: 700; }
.lead .s { color: var(--muted); font-size: 12px; margin-top: 2px; }
.lead .f { display: flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 12px; }
.lead .mv { margin-left: auto; display: flex; gap: 2px; }
.lead .mv button { width: 24px; height: 24px; border-radius: 6px; border: 1px solid var(--line2); background: var(--surface2); cursor: pointer; padding: 0; display: grid; place-items: center; color: var(--muted); }
.lead .mv button:hover { color: var(--text); border-color: var(--accent); }
.lead .mv svg { width: 12px; height: 12px; }
.due { font-size: 12px; font-weight: 600; }
.due.over { color: var(--bad); } .due.today { color: var(--warn); } .due.soon { color: var(--muted); }

/* Forms */
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; min-width: 0; }
.field label { font-size: 12px; font-weight: 600; color: var(--muted); letter-spacing: .3px; }
.inp, select.inp, textarea.inp {
  width: 100%; background: var(--bg2); border: 1px solid var(--line2); border-radius: 8px; padding: 8px 10px; color: var(--text); min-height: 36px;
}
textarea.inp { resize: vertical; min-height: 90px; line-height: 1.5; }
.inp:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.frow { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.switch { position: relative; width: 38px; height: 22px; border-radius: 99px; background: var(--surface3); border: 1px solid var(--line2); cursor: pointer; flex: none; padding: 0; }
.switch::after { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--muted); transition: .15s; }
.switch.on { background: var(--accent); border-color: var(--accent); }
.switch.on::after { left: 18px; background: var(--accent-ink); }
.small-print { font-size: 12px; color: var(--faint); line-height: 1.5; }
.segs { display: inline-flex; border: 1px solid var(--line2); border-radius: 8px; overflow: hidden; }
.segs button { border: 0; background: var(--bg2); padding: 6px 10px; cursor: pointer; color: var(--muted); font-weight: 600; font-size: 12.5px; }
.segs button + button { border-left: 1px solid var(--line2); }
.segs button.on { background: var(--accent); color: var(--accent-ink); }

/* Overlays */
.scrim { position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 60; opacity: 0; transition: opacity .15s; }
.scrim.show { opacity: 1; }
.modal {
  position: fixed; z-index: 70; left: 50%; top: 8vh; transform: translateX(-50%); width: min(560px, calc(100vw - 24px));
  max-height: 84vh; overflow: auto; background: var(--surface); border: 1px solid var(--line2); border-radius: 14px; box-shadow: var(--shadow);
}
.modal.wide { width: min(820px, calc(100vw - 24px)); }
.modal-h { display: flex; align-items: center; gap: 10px; padding: 16px 18px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--surface); z-index: 1; }
.modal-h h2 { font-size: 18px; }
.modal-h .x { margin-left: auto; }
.modal-b { padding: 16px 18px; }
.modal-f { display: flex; gap: 8px; justify-content: flex-end; padding: 12px 18px; border-top: 1px solid var(--line); position: sticky; bottom: 0; background: var(--surface); }
.drawer {
  position: fixed; z-index: 70; top: 0; right: 0; bottom: 0; width: min(480px, 100vw); background: var(--surface); border-left: 1px solid var(--line2);
  box-shadow: var(--shadow); display: flex; flex-direction: column; transform: translateX(100%); transition: transform .2s ease;
}
.drawer.show { transform: none; }
.drawer.left { left: 0; right: auto; border-left: 0; border-right: 1px solid var(--line2); transform: translateX(-100%); }
.drawer.left.show { transform: none; }
.drawer .modal-b { flex: 1; overflow: auto; }
.toasts { position: fixed; z-index: 95; bottom: 18px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; align-items: center; width: max-content; max-width: calc(100vw - 24px); }
.toast { background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 10px; font-weight: 600; box-shadow: var(--shadow); display: flex; align-items: center; gap: 10px; animation: tin .2s ease; }
.toast i { width: 8px; height: 8px; border-radius: 50%; background: var(--gold); flex: none; }
@keyframes tin { from { transform: translateY(10px); opacity: 0; } }

/* Command palette */
.palette { position: fixed; z-index: 80; left: 50%; top: 12vh; transform: translateX(-50%); width: min(620px, calc(100vw - 24px)); background: var(--surface); border: 1px solid var(--line2); border-radius: 14px; box-shadow: var(--shadow); overflow: hidden; }
.palette input { width: 100%; border: 0; background: transparent; padding: 16px 18px; font-size: 16px; color: var(--text); border-bottom: 1px solid var(--line); outline: none; }
.palette .list { max-height: 52vh; overflow: auto; padding: 6px; }
.palette .grp { font-size: 11px; letter-spacing: 1.2px; text-transform: uppercase; color: var(--faint); padding: 10px 12px 4px; }
.palette .it { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 8px; cursor: pointer; }
.palette .it .ic { width: 26px; height: 26px; border-radius: 7px; background: var(--surface3); display: grid; place-items: center; color: var(--muted); flex: none; }
.palette .it .ic svg { width: 14px; height: 14px; }
.palette .it .h { margin-left: auto; color: var(--faint); font-size: 12px; }
.palette .it.sel { background: var(--surface3); }
.palette .it.sel .ic { background: var(--gold); color: var(--gold-ink); }
.palette .foot { display: flex; gap: 14px; padding: 9px 14px; border-top: 1px solid var(--line); color: var(--faint); font-size: 12px; flex-wrap: wrap; }

/* Sign in */
.signin { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.signin-art { position: relative; background: #050606 url('../../assets/Drying-Meat.jpg') center/cover; }
.signin-art::after { content: ''; position: absolute; inset: 0; background: linear-gradient(160deg, rgba(0,157,142,.55), rgba(2,2,2,.82) 60%); }
.signin-art .copy { position: absolute; z-index: 1; left: 48px; right: 48px; bottom: 48px; color: #F3F1E8; }
.signin-art .copy h2 { font-size: 44px; line-height: 1.05; }
.signin-art .copy p { max-width: 420px; color: #d9d6c8; }
.signin-form { display: flex; align-items: center; justify-content: center; padding: 40px 24px; background: var(--bg); }
.signin-box { width: 100%; max-width: 380px; }
.signin-box img.logo { width: 92px; display: block; margin-bottom: 18px; }
.signin-box h1 { font-size: 26px; margin-bottom: 6px; }
.code { display: flex; gap: 8px; margin: 14px 0; }
.code input { width: 44px; height: 52px; text-align: center; font-size: 22px; font-family: 'Archivo Black'; border-radius: 10px; border: 1px solid var(--line2); background: var(--bg2); color: var(--text); }
.code input:focus { outline: none; border-color: var(--gold); }
.form-err { color: var(--bad); font-size: 13px; font-weight: 600; margin: -4px 0 12px; }
.form-err[hidden] { display: none; }

/* Calendar */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--line); gap: 1px; }
.cal .dow { background: var(--surface2); padding: 8px; font-size: 11.5px; font-weight: 600; color: var(--faint); letter-spacing: 1px; text-transform: uppercase; }
.cal .day { background: var(--surface); min-height: 108px; padding: 6px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.cal .day.out { background: var(--bg2); }
.cal .day.out .dn { color: var(--faint); }
.cal .day.today .dn { background: var(--gold); color: var(--gold-ink); border-radius: 6px; padding: 0 6px; }
.cal .dn { font-size: 12px; font-weight: 700; align-self: flex-start; }
.ev { font-size: 11.5px; border-radius: 6px; padding: 3px 6px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-left: 3px solid; background: var(--surface2); text-align: left; border-top: 0; border-right: 0; border-bottom: 0; width: 100%; color: var(--text); }
.ev:hover { background: var(--surface3); }
.ev.hastings { border-color: var(--c-shop); }
.ev.napier { border-color: var(--c-online); }
.ev.event { border-color: var(--c-markets); }
.ev .tm { color: var(--muted); }

/* Site manager */
.site-shell { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--bg2); }
.site-chrome { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-bottom: 1px solid var(--line); background: var(--surface); }
.site-chrome .dots { display: flex; gap: 5px; }
.site-chrome .dots i { width: 10px; height: 10px; border-radius: 50%; background: var(--line2); }
.site-chrome .url { flex: 1; min-width: 0; background: var(--bg2); border: 1px solid var(--line); border-radius: 7px; padding: 4px 10px; font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.site-stage { padding: 18px; display: flex; justify-content: center; }
.site-frame { width: 100%; max-width: 1180px; background: #F3F1E8; border-radius: 8px; overflow: hidden; transition: max-width .25s ease; box-shadow: 0 6px 30px rgba(0,0,0,.25); }
.site-frame.phone { max-width: 380px; }
.status-strip { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); margin-bottom: 12px; }

/* The mini public site. Always the brand's own light look. */
.ws { --t: #009D8E; --m: #E9A825; --c: #F3F1E8; --k: #020202; color: #020202; font-family: 'Space Grotesk', sans-serif; background: #F3F1E8; }
.ws h1, .ws h2, .ws h3 { font-family: 'Archivo Black'; font-weight: 400; color: #020202; }
.ws [data-edit] { position: relative; cursor: pointer; outline: 2px dashed transparent; outline-offset: -4px; transition: outline-color .12s; }
.ws [data-edit]:hover, .ws [data-edit].editing { outline-color: #E9A825; }
.ws [data-edit]::after {
  content: attr(data-label); position: absolute; top: 8px; right: 8px; background: #E9A825; color: #1A1200; font: 700 11px 'Space Grotesk';
  padding: 4px 8px; border-radius: 99px; opacity: 0; transition: opacity .12s; pointer-events: none; z-index: 2;
}
.ws [data-edit]:hover::after, .ws [data-edit].editing::after, .ws.hotspots [data-edit]::after { opacity: 1; }
.ws.hotspots [data-edit] { outline-color: rgba(233,168,37,.55); }
/* Teal darkened a step (#00756A) behind small text so it passes WCAG AA; #009D8E stays the accent. */
.ws-ann { background: #00756A; color: #fff; text-align: center; font-weight: 600; font-size: 13px; padding: 9px 40px; }
.ws-nav { display: flex; align-items: center; gap: 22px; padding: 12px 28px; background: #F3F1E8; }
.ws-nav img { width: 54px; }
.ws-nav nav { display: flex; gap: 20px; font-weight: 600; font-size: 14px; margin-left: auto; }
.ws-nav .cart { background: #020202; color: #F3F1E8; border-radius: 99px; padding: 6px 14px; font-weight: 700; font-size: 13px; }
.ws-hero { display: grid; grid-template-columns: 1fr 1.1fr; align-items: center; gap: 20px; padding: 36px 28px 44px; background: #00756A; color: #fff; }
.ws-hero .eyebrow { text-transform: uppercase; letter-spacing: 2px; font-size: 12px; font-weight: 700; color: #F3F1E8; }
.ws-hero h1 { color: #F3F1E8; font-size: 50px; line-height: 1; margin: 10px 0 14px; }
.ws-hero p { margin: 0 0 20px; font-size: 16px; max-width: 420px; }
.ws-hero .cta { display: inline-block; background: #E9A825; color: #020202; font-weight: 700; padding: 12px 22px; border-radius: 99px; }
.ws-hero img { width: 100%; filter: drop-shadow(0 18px 18px rgba(0,0,0,.25)); }
.ws-sec { padding: 40px 28px; }
.ws-sec h2 { font-size: 30px; margin-bottom: 12px; }
.ws-about { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; align-items: center; }
.ws-about p { font-size: 15px; line-height: 1.6; margin: 0 0 10px; }
.ws-about img { border-radius: 12px; width: 100%; aspect-ratio: 4/3; object-fit: cover; }
.ws-maker { background: #020202; color: #F3F1E8; }
.ws-maker h2 { color: #E9A825; }
.ws-products { background: #fff; }
.ws-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.ws-card { background: #F3F1E8; border-radius: 12px; padding: 12px; position: relative; }
.ws-card img { width: 100%; aspect-ratio: 1; object-fit: contain; }
.ws-card h3 { font-size: 15px; margin: 6px 0 2px; }
.ws-card .p { font-weight: 700; }
.ws-card .soldout { position: absolute; top: 10px; left: 10px; background: #020202; color: #F3F1E8; font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 99px; }
.ws-card.off img { opacity: .55; }
.ws-find { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; background: #E9A825; }
.ws-find h2 { font-size: 24px; }
.ws-find table { width: 100%; border-collapse: collapse; font-size: 14px; }
.ws-find td { padding: 5px 0; border-bottom: 1px solid rgba(0,0,0,.15); }
.ws-find td + td { text-align: right; font-weight: 600; }
.ws-mk { padding: 10px 0; border-bottom: 1px solid rgba(0,0,0,.15); }
.ws-mk b { display: block; }
.ws-foot { background: #020202; color: #cfccbf; padding: 22px 28px; font-size: 13px; display: flex; gap: 14px; align-items: center; }
.ws-foot img { width: 40px; }
.site-frame.phone .ws-nav nav { display: none; }
.site-frame.phone .ws-hero, .site-frame.phone .ws-about, .site-frame.phone .ws-find { grid-template-columns: 1fr; }
.site-frame.phone .ws-hero h1 { font-size: 34px; }
.site-frame.phone .ws-grid { grid-template-columns: 1fr 1fr; }
.site-frame.phone .ws-sec, .site-frame.phone .ws-hero { padding-left: 18px; padding-right: 18px; }

.prod-edit { display: flex; gap: 10px; align-items: center; padding: 10px; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 8px; cursor: pointer; background: var(--bg2); }
.prod-edit:hover { border-color: var(--line2); }
.imgpick { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 6px; }
.imgpick button { min-width: 0; padding: 2px; border: 2px solid var(--line); border-radius: 8px; background: var(--cream); cursor: pointer; aspect-ratio: 1; }
.imgpick button.on { border-color: var(--gold); }
.imgpick img { display: block; width: 100%; height: 100%; object-fit: contain; }

/* Invoice */
.inv { background: #fff; color: #111; border-radius: 10px; padding: 28px; font-size: 13px; }
.inv h2 { font-family: 'Archivo Black'; color: #111; font-size: 26px; }
.inv .top { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.inv img { width: 70px; }
.inv table { width: 100%; border-collapse: collapse; margin-top: 18px; }
.inv th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: #666; border-bottom: 2px solid #009D8E; padding: 6px 4px; }
.inv td { padding: 7px 4px; border-bottom: 1px solid #eee; font-variant-numeric: tabular-nums; }
.inv .r { text-align: right; }
.inv .tot td { border: 0; padding: 4px; }
.inv .grand td { font-weight: 800; font-size: 15px; border-top: 2px solid #111; }
.inv .muted { color: #666; }

.template-body { white-space: pre-wrap; font-size: 13.5px; line-height: 1.6; background: var(--bg2); border: 1px solid var(--line); border-radius: 10px; padding: 14px; }
.merge { background: color-mix(in srgb, var(--gold) 25%, transparent); border-radius: 4px; padding: 0 3px; }
.timeline { position: relative; padding-left: 18px; }
.timeline::before { content: ''; position: absolute; left: 5px; top: 4px; bottom: 4px; width: 2px; background: var(--line2); }
.tl { position: relative; padding: 0 0 14px; }
.tl::before { content: ''; position: absolute; left: -17px; top: 5px; width: 10px; height: 10px; border-radius: 50%; background: var(--surface); border: 2px solid var(--accent); }
.tl .d { font-size: 12px; color: var(--faint); }
.tl.won::before { border-color: var(--good); background: var(--good); }
.tl.lost::before { border-color: var(--bad); }
.tl.order::before { border-color: var(--gold); }

.shortcuts { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 22px; }
.shortcuts div { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.hint-bar { margin-top: 26px; display: flex; gap: 16px; flex-wrap: wrap; color: var(--faint); font-size: 12px; align-items: center; }

/* Responsive */
@media (max-width: 1180px) {
  .kbtn { min-width: 0; } .kbtn span { display: none; }
  .nav a { padding: 8px 9px; }
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 980px) {
  .nav { display: none; }
  .menubtn { display: grid; }
  .g-main, .g3 { grid-template-columns: 1fr; }
  .signin { grid-template-columns: 1fr; }
  .signin-art { min-height: 220px; }
  .signin-art .copy { left: 20px; right: 20px; bottom: 20px; }
  .signin-art .copy h2 { font-size: 28px; }
}
@media (max-width: 640px) {
  .topbar { padding: 0 12px; gap: 8px; }
  .brand small, .brand b { display: none; }
  .top-actions { gap: 6px; }
  .beta-badge { font-size: 10px; padding: 3px 7px; }
  .kbtn kbd { display: none; }
  .kbtn { padding: 0; width: 34px; justify-content: center; }
  .page { padding: 16px 16px 50px; }
  .page-head h1 { font-size: 23px; }
  .g4, .g2 { grid-template-columns: 1fr 1fr; gap: 10px; }
  .g2.stack { grid-template-columns: 1fr; }
  .kpi-val { font-size: 23px; }
  .card { padding: 14px; }
  .table-wrap { margin: 0 -14px; padding: 0 14px; }
  .hide-sm { display: none; }
  .frow { grid-template-columns: 1fr; }
  .board { grid-template-columns: repeat(6, 82vw); scroll-snap-type: x mandatory; }
  .col { scroll-snap-align: start; min-height: 0; }
  .cal .day { min-height: 64px; padding: 4px; }
  .cal .dow { padding: 6px 2px; text-align: center; font-size: 10px; }
  .ev { font-size: 0; padding: 0; height: 6px; border-left-width: 0; border-radius: 3px; }
  .ev.hastings { background: var(--c-shop); } .ev.napier { background: var(--c-online); } .ev.event { background: var(--c-markets); }
  .hbar { grid-template-columns: 96px 1fr 64px; }
  .shortcuts { grid-template-columns: 1fr; }
  .site-stage { padding: 10px; }
  .ws-hero { grid-template-columns: 1fr; }
  .ws-hero h1 { font-size: 30px; }
  .ws-about, .ws-find { grid-template-columns: 1fr; }
  .ws-grid { grid-template-columns: 1fr 1fr; }
  .ws-nav nav { display: none; }
  .ws-sec, .ws-hero { padding-left: 16px; padding-right: 16px; }
  .inv { padding: 16px; }
  .hint-bar { display: none; }
  .signin-art { min-height: 170px; }
  .code input { width: 40px; height: 48px; }
}
/* Icon sizing inside buttons and links */
button svg, a svg, .kbtn svg { width: 16px; height: 16px; flex: none; }
.kbtn svg { color: var(--muted); }
@media (min-width: 1181px) { body.side-edit .page { padding-right: 504px; } }
/* Below 980px the website section editor is a bottom sheet, so the live
   preview stays visible above it while Sam types. */
@media (max-width: 980px) {
  .drawer.side { top: auto; height: 52vh; width: 100vw; border-left: 0; border-top: 1px solid var(--line2); border-radius: 16px 16px 0 0; transform: translateY(100%); }
  .drawer.side.show { transform: none; }
  .drawer.side .modal-h { padding: 10px 16px; }
  .drawer.side .modal-h h2 { font-size: 16px; }
  .drawer.side .modal-b { padding: 12px 16px; }
  .drawer.side .modal-f { padding: 10px 16px; }
  body.side-edit .page { padding-bottom: 56vh; }
  .drawer.side #pe-img { height: 80px !important; }
}
@media (max-width: 640px) {
  .modal-f { flex-wrap: wrap; }
  .modal-f .btn { flex: 1 1 auto; }
  .modal-f .btn.icon-sm { flex: 0 0 auto; }
}

/* ---------- Socials ---------- */
:root { --fb: #1877F2; --ig1: #F58529; --ig2: #DD2A7B; --ig3: #8134AF;
  --fbp-bg: #242526; --fbp-text: #E4E6EB; --fbp-muted: #B0B3B8; --fbp-line: #3A3B3C;
  --igp-bg: #000000; --igp-text: #F5F5F5; --igp-muted: #A8A8A8; --igp-line: #262626; --igp-tag: #E0F1FF; --fbp-tag: #4599FF; }
:root[data-theme="light"] {
  --fbp-bg: #FFFFFF; --fbp-text: #050505; --fbp-muted: #65676B; --fbp-line: #CED0D4;
  --igp-bg: #FFFFFF; --igp-text: #000000; --igp-muted: #737373; --igp-line: #DBDBDB; --igp-tag: #00376B; --fbp-tag: #0064D1; }
.spacer { flex: 1; }
.row .s.wrap { white-space: normal; }
.b-fb { color: var(--fb); }
.b-ig { color: var(--ig2); }
.sch { display: inline-flex; gap: 3px; vertical-align: middle; }
.sch i { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 5px; }
.sch i svg { width: 12px; height: 12px; }
.sch i.b-fb { background: var(--fb); color: #fff; }
.sch i.b-ig { background: linear-gradient(45deg, var(--ig1), var(--ig2) 55%, var(--ig3)); color: #fff; }
.sico { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; flex: none; color: #fff; }
.sico svg { width: 16px; height: 16px; }
.sico.b-fb { background: var(--fb); }
.sico.b-ig { background: linear-gradient(45deg, var(--ig1), var(--ig2) 55%, var(--ig3)); }
.sico.lg { width: 42px; height: 42px; border-radius: 11px; }
.sico.lg svg { width: 21px; height: 21px; }
.hdot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex: none; background: var(--good); box-shadow: 0 0 0 3px color-mix(in srgb, var(--good) 22%, transparent); }
.hdot.warn { background: var(--warn); box-shadow: 0 0 0 3px color-mix(in srgb, var(--warn) 22%, transparent); }
.hdot.bad { background: var(--bad); box-shadow: 0 0 0 3px color-mix(in srgb, var(--bad) 22%, transparent); }

.sthumb { position: relative; width: 40px; height: 40px; border-radius: 8px; background: var(--cream); flex: none; overflow: hidden; display: grid; place-items: center; }
.sthumb img { width: 100%; height: 100%; object-fit: cover; }
.sthumb.sm { width: 34px; height: 34px; border-radius: 7px; }
.sthumb.lg { width: 64px; height: 64px; border-radius: 10px; }
.sthumb.text { background: var(--surface3); color: var(--muted); font-family: 'Archivo Black'; font-size: 13px; }
.sthumb .k { position: absolute; right: 2px; bottom: 2px; min-width: 16px; height: 16px; padding: 0 3px; border-radius: 5px; background: rgba(0,0,0,.66); color: #fff; font-size: 10px; display: grid; place-items: center; }
.sthumb .k svg { width: 9px; height: 9px; fill: currentColor; }

.sbanner { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 10px; margin-bottom: 12px; border: 1px solid; font-size: 13.5px; }
.sbanner > svg { width: 18px; height: 18px; flex: none; }
.sbanner .grow { flex: 1; min-width: 0; }
.sbanner.bad { color: var(--text); border-color: color-mix(in srgb, var(--bad) 55%, transparent); background: color-mix(in srgb, var(--bad) 12%, var(--surface)); }
.sbanner.bad > svg, .sbanner.bad b { color: var(--bad); }
.sbanner.warn { color: var(--text); border-color: color-mix(in srgb, var(--warn) 50%, transparent); background: color-mix(in srgb, var(--warn) 10%, var(--surface)); }
.sbanner.warn > svg, .sbanner.warn b { color: var(--warn); }
.drawer .sbanner { align-items: flex-start; }

.stools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.snav { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.snav b { min-width: 128px; text-align: center; font-variant-numeric: tabular-nums; }

/* Week view */
.sweek { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.sday { background: var(--bg2); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px; min-height: 340px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.sday header { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 0 2px 4px; }
.sday header b { font-size: 12px; letter-spacing: 1px; text-transform: uppercase; color: var(--faint); }
.sday .dn { font-family: 'Archivo Black'; font-size: 17px; line-height: 1; }
.sday.today { border-color: var(--gold); box-shadow: inset 0 2px 0 var(--gold); }
.sday.past { background: color-mix(in srgb, var(--bg2) 60%, var(--bg)); }
.sday.past header .dn { color: var(--muted); }
.sday.drop, .scal .day.drop { outline: 2px dashed var(--gold); outline-offset: -3px; background: color-mix(in srgb, var(--gold) 7%, var(--bg2)); }
.sday .mk { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; color: var(--c-markets); width: 100%; }
.sday .mk svg { width: 12px; height: 12px; }
.sadd { margin-top: auto; border: 1px dashed var(--line2); background: transparent; color: var(--faint); border-radius: 8px; padding: 6px; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 5px; font-size: 12.5px; font-weight: 600; }
.sadd:hover { color: var(--text); border-color: var(--accent); }
.sadd svg { width: 13px; height: 13px; }
.spost { background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--line2); border-radius: 9px; padding: 7px; cursor: pointer; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.spost[draggable="true"] { cursor: grab; }
.spost:hover, .spost:focus-visible { border-color: var(--line2); }
.spost.dragging, .sev.dragging { opacity: .4; }
.spost .top { display: flex; gap: 7px; width: 100%; min-width: 0; }
.spost .grow { flex: 1; min-width: 0; }
.spost .tm { display: flex; align-items: center; justify-content: space-between; gap: 4px; font-size: 12px; font-weight: 700; }
.spost .cap { font-size: 12px; color: var(--muted); line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; margin-top: 2px; }
.spost .pill { font-size: 11px; padding: 1px 7px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.st-needs { border-left-color: var(--warn) !important; }
.st-approved { border-left-color: var(--info) !important; }
.st-posted { border-left-color: var(--good) !important; }
.st-failed { border-left-color: var(--bad) !important; }
.st-draft { border-left-color: var(--line2) !important; }
.spost.st-draft { border-left-style: dashed; }
.spost.st-failed { background: color-mix(in srgb, var(--bad) 7%, var(--surface)); }
.spost.st-needs { background: color-mix(in srgb, var(--warn) 6%, var(--surface)); }
.scal .day { min-height: 116px; }
.lcap { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-width: 0; }

.snudge { display: flex; align-items: center; gap: 14px; margin-top: 14px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.snudge .grow { flex: 1; min-width: 0; }
.snudge .stack { display: flex; flex: none; }
.snudge .stack img { width: 38px; height: 38px; border-radius: 8px; background: var(--cream); object-fit: contain; border: 2px solid var(--surface); margin-left: -12px; }
.snudge .stack img:first-child { margin-left: 0; }

/* Instagram grid view */
.igprof { max-width: 640px; }
.igh { display: flex; gap: 18px; align-items: center; margin-bottom: 14px; }
.igh > img { width: 76px; height: 76px; border-radius: 50%; background: var(--cream); object-fit: contain; padding: 8px; flex: none; box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--ig2); }
.igh .nums { display: flex; gap: 16px; margin: 4px 0; font-size: 13px; flex-wrap: wrap; }
.iggrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 3px; }
.igcell { position: relative; aspect-ratio: 4 / 5; padding: 0; border: 0; background: var(--cream); cursor: pointer; overflow: hidden; }
.igcell img { width: 100%; height: 100%; object-fit: cover; display: block; }
.igcell .k { position: absolute; top: 6px; right: 6px; color: #fff; filter: drop-shadow(0 1px 2px rgba(0,0,0,.6)); }
.igcell .k svg { width: 16px; height: 16px; }
.igcell.queued { outline: 3px solid var(--info); outline-offset: -3px; }
.igcell.queued.st-needs { outline-color: var(--warn); }
.igcell.queued.st-draft { outline: 3px dashed var(--line2); }
.igcell.queued img { opacity: .82; }
.igcell .when { position: absolute; left: 6px; bottom: 6px; right: 6px; background: rgba(0,0,0,.72); color: #fff; font-size: 11px; font-weight: 600; padding: 3px 6px; border-radius: 6px; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Previews, drawn the way each network draws them */
.pvwrap { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: start; }
.pvwrap.one { grid-template-columns: minmax(0, 1fr); max-width: 400px; margin: 0 auto; }
.pvcell { min-width: 0; transition: opacity .15s; }
.pvcell.off { opacity: .38; }
.pvlabel { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 8px; }
.pvlabel svg { width: 14px; height: 14px; }
.pv { border-radius: 10px; overflow: hidden; border: 1px solid; font: 14px/1.38 -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif; }
.pv svg { width: 20px; height: 20px; }
.pv-h { display: flex; align-items: center; gap: 9px; padding: 11px 12px; }
.pv-h .grow { flex: 1; min-width: 0; }
.pv-h b { display: block; font-weight: 600; font-size: 14px; }
.pv-h small { display: flex; align-items: center; gap: 3px; font-size: 12px; }
.pv-h small svg { width: 11px; height: 11px; }
.pv .av { width: 38px; height: 38px; border-radius: 50%; background: #F3F1E8; object-fit: contain; padding: 3px; display: block; }
.pv .dots svg { width: 20px; height: 20px; }
.htag { font-weight: 400; }
.seemore { border: 0; background: none; padding: 0; cursor: pointer; font: inherit; font-weight: 600; }
.fbp { background: var(--fbp-bg); color: var(--fbp-text); border-color: var(--fbp-line); }
.fbp .pv-h small, .fbp .dots { color: var(--fbp-muted); }
.fbp .htag { color: var(--fbp-tag); }
.fbp .seemore { color: var(--fbp-text); }
.fb-text { padding: 0 12px 11px; white-space: normal; overflow-wrap: anywhere; }
.fb-text.big { font-size: 22px; line-height: 1.25; padding: 6px 12px 18px; }
.fb-media { background: #000; }
.fb-media.one img { width: 100%; height: 100%; object-fit: cover; display: block; background: #F3F1E8; }
.fb-media.one { overflow: hidden; }
.fb-media.grid { display: grid; gap: 2px; aspect-ratio: 1; }
.fb-media.grid.n2 { grid-template-columns: 1fr 1fr; }
.fb-media.grid.n3 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }
.fb-media.grid.n3 span:first-child { grid-row: 1 / 3; }
.fb-media.grid span { position: relative; overflow: hidden; background: #F3F1E8; min-height: 0; }
.fb-media.grid img { width: 100%; height: 100%; object-fit: cover; display: block; }
.fb-media.grid b { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(0,0,0,.5); color: #fff; font-size: 28px; }
.fb-acts { display: flex; justify-content: space-around; margin: 0 12px; padding: 6px 0; border-top: 1px solid var(--fbp-line); color: var(--fbp-muted); font-weight: 600; font-size: 13.5px; }
.fb-acts span { display: inline-flex; align-items: center; gap: 6px; padding: 4px 6px; }
.fb-acts svg { width: 18px; height: 18px; }
.igp { background: var(--igp-bg); color: var(--igp-text); border-color: var(--igp-line); }
.igp .pv-h small, .igp .dots { color: var(--igp-muted); }
.igp .htag { color: var(--igp-tag); }
.igp .seemore { color: var(--igp-muted); font-weight: 400; }
.igp .ring { padding: 2px; border-radius: 50%; background: linear-gradient(45deg, var(--ig1), var(--ig2) 55%, var(--ig3)); flex: none; }
.igp .ring .av { width: 32px; height: 32px; border: 2px solid var(--igp-bg); }
.ig-media { position: relative; background: #F3F1E8; overflow: hidden; max-height: 520px; }
.ig-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ig-media.bad { outline: 3px solid var(--bad); outline-offset: -3px; }
.ig-media.none { aspect-ratio: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; background: color-mix(in srgb, var(--bad) 10%, var(--igp-bg)); color: var(--bad); font-weight: 600; font-size: 13px; text-align: center; padding: 16px; border-top: 1px dashed var(--bad); border-bottom: 1px dashed var(--bad); }
.ig-media.none svg { width: 30px; height: 30px; }
.ig-media .cnt { position: absolute; top: 10px; right: 10px; background: rgba(0,0,0,.7); color: #fff; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 99px; }
.ig-media .warnover { position: absolute; left: 10px; bottom: 10px; display: inline-flex; align-items: center; gap: 5px; background: var(--bad); color: #fff; font-size: 12px; font-weight: 700; padding: 4px 9px; border-radius: 99px; }
.ig-media .warnover svg { width: 13px; height: 13px; }
.igdots { display: flex; justify-content: center; gap: 4px; padding-top: 8px; }
.igdots i { width: 6px; height: 6px; border-radius: 50%; background: var(--igp-line); }
.igdots i.on { background: #0095F6; }
.ig-acts { display: flex; align-items: center; gap: 14px; padding: 9px 12px 4px; }
.ig-acts .grow { flex: 1; }
.ig-acts svg { width: 23px; height: 23px; }
.ig-text { padding: 2px 12px 4px; overflow-wrap: anywhere; }
.ig-text b { font-weight: 600; }
.ig-when { padding: 2px 12px 12px; font-size: 10.5px; letter-spacing: .3px; color: var(--igp-muted); }
.reel { position: relative; aspect-ratio: 9 / 16; max-height: 520px; margin: 0 auto; background: #111; overflow: hidden; }
.reel.fb { max-height: 440px; }
.reel img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #F3F1E8; }
.reel .words { position: absolute; left: 10%; right: 10%; top: 40%; text-align: center; color: #fff; font: 800 22px/1.15 -apple-system, 'Segoe UI', sans-serif; text-shadow: 0 2px 10px rgba(0,0,0,.65); z-index: 2; }
.reel .rl-tag, .reel .rl-music { position: absolute; left: 10px; z-index: 2; display: inline-flex; align-items: center; gap: 5px; color: #fff; font-size: 12px; font-weight: 600; background: rgba(0,0,0,.55); padding: 3px 8px; border-radius: 99px; }
.reel .rl-tag { top: 10px; }
.reel .rl-music { bottom: 10px; }
.reel .rl-tag svg, .reel .rl-music svg { width: 12px; height: 12px; }
.reel .rl-tag svg { fill: currentColor; }

/* Composer */
.scomp { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 14px; align-items: start; }
.scol { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.pvcol { position: sticky; top: 72px; }
.lbl { font-size: 12px; font-weight: 600; color: var(--muted); letter-spacing: .3px; }
.lblrow { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.lblrow label { font-size: 12px; font-weight: 600; color: var(--muted); letter-spacing: .3px; }
.inp.mini { width: auto; max-width: 60%; min-height: 28px; padding: 3px 8px; font-size: 12.5px; }
.chchips { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.chchip { display: flex; align-items: center; gap: 9px; padding: 8px 10px; border: 1px solid var(--line2); border-radius: 10px; background: var(--bg2); cursor: pointer; text-align: left; min-width: 0; }
.chchip > span:nth-child(2) { flex: 1; min-width: 0; }
.chchip b { display: block; font-size: 13.5px; }
.chchip small { display: block; color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chchip:hover { border-color: var(--accent); }
.chchip:not(.on) .sico { filter: grayscale(1); opacity: .55; }
.chchip.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 9%, var(--bg2)); }
.chchip.on > svg { color: var(--accent); }
.picked { display: flex; flex-wrap: wrap; gap: 8px; }
.pk { position: relative; width: 88px; height: 88px; border-radius: 10px; background: var(--cream); overflow: hidden; border: 1px solid var(--line2); flex: none; }
.pk img { width: 100%; height: 100%; object-fit: contain; display: block; }
.pk .no { position: absolute; top: 4px; left: 4px; width: 18px; height: 18px; border-radius: 50%; background: var(--gold); color: var(--gold-ink); font-size: 11px; display: grid; place-items: center; }
.pk-b { position: absolute; left: 0; right: 0; bottom: 0; display: flex; justify-content: flex-end; gap: 2px; padding: 3px; background: linear-gradient(transparent, rgba(0,0,0,.55)); }
.pk-b button { width: 22px; height: 22px; border-radius: 6px; border: 0; background: rgba(255,255,255,.92); color: #111; cursor: pointer; display: grid; place-items: center; padding: 0; }
.pk-b button:disabled { opacity: .35; cursor: default; }
.pk-b button svg { width: 12px; height: 12px; }
.pk.add { border: 1px dashed var(--line2); background: var(--bg2); color: var(--muted); cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-size: 12px; font-weight: 600; }
.pk.add:hover { color: var(--text); border-color: var(--accent); }
.pk.add svg { width: 20px; height: 20px; }
.pickgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 6px; margin-top: 10px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg2); max-height: 300px; overflow: auto; }
.pickgrid button { position: relative; min-width: 0; padding: 2px; border: 2px solid var(--line); border-radius: 8px; background: var(--cream); cursor: pointer; aspect-ratio: 1; }
.pickgrid button.on { border-color: var(--gold); box-shadow: 0 0 0 2px color-mix(in srgb, var(--gold) 35%, transparent); }
.pickgrid img { width: 100%; height: 100%; object-fit: contain; display: block; }
.pickgrid .new { position: absolute; top: 3px; right: 3px; width: 9px; height: 9px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 2px var(--cream); }
.reelopts { border: 1px solid var(--line); border-radius: 10px; padding: 12px 12px 4px; margin-bottom: 12px; background: var(--bg2); }
.reelopts .inp { background: var(--surface); }
.frow3 { display: grid; grid-template-columns: 1fr 1fr 1.3fr; gap: 10px; }
.render { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.render .meter { flex: 1; min-width: 80px; margin: 0; }
.counter { font-size: 12px; color: var(--faint); }
.counter span { font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.counter .near { color: var(--warn); }
.counter .over { color: var(--bad); }
.tagsets { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chipbtn { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 99px; border: 1px solid var(--line2); background: var(--surface2); color: var(--text); cursor: pointer; font-size: 12.5px; font-weight: 600; }
.chipbtn:hover { border-color: var(--accent); }
.chipbtn svg { width: 12px; height: 12px; color: var(--muted); }
.besthint { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); padding: 9px 11px; border-radius: 9px; background: color-mix(in srgb, var(--accent) 8%, var(--bg2)); border: 1px solid color-mix(in srgb, var(--accent) 25%, var(--line)); }
.besthint > svg { width: 15px; height: 15px; color: var(--accent); }
.besthint > span:first-of-type { flex: 1; min-width: 180px; }
.besthint b { color: var(--text); }
.checks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.checks li { display: flex; align-items: center; gap: 9px; padding: 6px 0; font-size: 13px; flex-wrap: wrap; }
.checks li .grow { flex: 1; min-width: 160px; }
.checks li > i { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.checks li > i svg { width: 12px; height: 12px; }
.checks li.ok > i { color: var(--good); background: color-mix(in srgb, var(--good) 16%, transparent); }
.checks li.warn > i { color: var(--warn); background: color-mix(in srgb, var(--warn) 16%, transparent); }
.checks li.bad > i { color: var(--bad); background: color-mix(in srgb, var(--bad) 16%, transparent); }
.checks li.bad .grow { color: var(--text); font-weight: 600; }
.sactions { position: sticky; bottom: 0; z-index: 5; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 14px; padding: 12px 14px; background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(8px); border: 1px solid var(--line2); border-radius: var(--radius); box-shadow: 0 -6px 24px rgba(0,0,0,.18); }
.sactions .btn:disabled { opacity: .45; cursor: not-allowed; filter: none; }
.why { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--bad); min-width: 0; }
.why svg { width: 15px; height: 15px; }
.why.ok { color: var(--good); }

/* Results, log, library, accounts */
.rank { width: 22px; height: 22px; border-radius: 6px; background: var(--surface3); display: grid; place-items: center; font-size: 12px; flex: none; }
.chart.heat rect[data-tip] { cursor: default; }
.chart.heat text.hv { fill: #fff; font-weight: 700; font-size: 11px; pointer-events: none; }
:root[data-theme="light"] .chart.heat text.hv { fill: #fff; }
.slog .lwhat { font-size: 12.5px; margin-top: 3px; }
.row.lib { align-items: flex-start; }
.libb { display: flex; gap: 6px; align-items: center; flex: none; }
.libb .iconbtn { width: 28px; height: 28px; border-radius: 7px; }
.libb .iconbtn svg { width: 14px; height: 14px; }
.htags .htag { color: var(--accent); }
.acc { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-bottom: 1px solid var(--line); }
.acc:last-of-type { border-bottom: 0; }
.acc .grow { flex: 1; min-width: 0; }
.acc .t { font-weight: 700; }
.acc .s { color: var(--muted); font-size: 12.5px; }
.acc .meter { margin-top: 8px; max-width: 280px; }
.hl { display: flex; align-items: center; gap: 8px; margin-top: 6px; font-size: 13px; font-weight: 600; }
.hl.good { color: var(--good); } .hl.warn { color: var(--warn); } .hl.bad { color: var(--bad); }
.accb { display: flex; flex-direction: column; gap: 6px; align-items: stretch; flex: none; }
.radios { display: grid; gap: 8px; width: 100%; }
.radio { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line2); border-radius: 10px; cursor: pointer; background: var(--bg2); }
.radio input { margin: 3px 0 0; accent-color: var(--accent); }
.radio b { display: block; }
.radio small { display: block; color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.radio.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, var(--bg2)); }
.switch.on.danger { background: var(--bad); border-color: var(--bad); }
.btn.danger[aria-pressed="true"] { border-color: var(--bad); background: color-mix(in srgb, var(--bad) 12%, var(--surface2)); }
.reconn { display: flex; gap: 14px; align-items: flex-start; }
.linkbtn.bad { color: var(--bad); }
.linkbtn.warnc { color: var(--warn); }
.linkbtn { display: inline-flex; align-items: center; gap: 5px; }
.linkbtn svg { width: 14px; height: 14px; }

/* Dashboard tile */
.stile { position: relative; overflow: hidden; display: flex; align-items: center; gap: 14px; }
.stile .stripe { position: absolute; left: 0; top: 0; bottom: 0; width: 3px; }
.stile .grow { flex: 1; min-width: 0; }
.stile-h { font-family: 'Archivo Black'; font-size: 19px; line-height: 1.2; margin: 6px 0 4px; }
.stile .kpi-sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stile-l { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 8px; }
.stile-l .due { display: inline-flex; align-items: center; gap: 5px; }
.stile-l .due svg { width: 13px; height: 13px; }
.stile-b { display: flex; gap: 8px; flex: none; }

@media (max-width: 1180px) {
  .sweek { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .sday { min-height: 220px; }
  .scomp { grid-template-columns: 1fr; }
  .pvcol { position: static; }
}
@media (max-width: 980px) {
  .stile { flex-wrap: wrap; }
  .stile-b { width: 100%; }
}
@media (max-width: 640px) {
  .sweek { grid-template-columns: 1fr; }
  .sday { min-height: 0; }
  .sday.past:not(:has(.spost)) { display: none; }
  .snav { margin-left: 0; width: 100%; }
  .snav b { flex: 1; min-width: 0; }
  .stools .segs { max-width: 100%; overflow-x: auto; }
  .pvwrap { grid-template-columns: 1fr; }
  .frow3 { grid-template-columns: 1fr; }
  .chchips { grid-template-columns: 1fr; }
  .snudge { flex-wrap: wrap; }
  .snudge .btn { width: 100%; }
  .scal .day { min-height: 64px; }
  .ev.sev { background: var(--line2); }
  .ev.sev.st-needs { background: var(--warn); } .ev.sev.st-approved { background: var(--info); } .ev.sev.st-posted { background: var(--good); } .ev.sev.st-failed { background: var(--bad); }
  .acc { flex-wrap: wrap; }
  .accb { flex-direction: row; width: 100%; padding-left: 54px; }
  .row.lib { flex-wrap: wrap; }
  .libb { width: 100%; justify-content: flex-end; }
  .igh > img { width: 60px; height: 60px; }
  .sactions { padding: 10px; }
  .sactions .why { width: 100%; }
  .sactions .spacer { display: none; }
  .sactions .btn { flex: 1 1 auto; }
  .stile .kpi-sub { white-space: normal; }
  .stile-b .btn { flex: 1; }
  .reconn { flex-direction: column; }
}
.field > .segs { align-self: flex-start; max-width: 100%; }
