:root {
  --brand: #14532d;
  --brand-600: #166534;
  --brand-50: #f0fdf4;
  --brand-100: #dcfce7;
  --accent: #b45309;
  --bg: #f6f7f5;
  --surface: #ffffff;
  --ink: #18201b;
  --ink-2: #4b5650;
  --ink-3: #7c8781;
  --line: #e4e7e4;
  --danger: #b91c1c;
  --danger-50: #fef2f2;
  --warn-50: #fffbeb;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 24, 20, .05), 0 4px 16px rgba(16, 24, 20, .06);
  --shadow-lg: 0 10px 40px rgba(16, 24, 20, .18);
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--font); background: var(--bg); color: var(--ink); font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: var(--brand-600); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; line-height: 1.25; letter-spacing: -.01em; }
h1 { font-size: 26px; font-weight: 700; }
h2 { font-size: 18px; font-weight: 650; }
h3 { font-size: 15px; font-weight: 650; }
.muted { color: var(--ink-3); }
.small { font-size: 13px; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.num { font-variant-numeric: tabular-nums; }
.hidden { display: none !important; }

/* boot */
.boot { min-height: 100vh; display: grid; place-items: center; }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--brand-100); border-top-color: var(--brand); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* buttons & inputs */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; font-weight: 600; font-size: 14px; cursor: pointer; transition: background .15s, border-color .15s, transform .05s; white-space: nowrap; }
.btn:hover { background: #f3f5f3; text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-600); }
.btn.danger { color: var(--danger); }
.btn.danger:hover { background: var(--danger-50); border-color: #fecaca; }
.btn.danger.solid { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: rgba(0,0,0,.05); }
.btn.sm { height: 32px; padding: 0 11px; font-size: 13px; border-radius: 8px; }
.btn.lg { height: 48px; padding: 0 22px; font-size: 15px; }
.btn.block { width: 100%; }
.icon-btn { width: 36px; height: 36px; padding: 0; }
.btn svg, .icon { width: 18px; height: 18px; flex: none; }

label.field { display: block; margin-bottom: 14px; }
label.field > span { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
input, select, textarea { width: 100%; font: inherit; color: var(--ink); background: #fff; border: 1px solid #d5dad6; border-radius: 10px; padding: 9px 12px; height: 42px; outline: none; transition: border-color .15s, box-shadow .15s; }
textarea { height: auto; min-height: 80px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--brand-600); box-shadow: 0 0 0 3px rgba(22, 101, 52, .15); }
input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--brand); }
.input-prefix { position: relative; }
.input-prefix > b { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--ink-3); font-weight: 500; }
.input-prefix > input { padding-left: 24px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 14px; }
.spacer { flex: 1; }
.search { position: relative; }
.search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--ink-3); width: 17px; height: 17px; }
.search input { padding-left: 38px; }

/* cards */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 20px; }
.card-head { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.card-head h2 { flex: 1; }
.stack > * + * { margin-top: 18px; }
.empty { text-align: center; padding: 48px 20px; color: var(--ink-3); }
.empty svg { width: 40px; height: 40px; color: #c5ccc7; margin-bottom: 8px; }

/* badges */
.badge { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px; border-radius: 99px; font-size: 12px; font-weight: 600; background: #eef0ee; color: var(--ink-2); white-space: nowrap; }
.badge.green { background: var(--brand-100); color: var(--brand); }
.badge.amber { background: #fef3c7; color: #92400e; }
.badge.red { background: #fee2e2; color: #991b1b; }
.badge.blue { background: #e0ecff; color: #1e40af; }
.badge.pink { background: #fce7f3; color: #9d174d; }

/* tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-3); font-weight: 600; padding: 10px 16px; border-bottom: 1px solid var(--line); background: #fafbfa; }
td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tr.click { cursor: pointer; }
tr.click:hover td { background: #fafcfa; }
tfoot td { font-weight: 700; background: #fafbfa; }

/* ---------- login ---------- */
.login-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login-art { background: radial-gradient(120% 120% at 0% 0%, #1f7a45 0%, #14532d 45%, #0d3a20 100%); color: #fff; padding: 56px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.login-art::after { content: ""; position: absolute; right: -120px; bottom: -120px; width: 420px; height: 420px; border-radius: 50%; background: rgba(255,255,255,.06); }
.login-art::before { content: ""; position: absolute; right: 80px; top: -90px; width: 260px; height: 260px; border-radius: 50%; background: rgba(255,255,255,.05); }
.login-art h1 { font-size: 40px; max-width: 460px; letter-spacing: -.02em; }
.login-art p { opacity: .85; max-width: 420px; font-size: 17px; }
.login-form { display: grid; place-items: center; padding: 32px; }
.login-form form { width: 100%; max-width: 360px; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 16px; }
.logo-mark { width: 34px; height: 34px; border-radius: 10px; background: var(--brand); display: grid; place-items: center; color: #fff; }
.login-art .logo-mark { background: rgba(255,255,255,.15); }
.logo-mark svg { width: 20px; height: 20px; }
.error-box { background: var(--danger-50); color: var(--danger); border: 1px solid #fecaca; padding: 10px 12px; border-radius: 10px; font-size: 14px; margin-bottom: 14px; }
.notice { background: var(--warn-50); border: 1px solid #fde68a; color: #78350f; padding: 12px 16px; border-radius: 12px; font-size: 14px; display: flex; gap: 10px; align-items: flex-start; }
.notice.green { background: var(--brand-50); border-color: var(--brand-100); color: var(--brand); }

/* ---------- family shell ---------- */
.topbar { position: sticky; top: 0; z-index: 20; background: rgba(255,255,255,.92); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); }
.topbar-in { max-width: 1180px; margin: 0 auto; display: flex; align-items: center; gap: 14px; padding: 12px 20px; }
.topnav { display: flex; gap: 4px; margin-left: 18px; }
.topnav a { padding: 8px 12px; border-radius: 9px; color: var(--ink-2); font-weight: 600; font-size: 14px; }
.topnav a:hover { background: #f1f3f1; text-decoration: none; }
.topnav a.active { background: var(--brand-50); color: var(--brand); }
.balance-chip { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.15; }
.balance-chip small { font-size: 11px; color: var(--ink-3); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.balance-chip b { font-size: 18px; color: var(--brand); font-variant-numeric: tabular-nums; }
.cart-btn { position: relative; }
.cart-count { position: absolute; top: -6px; right: -6px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: var(--accent); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; border: 2px solid #fff; }
.page { max-width: 1180px; margin: 0 auto; padding: 28px 20px 100px; }
.page-head { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head .spacer { min-width: 10px; }
.page-head p { margin: 4px 0 0; color: var(--ink-3); }
.bottomnav { display: none; }

.hero { background: linear-gradient(120deg, #14532d, #1f7a45); color: #fff; border-radius: 18px; padding: 22px 26px; display: flex; align-items: center; gap: 20px; margin-bottom: 24px; box-shadow: var(--shadow); flex-wrap: wrap; }
.hero .big { font-size: 34px; font-weight: 750; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.hero .lbl { opacity: .8; font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.hero .sep { width: 1px; align-self: stretch; background: rgba(255,255,255,.2); }

.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { height: 34px; padding: 0 14px; border-radius: 99px; border: 1px solid var(--line); background: #fff; font: inherit; font-size: 14px; font-weight: 600; color: var(--ink-2); cursor: pointer; }
.chip:hover { border-color: #c9d0cb; }
.chip.active { background: var(--ink); border-color: var(--ink); color: #fff; }

.products { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 18px; margin-top: 18px; }
.product { background: #fff; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; display: flex; flex-direction: column; box-shadow: var(--shadow); transition: transform .15s, box-shadow .15s; }
.product:hover { transform: translateY(-2px); box-shadow: 0 2px 4px rgba(16,24,20,.05), 0 12px 28px rgba(16,24,20,.1); }
.product-img { aspect-ratio: 1 / 1; background: #f3f5f3; display: grid; place-items: center; overflow: hidden; }
.product-img img { width: 100%; height: 100%; object-fit: contain; padding: 10px; }
.product-img .ph { color: #c5ccc7; width: 48px; height: 48px; }
.product-body { padding: 14px 14px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.product-cat { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); }
.product-name { font-weight: 650; font-size: 15px; }
.product-desc { font-size: 13px; color: var(--ink-3); }
.product-foot { margin-top: auto; padding-top: 10px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.price { font-weight: 750; font-size: 18px; font-variant-numeric: tabular-nums; }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; height: 36px; background: #fff; }
.stepper button { width: 34px; height: 100%; border: 0; background: transparent; font-size: 18px; cursor: pointer; color: var(--ink-2); }
.stepper button:hover { background: #f1f3f1; }
.stepper span { min-width: 26px; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }
.stepper.on { border-color: var(--brand); }

/* drawer (cart) */
.overlay { position: fixed; inset: 0; background: rgba(12, 20, 15, .45); z-index: 50; animation: fade .15s; }
@keyframes fade { from { opacity: 0; } }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(440px, 100%); background: #fff; z-index: 51; display: flex; flex-direction: column; box-shadow: var(--shadow-lg); animation: slide .2s ease-out; }
@keyframes slide { from { transform: translateX(30px); opacity: 0; } }
.drawer-head { display: flex; align-items: center; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.drawer-head h2 { flex: 1; }
.drawer-body { flex: 1; overflow-y: auto; padding: 8px 20px; }
.drawer-foot { border-top: 1px solid var(--line); padding: 16px 20px calc(16px + env(safe-area-inset-bottom)); background: #fafbfa; }
.cart-line { display: flex; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.cart-line:last-child { border-bottom: 0; }
.thumb { width: 52px; height: 52px; border-radius: 10px; background: #f3f5f3; flex: none; display: grid; place-items: center; overflow: hidden; }
.thumb img { width: 100%; height: 100%; object-fit: contain; }
.thumb svg { width: 22px; height: 22px; color: #c5ccc7; }
.sum-row { display: flex; justify-content: space-between; padding: 3px 0; font-variant-numeric: tabular-nums; }
.sum-row.total { font-weight: 750; font-size: 17px; }
.sum-row.over { color: var(--danger); font-weight: 650; }

/* modal */
.modal-wrap { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 20px; overflow-y: auto; }
.modal { position: relative; z-index: 61; background: #fff; border-radius: 18px; width: min(560px, 100%); box-shadow: var(--shadow-lg); animation: pop .18s ease-out; max-height: calc(100vh - 40px); display: flex; flex-direction: column; }
.modal.wide { width: min(820px, 100%); }
@keyframes pop { from { transform: scale(.97); opacity: 0; } }
.modal-head { display: flex; align-items: center; padding: 18px 22px 0; }
.modal-head h2 { flex: 1; }
.modal-body { padding: 18px 22px; overflow-y: auto; }
.modal-foot { display: flex; gap: 10px; justify-content: flex-end; padding: 14px 22px 18px; border-top: 1px solid var(--line); }

/* toasts */
#toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: var(--ink); color: #fff; padding: 11px 16px; border-radius: 12px; font-size: 14px; font-weight: 550; box-shadow: var(--shadow-lg); animation: pop .18s ease-out; max-width: 90vw; }
.toast.error { background: var(--danger); }

/* ---------- admin shell ---------- */
.admin { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.sidebar { background: #0f2b1b; color: #cfe0d5; padding: 18px 14px; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 4px; overflow-y: auto; }
.sidebar .logo { color: #fff; padding: 4px 8px 18px; font-size: 15px; }
.sidebar .logo-mark { background: #1f7a45; }
.side-label { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: #7fa08b; font-weight: 700; padding: 14px 10px 6px; }
.sidebar a { display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: 9px; color: #cfe0d5; font-weight: 550; font-size: 14px; }
.sidebar a:hover { background: rgba(255,255,255,.06); text-decoration: none; color: #fff; }
.sidebar a.active { background: rgba(255,255,255,.12); color: #fff; }
.sidebar a .count { margin-left: auto; background: var(--accent); color: #fff; font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 99px; }
.sidebar .me { margin-top: auto; border-top: 1px solid rgba(255,255,255,.1); padding: 14px 10px 4px; font-size: 13px; }
.sidebar .me b { color: #fff; display: block; }
.admin-main { min-width: 0; }
.admin-main .page { max-width: 1240px; padding-top: 30px; }
.mobile-top { display: none; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; }
.stat { padding: 18px 20px; }
.stat .lbl { font-size: 13px; color: var(--ink-3); font-weight: 600; }
.stat .val { font-size: 28px; font-weight: 750; letter-spacing: -.02em; margin-top: 4px; font-variant-numeric: tabular-nums; }
.stat .sub { font-size: 13px; color: var(--ink-3); }

.switch { position: relative; width: 44px; height: 26px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch i { position: absolute; inset: 0; background: #cdd3cf; border-radius: 99px; transition: .2s; cursor: pointer; }
.switch i::after { content: ""; position: absolute; left: 3px; top: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: .2s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.switch input:checked + i { background: var(--brand-600); }
.switch input:checked + i::after { transform: translateX(18px); }

.rule-row { display: grid; grid-template-columns: 1.1fr .8fr .8fr 1fr 36px; gap: 8px; align-items: end; margin-bottom: 8px; }
.rule-row label span { font-size: 12px; font-weight: 600; color: var(--ink-3); display: block; margin-bottom: 4px; }
.rules-box { background: #fafbfa; border: 1px solid var(--line); border-radius: 12px; padding: 14px; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.tabs a { padding: 10px 14px; font-weight: 600; color: var(--ink-3); border-bottom: 2px solid transparent; margin-bottom: -1px; font-size: 14px; }
.tabs a:hover { color: var(--ink); text-decoration: none; }
.tabs a.active { color: var(--brand); border-color: var(--brand); }

.order-card + .order-card { margin-top: 14px; }
.order-items { list-style: none; margin: 0; padding: 0; }
.order-items li { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px dashed var(--line); font-size: 14px; }
.order-items li:last-child { border-bottom: 0; }

.fam-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.sched { padding: 18px 20px; display: flex; flex-direction: column; gap: 10px; }
.sched-top { display: flex; align-items: flex-start; gap: 12px; }
.sched-top h3 { font-size: 16px; }
.sched-meta { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; background: #fafbfa; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.sched-meta div small { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); font-weight: 700; }
.sched-meta div b { font-size: 14px; }
.rule-list { margin: 0; padding-left: 18px; font-size: 14px; color: var(--ink-2); }
.img-drop { border: 2px dashed #cfd6d1; border-radius: 12px; padding: 14px; display: flex; gap: 14px; align-items: center; cursor: pointer; background: #fafbfa; }
.img-drop:hover { border-color: var(--brand-600); }
.img-drop .thumb { width: 84px; height: 84px; }
.items-table .thumb { width: 44px; height: 44px; }
.pw-row { display: flex; gap: 8px; }
.pw-row input { flex: 1; }

/* print: shopping list */
@media print {
  .sidebar, .no-print, .mobile-top, #toasts { display: none !important; }
  .admin { display: block; }
  body { background: #fff; }
  .card { box-shadow: none; break-inside: avoid; }
  .page { padding: 0; }
}

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .login-wrap { grid-template-columns: 1fr; }
  .login-art { padding: 28px 24px; min-height: 0; }
  .login-art h1 { font-size: 28px; margin-top: 24px; }
  .login-art p { display: none; }
  .admin { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; z-index: 70; width: 270px; transform: translateX(-100%); transition: transform .2s; }
  .sidebar.open { transform: none; box-shadow: var(--shadow-lg); }
  .mobile-top { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: #0f2b1b; color: #fff; position: sticky; top: 0; z-index: 30; }
  .mobile-top .btn { color: #fff; }
  .rule-row { grid-template-columns: 1fr 1fr; }
  .rule-row .rm { grid-column: 2; justify-self: end; }
}
@media (max-width: 720px) {
  .topnav { display: none; }
  .bottomnav { display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 30; background: #fff; border-top: 1px solid var(--line); padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); }
  .bottomnav a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; font-weight: 600; color: var(--ink-3); padding: 6px 0; border-radius: 10px; }
  .bottomnav a.active { color: var(--brand); }
  .bottomnav a:hover { text-decoration: none; }
  .bottomnav svg { width: 22px; height: 22px; }
  .topbar-in { padding: 10px 14px; }
  .page { padding: 18px 14px 110px; }
  h1 { font-size: 22px; }
  .products { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .product-body { padding: 10px 10px 12px; }
  .product-foot { flex-direction: column; align-items: stretch; }
  .product-foot .stepper, .product-foot .btn { width: 100%; justify-content: space-between; }
  .price { font-size: 16px; }
  .hero { padding: 18px; gap: 14px; }
  .hero .big { font-size: 28px; }
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .sched-meta { grid-template-columns: 1fr 1fr; }
  .hide-sm { display: none; }
  td, th { padding: 10px 12px; }
}

/* purchases */
.purchase-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.purchase { overflow: hidden; display: flex; flex-direction: column; }
.purchase-img { aspect-ratio: 4 / 3; background: #f3f5f3; display: grid; place-items: center; color: #c5ccc7; }
.purchase-img svg { width: 40px; height: 40px; }
.purchase-img.has { cursor: zoom-in; }
.purchase-img img { width: 100%; height: 100%; object-fit: cover; }
.purchase-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 4px; }

/* overview table */
.overview th.center { text-align: center; }
.overview th[data-k] { cursor: pointer; user-select: none; }
.overview th[data-k]:hover { color: var(--ink); }
.overview th.sorted { color: var(--ink); }
.overview th.market { background: #eef8f1; }
.overview th.personal { background: #fdf6ea; }
.overview tr.grp th { border-bottom: 0; }
.overview td { font-size: 14px; }

/* product detail */
.pd { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; }
.pd-img { background: #f3f5f3; border-radius: 14px; aspect-ratio: 1/1; display: grid; place-items: center; overflow: hidden; }
.pd-img img { width: 100%; height: 100%; object-fit: contain; padding: 16px; }
.pd-img .ph { width: 64px; height: 64px; color: #c5ccc7; }
.pd h2 { font-size: 24px; margin: 6px 0 8px; }
.pd .price { font-size: 28px; }
.product-img { cursor: pointer; }
.product-name { cursor: pointer; }
.product-name:hover { color: var(--brand-600); }
@media (max-width: 720px) { .pd { grid-template-columns: 1fr; gap: 16px; } }
.sidebar a svg, .notice > svg, .topnav svg { width: 18px; height: 18px; flex: none; }
.notice > svg { margin-top: 2px; }
.sidebar .logo-mark svg { width: 20px; height: 20px; }
.rule-row { grid-template-columns: 1fr 1fr .7fr .7fr .9fr 36px; }
.rule-row.fam .mo { visibility: hidden; }
@media (max-width: 900px) { .rule-row { grid-template-columns: 1fr 1fr; } .rule-row.fam .mo { display: none; } }
.purchase { position: relative; }
.purchase.pending { border-color: #fcd34d; }
.purchase.rejected { opacity: .8; }
.purchase.picked { border-color: var(--brand-600); box-shadow: 0 0 0 3px rgba(22,101,52,.18); }
.pick { position: absolute; top: 10px; left: 10px; z-index: 2; background: #fff; border-radius: 8px; padding: 6px; box-shadow: var(--shadow); display: flex; cursor: pointer; }
.pick input { width: 20px; height: 20px; }
.feed { list-style: none; margin: 0; padding: 4px 0; }
.feed li { display: flex; gap: 12px; align-items: center; padding: 10px 18px; border-bottom: 1px solid var(--line); font-size: 14px; }
.feed li:last-child { border-bottom: 0; }
.feed-ic { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: #eef0ee; color: var(--ink-2); flex: none; }
.feed-ic svg { width: 16px; height: 16px; }
.feed-ic.green { background: var(--brand-100); color: var(--brand); }
.feed-ic.red { background: #fee2e2; color: #991b1b; }
.feed-ic.amber { background: #fef3c7; color: #92400e; }
.feed-ic.blue { background: #e0ecff; color: #1e40af; }
.stat-link { color: inherit; display: block; }
.stat-link:hover { text-decoration: none; border-color: #c9d0cb; }
.stat-link.attn { border-color: #fcd34d; background: #fffdf5; }
.pwbox { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; background: #fafbfa; border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.pwbox small { display: block; font-size: 12px; color: var(--ink-3); font-weight: 600; }
.pwbox b { font-size: 20px; font-family: ui-monospace, Menlo, Consolas, monospace; letter-spacing: .03em; }
input[type=radio], input[type=checkbox] { width: 18px; height: 18px; padding: 0; flex: none; accent-color: var(--brand); box-shadow: none; }
.web-pic { display: flex; gap: 8px; margin-top: 10px; }
.web-pic input { flex: 1; }
.steps { margin: 0 0 8px; padding-left: 20px; color: var(--ink-2); font-size: 14px; }
.steps li { margin-bottom: 4px; }
label.img-drop { margin-bottom: 0; }
.market-tabs { display: flex; gap: 10px; overflow-x: auto; margin-bottom: 16px; padding-bottom: 2px; }
.market-tab { flex: none; text-align: left; border: 1px solid var(--line); background: #fff; border-radius: 14px; padding: 10px 16px; font: inherit; cursor: pointer; display: flex; flex-direction: column; gap: 2px; min-width: 170px; box-shadow: var(--shadow); }
.market-tab b { font-size: 15px; }
.market-tab span { font-size: 12px; color: var(--ink-3); }
.market-tab.active { border-color: var(--brand); background: var(--brand-50); box-shadow: 0 0 0 2px rgba(22,101,52,.15); }
.market-tab.active span { color: var(--brand); }
.market-tab:disabled { opacity: .6; cursor: default; box-shadow: none; }
.web-pic { flex-wrap: wrap; }
.cands { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.cand { border: 2px solid var(--line); border-radius: 10px; background: #fff; padding: 4px; cursor: pointer; display: flex; flex-direction: column; gap: 2px; align-items: center; }
.cand img { width: 100%; aspect-ratio: 1/1; object-fit: contain; }
.cand span { font-size: 10px; color: var(--ink-3); }
.cand:hover { border-color: #b9c3bc; }
.cand.on { border-color: var(--brand); }
.chip.chk { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.chip.chk:has(input:checked) { background: var(--brand-50); border-color: var(--brand); color: var(--brand); }
.req-card .card-pad { padding: 16px; }
.scan-box { position: relative; background: #0f1a14; border-radius: 14px; overflow: hidden; aspect-ratio: 16 / 9; max-height: 46vh; width: 100%; display: grid; place-items: center; }
.scan-box video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; }
.scan-box video.on { opacity: 1; }
.scan-frame { position: absolute; left: 12%; right: 12%; top: 32%; bottom: 32%; border: 3px solid rgba(255,255,255,.85); border-radius: 12px; box-shadow: 0 0 0 9999px rgba(0,0,0,.25); pointer-events: none; }
.scan-msg { position: absolute; bottom: 10px; left: 0; right: 0; text-align: center; color: #fff; font-size: 14px; text-shadow: 0 1px 3px rgba(0,0,0,.6); padding: 0 12px; }
@media (max-width: 720px) { .scan-box { aspect-ratio: 4 / 3; } }
.bulk-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 16px; background: var(--brand-50); border-bottom: 1px solid var(--brand-100); position: sticky; top: 0; z-index: 3; }
.bulk-bar b { margin-right: 6px; color: var(--brand); }
.items-table tr.sel td { background: #f3faf5; }
.pickcell { cursor: default; }
.cam-box { position: relative; background: #0f1a14; border-radius: 14px; overflow: hidden; aspect-ratio: 4 / 3; max-height: 60vh; width: 100%; display: grid; place-items: center; }
.cam-box video { width: 100%; height: 100%; object-fit: contain; }
.img-drop .btn { position: relative; z-index: 1; }
#nChips .chip.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.cl-note { height: 34px; font-size: 13px; margin-top: 6px; padding: 6px 10px; }
.cl-note:not(:placeholder-shown) { border-color: var(--brand-100); background: var(--brand-50); color: var(--brand); font-weight: 600; }
.note-break { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.nb { font-size: 12px; background: var(--brand-50); color: var(--brand); border: 1px solid var(--brand-100); border-radius: 99px; padding: 1px 8px; white-space: nowrap; }
.nb.plain { background: #f3f5f3; color: var(--ink-3); border-color: var(--line); }
@media print { .nb { border-color: #999; } }

/* pinned, compact credit bar on the market page */
.shop-hero { position: sticky; top: calc(var(--tb, 62px) + 8px); z-index: 15; padding: 10px 16px; gap: 18px; border-radius: 14px; margin-bottom: 16px; flex-wrap: nowrap; box-shadow: 0 6px 18px rgba(16, 60, 35, .25); }
.shop-hero .lbl { font-size: 11px; letter-spacing: .05em; }
.shop-hero .big { font-size: 22px; line-height: 1.15; }
.shop-hero .sh-cart .big, .shop-hero .sh-left .big { font-size: 18px; }
.shop-hero .sh-when { font-size: 12px; opacity: .8; }
.shop-hero .sh-main { min-width: 0; }
.shop-hero .sh-main .lbl { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 260px; }
.shop-hero #heroCartBtn { background: #fff; border-color: #fff; color: var(--brand); height: 38px; position: relative; }
.sh-count { background: var(--accent); color: #fff; border-radius: 99px; font-size: 11px; font-weight: 700; padding: 1px 7px; margin-left: 2px; }
@media (max-width: 720px) {
  .shop-hero { top: calc(var(--tb, 56px) + 6px); padding: 8px 12px; gap: 12px; border-radius: 12px; }
  .shop-hero .sep, .shop-hero .sh-when { display: none; }
  .shop-hero .big { font-size: 18px; }
  .shop-hero .sh-cart .big, .shop-hero .sh-left .big { font-size: 15px; }
  .shop-hero .sh-main .lbl { max-width: 120px; }
  .shop-hero #heroCartBtn { height: 34px; padding: 0 10px; }
}
.notify-row { display: grid; grid-template-columns: 300px 1fr; gap: 12px; align-items: center; margin-bottom: 10px; }
.notify-row > span { margin: 0 !important; }
@media (max-width: 720px) { .notify-row { grid-template-columns: 1fr; gap: 4px; } }

/* credit history: tick boxes to delete lines */
th.sel, td.sel { width: 34px; padding-right: 0 !important; }
td.sel input, th.sel input { width: 16px; height: 16px; }
td.sel svg { width: 15px; height: 15px; vertical-align: -2px; }
