/* The Gift Boxx Admin — Apple-inspired interface. Light & dark. */
:root {
  --accent: #0A84FF;
  --bg: #F5F5F7; --panel: #FFFFFF; --panel-2: #FAFAFC; --ink: #1D1D1F; --ink-2: #6E6E73; --ink-3: #A1A1A6;
  --line: rgba(0, 0, 0, .08); --line-2: rgba(0, 0, 0, .05); --fill: rgba(118, 118, 128, .12); --fill-2: rgba(118, 118, 128, .08);
  --side: rgba(246, 246, 248, .72); --glass: rgba(255, 255, 255, .72);
  --green: #34C759; --orange: #FF9F0A; --red: #FF3B30; --purple: #AF52DE; --blue: #0A84FF; --teal: #30B0C7;
  --r: 14px; --r-sm: 10px; --r-lg: 20px;
  --shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 4px 16px rgba(0, 0, 0, .04);
  --shadow-lg: 0 24px 60px -12px rgba(0, 0, 0, .25), 0 0 0 .5px rgba(0, 0, 0, .06);
  --font: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Inter', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --display: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Inter', 'Segoe UI', Roboto, sans-serif;
  --ease: cubic-bezier(.25, .8, .25, 1);
  --accent-soft: color-mix(in srgb, var(--accent) 12%, transparent);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme=light]) {
    --bg: #000; --panel: #1C1C1E; --panel-2: #232326; --ink: #F5F5F7; --ink-2: #98989D; --ink-3: #636366;
    --line: rgba(255, 255, 255, .1); --line-2: rgba(255, 255, 255, .06); --fill: rgba(118, 118, 128, .24); --fill-2: rgba(118, 118, 128, .16);
    --side: rgba(28, 28, 30, .72); --glass: rgba(28, 28, 30, .72);
    --shadow: 0 0 0 .5px rgba(255, 255, 255, .06); --shadow-lg: 0 24px 60px -12px rgba(0, 0, 0, .7), 0 0 0 .5px rgba(255, 255, 255, .1);
    --accent-soft: color-mix(in srgb, var(--accent) 22%, transparent);
    color-scheme: dark;
  }
}
:root[data-theme=dark] {
  --bg: #000; --panel: #1C1C1E; --panel-2: #232326; --ink: #F5F5F7; --ink-2: #98989D; --ink-3: #636366;
  --line: rgba(255, 255, 255, .1); --line-2: rgba(255, 255, 255, .06); --fill: rgba(118, 118, 128, .24); --fill-2: rgba(118, 118, 128, .16);
  --side: rgba(28, 28, 30, .72); --glass: rgba(28, 28, 30, .72);
  --shadow: 0 0 0 .5px rgba(255, 255, 255, .06); --shadow-lg: 0 24px 60px -12px rgba(0, 0, 0, .7), 0 0 0 .5px rgba(255, 255, 255, .1);
  --accent-soft: color-mix(in srgb, var(--accent) 22%, transparent);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.47 var(--font); letter-spacing: -.01em; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
a.link, .content p a:not(.btn) { color: var(--accent); }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
img { max-width: 100%; display: block; }
h1, h2, h3, h4 { font-family: var(--display); margin: 0 0 .5em; letter-spacing: -.02em; font-weight: 600; }
h2 { font-size: 20px; } h3 { font-size: 16px; }
p { margin: 0 0 .8em; }
[hidden] { display: none !important; }
.i { width: 18px; height: 18px; flex: none; }
.muted { color: var(--ink-2); } .dim { color: var(--ink-3); }
.small { font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.right { text-align: right; } .center { text-align: center; }
kbd { font: 11px var(--font); padding: 2px 6px; border-radius: 6px; background: var(--fill); color: var(--ink-2); }
pre.code, code { font: 12.5px/1.5 ui-monospace, 'SF Mono', Menlo, monospace; }
pre.code { background: var(--fill-2); padding: 12px 14px; border-radius: var(--r-sm); overflow: auto; white-space: pre-wrap; word-break: break-all; }
.only-mobile { display: none !important; }

/* ---------- Sidebar ---------- */
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: 260px; z-index: 30; display: flex; flex-direction: column;
  background: var(--side); backdrop-filter: saturate(180%) blur(30px); -webkit-backdrop-filter: saturate(180%) blur(30px);
  border-right: 1px solid var(--line); padding: 14px 12px 12px;
}
.side-head { padding: 6px 8px 14px; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark { width: 34px; height: 34px; border-radius: 9px; overflow: hidden; box-shadow: 0 0 0 .5px var(--line), 0 2px 6px rgba(0, 0, 0, .12); }
.brand strong { display: block; font-size: 14px; line-height: 1.2; } .brand small { color: var(--ink-2); font-size: 12px; }
.search-trigger { display: flex; align-items: center; gap: 8px; width: 100%; padding: 7px 10px; border: 0; border-radius: var(--r-sm); background: var(--fill); color: var(--ink-2); cursor: pointer; margin-bottom: 10px; transition: background .2s; }
.search-trigger:hover { background: var(--fill-2); }
.search-trigger span { flex: 1; text-align: left; }
.side-nav { flex: 1; overflow-y: auto; margin: 0 -4px; padding: 0 4px; scrollbar-width: none; }
.side-label { font-size: 11px; font-weight: 600; color: var(--ink-3); text-transform: uppercase; letter-spacing: .04em; margin: 16px 10px 6px; }
.side-nav a { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 8px; color: var(--ink); font-size: 13.5px; transition: background .15s; }
.side-nav a .i { color: var(--accent); width: 17px; height: 17px; }
.side-nav a:hover { background: var(--fill-2); }
.side-nav a.on { background: var(--accent); color: #fff; }
.side-nav a.on .i { color: #fff; }
.side-nav a span { flex: 1; }
.side-nav a em { font-style: normal; font-size: 11.5px; font-weight: 600; min-width: 20px; padding: 0 6px; height: 20px; line-height: 20px; border-radius: 10px; text-align: center; background: var(--fill); color: var(--ink-2); }
.side-nav a.on em { background: rgba(255, 255, 255, .25); color: #fff; }
.side-foot { border-top: 1px solid var(--line); padding-top: 10px; display: grid; gap: 6px; }
.view-site { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 8px; color: var(--ink-2); font-size: 13px; }
.view-site:hover { background: var(--fill-2); color: var(--ink); }
.me { display: flex; align-items: center; gap: 10px; padding: 4px 4px 0 6px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-weight: 600; font-size: 13px; color: #fff; background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 50%, #AF52DE)); }
.me-name { flex: 1; min-width: 0; } .me-name strong { display: block; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .me-name small { color: var(--ink-2); font-size: 11.5px; }

/* ---------- Main ---------- */
.main { margin-left: 260px; min-height: 100vh; }
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 10px; height: 56px; padding: 0 28px;
  background: var(--glass); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid transparent; transition: border-color .2s;
}
.topbar.scrolled { border-bottom-color: var(--line); }
.top-title { font-size: 17px; margin: 0; flex: 1; opacity: 0; transform: translateY(4px); transition: opacity .2s, transform .2s; }
.topbar.scrolled .top-title { opacity: 1; transform: none; }
.top-actions { display: flex; gap: 4px; }
.content { padding: 8px 28px 60px; max-width: 1180px; }
body.wide .content { max-width: 1400px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin: 12px 0 22px; flex-wrap: wrap; }
.page-head h1 { font-size: 30px; margin: 0; letter-spacing: -.025em; }
.page-head p { margin: 4px 0 0; color: var(--ink-2); }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.back { display: inline-flex; align-items: center; gap: 4px; color: var(--accent); font-size: 14px; margin-bottom: 4px; }
.back .i { width: 16px; height: 16px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 34px; padding: 0 14px; border-radius: 999px;
  border: 0; background: var(--accent); color: #fff; font-weight: 500; font-size: 13.5px; cursor: pointer; white-space: nowrap;
  transition: filter .15s, transform .1s, background .15s; text-decoration: none !important;
}
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: scale(.97); }
.btn .i { width: 16px; height: 16px; }
.btn.secondary { background: var(--fill); color: var(--ink); }
.btn.secondary:hover { background: var(--fill-2); filter: none; }
.btn.plain { background: transparent; color: var(--accent); padding: 0 8px; }
.btn.plain:hover { background: var(--accent-soft); filter: none; }
.btn.danger { background: transparent; color: var(--red); }
.btn.danger:hover { background: color-mix(in srgb, var(--red) 10%, transparent); filter: none; }
.btn.lg { height: 42px; padding: 0 22px; font-size: 15px; }
.btn.sm { height: 28px; padding: 0 11px; font-size: 12.5px; }
.btn:disabled { opacity: .45; pointer-events: none; }
.icon-btn { display: inline-grid; place-items: center; width: 34px; height: 34px; border: 0; border-radius: 50%; background: transparent; color: var(--ink-2); cursor: pointer; transition: background .15s, color .15s; }
.icon-btn:hover { background: var(--fill-2); color: var(--ink); }

/* ---------- Cards ---------- */
.card { background: var(--panel); border-radius: var(--r-lg); box-shadow: var(--shadow); overflow: hidden; }
.card.pad, .card > .pad { padding: 20px 22px; }
.card + .card, .stack > * + * { margin-top: 16px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 22px 0; }
.card-head h2, .card-head h3 { margin: 0; font-size: 16px; }
.card-head a { color: var(--accent); font-size: 13px; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: 1fr 1fr; } .g3 { grid-template-columns: repeat(3, 1fr); } .g4 { grid-template-columns: repeat(4, 1fr); }
.g-main { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; }
.sticky-col { position: sticky; top: 72px; }

/* KPI tiles */
.kpi { padding: 18px 20px; }
.kpi-label { display: flex; align-items: center; gap: 8px; color: var(--ink-2); font-size: 13px; font-weight: 500; }
.kpi-label .dot { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; color: #fff; }
.kpi-label .dot .i { width: 15px; height: 15px; }
.kpi-value { font-family: var(--display); font-size: 28px; font-weight: 600; letter-spacing: -.03em; margin: 10px 0 2px; font-variant-numeric: tabular-nums; }
.delta { font-size: 12.5px; font-weight: 600; }
.delta.up { color: var(--green); } .delta.down { color: var(--red); }

/* Chart */
.chart { width: 100%; height: 220px; display: block; }
.chart .area { fill: url(#chartFill); }
.chart .line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .grid-line { stroke: var(--line-2); stroke-width: 1; }
.chart text { fill: var(--ink-3); font-size: 11px; font-family: var(--font); }
.chart .dot { fill: var(--panel); stroke: var(--accent); stroke-width: 2; opacity: 0; transition: opacity .15s; }
.chart-wrap { position: relative; padding: 8px 12px 12px; }
.chart-tip { position: absolute; pointer-events: none; background: var(--panel); box-shadow: var(--shadow-lg); border-radius: 10px; padding: 6px 10px; font-size: 12px; white-space: nowrap; transform: translate(-50%, -120%); opacity: 0; transition: opacity .12s; }
.chart-tip strong { display: block; font-size: 13px; }

/* Segmented control */
.segmented { display: inline-flex; padding: 2px; background: var(--fill); border-radius: 9px; gap: 2px; }
.segmented a, .segmented button, .segmented label { position: relative; padding: 4px 12px; border-radius: 7px; font-size: 12.5px; font-weight: 500; border: 0; background: none; cursor: pointer; color: var(--ink); white-space: nowrap; }
.segmented .on, .segmented input:checked + span { background: var(--panel); box-shadow: 0 1px 3px rgba(0, 0, 0, .12), 0 0 0 .5px var(--line); }
.segmented input { position: absolute; opacity: 0; }
.segmented label { padding: 0; } .segmented label span { display: block; padding: 4px 12px; border-radius: 7px; }
.segmented em { font-style: normal; color: var(--ink-3); margin-left: 4px; font-size: 11.5px; }

/* ---------- Lists & tables ---------- */
.table-wrap { overflow-x: auto; }
table.list { width: 100%; border-collapse: collapse; }
.list th { text-align: left; font-size: 12px; font-weight: 500; color: var(--ink-2); padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.list td { padding: 11px 14px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.list tr:last-child td { border-bottom: 0; }
.list tbody tr { transition: background .12s; }
.list tbody tr:hover { background: var(--fill-2); }
.list tr[data-href] { cursor: pointer; }
.list .thumb { width: 40px; height: 48px; border-radius: 8px; object-fit: cover; background: var(--fill); }
.list .title { font-weight: 500; }
.list .sub { color: var(--ink-2); font-size: 12.5px; }
.list input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--accent); }
.rows { list-style: none; margin: 0; padding: 0; }
.rows li, .rows > a { display: flex; align-items: center; gap: 12px; padding: 11px 22px; border-top: 1px solid var(--line-2); }
.rows li:first-child, .rows > a:first-child { border-top: 0; }
.rows > a:hover { background: var(--fill-2); }
.rows .grow { flex: 1; min-width: 0; }
.rows .grow strong { display: block; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rows .grow small { color: var(--ink-2); }
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--fill); color: var(--ink-2); white-space: nowrap; }
.b-processing, .b-packed, .b-new { background: color-mix(in srgb, var(--blue) 14%, transparent); color: var(--blue); }
.b-shipped, .b-replied { background: color-mix(in srgb, var(--purple) 14%, transparent); color: var(--purple); }
.b-delivered, .b-completed, .b-published, .b-approved, .b-paid, .b-won, .b-recovered, .b-ok { background: color-mix(in srgb, var(--green) 16%, transparent); color: #1E9E47; }
.b-pending_payment, .b-on_hold, .b-draft, .b-pending, .b-open, .b-reminded, .b-warn { background: color-mix(in srgb, var(--orange) 16%, transparent); color: #C46F00; }
.b-cancelled, .b-refunded, .b-failed, .b-closed, .b-err, .b-outofstock { background: color-mix(in srgb, var(--red) 13%, transparent); color: var(--red); }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.toolbar .search { flex: 1; min-width: 200px; position: relative; }
.toolbar .search .i { position: absolute; left: 10px; top: 50%; translate: 0 -50%; color: var(--ink-3); width: 16px; }
.toolbar .search input { padding-left: 32px; }
.pager { display: flex; gap: 6px; justify-content: center; padding: 14px; }
.pager a { min-width: 30px; height: 30px; display: grid; place-items: center; border-radius: 8px; font-size: 13px; }
.pager a.on { background: var(--accent); color: #fff; }
.pager a:not(.on):hover { background: var(--fill-2); }
.bulkbar { display: flex; gap: 8px; align-items: center; padding: 10px 16px; background: var(--accent-soft); border-bottom: 1px solid var(--line); }
.empty { text-align: center; padding: 60px 20px; color: var(--ink-2); }
.empty > .i { width: 44px; height: 44px; color: var(--ink-3); margin: 0 auto 12px; }
.empty h2 { color: var(--ink); }

/* ---------- Forms (iOS-style grouped) ---------- */
label.f, div.f { display: grid; gap: 6px; font-size: 13px; font-weight: 500; color: var(--ink); }
label.f > small, div.f > small, .help { font-weight: 400; color: var(--ink-2); font-size: 12px; }
input:not([type=checkbox]):not([type=radio]):not([type=color]):not([type=range]):not([type=file]), select, textarea {
  width: 100%; height: 36px; padding: 0 12px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--panel);
  outline: none; transition: border-color .15s, box-shadow .15s; font-size: 14px;
}
textarea { height: auto; padding: 9px 12px; resize: vertical; min-height: 80px; line-height: 1.5; }
select { appearance: none; -webkit-appearance: none; padding-right: 30px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%238E8E93' stroke-width='3'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 11px center; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3.5px var(--accent-soft); }
input[type=file] { font-size: 13px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
.form-grid .full { grid-column: 1 / -1; }
.fields { display: grid; gap: 14px; }
.group { background: var(--panel); border-radius: var(--r); box-shadow: var(--shadow); }
.group > .row { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 10px 16px; border-top: 1px solid var(--line-2); }
.group > .row:first-child { border-top: 0; }
.group > .row > label:first-child, .group > .row .row-label { flex: 1; font-weight: 500; font-size: 14px; }
.group > .row .row-label small { display: block; font-weight: 400; color: var(--ink-2); font-size: 12px; margin-top: 2px; }
.group > .row input:not([type=checkbox]):not([type=color]), .group > .row select { max-width: 360px; }
.group-title { font-size: 12.5px; color: var(--ink-2); text-transform: uppercase; letter-spacing: .03em; font-weight: 500; margin: 26px 16px 8px; }
.group-title:first-child { margin-top: 0; }
.group-foot { font-size: 12.5px; color: var(--ink-2); margin: 8px 16px 0; }
.stack-fields > .row { flex-direction: column; align-items: stretch; }
.stack-fields > .row input:not([type=checkbox]), .stack-fields > .row select { max-width: none !important; }

/* iOS switch */
.switch { position: relative; display: inline-block; width: 51px; height: 31px; flex: none; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: var(--fill); transition: background .25s var(--ease); }
.switch span::after { content: ''; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 3px 8px rgba(0, 0, 0, .15), 0 1px 1px rgba(0, 0, 0, .16); transition: transform .25s var(--ease); }
.switch input:checked + span { background: var(--green); }
.switch input:checked + span::after { transform: translateX(20px); }
.switch input:focus-visible + span { box-shadow: 0 0 0 3px var(--accent-soft); }
.switch.sm { width: 40px; height: 24px; } .switch.sm span::after { width: 20px; height: 20px; } .switch.sm input:checked + span::after { transform: translateX(16px); }
.check { display: flex; align-items: center; gap: 8px; font-size: 13.5px; cursor: pointer; }
.check input { width: 17px; height: 17px; accent-color: var(--accent); margin: 0; }

/* Colour picker */
.color-field { display: inline-flex; align-items: center; gap: 8px; padding: 3px 10px 3px 3px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel); }
.color-field input[type=color] { width: 28px; height: 28px; border: 0; border-radius: 50%; padding: 0; background: none; cursor: pointer; }
.color-field input[type=color]::-webkit-color-swatch-wrapper { padding: 0; } .color-field input[type=color]::-webkit-color-swatch { border: 0; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .1); }
.color-field input[type=color]::-moz-color-swatch { border: 0; border-radius: 50%; }
.color-field code { font-size: 12px; color: var(--ink-2); text-transform: uppercase; min-width: 60px; }

/* Image pickers */
.dropzone { border: 1.5px dashed var(--line); border-radius: var(--r); padding: 14px; transition: border-color .2s, background .2s; }
.dropzone.drag { border-color: var(--accent); background: var(--accent-soft); }
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; }
.gimg { position: relative; aspect-ratio: 1 / 1; border-radius: 12px; overflow: hidden; background: var(--fill); cursor: grab; box-shadow: 0 0 0 .5px var(--line); }
.gimg img { width: 100%; height: 100%; object-fit: cover; }
.gimg:first-child::after { content: 'Main'; position: absolute; left: 6px; bottom: 6px; font-size: 10.5px; font-weight: 600; padding: 2px 7px; border-radius: 999px; background: rgba(0, 0, 0, .55); color: #fff; backdrop-filter: blur(6px); }
.gimg .x { position: absolute; top: 6px; right: 6px; width: 24px; height: 24px; border-radius: 50%; border: 0; background: rgba(0, 0, 0, .55); color: #fff; display: grid; place-items: center; cursor: pointer; opacity: 0; transition: opacity .15s; backdrop-filter: blur(6px); }
.gimg .x .i { width: 13px; height: 13px; }
.gimg:hover .x { opacity: 1; }
.gimg.dragging { opacity: .4; }
.add-tile { aspect-ratio: 1 / 1; border-radius: 12px; border: 1.5px dashed var(--line); display: grid; place-content: center; justify-items: center; gap: 4px; color: var(--accent); cursor: pointer; font-size: 12.5px; font-weight: 500; background: none; transition: background .15s; }
.add-tile:hover { background: var(--accent-soft); }
.add-tile.uploading { color: var(--ink-3); pointer-events: none; }
.single-img { display: flex; align-items: center; gap: 12px; }
.single-img .preview { width: 64px; height: 64px; border-radius: 12px; object-fit: cover; background: var(--fill); box-shadow: 0 0 0 .5px var(--line); }

/* Rich text editor */
.rte-wrap { border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--panel); overflow: hidden; transition: border-color .15s, box-shadow .15s; }
.rte-wrap:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3.5px var(--accent-soft); }
.rte-bar { display: flex; flex-wrap: wrap; gap: 2px; padding: 5px; border-bottom: 1px solid var(--line-2); background: var(--panel-2); }
.rte-bar button { height: 28px; min-width: 30px; padding: 0 7px; border: 0; border-radius: 6px; background: none; cursor: pointer; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.rte-bar button.on { background: var(--fill); color: var(--ink); }
@media (hover: hover) { .rte-bar button:hover { background: var(--fill); color: var(--ink); } }
.rte-bar .sep { width: 1px; background: var(--line); margin: 4px 3px; }
.rte-area { min-height: 160px; padding: 14px 16px; outline: none; font-size: 15px; line-height: 1.6; }
.rte-area.short { min-height: 80px; }
.rte-area h2 { font-size: 20px; margin: 1em 0 .4em; } .rte-area h3 { font-size: 17px; margin: 1em 0 .4em; }
.rte-area ul, .rte-area ol { padding-left: 1.4em; } .rte-area blockquote { border-left: 3px solid var(--accent); margin: 1em 0; padding-left: 1em; color: var(--ink-2); }
.rte-area a { color: var(--accent); text-decoration: underline; }
.rte-area { position: relative; }
.rte-area:empty::before, .rte-area.is-empty::before { content: attr(data-placeholder); position: absolute; left: 16px; top: 14px; right: 16px; color: var(--ink-3); pointer-events: none; }
.rte-area > p { margin: 0 0 .75em; } .rte-area > :first-child { margin-top: 0; } .rte-area > :last-child { margin-bottom: 0; }
.rte-area h2, .rte-area h3 { line-height: 1.3; }
.rte-source { display: none; min-height: 200px; border: 0 !important; border-radius: 0 !important; box-shadow: none !important; font: 12.5px/1.5 ui-monospace, Menlo, monospace; }
.rte-wrap.source .rte-area { display: none; } .rte-wrap.source .rte-source { display: block; }

/* Variations editor */
.var-table { width: 100%; border-collapse: collapse; }
.var-card { border: 1px solid var(--line); border-radius: var(--r); margin-top: 10px; overflow: hidden; background: var(--panel-2); }
.var-top { display: flex; align-items: center; gap: 10px; padding: 10px 12px; cursor: pointer; }
.var-top .var-img { width: 38px; height: 46px; border-radius: 8px; object-fit: cover; background: var(--fill); flex: none; }
.var-top .grow { flex: 1; font-weight: 500; }
.var-top .var-price { color: var(--ink-2); font-variant-numeric: tabular-nums; }
.var-body { padding: 14px; border-top: 1px solid var(--line-2); background: var(--panel); }
.var-card:not(.open) .var-body { display: none; }
.var-card .chev { transition: transform .2s; color: var(--ink-3); }
.var-card.open .chev { transform: rotate(180deg); }
.attr-row { display: grid; grid-template-columns: 180px 1fr auto auto auto; gap: 8px; align-items: center; margin-bottom: 8px; }
.attr-row .attr-display { width: auto; max-width: 240px; font-size: 13.5px; padding: 7px 28px 7px 10px; }
.tag-input { display: flex; flex-wrap: wrap; gap: 6px; padding: 5px; min-height: 36px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--panel); cursor: text; }
.tag-input:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3.5px var(--accent-soft); }
.tag-input .tag { display: inline-flex; align-items: center; gap: 4px; padding: 2px 4px 2px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: 12.5px; font-weight: 500; }
.tag-input .tag button { border: 0; background: none; color: inherit; cursor: pointer; display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; padding: 0; }
.tag-input .tag button:hover { background: var(--accent-soft); }
.tag-input input { flex: 1; min-width: 80px; border: 0 !important; box-shadow: none !important; height: 26px !important; padding: 0 6px !important; background: none !important; }

/* Previews (Google / Shopping) */
.serp { font-family: Arial, sans-serif; padding: 14px 16px; border-radius: var(--r); background: #fff; color: #202124; box-shadow: 0 0 0 1px rgba(0, 0, 0, .06); }
.serp .site { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.serp .fav { width: 26px; height: 26px; border-radius: 50%; background: #F1F3F4; display: grid; place-items: center; overflow: hidden; }
.serp .fav img { width: 18px; height: 18px; }
.serp .site small { display: block; color: #4D5156; font-size: 12px; }
.serp .t { color: #1A0DAB; font-size: 19px; line-height: 1.3; margin: 6px 0 3px; }
.serp .d { color: #4D5156; font-size: 13.5px; line-height: 1.55; }
.serp .meta-row { color: #70757A; font-size: 13px; margin-top: 4px; }
.shop-card { width: 200px; font-family: Arial, sans-serif; background: #fff; color: #202124; border-radius: 12px; overflow: hidden; box-shadow: 0 0 0 1px rgba(0, 0, 0, .08), 0 2px 8px rgba(0, 0, 0, .06); }
.shop-card img { width: 100%; aspect-ratio: 1; object-fit: cover; background: #F1F3F4; }
.shop-card .b { padding: 10px 12px 12px; }
.shop-card .t { font-size: 13.5px; line-height: 1.35; max-height: 2.7em; overflow: hidden; }
.shop-card .p { font-weight: 700; margin-top: 6px; font-size: 14px; }
.shop-card .p del { color: #70757A; font-weight: 400; margin-left: 4px; font-size: 12.5px; }
.shop-card .s { color: #70757A; font-size: 12px; margin-top: 3px; }
.shop-card .free { color: #188038; font-size: 12px; }
.counter { font-size: 11.5px; color: var(--ink-3); float: right; font-weight: 400; }
.counter.over { color: var(--red); }
.score { display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; font-weight: 700; font-size: 14px; }
.wood-swatch { width: 100%; aspect-ratio: 16 / 7; border-radius: var(--r); position: relative; overflow: hidden; display: flex; align-items: flex-end; padding: 14px; box-shadow: inset 0 0 0 .5px rgba(0, 0, 0, .1); }
.wood-swatch.grain::before { content: ''; position: absolute; inset: 0; background: repeating-linear-gradient(97deg, transparent 0 22px, rgba(0, 0, 0, .04) 22px 23px, transparent 23px 51px); }
.wood-swatch strong { position: relative; font-family: Georgia, serif; font-size: 22px; font-weight: 500; }
.wood-swatch .pillx { position: relative; margin-left: auto; padding: 5px 12px; border-radius: 999px; font-size: 12px; font-weight: 600; color: #fff; }

/* Order detail */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 16px 22px; font-size: 13px; }
.timeline li::before { content: ''; position: absolute; left: 4px; top: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--ink-3); }
.timeline li::after { content: ''; position: absolute; left: 7.5px; top: 18px; bottom: 0; width: 1px; background: var(--line); }
.timeline li:first-child::before { background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.timeline li:last-child::after { display: none; }
.timeline small { display: block; color: var(--ink-3); font-size: 11.5px; }
.steps-bar { display: flex; gap: 0; margin: 4px 0 6px; }
.steps-bar div { flex: 1; text-align: center; font-size: 12px; color: var(--ink-3); position: relative; padding-top: 22px; }
.steps-bar div::before { content: ''; position: absolute; top: 5px; left: 50%; translate: -50% 0; width: 12px; height: 12px; border-radius: 50%; background: var(--fill); z-index: 1; }
.steps-bar div::after { content: ''; position: absolute; top: 10px; left: -50%; width: 100%; height: 2px; background: var(--fill); }
.steps-bar div:first-child::after { display: none; }
.steps-bar div.done { color: var(--ink); font-weight: 500; }
.steps-bar div.done::before, .steps-bar div.done::after { background: var(--green); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 13.5px; }
.kv dt { color: var(--ink-2); } .kv dd { margin: 0; }
.totals .r { display: flex; justify-content: space-between; padding: 4px 0; font-variant-numeric: tabular-nums; }
.totals .r.big { font-weight: 700; font-size: 16px; border-top: 1px solid var(--line); margin-top: 6px; padding-top: 10px; }
.gift-msg { padding: 12px 14px; border-radius: 12px; background: color-mix(in srgb, #BAA183 16%, transparent); font-style: italic; }

/* Setup checklist */
.setup li { display: flex; align-items: center; gap: 10px; }
.tick { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; border: 1.5px solid var(--ink-3); flex: none; }
.tick.on { background: var(--green); border-color: var(--green); color: #fff; }
.tick .i { width: 13px; height: 13px; stroke-width: 3; }
.progress-ring { --p: 0; width: 56px; height: 56px; border-radius: 50%; background: conic-gradient(var(--green) calc(var(--p) * 1%), var(--fill) 0); display: grid; place-items: center; }
.progress-ring span { width: 44px; height: 44px; border-radius: 50%; background: var(--panel); display: grid; place-items: center; font-weight: 600; font-size: 13px; }

/* Toasts */
.toasts { position: fixed; top: 14px; left: 50%; translate: -50% 0; z-index: 100; display: grid; gap: 8px; width: min(92vw, 440px); pointer-events: none; }
.toast { display: flex; gap: 10px; align-items: flex-start; padding: 12px 16px; border-radius: 14px; background: var(--glass); backdrop-filter: saturate(180%) blur(24px); -webkit-backdrop-filter: saturate(180%) blur(24px); box-shadow: var(--shadow-lg); font-weight: 500; pointer-events: auto; animation: tin .5s var(--ease) both; }
.toast .i { color: var(--green); margin-top: 1px; } .toast.t-error .i { color: var(--red); }
.toast.out { animation: tout .35s var(--ease) forwards; }
@keyframes tin { from { opacity: 0; transform: translateY(-16px) scale(.96); } }
@keyframes tout { to { opacity: 0; transform: translateY(-16px) scale(.96); } }

/* Command palette */
.cmdk { position: fixed; inset: 0; z-index: 90; background: rgba(0, 0, 0, .25); display: grid; justify-items: center; align-items: start; padding-top: 14vh; animation: fadein .15s; backdrop-filter: blur(2px); }
@keyframes fadein { from { opacity: 0; } }
.cmdk-box { width: min(640px, 92vw); background: var(--glass); backdrop-filter: saturate(180%) blur(40px); -webkit-backdrop-filter: saturate(180%) blur(40px); border-radius: 16px; box-shadow: var(--shadow-lg); overflow: hidden; animation: tin .25s var(--ease); }
.cmdk-input { display: flex; align-items: center; gap: 10px; padding: 0 16px; border-bottom: 1px solid var(--line); }
.cmdk-input input { border: 0 !important; box-shadow: none !important; background: none !important; height: 54px !important; font-size: 17px !important; padding: 0 !important; }
.cmdk-results { max-height: 50vh; overflow-y: auto; padding: 6px; }
.cmdk-results a { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 10px; }
.cmdk-results a.sel { background: var(--accent); color: #fff; }
.cmdk-results a.sel small { color: rgba(255, 255, 255, .8); }
.cmdk-results a span { flex: 1; min-width: 0; } .cmdk-results a small { display: block; color: var(--ink-2); font-size: 12px; }
.cmdk-results em { font-style: normal; font-size: 11px; color: var(--ink-3); }
.cmdk-results a.sel em { color: rgba(255, 255, 255, .7); }
.cmdk-results p { padding: 16px; color: var(--ink-2); margin: 0; text-align: center; }

/* Save bar (floating, appears when a form changes) */
.savebar { position: fixed; left: calc(260px + 50%); translate: calc(-50% - 130px) 0; bottom: 20px; z-index: 40; display: flex; align-items: center; gap: 12px; padding: 8px 8px 8px 18px; border-radius: 999px; background: var(--glass); backdrop-filter: saturate(180%) blur(24px); -webkit-backdrop-filter: saturate(180%) blur(24px); box-shadow: var(--shadow-lg); transform: translateY(120px); transition: transform .4s var(--ease); font-weight: 500; }
.savebar.show { transform: none; }

/* Tab bar (mobile) */
.tabbar { display: none; }

/* Login & install */
.auth-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(1200px 600px at 20% -10%, color-mix(in srgb, var(--accent) 16%, transparent), transparent), radial-gradient(900px 500px at 110% 110%, color-mix(in srgb, #AF52DE 14%, transparent), transparent), var(--bg); }
.auth-card { width: min(400px, 100%); background: var(--glass); backdrop-filter: saturate(180%) blur(30px); -webkit-backdrop-filter: saturate(180%) blur(30px); border-radius: 24px; box-shadow: var(--shadow-lg); padding: 34px 30px; display: grid; gap: 14px; text-align: center; }
.auth-card.wide { width: min(640px, 100%); text-align: left; }
.auth-card .logo { width: 64px; height: 64px; border-radius: 16px; margin: 0 auto 6px; box-shadow: 0 6px 20px rgba(0, 0, 0, .15); overflow: hidden; }
.auth-card h1 { font-size: 24px; margin: 0; }
.auth-card input { height: 44px !important; font-size: 15px !important; border-radius: 12px !important; }
.auth-card .btn { height: 44px; font-size: 15px; }
.err-box { background: color-mix(in srgb, var(--red) 10%, transparent); color: var(--red); padding: 10px 14px; border-radius: 12px; font-size: 13px; text-align: left; }

/* Print */
@media print {
  .sidebar, .topbar, .tabbar, .savebar, .toasts, .no-print { display: none !important; }
  .main { margin: 0; } .content { padding: 0; } body { background: #fff; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .g4 { grid-template-columns: 1fr 1fr; }
  .g-main { grid-template-columns: 1fr; }
  .sticky-col { position: static; }
}
@media (max-width: 860px) {
  .only-mobile { display: inline-grid !important; }
  .sidebar { transform: translateX(-100%); transition: transform .35s var(--ease); width: 290px; box-shadow: var(--shadow-lg); background: var(--panel); }
  body.side-open .sidebar { transform: none; }
  .side-scrim { position: fixed; inset: 0; z-index: 25; background: rgba(0, 0, 0, .3); opacity: 0; pointer-events: none; transition: opacity .3s; }
  body.side-open .side-scrim { opacity: 1; pointer-events: auto; }
  .main { margin-left: 0; padding-bottom: calc(70px + env(safe-area-inset-bottom)); }
  .topbar { padding: 0 12px; }
  .top-title { opacity: 1; transform: none; text-align: center; font-size: 16px; }
  .content { padding: 4px 14px 40px; }
  .page-head h1 { font-size: 26px; }
  .g2, .g3, .form-grid { grid-template-columns: 1fr; }
  .attr-row { grid-template-columns: 1fr; }
  .tabbar {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); background: var(--glass); backdrop-filter: saturate(180%) blur(24px); -webkit-backdrop-filter: saturate(180%) blur(24px); border-top: 1px solid var(--line);
  }
  .tabbar a, .tabbar button { display: grid; justify-items: center; gap: 2px; font-size: 10.5px; font-weight: 500; color: var(--ink-3); border: 0; background: none; padding: 2px 0; }
  .tabbar .i { width: 24px; height: 24px; }
  .tabbar .on { color: var(--accent); }
  .savebar { left: 50%; translate: -50% 0; bottom: calc(80px + env(safe-area-inset-bottom)); }
  .list .hide-m { display: none; }
  .group > .row { flex-wrap: wrap; }
  .group > .row input:not([type=checkbox]):not([type=color]), .group > .row select { max-width: none; }
}
@media (prefers-reduced-motion: reduce) { * { animation-duration: .01ms !important; transition-duration: .01ms !important; } }
.grid > .card + .card, .grid > * + * { margin-top: 0; }
label.f { position: relative; }
label.f > .counter { position: absolute; right: 0; top: 1px; }

/* ===== v2: layout robustness & mobile ===== */
:root { --toggle: #34C759; }
html, body { max-width: 100%; }
body { overflow-x: hidden; }
@supports (overflow: clip) { body { overflow-x: clip; } }
.grid > *, .g-main > *, .form-grid > *, .fields > *, .stack > * { min-width: 0; }
code, pre, .kv dd { overflow-wrap: anywhere; }
.page-head h1 { overflow-wrap: anywhere; }
.switch input:checked + span { background: var(--toggle); }
.hide-mobile { }

/* Header: title always centred */
.topbar { display: grid; grid-template-columns: 1fr auto 1fr; }
.top-left { justify-self: start; display: flex; }
.top-title { text-align: center; max-width: 60vw; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-actions { justify-self: end; }

/* Toast undo */
.toast { align-items: center; }
.toast span { flex: 1; }
.toast-undo .btn { height: 26px; }

/* History */
.activity li { align-items: flex-start; flex-wrap: wrap; }
.activity li.is-reverted { opacity: .55; }
.act-ic { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--fill); color: var(--ink-2); flex: none; }
.act-ic .i { width: 16px; height: 16px; }
.a-create { background: color-mix(in srgb, var(--green) 15%, transparent); color: #1E9E47; }
.a-delete { background: color-mix(in srgb, var(--red) 12%, transparent); color: var(--red); }
.a-revert { background: color-mix(in srgb, var(--purple) 14%, transparent); color: var(--purple); }
.act-btns { display: flex; gap: 4px; flex-wrap: wrap; }

/* Product list thumbnails with status tags */
.thumb-tag { position: relative; display: inline-block; }
.thumb-tag em { position: absolute; left: 50%; bottom: -6px; translate: -50% 0; font-style: normal; font-size: 9.5px; font-weight: 700; letter-spacing: .02em; padding: 1px 6px; border-radius: 999px; white-space: nowrap; background: var(--ink); color: var(--panel); box-shadow: 0 0 0 2px var(--panel); }
.thumb-tag em.t-draft { background: var(--orange); color: #fff; }
.thumb-tag em.t-sold { background: var(--red); color: #fff; }
tr.is-muted .title, tr.is-muted .thumb { opacity: .6; }

@media (max-width: 860px) {
  .hide-mobile { display: none !important; }
  .content { padding: 4px 12px calc(96px + env(safe-area-inset-bottom)); }
  .card > table.list, .card > form > table.list { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .table-wrap { margin: 0; }
  .toolbar { padding: 12px; }
  .toolbar .search { min-width: 0; flex-basis: 100%; }
  .toolbar > select, .toolbar > input[type=date] { flex: 1 1 140px; }
  .segmented { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
  .segmented::-webkit-scrollbar { display: none; }
  .page-head { margin: 8px 0 16px; }
  .head-actions { width: 100%; }
  .head-actions .btn { flex: 1 1 auto; }
  .rows li, .rows > a { padding: 11px 14px; }
  .card.pad, .card > .pad { padding: 16px; }
  .card-head { padding: 14px 16px 0; }
  .kpi-value { font-size: 24px; }
  .tabbar { position: fixed; left: 0; right: 0; bottom: 0; width: 100%; z-index: 50; }
  .savebar { left: 12px; right: 12px; translate: none; bottom: calc(76px + env(safe-area-inset-bottom)); justify-content: space-between; border-radius: 16px; z-index: 60; transform: translateY(calc(100% + 120px)); }
  .savebar.show { transform: none; }
  .toasts { top: calc(64px + env(safe-area-inset-top)); }
  .cmdk { padding-top: 8vh; }
  .attr-row { grid-template-columns: 1fr; }
  .serp, .shop-card { max-width: 100%; }
  #previews .grid { grid-template-columns: 1fr !important; }
  .var-top { flex-wrap: wrap; }
}

/* ---------- SEO panel ---------- */
.seo-box { display: grid; gap: 16px; }
.seo-box.flat { padding-top: 12px; }
.seo-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.seo-head h3 { margin: 0 0 2px; }
.seo-head .help { margin: 0; }
.seo-score { flex: none; display: inline-flex; align-items: baseline; gap: 1px; padding: 6px 12px; border-radius: 999px; background: var(--fill); font-variant-numeric: tabular-nums; }
.seo-score b { font-size: 17px; }
.seo-score small { color: var(--muted); font-size: 11px; }
.seo-score.good { background: rgba(52, 199, 89, .14); color: #1f8a3b; }
.seo-score.ok { background: rgba(255, 159, 10, .16); color: #a35f00; }
.seo-score.bad { background: rgba(255, 59, 48, .12); color: #c4271d; }
.seo-tabs { justify-self: start; max-width: 100%; overflow-x: auto; }
.seo-pane { display: grid; gap: 16px; }
.seo-pane[hidden] { display: none; }
.serp-wrap { display: grid; gap: 8px; }
.serp-mode { justify-self: start; }
.serp-mode svg { width: 14px; height: 14px; vertical-align: -2px; }
.serp.mobile { max-width: 380px; }
.serp.mobile .t { font-size: 17px; }
.serp .site small { overflow-wrap: anywhere; }
.slug-field { display: flex; align-items: stretch; border-radius: 10px; overflow: hidden; box-shadow: inset 0 0 0 1px var(--line); }
.slug-field em { font-style: normal; color: var(--muted); padding: 0 0 0 12px; display: flex; align-items: center; font-size: 13px; white-space: nowrap; }
.slug-field input { box-shadow: none !important; padding-left: 2px !important; min-width: 0; flex: 1; background: transparent; }
.seo-checks { display: grid; gap: 8px; }
.seo-checks details { border-radius: 12px; background: var(--fill); padding: 0 14px; }
.seo-checks summary { cursor: pointer; list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 0; font-weight: 600; font-size: 13.5px; }
.seo-checks summary::-webkit-details-marker { display: none; }
.seo-checks .badge-err, .seo-checks .badge-ok { font-size: 11.5px; font-weight: 500; padding: 2px 8px; border-radius: 999px; }
.seo-checks .badge-err { background: rgba(255, 59, 48, .12); color: #c4271d; }
.seo-checks .badge-ok { background: rgba(52, 199, 89, .14); color: #1f8a3b; }
.seo-checks ul { list-style: none; margin: 0; padding: 0 0 12px; display: grid; gap: 9px; }
.seo-checks li { display: flex; gap: 10px; font-size: 13.5px; line-height: 1.4; }
.seo-checks li i { flex: none; width: 18px; height: 18px; border-radius: 50%; margin-top: 1px; display: grid; place-items: center; }
.seo-checks li.pass i { background: #34C759; }
.seo-checks li.fail i { background: #FF3B30; }
.seo-checks li i::after { content: ''; width: 8px; height: 8px; background: #fff; -webkit-mask: var(--ic) center / contain no-repeat; mask: var(--ic) center / contain no-repeat; }
.seo-checks li.pass i { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Cpath d='M1 5.5 4 8l5-6' fill='none' stroke='%23000' stroke-width='2'/%3E%3C/svg%3E"); }
.seo-checks li.fail i { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Cpath d='m2 2 6 6M8 2 2 8' stroke='%23000' stroke-width='2'/%3E%3C/svg%3E"); }
.seo-checks li small { display: block; color: var(--muted); font-size: 12.5px; }
.og-card { max-width: 460px; border-radius: 12px; overflow: hidden; background: #F0F2F5; color: #1c1e21; box-shadow: 0 0 0 1px rgba(0, 0, 0, .06); font-family: -apple-system, Helvetica, Arial, sans-serif; }
.og-card img { display: block; width: 100%; aspect-ratio: 1.91 / 1; object-fit: cover; background: #ddd; }
.og-card .b { padding: 10px 12px; }
.og-card small { color: #65676B; font-size: 11.5px; }
.og-card .t { font-weight: 600; font-size: 15px; margin: 2px 0; }
.og-card .d { color: #65676B; font-size: 13px; }
.robots-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.seo-details { border-top: 1px solid var(--line-2); padding-top: 10px; }
.seo-details > summary { cursor: pointer; color: var(--accent); font-size: 13.5px; }

/* ---------- Guided setup ---------- */
.wz-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; margin-bottom: 8px; }
.wz-card { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px 14px; text-align: left; padding: 16px 18px; border: 0; border-radius: var(--r-lg); background: var(--panel); box-shadow: var(--shadow); cursor: pointer; color: var(--ink); font: inherit; transition: transform .15s, box-shadow .15s; }
.wz-card:hover { transform: translateY(-1px); box-shadow: var(--shadow), 0 6px 18px rgba(0, 0, 0, .06); }
.wz-ic { width: 40px; height: 40px; border-radius: 11px; background: var(--fill); display: grid; place-items: center; color: var(--accent); flex: none; }
.wz-ic svg { width: 20px; height: 20px; }
.wz-body strong { display: block; font-size: 15px; margin-bottom: 3px; }
.wz-body small { color: var(--muted); font-size: 13px; line-height: 1.45; display: block; }
.wz-meta { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.wz-go { color: var(--accent); font-size: 13.5px; font-weight: 500; display: inline-flex; align-items: center; gap: 2px; }
.wz-go svg { width: 14px; height: 14px; }
dialog.wizard { width: min(620px, calc(100vw - 24px)); max-height: min(760px, calc(100dvh - 24px)); padding: 0; border: 0; border-radius: 20px; background: var(--panel); color: var(--ink); box-shadow: 0 30px 80px rgba(0, 0, 0, .3); overflow: hidden; }
dialog.wizard[open] { display: flex; flex-direction: column; animation: wzIn .22s ease-out; }
dialog.wizard::backdrop { background: rgba(0, 0, 0, .35); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
@keyframes wzIn { from { opacity: 0; transform: translateY(12px) scale(.98); } }
.wz-top { display: flex; align-items: center; gap: 12px; padding: 16px 18px 12px; }
.wz-top > div { flex: 1; min-width: 0; }
.wz-top strong { display: block; }
.wz-top small { color: var(--muted); font-size: 12.5px; }
.wz-progress { height: 3px; background: var(--fill); }
.wz-progress span { display: block; height: 100%; background: var(--toggle, #34C759); transition: width .3s; }
.wz-steps { overflow-y: auto; padding: 20px 22px; flex: 1; min-height: 0; }
.wz-step { display: grid; gap: 14px; }
.wz-step[hidden] { display: none; }
.wz-num { margin: 0; color: var(--accent); font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.wz-step h2 { margin: -8px 0 0; font-size: 21px; letter-spacing: -.01em; }
.wz-text { font-size: 14.5px; line-height: 1.6; }
.wz-text p { margin: 0 0 8px; }
.wz-text ol { margin: 0 0 8px; padding-left: 20px; display: grid; gap: 6px; }
.wz-text code { background: var(--fill); padding: 1px 6px; border-radius: 6px; font-size: 12.5px; overflow-wrap: anywhere; }
.wz-link { justify-self: start; }
.wz-copy { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; align-items: center; padding: 10px 12px; border-radius: 12px; background: var(--fill); }
.wz-copy small { grid-column: 1 / -1; color: var(--muted); font-size: 12px; }
.wz-copy code { font-size: 12.5px; overflow-wrap: anywhere; font-family: ui-monospace, Menlo, monospace; }
.wz-fields { margin: 0; }
.wz-fields .row.col { flex-direction: column; align-items: stretch; }
.wz-fields input:not([type=checkbox]):not([type=color]), .wz-fields select, .wz-fields textarea { width: 100%; max-width: none; }
.wz-fields .row:not(.col) select { width: auto; max-width: 60%; }
.wz-test { display: grid; gap: 10px; justify-items: start; }
.wz-result { margin: 0; padding: 10px 12px; border-radius: 10px; font-size: 14px; width: 100%; box-sizing: border-box; }
.wz-result.ok { background: rgba(52, 199, 89, .14); color: #1f8a3b; }
.wz-result.err { background: rgba(255, 59, 48, .12); color: #c4271d; }
.wz-foot { display: flex; gap: 10px; padding: 12px 18px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line-2); }
.wz-spacer { flex: 1; }
@media (max-width: 640px) {
    .wz-grid { grid-template-columns: minmax(0, 1fr); }
    dialog.wizard { width: 100vw; max-width: 100vw; max-height: 92dvh; margin: auto 0 0; border-radius: 20px 20px 0 0; }
    .wz-steps { padding: 16px; }
}
.guide-strip { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 12px 14px; margin-bottom: 18px; border-radius: 14px; background: var(--panel); box-shadow: var(--shadow); font-size: 13.5px; }
.guide-strip > span { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; margin-right: 4px; }
.guide-strip svg { width: 16px; height: 16px; color: var(--accent); }
.guide-strip .chip { padding: 5px 12px; border-radius: 999px; background: var(--fill); color: var(--ink); font-size: 13px; text-decoration: none; }
.guide-strip .chip:hover { background: var(--accent); color: #fff; }
.wz-fields .badge, .group .row.col > .badge { align-self: flex-start; }
.notice { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 12px 16px; border-radius: 12px; background: var(--panel); box-shadow: var(--shadow); font-size: 14px; }
.notice.warn { background: rgba(255, 159, 10, .12); color: #7a4a00; box-shadow: none; }
.notice svg { width: 18px; height: 18px; flex: none; }
.notice .link { color: var(--accent); font-weight: 500; }
.auth-card .google-btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; }
.auth-card .or-line { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12.5px; }
.auth-card .or-line::before, .auth-card .or-line::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.video-field video.preview { width: 100%; max-width: 420px; max-height: 260px; border-radius: 12px; background: #000; display: block; margin-bottom: 8px; }
.video-field .video-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.row[hidden], .group .row[hidden] { display: none !important; }
.chip-checks { display: flex; flex-wrap: wrap; gap: 6px; padding: 4px 0; }
.chip-check { position: relative; cursor: pointer; }
.chip-check input { position: absolute; opacity: 0; pointer-events: none; }
.chip-check span { display: inline-block; padding: 5px 12px; border-radius: 999px; background: var(--fill); font-size: 13px; transition: background .15s, color .15s; }
.chip-check input:checked + span { background: var(--accent); color: #fff; }
.chip-check input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.vis-seg { align-self: flex-start; }
.thumb-tag em.t-private { background: #5B4B8A; color: #fff; }
.thumb-tag em.t-enquiry { background: #3F5A4A; color: #fff; }
.purge-form { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.purge-form input { width: 70px !important; height: 32px; padding: 4px 8px; }
.inline-form { display: inline; margin: 0; }
.danger-text { color: var(--red) !important; }
.badge.b-new { background: var(--accent); color: #fff; font-size: 10.5px; padding: 1px 7px; margin-left: 4px; vertical-align: middle; }
.links-field { display: grid; gap: 8px; width: 100%; }
.link-rows { display: grid; gap: 8px; }
.link-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr) 130px auto; gap: 6px; align-items: center; }
.links-field [data-link-add] { justify-self: start; }
@media (max-width: 640px) { .link-row { grid-template-columns: minmax(0, 1fr) auto; } .link-row input[name$="_url[]"] { grid-column: 1 / -1; grid-row: 2; } .link-row select { grid-column: 1 / -1; grid-row: 3; } .link-row [data-link-remove] { grid-row: 1; grid-column: 2; } }
.range-field { display: inline-flex; align-items: center; gap: 10px; min-width: 0; }
.range-field input[type=range] { width: 170px; max-width: 42vw; accent-color: var(--accent); padding: 0; height: 24px; box-shadow: none; background: none; }
.range-field output { font-variant-numeric: tabular-nums; min-width: 44px; text-align: right; color: var(--muted); font-size: 13px; }
.hero-slides { display: grid; gap: 10px; margin: 6px 0 8px; }
.hero-slide-row { padding: 12px; border-radius: 14px; background: var(--fill); display: grid; gap: 10px; }
.hero-slide-row .slide-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.hero-slide-row .slide-move { display: inline-flex; gap: 2px; }
.add-review { margin-bottom: 16px; }
.add-review > summary { list-style: none; display: inline-flex; cursor: pointer; }
.add-review > summary::-webkit-details-marker { display: none; }

/* Live badges: bold, high contrast */
.side-nav a em.nav-count { background: #FF3B30; color: #fff; font-weight: 700; font-size: 12px; min-width: 22px; height: 22px; line-height: 22px; border-radius: 11px; box-shadow: 0 0 0 2px var(--side, var(--bg)); }
.side-nav a.on em.nav-count { background: #fff; color: #FF3B30; }
.tabbar a { position: relative; }
.tabbar em.tab-count { position: absolute; top: 2px; left: 50%; margin-left: 6px; font-style: normal; background: #FF3B30; color: #fff; font-weight: 700; font-size: 11px; min-width: 18px; height: 18px; line-height: 18px; border-radius: 9px; padding: 0 5px; text-align: center; box-shadow: 0 0 0 2px var(--panel); }
.nav-count.bump, .tab-count.bump { animation: badgeBump .5s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes badgeBump { 0% { transform: scale(.5); } 100% { transform: scale(1); } }

/* "New order" pop-up */
dialog.live-pop { border: 0; padding: 0; border-radius: 20px; width: min(380px, calc(100vw - 32px)); background: var(--panel); color: var(--ink); box-shadow: 0 30px 80px rgba(0, 0, 0, .35); }
dialog.live-pop::backdrop { background: rgba(0, 0, 0, .3); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
dialog.live-pop[open] { animation: wzIn .25s ease-out; }
.live-pop .lp-body { padding: 24px 22px 18px; text-align: center; }
.live-pop .lp-icon { width: 54px; height: 54px; border-radius: 50%; background: #34C759; color: #fff; display: grid; place-items: center; margin: 0 auto 12px; }
.live-pop .lp-icon svg { width: 26px; height: 26px; }
.live-pop h2 { margin: 0 0 4px; font-size: 20px; }
.live-pop p { margin: 0; color: var(--muted); }
.live-pop .lp-actions { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--line-2); }
.live-pop .lp-actions > * { padding: 14px; font: inherit; font-size: 15px; border: 0; background: none; color: var(--accent); cursor: pointer; text-align: center; text-decoration: none; }
.live-pop .lp-actions > * + * { border-left: 1px solid var(--line-2); font-weight: 600; }

/* Marketing */
.mkt { margin-bottom: 16px; display: grid; gap: 14px; }
.mkt-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.mkt-head h2 { margin: 0; font-size: 18px; display: inline-flex; align-items: center; gap: 8px; }
.mkt-head h2 svg { width: 20px; height: 20px; color: var(--accent); }
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.kpis > div { background: var(--fill); border-radius: 14px; padding: 12px 14px; min-width: 0; }
.kpis span { display: block; font-size: 12px; color: var(--muted); }
.kpis strong { display: block; font-size: 20px; letter-spacing: -.01em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.mkt-sub { margin: 6px 0 -4px; font-size: 14px; }
.mkt-table td, .mkt-table th { white-space: nowrap; }
.mkt-table td:first-child { white-space: normal; min-width: 160px; }
.empty.slim { padding: 18px; text-align: left; display: grid; gap: 10px; justify-items: start; }
.empty.slim p { margin: 0; color: var(--muted); }
.live-pop .lp-actions > *:focus-visible { outline: none; background: var(--fill); }
/* Hidden save bar is also invisible (not just moved off-screen) */
.savebar:not(.show) { visibility: hidden; transition: transform .4s var(--ease), visibility 0s linear .4s; }
.savebar.show { visibility: visible; transition: transform .4s var(--ease), visibility 0s; }
.mkt-table th.right, .mkt-table td.right { text-align: right; }

/* ==========================================================================
   2.2.0
   ========================================================================== */
/* Photo & video pickers */
.single-img { flex-wrap: wrap; align-items: center; }
.single-img .img-box { position: relative; flex: none; width: 64px; height: 64px; border-radius: 12px; background: var(--fill-2); box-shadow: 0 0 0 .5px var(--line); display: grid; place-items: center; overflow: hidden; }
.single-img .img-box .preview { width: 100%; height: 100%; border-radius: 0; box-shadow: none; }
.single-img .img-tag { position: absolute; left: 3px; right: 3px; bottom: 3px; font: 600 9px/1.2 var(--font); font-style: normal; text-align: center; padding: 2px 3px; border-radius: 6px; background: rgba(0, 0, 0, .55); color: #fff; }
.single-img .img-none { font-size: 10.5px; font-style: normal; color: var(--ink-3); text-align: center; line-height: 1.25; padding: 4px; }
.single-img .img-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.single-img .img-alt, .video-one .img-alt { flex: 1 1 100%; height: 32px; font-size: 13px; }
.video-one { display: grid; gap: 8px; }
.video-one video.preview { width: 100%; max-width: 420px; max-height: 240px; border-radius: 12px; background: #000; display: block; }
.video-one .video-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.media-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 18px; }
.media-pair .pair-label { display: flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 500; color: var(--ink-2); margin-bottom: 6px; }
.media-pair .pair-label .i { width: 14px; height: 14px; }
@media (max-width: 700px) { .media-pair { grid-template-columns: minmax(0, 1fr); } }
.gimg .alt-btn { position: absolute; right: 6px; bottom: 6px; height: 22px; padding: 0 8px; border: 0; border-radius: 999px; background: rgba(0, 0, 0, .55); color: #fff; font: 600 10.5px/22px var(--font); cursor: pointer; backdrop-filter: blur(6px); }
.gimg.no-alt .alt-btn { background: #FF9F0A; color: #1d1d1f; }
.gimg.no-alt .alt-btn::before { content: '+ '; }
@media (hover: none) { .gimg .x { opacity: 1; } }

/* Media library (picker dialog and page) */
dialog.mlib { width: min(1040px, calc(100vw - 24px)); height: min(820px, calc(100dvh - 24px)); padding: 0; border: 0; border-radius: 20px; background: var(--panel); color: var(--ink); box-shadow: 0 30px 80px rgba(0, 0, 0, .3); overflow: hidden; }
dialog.mlib[open] { display: flex; flex-direction: column; animation: wzIn .22s ease-out; }
dialog.mlib::backdrop { background: rgba(0, 0, 0, .35); }
.mlib-page { display: flex; flex-direction: column; min-height: 70vh; overflow: hidden; }
.mlib-head { padding: 16px 18px 12px; border-bottom: 1px solid var(--line-2); display: grid; gap: 10px; }
.mlib-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.mlib-title h2 { margin: 0; font-size: 18px; }
.mlib-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.mlib-tools input[type=search] { flex: 1 1 220px; min-width: 0; }
.mlib-tools .btn .i { width: 16px; height: 16px; }
.mlib-spacer { flex: 0 0 0; }
.mlib-url { display: flex; gap: 8px; }
.mlib-url input { flex: 1; min-width: 0; }
.mlib-status { margin: 0; color: var(--ink-2); } .mlib-status.bad { color: var(--red, #FF3B30); }
.mlib-body { flex: 1; overflow-y: auto; padding: 14px 18px; }
.mlib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; }
.mtile { position: relative; aspect-ratio: 1; padding: 0; border: 0; border-radius: 12px; overflow: hidden; background: var(--fill-2); cursor: pointer; box-shadow: 0 0 0 .5px var(--line); transition: box-shadow .15s, transform .15s; }
.mtile img, .mtile video { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.mtile:hover { transform: translateY(-1px); }
.mtile.on { box-shadow: 0 0 0 3px var(--accent); }
.mtile-check { position: absolute; top: 6px; right: 6px; width: 22px; height: 22px; border-radius: 50%; background: var(--accent); color: #fff; display: none; place-items: center; }
.mtile-check .i { width: 14px; height: 14px; }
.mtile.on .mtile-check { display: grid; }
.mtile-noalt { position: absolute; left: 6px; bottom: 6px; font: 600 9.5px/1 var(--font); padding: 3px 6px; border-radius: 999px; background: rgba(255, 159, 10, .92); color: #1d1d1f; }
.mtile-play { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; }
.mtile-play::before { content: ''; width: 34px; height: 34px; border-radius: 50%; background: rgba(0, 0, 0, .55); }
.mtile-play::after { content: ''; position: absolute; left: 50%; top: 50%; transform: translate(-35%, -50%); border-style: solid; border-width: 7px 0 7px 11px; border-color: transparent transparent transparent #fff; }
.mlib-empty { text-align: center; padding: 40px 10px; margin: 0; }
.mlib-more { text-align: center; padding-top: 14px; }
.mlib-foot { border-top: 1px solid var(--line-2); padding: 12px 18px; display: flex; gap: 14px; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; background: var(--panel-2); }
.mlib-info { flex: 1 1 320px; min-width: 0; }
.mlib-info p { margin: 0; }
.mlib-btns { display: flex; gap: 8px; margin-left: auto; }
.mlib-sel { display: flex; gap: 12px; align-items: flex-start; }
.mlib-sel-media { flex: none; width: 76px; height: 76px; border-radius: 10px; overflow: hidden; background: var(--fill-2); }
.mlib-sel-media img, .mlib-sel-media video { width: 100%; height: 100%; object-fit: cover; }
.mlib-sel-meta { flex: 1; min-width: 0; display: grid; gap: 2px; }
.mlib-sel-meta > strong { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mlib-sel-meta > small { color: var(--ink-2); font-size: 12px; }
.mlib-sel-meta .f { margin-top: 6px; }
.mlib-manage { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.mlib-page .mlib-sel-media { width: 120px; height: 120px; }
.mlib-kinds button { border: 0; }
@media (max-width: 600px) {
  dialog.mlib { width: 100vw; height: 100dvh; max-width: none; max-height: none; border-radius: 0; }
  .mlib-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .mlib-tools .btn span { display: none; }
  .mlib-tools .btn { padding: 0 10px; }
  .mlib-sel-media { width: 60px; height: 60px; }
  .mlib-btns { width: 100%; } .mlib-btns .btn { flex: 1; justify-content: center; }
}

/* Section lists (move up/down, on/off) */
.sec-list { display: grid; gap: 0; }
.sec-row { display: flex; align-items: center; gap: 8px; padding: 9px 14px; border-top: 1px solid var(--line-2); background: var(--panel); }
.sec-row:first-child { border-top: 0; }
.sec-row .sec-name { flex: 1; min-width: 0; font-size: 14px; }
.sec-row .sec-name small { display: block; color: var(--ink-3); font-size: 12px; }
.sec-row .sec-move { display: flex; gap: 2px; }
.sec-row .sec-move .btn { width: 30px; height: 30px; padding: 0; justify-content: center; }
.sec-row .sec-move .i { width: 15px; height: 15px; }
.sec-row.moved { animation: secMoved .6s ease; }
@keyframes secMoved { from { background: var(--accent-soft); } to { background: var(--panel); } }
.overlay-field { display: grid; gap: 6px; }
.overlay-field .ov-scale { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--ink-3); }
.layout-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; align-items: start; }
.layout-grid .group { margin: 0; }
@media (max-width: 420px) { .layout-grid { grid-template-columns: minmax(0, 1fr); } }
.mlib-page .mlib-foot { position: sticky; bottom: 0; z-index: 3; box-shadow: 0 -8px 20px -16px rgba(0, 0, 0, .25); }
@media (max-width: 860px) { .mlib-page .mlib-foot { bottom: calc(62px + env(safe-area-inset-bottom)); } }
.mkt-loading { display: flex; align-items: center; gap: 10px; padding: 26px 4px; color: var(--ink-2); }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--fill); border-top-color: var(--accent); animation: spin .8s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.btn.spinning .i { animation: spin .8s linear infinite; }
.customer-note { margin-bottom: 16px; display: grid; gap: 12px; border-left: 4px solid var(--orange, #FF9F0A); }
.customer-note .cn-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.customer-note .cn-head h3 { display: flex; align-items: center; gap: 8px; }
.customer-note .cn-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.customer-note .cn-block p { margin: 0 0 4px; }
.customer-note .cn-note { font-size: 15.5px; line-height: 1.5; margin: 0 !important; }
.push-preview { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border-radius: 16px; background: var(--fill-2); box-shadow: 0 0 0 .5px var(--line); max-width: 420px; }
.push-preview img { width: 36px; height: 36px; border-radius: 9px; flex: none; }
.push-preview div { display: grid; gap: 1px; min-width: 0; }
.push-preview strong { font-size: 13.5px; } .push-preview span { font-size: 13px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.push-preview small { font-size: 11px; color: var(--ink-3); }
.ai-guide { font-size: 14px; line-height: 1.55; }
.ai-steps { padding-left: 1.2em; display: grid; gap: 10px; margin: 12px 0; }
.ai-steps code { font-size: 12px; background: var(--fill-2); padding: 1px 6px; border-radius: 6px; word-break: break-all; }
.reply-draft { margin-top: 18px; padding: 14px 16px; border-radius: 14px; background: var(--fill-2); box-shadow: 0 0 0 .5px var(--line); }
.reply-draft .rd-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 6px; }
.reply-draft .rd-head strong { display: flex; align-items: center; gap: 6px; }
.reply-draft p { margin: 0 0 6px; white-space: normal; line-height: 1.55; }
.auth-card.consent { width: min(470px, 100%); text-align: left; }
.auth-card.consent h1 { text-align: center; }
.consent-list { background: var(--fill-2); border-radius: 14px; padding: 12px 16px; font-size: 13.5px; }
.consent-list p { margin: 6px 0 4px; }
.consent-list ul { margin: 0 0 6px; padding-left: 1.2em; color: var(--ink-2); display: grid; gap: 3px; }

/* 2.3.0 — Styles × box types grid */
.style-grid { border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; margin-bottom: 18px; background: var(--panel-2); }
.style-grid h4 { margin: 0 0 4px; font-size: 15px; }
.style-grid .help { margin: 0 0 10px; }
.sg-table { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.sg-table:not(:empty) { margin-top: 12px; }
table.sg { border-collapse: collapse; min-width: 100%; font-size: 14px; }
table.sg th, table.sg td { padding: 8px 10px; border-bottom: 1px solid var(--line-2); text-align: left; white-space: nowrap; }
table.sg thead th { font-weight: 600; color: var(--ink-2); font-size: 13px; }
table.sg tbody th { font-weight: 600; }
.sg-cell { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; min-height: 32px; }
.sg-cell input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--accent); }
.sg-price { display: inline-flex; align-items: center; gap: 2px; color: var(--ink-2); }
.sg-price input { width: 86px; min-width: 86px; flex: none; padding: 5px 8px; font-size: 14px; }
.sg-ship { width: 84px; min-width: 84px; padding: 5px 8px; font-size: 14px; }

/* What's inside the Boxx editor */
.wib-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 12px; }
.wib-tab { border: 1px solid var(--line); background: var(--panel); color: var(--ink); border-radius: 999px; padding: 6px 14px; font: inherit; font-size: 14px; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; }
.wib-tab small { color: var(--ink-3); font-size: 12px; }
.wib-tab.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.wib-tab.on small { color: rgba(255, 255, 255, .8); }
.wib-items { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 8px; }
.wib-item { display: grid; grid-template-columns: 22px minmax(0, 1fr) minmax(0, 1.4fr) auto; gap: 8px; align-items: center; }
.wib-num { color: var(--ink-3); font-size: 13px; text-align: right; font-variant-numeric: tabular-nums; }
.wib-acts { display: inline-flex; gap: 2px; }
.wib-item:first-child [data-mv="-1"], .wib-item:last-child [data-mv="1"] { opacity: .3; pointer-events: none; }
@media (max-width: 700px) {
  .wib-item { grid-template-columns: 22px minmax(0, 1fr); padding-bottom: 8px; border-bottom: 1px solid var(--line-2); }
  .wib-item .wi-note { grid-column: 2; }
  .wib-item .wib-acts { grid-column: 2; justify-self: end; }
}

/* 2.3.1 — photo lists: drag anywhere (press and hold on phones), ★ Main, photos for each style */
.gimg { cursor: grab; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.gimg img { pointer-events: none; }
.gallery-grid.sorting .gimg { cursor: grabbing; }
.gimg.dragging { opacity: .55; outline: 2px solid var(--accent); outline-offset: 2px; transform: scale(.97); }
.gimg:first-child::after { content: none; }
.gimg .main-btn { position: absolute; left: 6px; bottom: 6px; display: inline-flex; align-items: center; gap: 3px; padding: 3px 8px 3px 6px; border: 0; border-radius: 999px;
  background: rgba(0, 0, 0, .55); color: #fff; font: inherit; font-size: 10.5px; font-weight: 600; cursor: pointer; backdrop-filter: blur(6px); opacity: 0; transition: opacity .15s; }
.gimg .main-btn .i { width: 11px; height: 11px; }
.gimg:hover .main-btn, .gimg:first-child .main-btn { opacity: 1; }
.gimg:first-child .main-btn { background: var(--accent); cursor: default; }
.gimg:not(:first-child) .main-btn span::before { content: 'Set '; }
@media (hover: none) { .gimg .x, .gimg .main-btn { opacity: 1; } }
.style-photos { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line-2); }
.style-photos h4 { margin: 0 0 4px; font-size: 15px; }
.style-photos .help { margin: 0 0 12px; }
/* No blue flash when tapping on phones */
html { -webkit-tap-highlight-color: transparent; }
.btn.icon-only { padding-left: 0; padding-right: 0; width: 38px; justify-content: center; }
.btn.icon-only .i { margin: 0; }

/* 2.4.0: fingerprint / Face ID sign-in */
.auth-card .passkey-btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; }
.auth-card .passkey-btn .i { width: 20px; height: 20px; }
.auth-card .passkey-btn.alt { background: none; color: var(--accent); box-shadow: none; height: auto; padding: 6px 10px; font-size: 14px; font-weight: 500; }
.auth-card .passkey-msg { margin: -4px 0 0; color: var(--orange, #c26a00); }
dialog.pk-offer { border: 0; padding: 26px 24px 20px; border-radius: 22px; width: min(400px, calc(100vw - 32px)); background: var(--panel); color: var(--ink); box-shadow: 0 30px 80px rgba(0, 0, 0, .35); text-align: center; }
dialog.pk-offer::backdrop { background: rgba(0, 0, 0, .3); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
dialog.pk-offer[open] { animation: wzIn .25s ease-out; }
.pk-offer .pk-icon { width: 60px; height: 60px; border-radius: 18px; margin: 0 auto 14px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, var(--accent), #5E5CE6); }
.pk-offer .pk-icon svg { width: 32px; height: 32px; }
.pk-offer h2 { font-size: 19px; margin: 0 0 8px; line-height: 1.3; }
.pk-offer p { margin: 0 0 16px; color: var(--ink-2); font-size: 14px; line-height: 1.5; }
.pk-offer .pk-err { color: var(--red, #d70015); }
.pk-offer .pk-actions { display: grid; gap: 8px; }

/* 2.4.0: Your profile — two columns on wide screens; devices; notifications */
.profile-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; max-width: 1100px; }
@media (max-width: 900px) { .profile-grid { grid-template-columns: 1fr; } }
.dev-rows { margin: 0 -22px; border-top: 1px solid var(--line-2); }
.dev-rows li { padding: 10px 22px; }
.dev-rows form { margin: 0; }
.push-state { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.dot-state { width: 9px; height: 9px; border-radius: 50%; background: var(--ink-3); flex: none; }
.dot-state.on { background: #34C759; box-shadow: 0 0 0 4px rgba(52, 199, 89, .18); }
.dot-state.off { background: #FF9F0A; }
.ios-hint { background: var(--fill); border-radius: 12px; padding: 10px 12px; margin: 0; line-height: 1.5; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }
.btn-row:not(:has(> :not([hidden]))) { display: none; }
.push-prefs .group { margin: 0; }

/* 2.4.0: visitors & abandoned carts */
.via-list { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 3px; font-size: 13px; }
.via-list li { display: flex; justify-content: space-between; gap: 8px; }
.carts-table .cart-items { color: var(--ink-2); }
.carts-table .cart-acts { display: flex; gap: 4px; justify-content: flex-end; align-items: center; }
tr.row-focus td { background: color-mix(in srgb, var(--accent) 10%, transparent); }
.seg-scroll { overflow-x: auto; max-width: 100%; scrollbar-width: none; }
.seg-scroll::-webkit-scrollbar { display: none; }
.seg-scroll a { white-space: nowrap; }
.search-mini input { min-width: 200px; height: 34px; border-radius: 10px; }
.top-boxes li { align-items: flex-start; }
.mini-bars { display: grid; gap: 4px; margin-top: 6px; }
.mini-bars > span { position: relative; display: block; height: 18px; border-radius: 6px; background: var(--fill); overflow: hidden; }
.mini-bars i { position: absolute; inset: 0 auto 0 0; background: color-mix(in srgb, var(--accent) 30%, transparent); }
.mini-bars i.b2 { background: color-mix(in srgb, #34C759 32%, transparent); }
.mini-bars em { position: relative; font-style: normal; font-size: 11.5px; padding: 0 7px; line-height: 18px; color: var(--ink-2); }
.kv-sm { font-size: 20px; }
.opt-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.chip-sm { display: inline-block; font-size: 12px; padding: 2px 8px; border-radius: 999px; background: var(--fill); white-space: nowrap; }
.yes { color: var(--green); display: inline-flex; }
.yes .i { width: 18px; height: 18px; }
.list .center { text-align: center; }
.visit-list { padding: 4px 0 8px; }
.visit { border-top: 1px solid var(--line-2); }
.visit summary { list-style: none; cursor: pointer; padding: 12px 22px; display: flex; align-items: center; gap: 4px; }
.visit summary::-webkit-details-marker { display: none; }
.visit summary .i { margin-left: auto; width: 16px; height: 16px; transition: transform .2s; }
.visit[open] summary .i { transform: rotate(180deg); }
.tl { list-style: none; margin: 0; padding: 0 22px 14px; position: relative; }
.tl::before { content: ''; position: absolute; left: 36px; top: 4px; bottom: 18px; width: 2px; background: var(--line-2); }
.tl li { display: flex; gap: 12px; padding: 6px 0; position: relative; }
.tl-ic { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--panel); box-shadow: 0 0 0 1px var(--line); flex: none; z-index: 1; color: var(--ink-2); }
.tl-ic .i { width: 15px; height: 15px; }
.tl-body { display: grid; gap: 1px; padding-top: 4px; min-width: 0; }
.tl-text { font-size: 14px; overflow-wrap: anywhere; }
.tl-meta { font-size: 12px; color: var(--ink-3); }
.tl-meta a { color: inherit; }
.tl-cart_add .tl-ic, .tl-order .tl-ic, .tl-paid .tl-ic { background: #34C759; color: #fff; box-shadow: none; }
.tl-wib .tl-ic { background: var(--accent); color: #fff; box-shadow: none; }
.tl-cart_remove .tl-ic { background: #FF9F0A; color: #fff; box-shadow: none; }
.row-thumb { width: 40px; height: 40px; border-radius: 8px; object-fit: cover; flex: none; }
.b-handled, .b-expired, .b-unsubscribed { background: var(--fill); color: var(--ink-2); }

/* 2.4.0: notes & tasks */
.task-list { list-style: none; margin: 0; padding: 0; }
.task { display: flex; gap: 12px; align-items: flex-start; padding: 12px 22px; border-top: 1px solid var(--line-2); }
.task-check-form { margin: 0; }
.task-check { width: 24px; height: 24px; border-radius: 50%; border: 1.5px solid var(--ink-3); background: none; display: grid; place-items: center; cursor: pointer; color: transparent; padding: 0; margin-top: 1px; transition: background .15s, border-color .15s, color .15s; }
.task-check .i { width: 14px; height: 14px; }
.task-check:hover { border-color: var(--green); color: var(--green); }
.task.is-done .task-check { background: var(--green); border-color: var(--green); color: #fff; }
.task.is-done .task-title { text-decoration: line-through; color: var(--ink-3); }
.task.is-over .task-check { border-color: var(--red); }
.note-ic { width: 24px; height: 24px; display: grid; place-items: center; color: var(--accent); flex: none; }
.task-body { flex: 1; min-width: 0; }
.task-title { font-size: 15px; font-weight: 500; overflow-wrap: anywhere; }
.task-details { font-size: 13.5px; color: var(--ink-2); margin-top: 3px; overflow-wrap: anywhere; }
.task-meta { display: flex; gap: 10px; flex-wrap: wrap; font-size: 12.5px; color: var(--ink-3); margin-top: 4px; align-items: center; }
.task-meta .i { width: 13px; height: 13px; vertical-align: -2px; }
.task-meta .due.today { color: var(--blue); font-weight: 600; }
.task-meta .due.over { color: var(--red); font-weight: 600; }
.task-meta .who { background: var(--fill); border-radius: 999px; padding: 1px 8px; }
.task-meta .who.auto { background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); }
.task-acts { display: flex; gap: 2px; align-items: center; }
.task-acts form { margin: 0; }
small.od { color: var(--red); font-weight: 600; }
.dash-tasks summary { list-style: none; cursor: pointer; }
.dash-tasks summary::-webkit-details-marker { display: none; }
.dash-tasks summary h2 { display: flex; align-items: center; gap: 8px; }
.dash-tasks summary h2 .i { width: 18px; height: 18px; }
.dash-tasks-chev .i { width: 18px; height: 18px; transition: transform .2s; }
.dash-tasks[open] .dash-tasks-chev .i { transform: rotate(180deg); }
.count-pill { font-size: 12px; font-weight: 600; background: var(--fill); border-radius: 999px; padding: 1px 8px; }
.task-list.compact .task { padding: 10px 22px; }
.quick-task { display: flex; gap: 8px; padding: 12px 22px; border-top: 1px solid var(--line-2); flex-wrap: wrap; }
.quick-task input[name=title] { flex: 1 1 200px; }
.quick-task input[type=date] { flex: 0 0 150px; }
.dash-tasks-foot { padding: 0 22px 14px; font-size: 13.5px; }
.dash-tasks-foot a { color: var(--accent); }
.note-list { margin: 0; padding: 0 0 6px 0; list-style: none; counter-reset: n; }
.note-list > li { counter-increment: n; display: flex; gap: 12px; padding: 12px 22px; border-top: 1px solid var(--line-2); align-items: flex-start; }
.note-list > li::before { content: counter(n); flex: none; width: 24px; height: 24px; border-radius: 50%; background: var(--fill); display: grid; place-items: center; font-size: 12px; font-weight: 600; color: var(--ink-2); }
.note-body { flex: 1; min-width: 0; font-size: 15px; overflow-wrap: anywhere; display: grid; gap: 2px; }
.note-edit { flex: 1; display: grid; gap: 8px; }
.history-summary { margin: 0; padding: 0 22px 16px; color: var(--ink-2); font-size: 14px; line-height: 1.6; }
.wp-bar { height: 6px; border-radius: 999px; background: var(--fill); overflow: hidden; }
.wp-bar i { display: block; height: 100%; background: var(--accent); transition: width .4s; }

/* 2.4.0: Box used (product editor) */
.bu-rows { display: grid; gap: 8px; }
.bu-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 260px); gap: 10px; align-items: center; }
.bu-row.off { opacity: .55; }
.bu-name { font-size: 14px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 600px) { .bu-row { grid-template-columns: 1fr; gap: 4px; } }

/* 2.4.0: Costs & profit — chart colours (validated palette; dark steps chosen for the dark surface) */
.viz-root {
  --series-1: #2a78d6; --series-2: #eb6834; --series-3: #1baf7a;
  --cat-items: #2a78d6; --cat-boxes: #eb6834; --cat-google: #1baf7a; --cat-meta: #eda100; --cat-influencers: #c13584; --cat-samples: #8a6d3b; --cat-photography: #e87ba4; --cat-packaging: #008300; --cat-other: #6250d6; --cat-shipping: #0e8f9a; --cat-order_costs: #b5179e; --cat-salaries: #4361ee; --cat-team: #e0459b; --cat-travel: #5f9a14; --cat-experiments: #8b4fd8; --cat-running: #6c757d;
  --good: #0ca30c; --warn: #fab219; --crit: #d03b3b;
}
@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) .viz-root {
    --series-1: #3987e5; --series-2: #d95926; --series-3: #199e70;
    --cat-items: #3987e5; --cat-boxes: #d95926; --cat-google: #199e70; --cat-meta: #c98500; --cat-influencers: #e1306c; --cat-samples: #b08d57; --cat-photography: #d55181; --cat-packaging: #008300; --cat-other: #9085e9; --cat-shipping: #22b8c4; --cat-order_costs: #d63fbd; --cat-salaries: #6b85ff; --cat-team: #f77cc6; --cat-travel: #93d02a; --cat-experiments: #b07ff0; --cat-running: #8f969c;
  }
}
:root[data-theme="dark"] .viz-root {
  --series-1: #3987e5; --series-2: #d95926; --series-3: #199e70;
  --cat-items: #3987e5; --cat-boxes: #d95926; --cat-google: #199e70; --cat-meta: #c98500; --cat-influencers: #e1306c; --cat-samples: #b08d57; --cat-photography: #d55181; --cat-packaging: #008300; --cat-other: #9085e9; --cat-shipping: #22b8c4; --cat-order_costs: #d63fbd; --cat-salaries: #6b85ff; --cat-team: #f77cc6; --cat-travel: #93d02a; --cat-experiments: #b07ff0; --cat-running: #8f969c;
}
.g5 { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 1200px) { .g5 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 700px) { .g5 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.filter-row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.legend { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; font-size: 13px; color: var(--ink-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.sw { width: 10px; height: 10px; border-radius: 3px; display: inline-block; flex: none; }
.io-chart { padding: 6px 12px 0 6px; min-height: 240px; }
.viz { display: block; max-width: 100%; height: auto; overflow: visible; }
.viz .gridline { stroke: var(--line-2); stroke-width: 1; }
.viz .axis { stroke: var(--line); stroke-width: 1; }
.viz .tick { fill: var(--ink-3); font-size: 11px; font-variant-numeric: tabular-nums; }
.viz .bar-in { fill: var(--series-1); }
.viz .bar-out { fill: var(--series-2); }
.viz .hit { fill: transparent; }
.viz .col.on .hit, .viz .col:focus .hit { fill: var(--fill-2); }
.viz .col:focus { outline: none; }
.chart-note { margin: 4px 22px 14px; }
.split-bar { display: flex; gap: 2px; height: 24px; margin: 8px 22px 14px; border-radius: 6px; overflow: hidden; }
.split-bar .seg { min-width: 3px; cursor: default; transition: filter .15s; }
.split-bar .seg:hover, .split-bar .seg:focus { filter: brightness(1.12); outline: none; }
.split-bar.empty-bar { height: auto; color: var(--ink-3); font-size: 13px; }
.split-legend { list-style: none; margin: 0; padding: 0 22px 14px; display: grid; gap: 7px; font-size: 13.5px; }
.split-legend li { display: flex; align-items: center; gap: 8px; }
.split-legend .grow { flex: 1; min-width: 0; }
.num { font-variant-numeric: tabular-nums; }
.viz-tip { position: fixed; z-index: 1000; pointer-events: none; background: var(--panel); color: var(--ink); border-radius: 10px; padding: 8px 10px; box-shadow: 0 8px 30px rgba(0, 0, 0, .18), 0 0 0 .5px var(--line); font-size: 12.5px; min-width: 140px; }
.viz-tip .vt-title { color: var(--ink-2); font-size: 12px; margin-bottom: 4px; }
.viz-tip .vt-row { display: flex; align-items: center; gap: 6px; }
.viz-tip .vt-row i { width: 10px; height: 2px; border-radius: 1px; flex: none; }
.viz-tip .vt-row strong { font-variant-numeric: tabular-nums; }
.viz-tip .vt-row span { color: var(--ink-2); }
.whatif { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; font-size: 13px; color: var(--ink-2); }
.whatif label { display: inline-flex; align-items: center; gap: 8px; }
.whatif input[type=range] { width: 120px; accent-color: var(--accent); }
#boxes .whatif input[type=number] { width: 96px; height: 34px; } /* id: beats the general input rule */
@media (max-width: 700px) {
  .profit-table th:first-child, .profit-table td:first-child { min-width: 150px; }
  .whatif { gap: 10px 14px; }
}
.whatif output { min-width: 38px; font-variant-numeric: tabular-nums; color: var(--ink); }
.profit-table th[data-sort] { cursor: pointer; user-select: none; }
.profit-table th[data-dir=desc]::after { content: ' ↓'; }
.profit-table th[data-dir=asc]::after { content: ' ↑'; }
.profit-table tbody.pgroup + tbody.pgroup tr:first-child td { border-top: 1px solid var(--line); }
.cost-tip { border-bottom: 1px dotted var(--ink-3); cursor: help; }
.warn-txt { color: #C46F00; }
.kpi .warn-txt .i { width: 14px; height: 14px; vertical-align: -2px; }
.meter { display: grid; gap: 4px; min-width: 120px; }
.meter-track { display: block; height: 6px; border-radius: 999px; overflow: hidden; background: color-mix(in srgb, var(--meter) 18%, transparent); }
.meter-track i { display: block; height: 100%; border-radius: 999px; background: var(--meter); }
.meter-label { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; }
.meter-label .i { width: 13px; height: 13px; color: var(--meter); }
.meter-label small { color: var(--ink-2); }
.m-good { --meter: var(--good); } .m-warn { --meter: var(--warn); } .m-crit { --meter: var(--crit); } .m-none { --meter: var(--ink-3); }
.total-row td { font-weight: 600; border-top: 1px solid var(--line); }
/* Stock */
.low-rows li { gap: 8px; flex-wrap: wrap; }
.low-rows .grow { text-decoration: none; color: inherit; }
.stock-table .sub.late, .sub.late { color: var(--red); }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.steps li { position: relative; padding-left: 28px; display: grid; }
.steps li::before { content: ''; position: absolute; left: 4px; top: 4px; width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--line); background: var(--panel); }
.steps li.done::before { background: var(--green); border-color: var(--green); }
.steps li.now::before { border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent); }
.steps small { color: var(--ink-2); }
.restock-now { display: grid; gap: 12px; }
.restock-acts { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-end; }
.restock-acts form { margin: 0; }
.stock-up { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; }
.stock-up label { display: grid; gap: 2px; font-size: 12px; color: var(--ink-2); }
.stock-up input { width: 100px; height: 34px; }
.per-box { width: 64px; height: 32px; text-align: right; }
td.neg { color: var(--red); } td.pos { color: var(--green); }
.cost-items input, .cost-items select { min-width: 110px; height: 34px; }
.cost-items input[name$="[buy_url]"] { min-width: 180px; }
.money-in { width: 100px; text-align: right; }
.extras { display: grid; gap: 6px; margin-top: 6px; }
.extra-row { display: grid; grid-template-columns: minmax(0, 1fr) 110px; gap: 6px; }
.opt-cost { border-top: 1px solid var(--line-2); padding: 10px 0; }
.opt-cost summary { cursor: pointer; font-weight: 500; }
.opt-cost[open] summary { margin-bottom: 8px; }

/* 2.4.1 — inside each option row: photos for each value, and which main choices it comes with */
.attr-row { grid-template-columns: 180px auto auto auto minmax(0, 1fr) auto; row-gap: 6px; padding-bottom: 10px; border-bottom: 1px solid var(--line-2); margin-bottom: 10px; }
.attr-row > input[name^=attr_name] { grid-column: 1; grid-row: 1; }
.attr-row > .tag-input { grid-column: 2 / -1; grid-row: 1; }
.attr-row > .attr-display { grid-column: 2; grid-row: 2; }
.attr-row > .ap-btn { grid-column: 3; grid-row: 2; }
.attr-row > label.check { grid-column: 4; grid-row: 2; }
.attr-row > [data-remove-attr] { grid-column: 6; grid-row: 2; }
.attr-row > .ap-only { grid-row: 3; grid-column: 2 / -1; }
.attr-row > .ap-box { grid-row: 4; }
.attr-row .ap-btn { gap: 6px; white-space: nowrap; }
.attr-row .ap-btn .i { width: 16px; height: 16px; }
.attr-row .ap-count { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--accent); color: #fff; font-size: 11px; font-weight: 600; display: inline-grid; place-items: center; }
.attr-row .ap-count[hidden] { display: none; }
.attr-row .ap-btn[aria-expanded="true"] { background: var(--fill); }
.attr-row > .ap-box { grid-column: 1 / -1; }
.ap-only { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: -2px 0 2px; }
.ap-only[hidden], .ap-box[hidden] { display: none; }
.ap-only-label { font-size: 12.5px; color: var(--ink-2); margin-right: 2px; }
.chip-check { position: relative; display: inline-flex; align-items: center; gap: 5px; padding: 4px 11px 4px 9px; border-radius: 999px; background: var(--fill); color: var(--ink-2); font-size: 12.5px; cursor: pointer; text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--ink-2) 60%, transparent); }
.chip-check input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; pointer-events: none; }
.chip-check::before { content: ''; width: 12px; height: 12px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px currentColor; flex: none; }
.chip-check:has(input:checked) { background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); font-weight: 500; text-decoration: none; }
.chip-check:has(input:checked)::before { box-shadow: inset 0 0 0 4px currentColor; }
.chip-check:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.ap-box { border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; background: var(--panel-2); margin: 2px 0 6px; }
.ap-box .help { margin: 0 0 10px; }
.ap-box .ap-tabs { margin-bottom: 10px; }
@media (max-width: 860px) {
  .attr-row { grid-template-columns: minmax(0, 1fr) auto auto auto; column-gap: 6px; }
  .attr-row > input[name^=attr_name], .attr-row > .tag-input, .attr-row > .ap-only, .attr-row > .ap-box { grid-column: 1 / -1; grid-row: auto; }
  .attr-row > .attr-display { grid-column: 1; grid-row: auto; max-width: none; }
  .attr-row > .ap-btn { grid-column: 2; grid-row: auto; }
  .attr-row > label.check { grid-column: 3; grid-row: auto; font-size: 13px; }
  .attr-row > [data-remove-attr] { grid-column: 4; grid-row: auto; }
}
.ap-only .link-btn { border: 0; background: none; padding: 0; color: var(--accent); font: inherit; font-size: 12.5px; cursor: pointer; }

/* 2.4.1 — Media library page: the photos grow with the page (the bottom panel no longer covers the last row);
   the panel stays in view at the bottom while scrolling, and sits below the last row at the end. */
.mlib-page { overflow: clip; }
.mlib-page .mlib-body { flex: none; overflow: visible; }
.mlib-tools [data-bulk].on { background: var(--accent); color: #fff; }
.mlib-bulk { display: flex; align-items: center; justify-content: space-between; gap: 10px 14px; flex-wrap: wrap; width: 100%; }
.mlib-bulk-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.mlib-info:has(.mlib-bulk) { flex: 1; }
.mlib-bulk-on .mtile .mtile-check { display: grid; background: rgba(255, 255, 255, .9); color: transparent; box-shadow: 0 0 0 1.5px rgba(0, 0, 0, .3); }
.mlib-bulk-on .mtile.on .mtile-check { background: var(--accent); color: #fff; box-shadow: none; }

/* 2.4.1 — tasks given to a teammate */
.task-meta .who.given { background: color-mix(in srgb, var(--purple) 14%, transparent); color: var(--purple); display: inline-flex; align-items: center; gap: 4px; }
.task-meta .who .i { width: 13px; height: 13px; }

/* 2.4.1 — What's inside: the stock item a line uses (only for you) */
.wib-item .wib-acts { grid-row: 1; grid-column: 4; }
.wib-item .wi-stock-l { grid-row: 2; grid-column: 2 / 4; display: flex; align-items: center; gap: 6px; color: var(--ink-3); margin-top: -2px; }
.wib-item .wi-stock-l .i { width: 15px; height: 15px; flex: none; }
.wib-item .wi-stock { font-size: 13px; padding: 6px 10px; background: var(--fill-2); border-color: transparent; color: var(--ink-2); }
#wib-editor .help .i { width: 14px; height: 14px; vertical-align: -2px; }
@media (max-width: 700px) {
  .wib-item .wib-acts { grid-row: auto; grid-column: 2; }
  .wib-item .wi-stock-l { grid-row: auto; grid-column: 2; }
}
@media (max-width: 860px) { .mlib-tools [data-bulk] span { display: inline; } }

/* 2.4.1.1 — photos inside each option card */
.var-photos { margin-bottom: 14px; }
/* 2.4.1.5 — What's inside one option, inside its card under the photos */
.var-wib { margin-bottom: 16px; padding: 12px; border-radius: var(--r-sm); background: var(--fill-2); }
.var-wib .f-label { font-size: 13.5px; font-weight: 500; margin-bottom: 8px; }
.var-wib .f-label small { display: block; font-weight: 400; color: var(--ink-3); font-size: 12px; margin-top: 2px; }
.var-wib .wib-items:empty { margin: 0; }
.var-wib .vw-acts { display: flex; gap: 8px; flex-wrap: wrap; }
.var-photos .f-label { font-size: 13.5px; font-weight: 500; margin-bottom: 8px; }
.var-photos .f-label small { display: block; font-weight: 400; color: var(--ink-3); font-size: 12px; margin-top: 2px; }

/* 2.4.1.1 — Updates: upload progress */
.upd-progress { display: grid; gap: 8px; padding: 12px 14px; border-radius: var(--r-sm); background: var(--fill-2); }
.upd-progress[hidden] { display: none; }
.upd-prog-top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: 13.5px; min-width: 0; }
.upd-prog-top span { min-width: 0; overflow-wrap: anywhere; }
.upd-prog-top strong { font-variant-numeric: tabular-nums; font-size: 15px; flex: none; }
.upd-bar { height: 10px; border-radius: 999px; background: var(--fill); overflow: hidden; position: relative; }
.upd-bar i { display: block; height: 100%; width: 0; min-width: 10px; border-radius: 999px; background: var(--accent); transition: width .5s cubic-bezier(.25, .8, .25, 1), background-color .3s; position: relative; overflow: hidden; }
/* a soft light runs along the filled part while it works, so it never looks stuck */
.upd-progress.running .upd-bar i::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .45), transparent); transform: translateX(-100%); animation: upd-run 1.4s ease-in-out infinite; }
.upd-progress.done .upd-bar i { background: var(--green); }
.upd-progress.failed .upd-bar i { background: var(--red); }
.upd-progress.failed [data-upd-text] { color: var(--red); }
.upd-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12.5px; color: var(--ink-3); }
.upd-steps li { display: flex; align-items: center; gap: 6px; transition: color .3s; }
.upd-steps li::before { content: ''; width: 14px; height: 14px; border-radius: 50%; border: 1.5px solid currentColor; box-sizing: border-box; flex: none; }
.upd-steps li.on { color: var(--ink); font-weight: 600; }
.upd-steps li.on::before { border-color: var(--accent); border-right-color: transparent; animation: spin .8s linear infinite; }
.upd-steps li.done { color: var(--ink-2); }
.upd-steps li.done::before { border-color: var(--green); background: var(--green) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 6.2 5 8.5l4.5-5' fill='none' stroke='white' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 10px no-repeat; }
.upd-progress.failed .upd-steps li.on::before { animation: none; border-color: var(--red); }
@keyframes upd-run { to { transform: translateX(100%); } }
@media (prefers-reduced-motion: reduce) { .upd-progress.running .upd-bar i::after, .upd-steps li.on::before { animation: none; } }
.upd-covers { margin: 12px 0 0; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); font-size: 13.5px; }
.upd-covers p { margin: 0 0 6px; }
.upd-covers ol { margin: 0; padding-left: 20px; display: grid; gap: 4px; line-height: 1.5; }
.notes-sent { margin-bottom: 16px; }
.notes-sent .note-list > li { align-items: center; }
.notes-sent .note-list .badge { flex: none; }
@media (max-width: 560px) { .notes-sent .note-list > li { flex-wrap: wrap; row-gap: 6px; } .notes-sent .note-body { flex-basis: calc(100% - 36px); } .notes-sent .note-list .badge { margin-left: 36px; } }
.notes-sent-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 10px 22px 14px; border-top: 1px solid var(--line-2); margin: 0; }

/* 2.4.1.2 — updates sent by Claude */
.upd-ready { margin-bottom: 16px; border: 1.5px solid color-mix(in srgb, var(--accent) 45%, transparent); }
.upd-ready, .upd-push { scroll-margin-top: 76px; } /* opened from a notification: keep the heading below the top bar */
form[data-update-form] { align-content: start; }
.upd-ready-head { display: flex; gap: 12px; align-items: flex-start; }
.upd-ready-head h2 { margin: 0; font-size: 18px; }
.upd-ready-head p { margin: 2px 0 0; }
.upd-ready-ic { width: 36px; height: 36px; border-radius: 10px; background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); display: grid; place-items: center; flex: none; }
.upd-notes { margin: 12px 0 0; padding: 10px 12px; border-radius: 12px; background: var(--fill-2); font-size: 13.5px; line-height: 1.55; max-height: 220px; overflow: auto; }
.upd-ready-acts { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.upd-ready .upd-progress { margin-top: 12px; }
.upd-push-head { display: flex; align-items: center; gap: 10px; }
.upd-key { padding: 12px; border-radius: 12px; background: color-mix(in srgb, var(--orange) 10%, transparent); margin-bottom: 12px; }
.upd-key-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.upd-key-row code { font-size: 13px; padding: 6px 10px; border-radius: 8px; background: var(--panel); word-break: break-all; flex: 1; min-width: 0; }
.dash-update { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; padding: 12px 16px; border-radius: 14px; background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--ink); font-weight: 500; }
.dash-update .i { color: var(--accent); }
.dash-update span { flex: 1; }

/* Influencers & email marketing (2.5.0) */
.copy-row { display: flex; gap: 8px; align-items: center; }
.copy-row input { flex: 1; min-width: 0; font-size: 13px; color: var(--muted); }
.input-pair { display: flex; gap: 8px; }
.input-pair input { flex: 1; min-width: 0; }
.input-pair select { width: auto; flex: none; }
.rows .row-static { display: flex; align-items: center; gap: 12px; padding: 11px 22px; border-top: 1px solid var(--line-2); }
.rows .row-static:first-child { border-top: 0; }
.rows .row-static small { display: block; color: var(--muted); font-size: 12.5px; }
.aff-bars { display: flex; align-items: flex-end; gap: 2px; height: 64px; margin-top: 14px; }
.aff-bars span { flex: 1; min-width: 2px; border-radius: 3px 3px 0 0; background: color-mix(in srgb, var(--accent) 45%, transparent); }
.aff-bars span.sale { background: #D4A24C; }
.aff-roi { display: grid; gap: 2px; margin: 12px 0 0; padding: 10px 12px; border-radius: 12px; background: var(--fill); font-size: 12.5px; color: var(--muted); }
.aff-roi b { color: var(--ink); }
.aff-roi b.good { color: #1E9E47; } .aff-roi b.ok { color: #C46F00; } .aff-roi b.bad { color: var(--red); }
.gift-row { display: grid; gap: 12px; padding: 16px 22px; border-top: 1px solid var(--line-2); }
.gift-top { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.gift-top strong { display: inline-flex; align-items: center; gap: 6px; }
.gift-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 760px) { .gift-grid { grid-template-columns: 1fr 1fr; } .gift-grid [style*="span 2"] { grid-column: 1 / -1 !important; } }
.gift-acts { display: flex; gap: 8px; }
.gift-new { background: color-mix(in srgb, var(--accent) 4%, transparent); border-radius: 0 0 var(--radius, 18px) var(--radius, 18px); }
.ol-head, .ol-row { display: grid; grid-template-columns: minmax(0, 1fr) 70px 130px 90px 36px; gap: 8px; align-items: center; }
.ol-head { font-size: 12px; color: var(--muted); }
[data-ol-lines] { display: grid; gap: 8px; }
.ol-row select, .ol-row input { min-width: 0; width: 100%; }
.ol-price { display: flex; align-items: center; gap: 4px; }
.ol-total { text-align: right; font-size: 14px; }
.ol-sum { display: flex; justify-content: space-between; align-items: baseline; padding-top: 10px; border-top: 1px solid var(--line-2); }
.ol-sum strong { font-size: 22px; }
@media (max-width: 640px) {
  .ol-head { display: none; }
  .ol-row { grid-template-columns: 1fr 1fr 36px; padding: 10px; border-radius: 12px; background: var(--fill); }
  .ol-row select { grid-column: 1 / -1; }
  .ol-total { grid-column: 1 / 3; text-align: left; }
}
/* Email marketing */
.em-kinds { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.em-kind { display: grid; gap: 6px; align-content: start; text-align: left; padding: 20px; cursor: pointer; border: 1px solid var(--line-2); font: inherit; color: inherit; transition: transform .15s, box-shadow .15s, border-color .15s; }
.em-kind:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--accent) 50%, transparent); }
.em-kind strong { font-size: 16px; }
.em-kind small { color: var(--muted); }
.em-kind-ico { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); font-size: 19px; margin-bottom: 4px; }
.em-kind-go { display: inline-flex; align-items: center; gap: 4px; margin-top: 6px; font-size: 13px; font-weight: 600; color: var(--accent); }
.em-layout { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 1180px) { .em-layout { grid-template-columns: minmax(0, 1fr) minmax(380px, 520px); } }
.em-preview-col { display: grid; gap: 8px; }
@media (min-width: 1180px) { .em-layout .em-preview-col { position: sticky; top: 16px; } }
.em-preview-bar { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.em-preview { border-radius: 18px; overflow: hidden; border: 1px solid var(--line-2); background: #eee; height: min(78vh, 900px); min-height: 480px; display: flex; justify-content: center; transition: background .2s; }
.em-preview iframe { width: 100%; height: 100%; border: 0; background: #fff; transition: width .25s ease; }
.em-preview.mobile { background: var(--fill); }
.em-preview.mobile iframe { width: 375px; max-width: 100%; border-left: 1px solid var(--line-2); border-right: 1px solid var(--line-2); }
.em-templates { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); }
.em-tpl { display: grid; gap: 6px; cursor: pointer; }
.em-tpl input { position: absolute; opacity: 0; pointer-events: none; }
.em-tpl-frame { position: relative; display: block; height: 190px; border-radius: 12px; overflow: hidden; border: 2px solid var(--line-2); transition: border-color .15s, box-shadow .15s; }
.em-tpl-frame iframe { position: absolute; top: 0; left: 0; width: 640px; height: 960px; border: 0; transform: scale(.205); transform-origin: 0 0; pointer-events: none; }
.em-tpl:hover .em-tpl-frame { border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.em-tpl input:checked + .em-tpl-frame { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
.em-tpl input:focus-visible + .em-tpl-frame { outline: 2px solid var(--accent); outline-offset: 2px; }
.em-tpl-name { display: grid; grid-template-columns: auto 1fr; column-gap: 6px; align-items: center; font-size: 12.5px; font-weight: 600; line-height: 1.25; }
.em-tpl-name i { width: 9px; height: 9px; border-radius: 50%; grid-row: span 2; }
.em-tpl-name small { grid-column: 2; font-weight: 400; color: var(--muted); font-size: 11.5px; }
.em-products { display: grid; gap: 6px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); max-height: 340px; overflow-y: auto; padding: 2px; }
.em-prod { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; border: 1px solid var(--line-2); cursor: pointer; font-size: 13px; }
.em-prod[hidden] { display: none; }
.em-prod:has(input:checked) { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 7%, transparent); }
.em-prod img { width: 40px; height: 40px; border-radius: 8px; object-fit: cover; flex: none; }
.em-prod span { display: grid; min-width: 0; }
.em-prod small { color: var(--muted); }
.em-lists { display: grid; gap: 6px; padding-left: 26px; }
.em-count { margin: 4px 0 0; font-size: 14px; }
.em-count b { font-size: 18px; }
.em-progress { height: 10px; border-radius: 999px; background: var(--fill); overflow: hidden; }
.em-progress span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 60%, #fff)); transition: width .6s ease; }
.em-filter { display: flex; flex-wrap: wrap; gap: 8px; padding: 16px 22px 8px; }
.em-filter input[type=search] { flex: 1 1 200px; min-width: 0; }
.em-filter select { width: auto; }
/* Stock: earlier purchases, dates */
.purchase-past { border-top: 1px solid var(--line-2); padding-top: 12px; }
.purchase-past > summary { cursor: pointer; font-weight: 600; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.date-edit { display: inline-block; margin-left: 6px; }
.date-edit > summary { cursor: pointer; display: inline; }
.inline-form { display: inline-flex; gap: 6px; align-items: center; margin-top: 6px; flex-wrap: wrap; }
.inline-form input[type=date] { width: auto; }
/* Orders: payments, reminders, custom boxes */
.pay-sum { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; font-size: 14px; }
.pay-sum b { text-align: right; font-variant-numeric: tabular-nums; }
.pay-sum .due { font-size: 18px; color: var(--red); }
.pay-sum .ok { font-size: 18px; color: #1E9E47; }
.pay-list { display: grid; gap: 6px; margin: 4px 0 0; padding: 0; list-style: none; }
.pay-list li { display: flex; justify-content: space-between; gap: 10px; align-items: center; font-size: 13px; padding: 8px 10px; border-radius: 10px; background: var(--fill); }
.pay-list form { margin: 0; }
.wib-custom { margin: 0 22px 14px; padding: 12px 14px; border-radius: 12px; background: var(--fill); }
.wib-custom ul { margin: 6px 0 0; padding-left: 18px; font-size: 13px; }
.wib-rows { display: grid; gap: 8px; }
.wib-row { display: grid; grid-template-columns: minmax(0, 1fr) 70px 110px 36px; gap: 8px; align-items: center; }
.wib-row input { min-width: 0; width: 100%; }
.wib-head { display: grid; grid-template-columns: minmax(0, 1fr) 70px 110px 36px; gap: 8px; font-size: 12px; color: var(--muted); }
@media (max-width: 640px) { .wib-head { display: none; } .wib-row { grid-template-columns: 1fr 70px 36px; padding: 8px; border-radius: 10px; background: var(--fill); } .wib-row input[name^="wib_name"] { grid-column: 1 / -1; } }
/* Visitors: traffic */
.tr-bars { display: flex; align-items: flex-end; gap: 3px; height: 140px; padding: 8px 22px 0; }
.tr-bars span { flex: 1; min-width: 3px; border-radius: 4px 4px 0 0; background: color-mix(in srgb, var(--accent) 55%, transparent); position: relative; }
.tr-bars span i { position: absolute; left: 0; right: 0; bottom: 0; border-radius: inherit; background: var(--accent); }
.tr-axis { display: flex; justify-content: space-between; padding: 6px 22px 14px; font-size: 12px; color: var(--muted); }
.ch-bar { height: 6px; border-radius: 6px; background: var(--fill); overflow: hidden; margin-top: 4px; min-width: 60px; }
.ch-bar i { display: block; height: 100%; background: var(--accent); border-radius: inherit; }

/* ---------- 2.6.1: scanner, batches & expiry, deliveries, spam, team rights ---------- */
html.scan-open, html.scan-open body { overflow: hidden; }
.scan-hint { margin: -6px 0 14px; }
.big-tap { min-height: 48px; padding-left: 22px; padding-right: 22px; font-size: 15px; }
.card-title-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.flash-ring { box-shadow: 0 0 0 3px var(--accent), var(--shadow) !important; transition: box-shadow .3s; }
.b-spam { background: color-mix(in srgb, var(--orange) 16%, transparent); color: var(--orange); }

.scan-overlay { position: fixed; inset: 0; z-index: 1000; background: #000; color: #fff; display: flex; flex-direction: column; }
.scan-overlay[hidden] { display: none; }
.scan-overlay video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.scan-shade { position: absolute; inset: 0; background: radial-gradient(ellipse 60% 26% at 50% 42%, transparent 60%, rgba(0, 0, 0, .55) 61%); pointer-events: none; }
.scan-guide { position: absolute; left: 7%; right: 7%; top: 30%; height: 24%; pointer-events: none; }
.scan-guide i { position: absolute; width: 34px; height: 34px; border: 4px solid #fff; border-radius: 4px; }
.scan-guide i:nth-child(1) { left: 0; top: 0; border-right: 0; border-bottom: 0; }
.scan-guide i:nth-child(2) { right: 0; top: 0; border-left: 0; border-bottom: 0; }
.scan-guide i:nth-child(3) { left: 0; bottom: 0; border-right: 0; border-top: 0; }
.scan-guide i:nth-child(4) { right: 0; bottom: 0; border-left: 0; border-top: 0; }
.scan-laser { position: absolute; left: 6%; right: 6%; top: 50%; height: 2px; background: #ff3b30; box-shadow: 0 0 10px #ff3b30; animation: scanLaser 1.6s ease-in-out infinite alternate; }
@keyframes scanLaser { from { transform: translateY(-36px); } to { transform: translateY(36px); } }
@media (prefers-reduced-motion: reduce) { .scan-laser { animation: none; } }
.scan-top { position: relative; display: flex; align-items: center; gap: 10px; padding: calc(10px + env(safe-area-inset-top)) 12px 10px; background: linear-gradient(rgba(0, 0, 0, .6), transparent); }
.scan-title { flex: 1; text-align: center; font-weight: 600; font-size: 15px; text-shadow: 0 1px 3px rgba(0, 0, 0, .6); }
.scan-btn { width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .18); color: #fff; font-size: 18px; cursor: pointer; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.scan-btn.on { background: #ffd60a; color: #000; }
.scan-sheet { position: relative; margin-top: auto; padding: 14px 14px calc(14px + env(safe-area-inset-bottom)); background: rgba(20, 20, 22, .82); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); border-radius: 20px 20px 0 0; display: grid; gap: 10px; max-height: 58vh; }
.scan-msg { margin: 0; font-size: 14px; line-height: 1.4; color: rgba(255, 255, 255, .85); }
.scan-msg.err { color: #ff8a80; }
.scan-msg.ok { color: #7ee2a0; }
.scan-type { display: flex; gap: 8px; }
.scan-type input { flex: 1; min-width: 0; height: 48px; border-radius: 12px; border: 0; padding: 0 14px; font-size: 17px; background: rgba(255, 255, 255, .14); color: #fff; }
.scan-type input::placeholder { color: rgba(255, 255, 255, .55); }
.scan-go, .scan-done { height: 48px; border: 0; border-radius: 12px; padding: 0 18px; font-weight: 600; font-size: 15px; background: var(--accent); color: #fff; cursor: pointer; }
.scan-done { width: 100%; background: #34c759; }
.scan-list { overflow-y: auto; display: grid; gap: 6px; max-height: 32vh; -webkit-overflow-scrolling: touch; }
.scan-row { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 12px; background: rgba(255, 255, 255, .1); }
.scan-row.flash { animation: scanFlash .6s; }
@keyframes scanFlash { from { background: rgba(52, 199, 89, .55); } }
.scan-row .grow { flex: 1; min-width: 0; }
.scan-row .grow b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.scan-row small { color: rgba(255, 255, 255, .6); }
.scan-row button { width: 40px; height: 40px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .2); color: #fff; font-size: 20px; cursor: pointer; }
.scan-row .q { min-width: 26px; text-align: center; font-size: 17px; }

.scan-summary, .crop-overlay { position: fixed; inset: 0; z-index: 1001; background: rgba(0, 0, 0, .55); display: flex; align-items: flex-end; justify-content: center; }
.ss-card { width: min(720px, 100%); max-height: 94vh; overflow-y: auto; background: var(--panel); color: var(--ink); border-radius: 20px 20px 0 0; padding: 18px 16px calc(16px + env(safe-area-inset-bottom)); display: grid; gap: 12px; }
@media (min-width: 760px) { .scan-summary { align-items: center; } .ss-card { border-radius: 20px; } }
.ss-head { display: flex; align-items: center; justify-content: space-between; }
.ss-head h2 { margin: 0; font-size: 19px; }
.ss-items { display: grid; gap: 10px; }
.ss-item { border: 1px solid var(--line); border-radius: 14px; padding: 12px; display: grid; gap: 10px; }
.ss-top { display: grid; grid-template-columns: minmax(0, 1fr) 96px 110px; gap: 10px; align-items: end; }
.ss-top > b { align-self: center; font-size: 15px; }
.ss-foot { display: flex; gap: 10px; justify-content: flex-end; position: sticky; bottom: calc(-16px - env(safe-area-inset-bottom)); background: var(--panel); padding: 10px 0 0; }
@media (max-width: 520px) { .ss-top { grid-template-columns: 1fr 1fr; } .ss-top > :first-child { grid-column: 1 / -1; } .ss-foot .btn { flex: 1; } }
.ss-card .scan-msg.err { color: var(--red); }

.crop-overlay { flex-direction: column; align-items: stretch; background: #000; color: #fff; }
.crop-top { display: flex; align-items: center; gap: 12px; padding: calc(10px + env(safe-area-inset-top)) 12px 10px; font-weight: 600; }
.crop-stage { position: relative; flex: 1; display: grid; place-items: center; overflow: hidden; touch-action: none; }
.crop-stage canvas { max-width: 100%; max-height: 100%; touch-action: none; cursor: crosshair; }
.crop-box { position: absolute; border: 3px solid #ffd60a; box-shadow: 0 0 0 9999px rgba(0, 0, 0, .45); pointer-events: none; border-radius: 4px; }
.crop-foot { display: flex; gap: 10px; padding: 12px 12px calc(12px + env(safe-area-inset-bottom)); }
.crop-foot .btn { flex: 1; min-height: 48px; }

/* Delivery lines with expiry dates */
.lines { display: grid; gap: 10px; }
.line { position: relative; display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 10px; align-items: start; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel-2); }
.line .line-more { grid-column: 1 / -1; }
.line .line-x { position: absolute; top: 4px; right: 4px; }
.exp-row { display: flex; gap: 8px; align-items: center; }
.exp-row input { flex: 1; min-width: 0; }
.exp-row .btn { white-space: nowrap; min-height: 40px; }
@media (max-width: 520px) { .line { grid-template-columns: 1fr; } .exp-row .btn span { display: none; } }
.ocr-filled { background: color-mix(in srgb, #ffd60a 28%, var(--panel)) !important; box-shadow: 0 0 0 2px #ffd60a !important; }
.ocr-note { display: block; margin-top: 4px; color: var(--ink-2); font-size: 12px; }
.open-order { padding: 10px 12px; border-radius: 12px; background: var(--accent-soft); }
.from-scan { box-shadow: 0 0 0 2px var(--accent), var(--shadow); }

/* Batches and expiry colours */
.batch-rows li { align-items: flex-start; }
.batch-qty { display: grid; justify-items: center; min-width: 44px; line-height: 1.1; }
.batch-qty strong { font-size: 19px; }
.batch-qty small { color: var(--ink-2); font-size: 11px; }
.batch-acts { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 4px; }
.batch-acts details.mini[open] { flex-basis: 100%; }
.batch-acts .inline-form { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.batch-fix { margin-top: 8px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; }
.batch-rows li.exp-expired { background: color-mix(in srgb, var(--red) 6%, transparent); }
.batch-rows li.exp-nopack { background: color-mix(in srgb, var(--orange) 7%, transparent); }
.exp-expired, .pack-b.exp-expired { color: var(--red); }
.exp-nopack, .pack-b.exp-nopack { color: var(--orange); }
.exp-soon { color: color-mix(in srgb, var(--orange) 80%, var(--ink)); }
.exp-badge.exp-ok { background: color-mix(in srgb, var(--green) 14%, transparent); color: var(--green); }
.exp-badge.exp-soon { background: color-mix(in srgb, var(--orange) 14%, transparent); color: var(--orange); }
.exp-badge.exp-nopack { background: color-mix(in srgb, var(--orange) 20%, transparent); color: var(--orange); }
.exp-badge.exp-expired { background: color-mix(in srgb, var(--red) 14%, transparent); color: var(--red); }
.kpi-value.exp-expired { color: var(--red); } .kpi-value.exp-nopack, .kpi-value.exp-soon { color: var(--orange); }
.used-batches { padding: 4px 22px 14px; }
.expiry-list li { align-items: center; }
.pack-plan .rows li { padding-left: 0; padding-right: 0; align-items: flex-start; }
.pack-b { display: block; color: var(--ink-2); }
.rows.tight li { padding: 8px 0; }
.rows .grow strong + small, .rows .grow small + small { display: block; }

/* Barcodes */
.code-add { display: flex; gap: 8px; align-items: center; }
.code-add input[name=code], .code-add input[name=barcode] { flex: 1; min-width: 0; }
.code-rows code { font-size: 14px; letter-spacing: .03em; }

/* Corrections */
.fix-edit[open] { margin-top: 8px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel-2); }
.fix-edit .fields { gap: 10px; }
.fix-batch { padding-top: 8px; border-top: 1px dashed var(--line); }
.purchase-rows .grow strong { white-space: normal; }
.danger-txt { color: var(--red) !important; }

/* Team rights */
.team-perms { margin-top: 6px; }
.team-perms .check { font-size: 13px; color: var(--ink); }
/* Switch rows inside ordinary cards (Stock forms): label on the left, its note under it, the switch on the right. */
.fields > .row { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.fields > .row .row-label { flex: 1; min-width: 0; font-weight: 500; font-size: 14px; }
.fields > .row .row-label small { display: block; font-weight: 400; color: var(--ink-2); font-size: 12px; margin-top: 2px; }
#scan-new, #add, #receive, #batches, #barcodes, #purchases { scroll-margin-top: 76px; }

/* ===== 2.6.3: page tabs, sheets, the floating "+" button, calmer phone layouts ===== */
/* Page tabs */
.ptabs { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; margin: 0 0 18px; padding: 4px; background: var(--fill); border-radius: 12px; position: sticky; top: 64px; z-index: 15; }
.ptabs::-webkit-scrollbar { display: none; }
.ptabs a { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 9px; font-size: 13.5px; font-weight: 500; color: var(--ink-2); white-space: nowrap; transition: background .15s, color .15s; }
.ptabs a .i { width: 15px; height: 15px; }
.ptabs a:hover { color: var(--ink); }
.ptabs a.on { background: var(--panel); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .12), 0 0 0 .5px var(--line); }
.ptabs a em { font-style: normal; font-size: 11px; font-weight: 600; min-width: 18px; height: 18px; line-height: 18px; padding: 0 5px; border-radius: 9px; background: var(--fill); color: var(--ink-2); text-align: center; }
.ptabs a em.hot { background: var(--red); color: #fff; }
[data-ptabs-mode=all] .ptab-off { display: none !important; }
@media (max-width: 1100px) { [data-ptabs-mode=mobile] .ptab-off { display: none !important; } }
@media (min-width: 1101px) { [data-ptabs-mode=mobile] > .ptabs { display: none; } }
.ppanel-narrow { max-width: 820px; }
.panel-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 860px) { .panel-grid { grid-template-columns: 1fr; } }
.panel-grid > * + * { margin-top: 0 !important; }

/* Sheets: a bottom sheet on phones, a dialog on bigger screens */
dialog.sheet { width: min(560px, calc(100vw - 32px)); max-height: min(86dvh, 820px); padding: 0; border: 0; border-radius: 20px; background: var(--panel); color: var(--ink); box-shadow: 0 30px 80px rgba(0, 0, 0, .3); overflow: hidden; }
dialog.sheet[open] { display: flex; flex-direction: column; animation: sheetIn .22s var(--ease); }
dialog.sheet.closing { animation: sheetOut .18s ease-in forwards; }
dialog.sheet::backdrop { background: rgba(0, 0, 0, .38); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.sheet-head { display: flex; align-items: center; gap: 10px; padding: 16px 18px 12px; border-bottom: 1px solid var(--line-2); }
.sheet-head h3 { flex: 1; margin: 0; font-size: 17px; }
.sheet-grip { display: none; }
.sheet-body { overflow-y: auto; padding: 16px 18px calc(18px + env(safe-area-inset-bottom)); -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.sheet-foot { display: flex; gap: 10px; padding: 12px 18px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line-2); background: var(--panel); }
.sheet-foot .btn { flex: 1; height: 44px; font-size: 15px; }
@keyframes sheetIn { from { opacity: 0; transform: translateY(16px) scale(.98); } }
@keyframes sheetOut { to { opacity: 0; transform: translateY(16px) scale(.98); } }
@media (max-width: 860px) {
  dialog.sheet { width: 100%; max-width: 100%; margin: auto 0 0; max-height: 92dvh; border-radius: 22px 22px 0 0; }
  dialog.sheet[open] { animation: sheetUp .26s var(--ease); }
  dialog.sheet.closing { animation: sheetDown .18s ease-in forwards; }
  .sheet-grip { display: block; width: 100%; padding: 8px 0 0; touch-action: none; cursor: grab; }
  .sheet-grip::before { content: ""; display: block; width: 40px; height: 5px; border-radius: 3px; background: var(--ink-3); opacity: .5; margin: 0 auto; }
  .sheet-head { padding-top: 6px; }
  @keyframes sheetUp { from { transform: translateY(100%); } }
  @keyframes sheetDown { to { transform: translateY(100%); } }
}

/* The floating "+" button (phones and tablets) */
.fab { position: fixed; right: 16px; bottom: calc(84px + env(safe-area-inset-bottom)); z-index: 35; display: none; flex-direction: column; align-items: flex-end; gap: 10px; pointer-events: none; }
.fab-main { pointer-events: auto; } /* 2.7.1: only the + button (and the menu once open) takes taps; the box around the hidden menu used to block whatever was under it */
.fab-main { width: 58px; height: 58px; border-radius: 50%; border: 0; display: grid; place-items: center; background: var(--accent); color: #fff; box-shadow: 0 10px 28px color-mix(in srgb, var(--accent) 45%, transparent), 0 2px 6px rgba(0, 0, 0, .18); cursor: pointer; transition: transform .25s var(--ease); }
.fab-main .i { width: 26px; height: 26px; transition: transform .25s var(--ease); }
.fab.open .fab-main .i { transform: rotate(45deg); }
.fab-menu { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; pointer-events: none; }
.fab-menu > * { display: inline-flex; align-items: center; gap: 10px; height: 44px; padding: 0 18px 0 14px; border-radius: 22px; border: 0; background: var(--panel); color: var(--ink); font: 500 14.5px var(--font); box-shadow: var(--shadow-lg); cursor: pointer; opacity: 0; transform: translateY(10px) scale(.96); transition: opacity .18s, transform .22s var(--ease); white-space: nowrap; }
.fab-menu > * .i { width: 18px; height: 18px; color: var(--accent); }
.fab.open .fab-menu { pointer-events: auto; }
.fab.open .fab-menu > * { opacity: 1; transform: none; }
.fab.open .fab-menu > *:nth-child(2) { transition-delay: .03s; } .fab.open .fab-menu > *:nth-child(3) { transition-delay: .06s; } .fab.open .fab-menu > *:nth-child(4) { transition-delay: .09s; } .fab.open .fab-menu > *:nth-child(5) { transition-delay: .12s; }
.fab-scrim { display: none; }
.fab::before { content: ""; position: fixed; inset: 0; z-index: -1; background: rgba(0, 0, 0, .28); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); opacity: 0; pointer-events: none; transition: opacity .2s; }
.fab.open::before { opacity: 1; pointer-events: auto; }
@media (max-width: 860px) { .fab { display: flex; } .fab-only-desktop { display: none !important; } }
@media (max-width: 860px) { .head-actions.fab-hides { display: none; } }
html.kb-open .fab, html.scan-open .fab { display: none; }

/* Stat cards that scroll sideways on phones */
@media (max-width: 640px) {
  .kpi-strip { display: flex !important; overflow-x: auto; scroll-snap-type: x mandatory; gap: 10px !important; margin: 0 -14px 14px !important; padding: 2px 14px 6px; scrollbar-width: none; }
  .kpi-strip::-webkit-scrollbar { display: none; }
  .kpi-strip > * { flex: 0 0 min(72%, 260px); scroll-snap-align: start; margin: 0 !important; }
  .kpi-strip .kpi { padding: 14px 16px; }
  .kpi-strip .kpi-value { font-size: 22px; margin: 6px 0 0; }
  .kpi-strip .kpi-label .dot { width: 22px; height: 22px; border-radius: 7px; }
}

/* Calmer phone layouts everywhere */
@media (max-width: 640px) {
  .lede { display: none; }
  .page-head { margin: 4px 0 14px; gap: 10px; }
  .page-head h1 { font-size: 24px; }
  .card.pad, .card .pad { padding: 16px; }
  .card-head { padding: 14px 16px 0; }
  .rows li, .rows > a { padding: 11px 16px; }
  .card > .table-wrap .list th:first-child, .card > .table-wrap .list td:first-child { padding-left: 16px; }
  .head-actions .btn { height: 34px; }
  .ptabs { top: 60px; margin-left: -12px; margin-right: -12px; border-radius: 0; padding: 6px 12px; /* = .content side padding on phones */ background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: saturate(180%) blur(18px); -webkit-backdrop-filter: saturate(180%) blur(18px); border-bottom: 1px solid var(--line-2); }
  .ptabs a { padding: 7px 12px; }
  .ptabs a.on { background: var(--panel); }
}
.btn.block { width: 100%; justify-content: center; }
.more-link { display: inline-flex; align-items: center; gap: 4px; color: var(--accent); font-size: 13px; font-weight: 500; }
.quick-acts { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.quick-acts > * { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 14px; border-radius: 14px; background: var(--panel); box-shadow: var(--shadow); border: 0; text-align: left; font: inherit; color: var(--ink); cursor: pointer; }
.quick-acts > * .i { width: 22px; height: 22px; color: var(--accent); }
.quick-acts > * strong { font-size: 14px; font-weight: 600; }
.quick-acts > * small { color: var(--ink-2); font-size: 12px; line-height: 1.35; }
.quick-acts > *:active { transform: scale(.98); }

/* ===== 2.6.3: Costs & profit — the money dashboard ===== */
.viz-root { --grp-marketing: #c13584; --grp-fulfilment: #0e8f9a; --grp-team: #4361ee; --grp-operations: #8b4fd8; }
@media (prefers-color-scheme: dark) { :root:where(:not([data-theme="light"])) .viz-root { --grp-marketing: #e1306c; --grp-fulfilment: #22b8c4; --grp-team: #6b85ff; --grp-operations: #b07ff0; } }
:root[data-theme="dark"] .viz-root { --grp-marketing: #e1306c; --grp-fulfilment: #22b8c4; --grp-team: #6b85ff; --grp-operations: #b07ff0; }
.chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 2px 0; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 13px; border-radius: 999px; border: 0; background: var(--fill); color: var(--ink); font: 500 13px var(--font); white-space: nowrap; cursor: pointer; text-decoration: none; transition: background .15s, color .15s; }
.chip .i { width: 14px; height: 14px; }
.chip small { color: var(--ink-2); font-weight: 400; font-variant-numeric: tabular-nums; }
.chip i { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.chip:hover { background: var(--fill-2); }
.chip.on { background: var(--ink); color: var(--panel); }
.chip.on small { color: color-mix(in srgb, var(--panel) 75%, transparent); }
.period-bar { display: grid; gap: 8px; margin: -6px 0 14px; }
.period-note { font-size: 13px; color: var(--ink-2); }
.card-title { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.card-title h3 { margin: 0; font-size: 16px; }
.card-title.pad-x { padding: 18px 22px 0; }
.delta { display: inline-flex; align-items: center; gap: 2px; font-size: 11.5px; font-weight: 600; padding: 2px 7px; border-radius: 999px; vertical-align: middle; font-variant-numeric: tabular-nums; white-space: nowrap; }
.delta.good { background: color-mix(in srgb, var(--green) 15%, transparent); color: color-mix(in srgb, var(--green) 75%, var(--ink)); }
.delta.bad { background: color-mix(in srgb, var(--red) 13%, transparent); color: var(--red); }
.delta.flat { background: var(--fill); color: var(--ink-2); }
.money-overview > * + * { margin-top: 16px; }
.money-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
.money-grid > * + * { margin-top: 0 !important; }
@media (max-width: 900px) { .money-grid { grid-template-columns: 1fr; } }

/* Profit hero */
.money-hero { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 20px; padding: 22px 24px; background:
  radial-gradient(600px 220px at 0% 0%, color-mix(in srgb, var(--good) 14%, transparent), transparent 70%), var(--panel); }
.money-hero.is-loss { background: radial-gradient(600px 220px at 0% 0%, color-mix(in srgb, var(--crit) 14%, transparent), transparent 70%), var(--panel); }
.mh-label { font-size: 13px; font-weight: 500; color: var(--ink-2); }
.mh-value { font-family: var(--display); font-size: 40px; font-weight: 700; letter-spacing: -.035em; margin: 4px 0 2px; font-variant-numeric: tabular-nums; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.money-hero.is-loss .mh-value { color: var(--crit); }
.mh-sub { margin: 0; color: var(--ink-2); font-size: 14px; }
.mh-sub b { color: var(--ink); }
.mh-meter { position: relative; height: 8px; border-radius: 4px; background: var(--fill); margin-top: 12px; max-width: 360px; }
.mh-meter i { position: absolute; inset: 0 auto 0 0; border-radius: 4px; background: var(--good); }
.money-hero.is-loss .mh-meter i { background: var(--crit); }
.mh-meter b { position: absolute; top: -3px; width: 2px; height: 14px; background: var(--ink); border-radius: 1px; }
.mh-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mh-stats > div { display: grid; gap: 2px; align-content: start; padding: 12px 14px; border-radius: 14px; background: var(--fill-2); }
.mh-stats span { font-size: 12px; color: var(--ink-2); }
.mh-stats b { font-size: 19px; font-weight: 650; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.mh-stats .delta { justify-self: start; }
@media (max-width: 760px) {
  .money-hero { grid-template-columns: 1fr; padding: 18px; }
  .mh-value { font-size: 34px; }
}

/* Every ₹100 */
.per100 { display: flex; gap: 2px; height: 30px; border-radius: 10px; overflow: hidden; }
.per100 span { min-width: 3px; }
.per100-legend { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 8px; }
.per100-legend li { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.per100-legend i { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.per100-legend b { font-variant-numeric: tabular-nums; min-width: 42px; text-align: right; }
.per100-legend small { min-width: 78px; text-align: right; font-variant-numeric: tabular-nums; }
.per100-legend li.loss b { color: var(--crit); }

/* From sales to profit (a bridge) */
.bridge { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.bridge li { display: grid; grid-template-columns: minmax(0, 132px) minmax(0, 1fr) auto; gap: 10px; align-items: center; font-size: 13.5px; }
.b-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink-2); }
.b-total .b-label, .b-result .b-label { color: var(--ink); font-weight: 600; }
.b-track { position: relative; height: 18px; border-radius: 6px; background: var(--fill-2); }
.b-track i { position: absolute; top: 0; bottom: 0; border-radius: 5px; background: var(--series-2); }
.b-total .b-track i { background: var(--series-1); }
.b-result .b-track i { background: var(--good); }
.b-result.neg .b-track i { background: var(--crit); }
.bridge b { font-size: 13px; min-width: 76px; text-align: right; }
.b-result { border-top: 1px dashed var(--line); padding-top: 9px; }
.b-result.neg b { color: var(--crit); }
@media (max-width: 420px) { .bridge li { grid-template-columns: 96px minmax(0, 1fr) auto; } }

/* Spending by category */
.cats-wrap { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 18px; align-items: center; }
.donut { width: 150px; height: 150px; transform: rotate(-90deg); }
.donut circle { fill: none; stroke-width: 6.4; }
.donut-bg { stroke: var(--fill-2); }
.donut text { transform: rotate(90deg); transform-origin: 21px 21px; text-anchor: middle; fill: var(--ink); }
.donut-total { font-size: 5.6px; font-weight: 700; }
.donut-cap { font-size: 3.4px; fill: var(--ink-2) !important; }
.cat-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.cat-list a { display: flex; align-items: center; gap: 10px; padding: 7px 8px; margin: 0 -8px; border-radius: 10px; color: inherit; }
.cat-list a:hover { background: var(--fill-2); }
.cat-list i { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.cat-list .grow { min-width: 0; font-size: 14px; }
.cat-list .grow small { display: block; font-size: 11.5px; color: var(--ink-2); }
.cat-list b { font-size: 14px; }
@media (max-width: 480px) { .cats-wrap { grid-template-columns: 1fr; justify-items: center; } .cats-wrap .cat-list { width: 100%; } }

/* Insights */
.insights { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.insights li { display: flex; gap: 12px; align-items: flex-start; }
.ins-ic { flex: none; width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--fill); color: var(--ink-2); }
.ins-ic .i { width: 17px; height: 17px; }
.insights .t-good .ins-ic { background: color-mix(in srgb, var(--green) 16%, transparent); color: color-mix(in srgb, var(--green) 80%, var(--ink)); }
.insights .t-bad .ins-ic { background: color-mix(in srgb, var(--red) 14%, transparent); color: var(--red); }
.insights .t-warn .ins-ic { background: color-mix(in srgb, var(--orange) 16%, transparent); color: #C46F00; }
.insights .t-info .ins-ic { background: var(--accent-soft); color: var(--accent); }
.insights strong { display: block; font-size: 14px; font-weight: 600; }
.insights small { display: block; color: var(--ink-2); font-size: 12.5px; line-height: 1.4; margin-top: 1px; }

/* Trend */
.money-trend .trend-chart { padding: 6px 12px 0 6px; }
.viz .profit-line { fill: none; stroke: var(--good); stroke-width: 2.2; stroke-linejoin: round; stroke-linecap: round; }
.viz .profit-dot { fill: var(--panel); stroke: var(--good); stroke-width: 2; }
.viz .profit-dot.neg { stroke: var(--crit); }
.sw.sw-line { height: 3px; border-radius: 2px; }
.money-trend .chart-note { padding: 4px 22px 16px; margin: 0; }

/* Average order (a receipt) */
.receipt { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 14px; }
.receipt li { display: flex; align-items: baseline; gap: 8px; }
.receipt li span { flex: 1; display: flex; align-items: baseline; gap: 8px; color: var(--ink-2); }
.receipt li span::after { content: ""; flex: 1; border-bottom: 1px dotted var(--line); transform: translateY(-3px); }
.receipt li b { font-variant-numeric: tabular-nums; }
.receipt li:first-child span, .receipt .total span { color: var(--ink); }
.receipt .total { border-top: 1px solid var(--line); padding-top: 9px; margin-top: 2px; font-size: 16px; }
.receipt .total b { color: color-mix(in srgb, var(--green) 75%, var(--ink)); }
.receipt .total.neg b { color: var(--crit); }

/* Top boxes */
.earners { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.earners a { display: flex; align-items: center; gap: 12px; padding: 8px; margin: 0 -8px; border-radius: 10px; color: inherit; }
.earners a:hover { background: var(--fill-2); }
.earners .grow { min-width: 0; display: grid; gap: 2px; }
.earners .grow b { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.earners small { color: var(--ink-2); font-size: 12px; }
.earners .bar { height: 5px; border-radius: 3px; background: var(--fill-2); margin-top: 3px; }
.earners .bar i { display: block; height: 100%; border-radius: 3px; background: var(--good); }
.earners b.neg { color: var(--crit); }

/* Spending */
.spend-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.spend-search { flex: 1; min-width: 180px; }
.spend-search input { width: 100%; min-width: 0; }
.cat-chips { margin-bottom: 12px; }
.ledger-total { display: flex; justify-content: space-between; align-items: center; padding: 14px 22px; font-size: 14px; color: var(--ink-2); border-bottom: 1px solid var(--line-2); }
.ledger-total b { color: var(--ink); font-size: 18px; }
.ledger-day { display: flex; justify-content: space-between; align-items: center; padding: 10px 22px 4px; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-3); background: var(--panel-2); }
.ledger-day small { font-weight: 500; letter-spacing: 0; }
.ledger-rows li { gap: 10px; padding-top: 9px; padding-bottom: 9px; }
.ledger-rows .grow strong a { color: inherit; }
.ledger-rows .grow strong { white-space: normal; }
.lg-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
@media (max-width: 640px) { .ledger-total, .ledger-day { padding-left: 16px; padding-right: 16px; } .hide-xs { display: none !important; } }

/* Profit & loss */
.pl td, .pl th { padding-top: 9px; padding-bottom: 9px; }
.pl tr.sub td:first-child, .pl tr.detail td:first-child { color: var(--ink-2); }
.pl tr.subtotal td, .pl tr.total td { border-top: 1px solid var(--line); }
.pl tr.total td { font-size: 16px; border-top: 2px solid var(--ink); }
.pl tr.grp td:first-child { font-weight: 600; }
.pl tr.detail td { font-size: 13px; }
.pl .indent { padding-left: 16px; display: inline-block; }
.pl small { display: block; font-size: 11.5px; }
.explain { margin: 0; padding-left: 18px; display: grid; gap: 8px; color: var(--ink-2); font-size: 13.5px; }
.explain b { color: var(--ink); }

/* Add an expense */
.amount-input { display: flex; align-items: center; gap: 6px; padding: 6px 16px; border-radius: 16px; background: var(--fill-2); }
.amount-input span { font-size: 28px; color: var(--ink-3); font-weight: 600; }
.amount-input input { flex: 1; min-width: 0; border: 0 !important; background: none !important; box-shadow: none !important; font-size: 34px !important; font-weight: 700; height: 56px !important; padding: 0 !important; font-variant-numeric: tabular-nums; }
.cat-pick { border: 0; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.cat-pick legend { font-size: 13px; font-weight: 500; color: var(--ink-2); margin-bottom: 8px; padding: 0; }
.cat-pick label { position: relative; cursor: pointer; }
.cat-pick input { position: absolute; opacity: 0; pointer-events: none; }
.cat-pick span { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: 999px; background: var(--fill); font-size: 13px; transition: background .15s, color .15s; }
.cat-pick span i { width: 8px; height: 8px; border-radius: 50%; }
.cat-pick input:checked + span { background: var(--ink); color: var(--panel); }
.cat-pick input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.empty.sm { padding: 20px; }
.bridge.has-loss .b-track::after { content: ""; position: absolute; top: -3px; bottom: -3px; left: var(--zero); width: 1.5px; background: var(--ink-2); border-radius: 1px; }
.bridge .b-label { white-space: normal; line-height: 1.2; }

/* ===== 2.6.3: shared bits for the calmer pages ===== */
/* Filter chips with counts (stock list, order lists…) */
.fchips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 14px 18px 12px; border-bottom: 1px solid var(--line-2); }
.fchips::-webkit-scrollbar { display: none; }
.fchips a { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 999px; background: var(--fill); color: var(--ink); font-size: 13px; font-weight: 500; white-space: nowrap; transition: background .15s, color .15s; }
.fchips a em { font-style: normal; font-size: 12px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.fchips a:hover { background: var(--fill-2); }
.fchips a.on { background: var(--ink); color: var(--panel); }
.fchips a.on em { color: color-mix(in srgb, var(--panel) 72%, transparent); }
.fchips a.hot:not(.on) em { color: var(--red); font-weight: 600; }
/* A folded group at the end of a list */
details.fold { border-top: 1px solid var(--line-2); }
details.fold > summary { list-style: none; display: flex; flex-direction: column; gap: 2px; padding: 14px 18px; cursor: pointer; }
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary span { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; }
details.fold > summary span::after { content: ""; width: 7px; height: 7px; border-right: 2px solid var(--ink-3); border-bottom: 2px solid var(--ink-3); transform: rotate(45deg) translateY(-2px); transition: transform .2s var(--ease); }
details.fold[open] > summary span::after { transform: rotate(-135deg) translateY(-1px); }
details.fold > summary small { color: var(--ink-2); font-size: 12.5px; }
/* "More fields" inside a form */
details.more-fields > summary { list-style: none; display: inline-flex; align-items: center; gap: 6px; color: var(--accent); font-size: 14px; font-weight: 500; cursor: pointer; padding: 2px 0; }
details.more-fields > summary::-webkit-details-marker { display: none; }
details.more-fields > summary::before { content: "+"; font-weight: 600; width: 14px; text-align: center; }
details.more-fields[open] > summary::before { content: "−"; }
details.more-fields > .fields { margin-top: 12px; }
.or-line { display: flex; align-items: center; gap: 10px; margin: 14px 0; color: var(--ink-3); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.or-line::before, .or-line::after { content: ""; flex: 1; height: 1px; background: var(--line-2); }
.page-foot { margin: 16px 2px 0; }
.page-foot a { display: inline-flex; align-items: center; gap: 6px; }
.page-foot .i { width: 15px; height: 15px; }
.pill { display: inline-flex; align-items: center; height: 26px; padding: 0 10px; border-radius: 13px; background: var(--fill); color: var(--ink-2); font-size: 12px; font-weight: 500; white-space: nowrap; }
.pill.late { background: color-mix(in srgb, var(--red) 13%, transparent); color: var(--red); }

/* ===== 2.6.3: Stock — summary first ===== */
.scanbar { position: relative; display: flex; align-items: center; gap: 8px; height: 50px; margin: 0 0 8px; padding: 0 6px 0 14px; border-radius: 14px; background: var(--panel); box-shadow: var(--shadow); }
.scanbar .sb-icon { display: grid; color: var(--ink-3); }
.scanbar .sb-icon .i { width: 18px; height: 18px; }
.scanbar input[type=search] { flex: 1; min-width: 0; height: 100% !important; border: 0 !important; background: none !important; box-shadow: none !important; padding: 0 !important; border-radius: 0 !important; font: 400 16px var(--font); color: var(--ink); outline: none; }
.scanbar input[type=search]::-webkit-search-cancel-button { display: none; }
.scanbar:focus-within { box-shadow: var(--shadow), 0 0 0 2px color-mix(in srgb, var(--accent) 55%, transparent); }
.sb-clear { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; color: var(--ink-3); }
.sb-clear .i { width: 16px; height: 16px; }
.sb-scan { display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 14px; border: 0; border-radius: 10px; background: var(--accent); color: #fff; font: 600 14px var(--font); cursor: pointer; }
.sb-scan .i { width: 18px; height: 18px; }
.scan-hint { margin: 0 2px 16px; font-size: 12.5px; color: var(--ink-2); }
.stock-sum { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); align-items: center; gap: 18px; padding: 18px 20px; margin-bottom: 16px; }
.ss-label { display: block; font-size: 12.5px; color: var(--ink-2); font-weight: 500; }
.ss-value b { display: block; font-size: 28px; font-weight: 700; letter-spacing: -.02em; margin: 2px 0; }
.ss-note { display: block; font-size: 12px; color: var(--ink-3); }
.ss-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.ss-stat { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: 12px; background: var(--fill); color: var(--ink); transition: background .15s, transform .1s; }
.ss-stat b { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.1; }
.ss-stat span { font-size: 12px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ss-stat:hover { background: var(--fill-2); }
.ss-stat:active { transform: scale(.98); }
.ss-stat.warn b { color: var(--orange); }
.ss-stat.crit b { color: var(--red); }
.ss-stat.on { box-shadow: inset 0 0 0 1.5px var(--ink); }
.attn { margin-bottom: 16px; }
.attn .card-head { padding-bottom: 6px; }
.attn-list { list-style: none; margin: 0; padding: 0 0 6px; }
.attn-list li { position: relative; display: flex; align-items: center; gap: 12px; padding: 10px 18px 10px 30px; }
.attn-list li + li { border-top: 1px solid var(--line-2); }
.attn-list li::before { content: ""; position: absolute; left: 16px; top: 50%; width: 8px; height: 8px; margin-top: -4px; border-radius: 50%; background: var(--ink-3); }
.attn-list li.t-crit::before { background: var(--red); box-shadow: 0 0 0 3px color-mix(in srgb, var(--red) 18%, transparent); }
.attn-list li.t-warn::before { background: var(--orange); }
.attn-list li.t-soon::before { background: #e3b008; }
.attn-list .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; color: var(--ink); }
.attn-list strong { font-size: 14.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.attn-list small { font-size: 12.5px; color: var(--ink-2); }
.attn-list li.t-crit small { color: var(--red); }
.attn-list form { margin: 0; }
.attn-more { margin: 0; padding: 10px 18px 14px; border-top: 1px solid var(--line-2); font-size: 13px; color: var(--ink-2); }
.attn-more a { color: var(--accent); }
.stock-card { overflow: hidden; }
.stock-list { list-style: none; margin: 0; padding: 0; }
.stock-list li + li { border-top: 1px solid var(--line-2); }
.srow, .srow-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 11px 18px; }
.srow { color: var(--ink); transition: background .12s; }
.srow:hover { background: var(--fill); }
.srow:active { background: var(--fill-2); }
.srow-head { display: none; padding-top: 10px; padding-bottom: 8px; font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-3); border-bottom: 1px solid var(--line-2); }
.s-main { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.s-name { display: flex; align-items: center; gap: 7px; min-width: 0; }
.s-name strong { font-size: 14.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.s-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--green); }
.st-low .s-dot { background: var(--orange); }
.st-out .s-dot { background: var(--red); }
.st-none .s-dot { background: transparent; box-shadow: inset 0 0 0 1.5px var(--ink-3); }
.s-tag { flex: none; display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 6px; background: var(--fill); color: var(--ink-2); }
.s-tag .i { width: 12px; height: 12px; }
.s-main small { padding-left: 15px; font-size: 12.5px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.s-restock { color: var(--blue); font-weight: 500; }
.s-restock.late { color: var(--red); }
.s-qty { display: flex; align-items: baseline; justify-content: flex-end; gap: 4px; min-width: 52px; text-align: right; font-variant-numeric: tabular-nums; }
.s-qty b { font-size: 17px; font-weight: 700; }
.s-qty small { font-size: 12px; color: var(--ink-2); }
.st-low .s-qty b { color: var(--orange); }
.st-out .s-qty b { color: var(--red); }
.s-state, .s-boxes, .s-cost { display: none; font-size: 13px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.st-low .s-state { color: var(--orange); } .st-out .s-state { color: var(--red); }
@media (min-width: 768px) {
  .srow, .srow-head { grid-template-columns: minmax(0, 1fr) 120px 90px; }
  .srow-head { display: grid; }
  .srow-head .s-qty { display: block; }
  .s-state { display: block; }
}
@media (min-width: 1024px) {
  .srow, .srow-head { grid-template-columns: minmax(0, 1fr) 130px 70px 90px 100px; }
  .s-boxes, .s-cost { display: block; text-align: right; }
}
.stock-card .expiry-list { margin: 0; }
.stock-card .empty { padding: 40px 20px; }
.already .code-add input { flex: 1; min-width: 0; }
@media (max-width: 860px) { .scan-hint { display: none; } }
@media (max-width: 640px) {
  .stock-sum { grid-template-columns: 1fr; gap: 12px; padding: 16px; }
  .ss-value b { font-size: 26px; }
  .ss-value { display: grid; grid-template-columns: auto 1fr; align-items: baseline; column-gap: 10px; }
  .ss-value .ss-label { grid-column: 1 / -1; }
  .ss-value .ss-note { align-self: center; }
  .fchips { padding: 12px 14px 10px; }
  .srow { padding: 11px 16px; }
  .attn-list li { padding-right: 16px; }
}

/* ===== 2.6.3: Stock item — summary first, actions as sheets, the rest in tabs ===== */
.item-head h1 { margin-bottom: 6px; }
.item-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; }
.item-tags:empty { display: none; }
.item-tags .pill .i { width: 13px; height: 13px; margin-right: 4px; }
.link-pill { color: var(--accent); }
.item-hero { padding: 18px 20px 16px; margin-bottom: 16px; }
.ih-top { display: grid; gap: 12px; }
.ih-label { display: block; font-size: 12.5px; font-weight: 500; color: var(--ink-2); }
.ih-num { display: block; font-size: 42px; font-weight: 700; letter-spacing: -.03em; line-height: 1.05; margin: 2px 0 4px; font-variant-numeric: tabular-nums; }
.ih-num small { font-size: 16px; font-weight: 500; color: var(--ink-2); letter-spacing: 0; }
.ih-sub { font-size: 13px; color: var(--ink-2); }
.ih-state { font-weight: 600; color: var(--green); }
.st-low .ih-state, .st-low .ih-num { color: var(--orange); }
.st-out .ih-state, .st-out .ih-num { color: var(--red); }
.st-none .ih-state { color: var(--ink-2); }
.ih-level { position: relative; height: 8px; border-radius: 4px; background: var(--fill); }
.lv-fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 4px; background: var(--green); transition: width .4s var(--ease); }
.st-low .lv-fill { background: var(--orange); }
.st-out .lv-fill { background: var(--red); }
.lv-mark { position: absolute; top: -3px; bottom: -3px; width: 2px; margin-left: -1px; border-radius: 1px; background: var(--ink-2); }
.ih-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; margin: 16px 0 0; padding: 12px 0 0; border-top: 1px solid var(--line-2); }
.ih-stats > div { min-width: 0; padding: 0 10px; }
.ih-stats > div:first-child { padding-left: 0; }
.ih-stats > div + div { border-left: 1px solid var(--line-2); }
.ih-stats dt { font-size: 11.5px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ih-stats dd { margin: 2px 0 0; font-size: 16px; font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ih-stats dd small { font-size: 12px; font-weight: 500; color: var(--ink-2); }
.ih-stats dd.exp-expired { color: var(--red); } .ih-stats dd.exp-nopack, .ih-stats dd.exp-soon { color: var(--orange); }
.ih-acts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 16px; }
.ia { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 66px; padding: 10px 6px; border: 0; border-radius: 14px; background: var(--fill); color: var(--ink); font: 500 12.5px var(--font); text-align: center; cursor: pointer; transition: background .15s, transform .1s; }
.ia .i { width: 21px; height: 21px; color: var(--accent); }
.ia:hover { background: var(--fill-2); }
.ia:active { transform: scale(.97); }
.ia-main { background: var(--accent); color: #fff; }
.ia-main .i { color: #fff; }
.ia-main:hover { background: color-mix(in srgb, var(--accent) 88%, #000); }
.ih-task { margin: 12px 0 0; font-size: 12.5px; color: var(--ink-2); display: flex; align-items: center; gap: 6px; }
.ih-task .i { width: 14px; height: 14px; }
.onway { margin-bottom: 16px; }
.card-note { margin: 6px 22px 0; }
.card-foot { padding: 12px 22px 16px; border-top: 1px solid var(--line-2); }
.usage-rows li { align-items: center; gap: 12px; }
.usage-rows .grow { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.usage-rows .grow small { color: var(--ink-2); font-size: 12.5px; }
.per-box-l { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.per-box-l input { width: 56px; text-align: center; }
.per-box-l small, .can-make small, .mv-after small { font-size: 11px; color: var(--ink-3); }
.can-make, .mv-after { display: flex; flex-direction: column; align-items: flex-end; min-width: 54px; font-variant-numeric: tabular-nums; }
.can-make b { font-size: 17px; }
.move-rows li { align-items: center; gap: 12px; }
.move-rows .grow { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.move-rows .grow strong { font-size: 14px; font-weight: 600; }
.move-rows .grow small { color: var(--ink-2); font-size: 12.5px; }
.mv-delta { flex: none; min-width: 52px; height: 30px; display: grid; place-items: center; padding: 0 8px; border-radius: 9px; font-weight: 700; font-size: 14px; font-variant-numeric: tabular-nums; }
.mv-delta.pos { background: color-mix(in srgb, var(--green) 14%, transparent); color: var(--green); }
.mv-delta.neg { background: color-mix(in srgb, var(--red) 12%, transparent); color: var(--red); }
.mv-after { font-weight: 600; }
.danger-zone { text-align: left; }
.big-input { font-size: 22px !important; height: 52px !important; font-weight: 600; }
.sheet-head .btn.sm { flex: none; }
@media (min-width: 861px) { .item-hero { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); column-gap: 28px; align-items: start; }
  .item-hero .ih-top { grid-column: 1; }
  .item-hero .ih-stats { grid-column: 1; }
  .item-hero .ih-acts { grid-column: 2; grid-row: 1 / span 2; margin-top: 0; grid-template-columns: repeat(2, minmax(0, 1fr)); align-self: stretch; }
  .item-hero .ia { min-height: 0; flex-direction: row; gap: 8px; font-size: 14px; }
  .item-hero .ih-task { grid-column: 1 / -1; } }
@media (max-width: 640px) {
  .item-hero { padding: 16px; }
  .ih-num { font-size: 38px; }
  .ih-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 12px; }
  .ih-stats > div:nth-child(3) { padding-left: 0; border-left: 0; }
  .ia { min-height: 62px; font-size: 12px; }
  .card-note { margin: 6px 16px 0; }
  .card-foot { padding: 12px 16px 16px; }
}

/* ===== 2.6.3: Order — who, how much, what's next on top ===== */
.order-meta { color: var(--ink-2); }
.order-hero { padding: 18px 20px; margin-bottom: 16px; display: grid; gap: 14px; }
.oh-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.oh-label { display: block; font-size: 12px; font-weight: 500; color: var(--ink-2); }
.oh-who { min-width: 0; }
.oh-who b { display: block; font-size: 20px; font-weight: 700; letter-spacing: -.01em; margin: 2px 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.oh-who small { font-size: 12.5px; color: var(--ink-2); }
.oh-money { text-align: right; flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.oh-money b { font-size: 24px; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; }
.pay-pill { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: 12px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.pay-pill.t-ok { background: color-mix(in srgb, var(--green) 15%, transparent); color: var(--green); }
.pay-pill.t-warn { background: color-mix(in srgb, var(--orange) 16%, transparent); color: var(--orange); }
.pay-pill.t-bad { background: color-mix(in srgb, var(--red) 14%, transparent); color: var(--red); }
.pay-pill.t-info { background: color-mix(in srgb, var(--blue) 14%, transparent); color: var(--blue); }
.oh-when { margin: 0; display: flex; align-items: center; gap: 8px; padding: 9px 12px; border-radius: 11px; background: var(--fill); font-size: 13.5px; font-weight: 500; }
.oh-when .i { width: 16px; height: 16px; color: var(--accent); }
.oh-when.soon { background: color-mix(in srgb, var(--orange) 14%, transparent); color: var(--orange); }
.oh-when.soon .i { color: var(--orange); }
.oh-steps { margin: 2px 0 0; }
.oh-next { display: flex; align-items: center; gap: 12px; margin: 0; }
.oh-next .btn { height: 46px; padding: 0 22px; font-size: 15px; }
.oh-next small { font-size: 12px; color: var(--ink-3); }
.oh-acts { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.oh-acts .ia { min-height: 60px; text-decoration: none; }
.oi-img { width: 48px; height: 58px; border-radius: 10px; object-fit: cover; flex: none; }
.oi-row .grow { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.oi-row .grow small { color: var(--ink-2); font-size: 12.5px; }
.oi-each { font-variant-numeric: tabular-nums; }
.oi-total { min-width: 80px; text-align: right; }
.order-more-acts { display: flex; flex-wrap: wrap; gap: 8px; }
.order-more-acts form { margin: 0; }
.status-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; }
.status-pick label { position: relative; }
.status-pick input { position: absolute; opacity: 0; pointer-events: none; }
.status-pick span { display: flex; align-items: center; justify-content: center; height: 42px; padding: 0 10px; border-radius: 11px; background: var(--fill); font-size: 13.5px; font-weight: 500; text-align: center; cursor: pointer; transition: background .15s, box-shadow .15s; }
.status-pick input:checked + span { background: var(--panel); box-shadow: inset 0 0 0 2px var(--accent); color: var(--ink); }
.status-pick input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (max-width: 640px) {
  .order-hero { padding: 16px; gap: 12px; }
  .oh-who b { font-size: 18px; }
  .oh-money b { font-size: 21px; }
  .oh-acts { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .oh-acts .ia { min-height: 56px; }
  .oh-next { flex-direction: column; align-items: stretch; gap: 6px; }
  .oh-next .btn { width: 100%; justify-content: center; }
  .oh-next small { text-align: center; }
  .page-head .order-meta { font-size: 12.5px; }
}

/* ===== 2.6.3: Dashboard — "Pending work" ===== */
.dash-tasks > summary.dt-sum { display: flex; align-items: center; gap: 12px; padding: 14px 18px; list-style: none; cursor: pointer; border-radius: inherit; }
.dash-tasks > summary.dt-sum:hover { background: color-mix(in srgb, var(--fill) 60%, transparent); }
.dash-tasks[open] > summary.dt-sum { border-bottom: 1px solid var(--line-2); border-radius: var(--r) var(--r) 0 0; }
.dt-icon { flex: none; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); }
.dt-icon .i { width: 18px; height: 18px; }
.dash-tasks.has-over .dt-icon { background: color-mix(in srgb, var(--red) 14%, transparent); color: var(--red); }
.dt-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.dt-title { display: flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 650; }
.dt-title .badge { font-size: 11px; }
.dt-next { font-size: 12.5px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dt-next b { font-weight: 500; color: var(--ink); }
.dt-next .over { color: var(--red); font-weight: 600; }
.dash-tasks[open] .dt-next { display: none; }
.dash-tasks-chev { flex: none; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--fill); color: var(--ink-2); }
.dash-tasks-chev .i { width: 16px; height: 16px; transition: transform .25s var(--ease); }
.dash-tasks[open] .dash-tasks-chev .i { transform: rotate(180deg); }
.dash-tasks .task-list.compact .task:first-child { border-top: 0; }
.dash-tasks .quick-task { align-items: center; padding: 12px 18px; }
.dash-tasks .quick-task input[name=title] { flex: 1 1 220px; min-width: 0; }
.qt-row { display: flex; gap: 8px; flex: 0 0 auto; }
.qt-row input[type=date] { width: 150px; }
.dash-tasks-foot { padding: 0 18px 14px; }
@media (max-width: 640px) {
  .dash-tasks > summary.dt-sum { padding: 13px 16px; }
  .dash-tasks .task-list.compact .task { padding: 10px 16px; }
  .dash-tasks .quick-task { padding: 12px 16px; }
  .qt-row { flex: 1 1 100%; }
  .qt-row input[type=date] { flex: 1; width: auto; min-width: 0; }
  .dash-tasks-foot { padding: 0 16px 14px; }
}
.dt-next .when { color: var(--blue); font-weight: 600; }

/* ===== 2.6.3: Orders list — two-line cards on phones ===== */
.m-only { display: none; }
.tb-dates { display: inline-flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.tb-dates input[type=date] { width: auto; }
.tb-dates-toggle { display: none; }
@media (max-width: 640px) {
  .m-only { display: inline; }
  div.m-only { display: block; }
  .orders-card .toolbar { gap: 8px; padding: 12px 14px; }
  .orders-card .toolbar .segmented { flex: 1 1 100%; }
  .orders-card .toolbar .search { flex: 1 1 0; min-width: 0; }
  .tb-dates-toggle { display: inline-flex; height: 40px; }
  .tb-dates { display: none; flex: 1 1 100%; }
  .toolbar.show-dates .tb-dates { display: flex; }
  .tb-dates input[type=date] { flex: 1; min-width: 0; }
  .orders-table thead { display: none; }
  .orders-table, .orders-table tbody { display: block; }
  .orders-table tbody tr { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "chk order total" "chk cust status"; column-gap: 12px; row-gap: 3px; align-items: center; padding: 12px 16px; border-top: 1px solid var(--line-2); }
  .orders-table tbody tr:first-child { border-top: 0; }
  .orders-table td { display: block; padding: 0 !important; border: 0 !important; min-width: 0; }
  .orders-table .c-chk { grid-area: chk; }
  .orders-table .c-order { grid-area: order; }
  .orders-table .c-cust { grid-area: cust; }
  .orders-table .c-status { grid-area: status; justify-self: end; }
  .orders-table .c-total { grid-area: total; text-align: right; }
  .orders-table .c-date, .orders-table .c-pay, .orders-table .c-when { display: none; }
  .orders-table .c-order .title { display: flex; align-items: center; gap: 6px; font-weight: 650; }
  .orders-table .c-order .sub, .orders-table .c-cust .sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .orders-table .c-cust .title { font-size: 13.5px; font-weight: 500; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .orders-table .c-cust .sub { display: none; }
  .orders-table .c-order .sub { font-size: 12px; }
  .orders-table .c-total strong { font-size: 15.5px; }
  .orders-table .due-sub { color: var(--red); font-size: 11.5px; font-weight: 600; }
  .orders-table .badge { font-size: 11px; }
}
.toolbar .search input { padding-left: 34px !important; }

/* ===== 2.6.4: ⓘ explanations instead of long help texts ===== */
.tip { display: inline-flex; align-items: center; vertical-align: middle; margin-left: 2px; font-size: 0; line-height: 0; letter-spacing: 0; text-transform: none; font-weight: 400; }
.tip-i { position: relative; display: inline-grid; place-items: center; width: 28px; height: 28px; margin: -6px -4px; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--ink-3); cursor: pointer; flex: none; transition: color .15s, background .15s; -webkit-tap-highlight-color: transparent; }
.tip-i .i { width: 16px; height: 16px; }
.tip-i:hover, .tip-i[aria-expanded="true"] { color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); }
.tip-i:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.tip-body { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; }
.tip-bubble { position: fixed; z-index: 1000; box-sizing: border-box; padding: 10px 13px; border-radius: 12px; background: var(--ink); color: var(--panel); font: 400 13px/1.5 var(--font); letter-spacing: 0; text-align: left; text-transform: none; white-space: normal; overflow-wrap: anywhere; box-shadow: 0 12px 32px rgba(0, 0, 0, .28); animation: tipIn .14s ease-out; }
.tip-bubble[hidden] { display: none; }
.tip-bubble::before { content: ""; position: absolute; left: var(--ax, 50%); top: -5px; width: 10px; height: 10px; margin-left: -5px; background: inherit; border-radius: 2px; transform: rotate(45deg); }
.tip-bubble.above::before { top: auto; bottom: -5px; }
.tip-bubble a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.tip-bubble b, .tip-bubble strong { font-weight: 650; }
.tip-bubble code { background: color-mix(in srgb, var(--panel) 18%, transparent); color: inherit; padding: 0 4px; border-radius: 4px; }
.tip-bubble .i { width: 13px; height: 13px; vertical-align: -2px; }
@keyframes tipIn { from { opacity: 0; transform: translateY(3px); } }
h1 .tip-i .i { width: 18px; height: 18px; }
.page-head h1 .tip { margin-left: 4px; }
.btn-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
details.fold-card > summary { list-style: none; cursor: pointer; margin: 0; display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
details.fold-card > summary::-webkit-details-marker { display: none; }
details.fold-card[open] > summary { margin-bottom: 12px; }
details.fold-card[open] > summary small { display: none; }
/* A field label with an ⓘ: title, short hint and ⓘ on one line, the field below */
label.f:has(> .tip), div.f:has(> .tip) { display: flex; flex-wrap: wrap; align-items: center; column-gap: 6px; row-gap: 6px; }
label.f:has(> .tip) > :not(.tip):not(small):not(.counter), div.f:has(> .tip) > :not(.tip):not(small):not(.counter) { flex: 1 1 100%; min-width: 0; }
label.f:has(> .tip) > small, div.f:has(> .tip) > small { flex: 0 0 auto; }
.f > .tip { margin-left: -2px; }
.tip-scroll { max-height: min(60vh, 440px); overflow-y: auto; overscroll-behavior: contain; }
/* A sheet whose content sits in a <form> (Add expense, Pick dates): the form takes the sheet's height so its body scrolls */
dialog.sheet > form { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; margin: 0; }
dialog.sheet > form > .sheet-body, dialog.sheet > .sheet-body { flex: 1 1 auto; min-height: 0; }
dialog.sheet > .sheet-head, dialog.sheet > .sheet-grip, dialog.sheet .sheet-foot { flex: none; }

/* ===== 2.6.4: Product editor — summary on top, sections as tabs ===== */
.prod-hero { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px 20px; align-items: center; padding: 16px 18px; margin-bottom: 16px; }
.ph-main { display: flex; align-items: center; gap: 14px; min-width: 0; }
.ph-img { flex: none; width: 64px; height: 64px; border-radius: 14px; overflow: hidden; display: grid; place-items: center; background: var(--fill); color: var(--ink-3); }
.ph-img img { width: 100%; height: 100%; object-fit: cover; }
.ph-img .i { width: 24px; height: 24px; }
.ph-text { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.ph-price { font-size: 20px; font-weight: 700; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.ph-price small { font-size: 12.5px; font-weight: 500; color: var(--ink-2); letter-spacing: 0; }
.ph-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.ph-tags .pill.ok { background: color-mix(in srgb, var(--green) 15%, transparent); color: var(--green); }
.ph-stats { display: flex; gap: 0; margin: 0; }
.ph-stats > div { padding: 0 14px; text-align: center; }
.ph-stats > div + div { border-left: 1px solid var(--line-2); }
.ph-stats dt { font-size: 11.5px; color: var(--ink-2); }
.ph-stats dd { margin: 2px 0 0; font-size: 17px; font-weight: 650; font-variant-numeric: tabular-nums; }
.ph-check { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding-top: 12px; border-top: 1px solid var(--line-2); }
.ph-check-t { display: inline-flex; align-items: center; font-size: 12.5px; font-weight: 600; color: var(--ink-2); margin-right: 4px; }
.ph-check.done .ph-check-t { color: var(--green); }
.ph-c { display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 10px 0 8px; border-radius: 14px; font-size: 12.5px; font-weight: 500; background: color-mix(in srgb, var(--orange) 14%, transparent); color: var(--orange); }
.ph-c .i { width: 14px; height: 14px; }
.ph-c.ok { background: var(--fill); color: var(--ink-2); }
.ph-c.ok .i { color: var(--green); }
[data-ptabs="product"] .stack > [data-ppanel] { margin-top: 0; margin-bottom: 16px; }
[data-ptabs="product"] .stack > [data-ppanel]:last-child { margin-bottom: 0; }
@media (min-width: 1101px) {
  [data-ptabs="product"] .ptab-m { display: none !important; }
  [data-ptabs="product"][data-ptabs-mode=all] .prod-side.ptab-off { display: block !important; }
}
@media (max-width: 640px) {
  .prod-hero { grid-template-columns: 1fr; padding: 14px 16px; gap: 12px; }
  .ph-img { width: 56px; height: 56px; }
  .ph-stats { justify-content: space-between; padding-top: 10px; border-top: 1px solid var(--line-2); }
  .ph-stats > div { flex: 1; padding: 0 6px; }
  .page-head .head-actions .bt { display: none; }
}

/* 2.6.7: easy taps. A switch row reacts anywhere; the switch takes taps a little beyond its edge; Save shows a spinner at once. */
.row:has(.switch input[type=checkbox]) { cursor: pointer; -webkit-tap-highlight-color: transparent; }
.switch input { top: -10px; right: -8px; bottom: -10px; left: -8px; width: auto; height: auto; }
.btn.is-saving, .btn.is-saving:disabled { position: relative; opacity: 1; -webkit-text-fill-color: transparent; }
.btn.is-saving > * { visibility: hidden; }
.btn.is-saving::after { content: ''; position: absolute; inset: 0; margin: auto; width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }

/* 2.7.1: sideways strips (ui.js "Sideways strips"): a ‹ › button on the side with more (tabs, chips), a fade on the others */
.hs-btn { position: sticky; z-index: 2; flex: 0 0 34px; width: 34px; align-self: stretch; display: none; align-items: center; justify-content: center; border: 0; padding: 0; margin-top: 0; margin-bottom: 0; color: var(--ink); cursor: pointer; opacity: 0; pointer-events: none; transition: opacity .15s; -webkit-tap-highlight-color: transparent; }
.hs > .hs-btn { display: flex; }
.hs-lb { left: 0; background: linear-gradient(90deg, var(--hs-bg) 58%, transparent); justify-content: flex-start; }
.hs-rb { right: 0; background: linear-gradient(270deg, var(--hs-bg) 58%, transparent); justify-content: flex-end; }
.hs-l > .hs-lb, .hs-r > .hs-rb { opacity: 1; pointer-events: auto; }
.hs-btn svg { width: 26px; height: 26px; padding: 5px; border-radius: 50%; background: var(--panel); box-shadow: 0 1px 4px rgba(0, 0, 0, .2), 0 0 0 .5px var(--line); fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.hs-mask.hs-r { -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 36px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 36px), transparent); }
.hs-mask.hs-l { -webkit-mask-image: linear-gradient(270deg, #000 calc(100% - 36px), transparent); mask-image: linear-gradient(270deg, #000 calc(100% - 36px), transparent); }
.hs-mask.hs-l.hs-r { -webkit-mask-image: linear-gradient(90deg, transparent, #000 36px, #000 calc(100% - 36px), transparent); mask-image: linear-gradient(90deg, transparent, #000 36px, #000 calc(100% - 36px), transparent); }
.ptabs, .chips, .fchips, .segmented, .seg-scroll, .seo-tabs { overscroll-behavior-x: contain; }
.oh-review { margin-top: 8px; } /* 2.7.3: Ask for a review, under the order's tiles */
.oh-review .i { width: 16px; height: 16px; }
/* 2.7.3: Reviews → Review card QR (the QR printed on thank-you cards, /review/) */
.rq-card { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.rq-img { width: 136px; height: 136px; flex: none; background: #fff; border-radius: 12px; padding: 4px; box-shadow: inset 0 0 0 1px var(--line); }
.rq-img svg { display: block; width: 100%; height: 100%; }
.rq-text { flex: 1; min-width: 210px; }
.rq-text h2 { margin: 0 0 4px; font-size: 16px; }
.rq-text p { margin: 0; overflow-wrap: anywhere; }
.rq-btns { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.rq-new { margin-top: 6px; display: flex; align-items: center; gap: 2px; }
.rq-new .btn { padding-left: 0; color: var(--ink-2); }

/* ===== 2.8.0: Invoices — quotations, proformas and invoices ===== */
.inv-st { display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 11px; font-size: 11.5px; font-weight: 600; white-space: nowrap; vertical-align: middle; background: var(--fill); color: var(--ink-2); }
.inv-st.t-ok { background: color-mix(in srgb, var(--green) 15%, transparent); color: var(--green); }
.inv-st.t-warn { background: color-mix(in srgb, var(--orange) 16%, transparent); color: var(--orange); }
.inv-st.t-bad { background: color-mix(in srgb, var(--red) 14%, transparent); color: var(--red); }
.inv-st.t-info { background: color-mix(in srgb, var(--blue) 14%, transparent); color: var(--blue); }
h1 .inv-st { font-size: 12px; height: 24px; margin-left: 4px; }
.inv-hero .oh-acts form.ia-form, .oh-acts form.ia-form { display: contents; }
.oh-acts .ia span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.inv-new { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.inv-linkline { margin: 0; color: var(--ink-2); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.inv-linkline .i { width: 15px; height: 15px; }
.link-btn { border: 0; background: none; padding: 0; font: inherit; color: var(--accent); cursor: pointer; }
.inv-search { border-bottom: 1px solid var(--line-2); }
.inv-rows > a { gap: 14px; align-items: center; color: inherit; text-decoration: none; }
.inv-rows .grow strong { font-size: 14.5px; }
.inv-rows .grow small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 12.5px; }
.inv-amt { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; text-align: right; }
.inv-amt b { font-size: 15px; font-weight: 650; }
.inv-amt .due { font-size: 11.5px; color: var(--red); }
.inv-grid { grid-template-columns: minmax(0, 1fr) 380px; }
@media (max-width: 1100px) { .inv-grid { grid-template-columns: 1fr; } }
.il-list { display: grid; gap: 12px; }
.il { display: grid; gap: 12px; padding: 14px; border-radius: 14px; background: var(--fill-2, var(--fill)); border: 1px solid var(--line-2); }
.il[data-kind=extra] { background: transparent; }
.il-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: -4px -6px -4px 0; }
.il-tag { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); text-transform: uppercase; letter-spacing: .03em; }
.il-tag .i { width: 15px; height: 15px; color: var(--accent); }
.il-tools { display: inline-flex; gap: 2px; }
.il-tools .icon-btn { width: 38px; height: 38px; }
.il textarea[data-il-contents] { min-height: 96px; line-height: 1.5; }
.il-money { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr) minmax(0, .9fr) minmax(0, 1.2fr); gap: 10px; align-items: end; }
.il-amt { display: grid; gap: 6px; text-align: right; font-size: 13px; font-weight: 500; }
.il-amt b { font-size: 16px; font-weight: 650; line-height: 40px; }
.il-add { display: flex; flex-wrap: wrap; gap: 8px; }
.inv-disc { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding-top: 6px; border-top: 1px solid var(--line-2); }
.inv-disc .row-label { font-size: 13px; font-weight: 500; margin-right: auto; }
.inv-disc input { width: 120px; text-align: right; }
.inv-totals { padding: 0; }
.inv-client-search { position: relative; }
.inv-suggest { position: absolute; left: 0; right: 0; top: 100%; z-index: 45; /* above the "Unsaved changes" bar */ margin-top: 4px; display: grid; padding: 6px; border-radius: 14px; background: var(--panel); box-shadow: 0 12px 34px rgba(0, 0, 0, .18), 0 0 0 .5px var(--line); }
.inv-suggest[hidden] { display: none; }
.inv-suggest button { display: grid; gap: 2px; text-align: left; padding: 10px 12px; border: 0; border-radius: 10px; background: none; font: inherit; color: var(--ink); cursor: pointer; }
.inv-suggest button:hover, .inv-suggest button:focus-visible { background: var(--fill); }
.inv-suggest small { color: var(--ink-2); font-weight: 400; }
.inv-kind { display: flex; }
.inv-kind label { flex: 1; text-align: center; }
.inv-deliver > summary { cursor: pointer; }
.inv-due { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.inv-due input[type=date] { width: auto; flex: 1; min-width: 150px; }
.plan-rows { display: grid; gap: 8px; }
.plan-row { display: grid; grid-template-columns: 92px minmax(0, 1fr) 38px; gap: 8px; align-items: center; }
.plan-row .pct { position: relative; }
.plan-row .pct input { padding-right: 28px !important; text-align: right; } /* room for the % sign (the shared input padding is more specific) */
.plan-row .pct i { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); font-style: normal; color: var(--ink-2); pointer-events: none; }
.plan-foot { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.plan-foot small { color: var(--ink-2); font-weight: 400; }
.plan-foot small.warn-txt { color: var(--orange); }
.inv-switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 10px; border-top: 1px solid var(--line-2); cursor: pointer; }
.inv-switch .row-label { font-size: 13px; font-weight: 500; }
.inv-save { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 16px 0 0; }
.inv-save .btn { height: 46px; padding: 0 26px; font-size: 15px; }
.inv-more { margin-top: 16px; }
.send-tabs { display: flex; }
.send-tabs label { flex: 1; text-align: center; }
.send-tabs .i { width: 15px; height: 15px; vertical-align: -3px; }
.sig-field { display: grid; gap: 10px; justify-items: start; }
.sig-preview { max-width: 220px; max-height: 110px; padding: 8px; border-radius: 10px; background: #fff; box-shadow: 0 0 0 1px var(--line); }
@media (max-width: 640px) {
  .inv-new { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .il { padding: 12px; }
  .il-money { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .il-unit-hidden { display: none; }
  .inv-disc input { flex: 1; width: auto; }
  .inv-save .btn { flex: 1; justify-content: center; }
  .plan-row { grid-template-columns: 80px minmax(0, 1fr) 38px; }
}

/* ===== 2.8.2: stock bought for a particular order ===== */
.stock-for { display: grid; gap: 10px; }
.stock-for > * { min-width: 0; } /* long item names must not widen the card (its rows used to run off the screen) */
.sf-list .grow strong { white-space: normal; overflow: visible; }
.stock-for .card-title-row { flex-wrap: wrap; gap: 6px 12px; }
.sf-list li { align-items: center; gap: 10px; padding-left: 0; padding-right: 0; }
.sf-list .grow a { display: block; color: inherit; text-decoration: none; } /* the name's own line: the detail line below mustn't sit over its link */
.sf-list .grow small { display: block; margin-top: 2px; font-size: 12.5px; color: var(--ink-2); }
.sf-bad { color: var(--red); font-weight: 600; }
.sf-acts { display: inline-flex; gap: 6px; flex: none; }
.sf-acts .btn { white-space: nowrap; }
.stock-for details.sf-fold { border-top: 1px solid var(--line-2); margin: 0 -2px; }
.stock-for details.sf-fold > summary { padding: 12px 2px; }
.stock-for details.sf-fold > summary .i { width: 15px; height: 15px; color: var(--green); }
.onway-for { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; margin: 0; }
.onway-for label.f { flex: 1; min-width: 220px; }
@media (max-width: 640px) {
  .sf-list li { flex-wrap: wrap; }
  .sf-acts { width: 100%; }
  .sf-acts .btn { flex: 1; justify-content: center; height: 40px; }
}
/* Customer photos and letter on an order item (2.8.5) */
.pi-box { margin: 0 22px 12px; padding: 10px 12px; border: 1px dashed var(--line); border-radius: 12px; }
.pi-box .i { width: 15px; height: 15px; vertical-align: -2px; }
.pi-thumbs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.pi-thumbs img { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; display: block; }
.pi-letter { white-space: pre-wrap; font-family: Georgia, serif; font-size: 14px; line-height: 1.6; margin: 8px 0 0; }
.pi-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }


/* 2.8.11: Settings → Security */
.sec-hero { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.sec-hero strong { display: block; font-size: 17px; }
.sec-hero small { color: var(--ink-2); }
.sec-shield { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; flex: none; background: color-mix(in srgb, var(--green) 16%, transparent); color: var(--green); }
.sec-shield .i { width: 24px; height: 24px; }
.sec-list li { align-items: flex-start; }
.sec-list .grow strong { white-space: normal; }
.sec-list .grow small { display: block; margin-top: 2px; line-height: 1.45; }
.sec-ic { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.sec-ic .i { width: 15px; height: 15px; }
.sec-ok { background: color-mix(in srgb, var(--green) 16%, transparent); color: var(--green); }
.sec-warn, .sec-todo { background: color-mix(in srgb, var(--orange) 18%, transparent); color: var(--orange); }
.sec-info { background: var(--fill); color: var(--ink-2); }
.sec-hero ~ .card { margin-top: 16px; } /* only on this page */

/* 2.8.12: Profile → Look → Glass background photo */
.gp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; margin-top: 6px; }
.gp-tile { position: relative; display: grid; gap: 4px; font-size: 12px; font-weight: 500; color: var(--ink-2); cursor: pointer; }
.gp-tile input { position: absolute; opacity: 0; pointer-events: none; }
.gp-tile img, .gp-own > span { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 12px; box-shadow: 0 0 0 1px var(--line); }
.gp-own > span { display: grid; place-items: center; text-align: center; padding: 8px; background: var(--fill); color: var(--ink); }
.gp-tile input:checked + img, .gp-own input:checked + span { box-shadow: 0 0 0 3px var(--accent); }
.gp-tile input:focus-visible + img, .gp-own input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.gp-own-field { margin-top: 10px; }
