/* Stock Watch - hand-written, no build step. Dark by default; [data-theme=light] overrides. */
:root {
  --bg: #0a0d14;
  --bg-grad: radial-gradient(1200px 600px at 10% -10%, #1b1f3b 0%, transparent 60%),
             radial-gradient(900px 500px at 110% 10%, #132a2a 0%, transparent 55%);
  --surface: #121722;
  --surface-2: #19202e;
  --surface-3: #212a3b;
  --border: #283246;
  --text: #e8ecf4;
  --muted: #9ba6bb;
  --accent: #7c83ff;
  --accent-strong: #6366f1;
  --accent-text: #ffffff;
  --focus: #a5abff;
  --green: #4ade80; --green-bg: rgba(34, 197, 94, .14); --green-bd: rgba(74, 222, 128, .35);
  --grey: #b4bccb;  --grey-bg: rgba(148, 163, 184, .13); --grey-bd: rgba(148, 163, 184, .3);
  --amber: #fbbf24; --amber-bg: rgba(245, 158, 11, .14); --amber-bd: rgba(251, 191, 36, .4);
  --blue: #7cb4ff;  --blue-bg: rgba(59, 130, 246, .15); --blue-bd: rgba(124, 180, 255, .38);
  --red: #f87171;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
  --glow: 0 0 0 1px rgba(74, 222, 128, .45), 0 0 28px rgba(34, 197, 94, .28);
  --radius: 16px;
  --radius-sm: 10px;
  color-scheme: dark;
}
[data-theme="light"] {
  --bg: #f3f5fa;
  --bg-grad: radial-gradient(1200px 600px at 10% -10%, #e3e6ff 0%, transparent 60%),
             radial-gradient(900px 500px at 110% 10%, #dcf3ee 0%, transparent 55%);
  --surface: #ffffff;
  --surface-2: #f6f7fb;
  --surface-3: #eceff6;
  --border: #dde2ec;
  --text: #0f172a;
  --muted: #4b5568;
  --accent: #4f46e5;
  --accent-strong: #4338ca;
  --focus: #4f46e5;
  --green: #15803d; --green-bg: #dcfce7; --green-bd: #86efac;
  --grey: #475569;  --grey-bg: #eef1f5; --grey-bd: #cbd5e1;
  --amber: #a16207; --amber-bg: #fef3c7; --amber-bd: #fcd34d;
  --blue: #1d4ed8;  --blue-bg: #dbeafe; --blue-bd: #93c5fd;
  --red: #b91c1c;
  --shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 8px 24px rgba(15, 23, 42, .07);
  --glow: 0 0 0 1px #4ade80, 0 0 26px rgba(34, 197, 94, .3);
  color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; } /* .row2/.save-bar set display, which would beat the attribute */
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh;
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--text); background: var(--bg-grad), var(--bg); background-attachment: fixed;
}
h1 { font-size: 1.7rem; line-height: 1.2; margin: 0; letter-spacing: -.02em; }
h2 { font-size: 1.05rem; margin: 0 0 .9rem; letter-spacing: -.01em; }
a { color: var(--accent); }
img { max-width: 100%; }
.muted { color: var(--muted); margin: .25rem 0 0; }
.hint { color: var(--muted); font-size: .85rem; margin: .2rem 0; }
.opt { color: var(--muted); font-weight: 400; font-size: .8rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--accent-strong); color: #fff; padding: 8px 12px; border-radius: 8px; z-index: 50; }
.skip:focus { left: 8px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }

/* header */
.top {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 1rem;
  padding: .7rem max(16px, calc((100vw - 1240px) / 2)); backdrop-filter: blur(14px);
  background: color-mix(in srgb, var(--bg) 78%, transparent); border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: .55rem; font-weight: 700; color: var(--text); text-decoration: none; letter-spacing: -.01em; }
.logo { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; color: #fff;
  background: linear-gradient(135deg, #818cf8, #6366f1 55%, #22c55e); box-shadow: 0 4px 14px rgba(99, 102, 241, .45); }
nav { display: flex; gap: .25rem; overflow-x: auto; scrollbar-width: none; flex: 1; }
nav::-webkit-scrollbar { display: none; }
nav a { color: var(--muted); text-decoration: none; padding: .45rem .75rem; border-radius: 9px; font-weight: 550; white-space: nowrap; transition: background .15s, color .15s; }
nav a:hover { color: var(--text); background: var(--surface-2); }
nav a[aria-current="page"] { color: var(--text); background: var(--surface-3); }
.top-actions { display: flex; gap: .35rem; }
.top-actions form { margin: 0; }
.icon-btn { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface); color: var(--muted); cursor: pointer; transition: color .15s, background .15s; }
.icon-btn:hover { color: var(--text); background: var(--surface-2); }
[data-theme="dark"] .i-moon, [data-theme="light"] .i-sun { display: none; }

main { max-width: 1240px; margin: 0 auto; padding: 1.4rem 16px 4rem; }
main:focus { outline: none; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.2rem; }
.back { display: inline-block; color: var(--muted); text-decoration: none; margin-bottom: .5rem; font-size: .9rem; }
.back:hover { color: var(--text); }
.actions { display: flex; gap: .5rem; align-items: center; }
.actions.wrap { flex-wrap: wrap; margin-top: 1rem; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; padding: .6rem 1rem; border-radius: 11px;
  border: 1px solid transparent; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: transform .08s, background .15s, border-color .15s, box-shadow .15s, opacity .15s; }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .55; cursor: progress; }
.btn.primary { background: linear-gradient(180deg, var(--accent), var(--accent-strong)); color: var(--accent-text); box-shadow: 0 4px 14px rgba(99, 102, 241, .35); }
.btn.primary:hover { box-shadow: 0 6px 20px rgba(99, 102, 241, .5); }
.btn.ghost { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn.ghost:hover { background: var(--surface-2); }
.btn.danger { background: #dc2626; color: #fff; }
.btn.danger-text { color: var(--red); }
.btn.sm { padding: .35rem .7rem; font-size: .85rem; border-radius: 9px; }
.btn.wide { width: 100%; }
.link { font-size: .88rem; font-weight: 600; text-decoration: none; }

/* panels + forms */
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.2rem; box-shadow: var(--shadow); margin-bottom: 1rem; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: .8rem; }
.panel-head h2 { margin: 0; }
.panel-head .muted { margin: 0; }
.stack { display: flex; flex-direction: column; gap: 1rem; }
.stack.narrow { max-width: 560px; }
label { display: flex; flex-direction: column; gap: .35rem; font-weight: 600; font-size: .9rem; }
label.inline { flex-direction: row; align-items: center; gap: .5rem; font-weight: 500; }
input, select { font: inherit; color: var(--text); background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: .6rem .75rem; min-height: 42px; width: 100%; transition: border-color .15s, box-shadow .15s; }
input[type=checkbox], input[type=radio] { width: 18px; height: 18px; min-height: 0; accent-color: var(--accent-strong); }
input:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 30%, transparent); outline: none; }
input::placeholder { color: color-mix(in srgb, var(--muted) 75%, transparent); }
fieldset { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .4rem; }
legend { font-weight: 600; font-size: .9rem; margin-bottom: .35rem; padding: 0; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1rem; }
.row2:last-child { margin-bottom: 0; }
.grow { flex: 1; }
.form-error { color: var(--red); font-weight: 600; margin: 0; min-height: 0; }
.form-error:empty { display: none; }
.error-box { margin-top: 1rem; padding: .75rem 1rem; border-radius: var(--radius-sm); background: var(--amber-bg); border: 1px solid var(--amber-bd); color: var(--amber); font-weight: 550; word-break: break-word; }
.secret-row { display: flex; gap: .5rem; align-items: center; }

/* stats */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: .9rem; margin-bottom: 1.2rem; }
.stat { position: relative; overflow: hidden; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.1rem; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: .2rem; }
.stat::after { content: ""; position: absolute; inset: auto -30% -60% auto; width: 140px; height: 140px; border-radius: 50%; background: var(--tint, transparent); opacity: .18; filter: blur(10px); }
.stat:nth-child(1) { --tint: #6366f1; } .stat:nth-child(2) { --tint: #22c55e; } .stat:nth-child(3) { --tint: #38bdf8; } .stat:nth-child(4) { --tint: #f59e0b; }
.stat-label { color: var(--muted); font-size: .82rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.stat-value { font-size: 1.9rem; font-weight: 750; letter-spacing: -.03em; line-height: 1.15; }
.stat-sub { color: var(--muted); font-size: .82rem; }
.stat.hot .stat-value { color: var(--green); }
.stat.bad .stat-value { color: var(--amber); }

/* dashboard layout */
.dash { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 1.2rem; align-items: start; }
.toolbar { display: flex; flex-wrap: wrap; gap: .7rem; align-items: center; margin-bottom: 1rem; }
.toolbar.panel { align-items: flex-end; }
.toolbar.panel label { min-width: 170px; }
.search { flex-direction: row; align-items: center; gap: .5rem; flex: 1; min-width: 200px; position: relative; font-weight: 400; }
.search svg { position: absolute; left: .75rem; color: var(--muted); }
.search input { padding-left: 2.2rem; }
.chips { display: flex; gap: .35rem; flex-wrap: wrap; }
.chip { font: inherit; font-size: .86rem; font-weight: 600; padding: .4rem .8rem; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--muted); cursor: pointer; transition: all .15s; }
.chip:hover { color: var(--text); }
.chip[aria-pressed="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 1rem; }

/* watch card */
.card { position: relative; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden; transition: transform .18s, box-shadow .25s, border-color .25s; animation: rise .3s ease both; }
.card:hover { transform: translateY(-2px); }
.card.in_stock { border-color: var(--green-bd); box-shadow: var(--shadow), var(--glow); }
.card.paused { opacity: .78; }
.card-img { aspect-ratio: 16 / 10; background: var(--surface-3); display: grid; place-items: center; overflow: hidden; border-bottom: 1px solid var(--border); }
.card-img img { width: 100%; height: 100%; object-fit: cover; display: block; } /* fill edge to edge (Karl, 2026-10-19) */
.card-img .ph { color: #94a3b8; font-size: 2.2rem; }
.card .badge { position: absolute; top: .7rem; right: .7rem; box-shadow: 0 2px 8px rgba(0, 0, 0, .18); backdrop-filter: blur(6px); }
.card-body { padding: .9rem 1rem .4rem; flex: 1; }
.card-title { font-weight: 700; font-size: 1rem; line-height: 1.3; margin: 0 0 .15rem; }
.card-title a { color: var(--text); text-decoration: none; }
.card-title a::after { content: ""; position: absolute; inset: 0; } /* whole card clickable */
.card-meta { color: var(--muted); font-size: .85rem; margin: 0; }
.card-foot { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .6rem 1rem .9rem; position: relative; z-index: 1; }
.card-foot .when { color: var(--muted); font-size: .8rem; }
.card-foot .btns { display: flex; gap: .4rem; align-items: center; }
.mini-btn { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; border: 1px solid var(--border); background: var(--surface-2); color: var(--muted); cursor: pointer; }
.mini-btn:hover { color: var(--text); }
.mini-btn.spin svg { animation: spin 1s linear infinite; }
.skel-card { min-height: 290px; }
.empty { grid-column: 1 / -1; text-align: center; padding: 3rem 1rem; border: 1.5px dashed var(--border); border-radius: var(--radius); color: var(--muted); }
.empty h2 { color: var(--text); margin-bottom: .4rem; }

/* badges */
.badge { display: inline-flex; align-items: center; gap: .35rem; font-size: .76rem; font-weight: 700; padding: .25rem .6rem; border-radius: 999px; border: 1px solid; white-space: nowrap; letter-spacing: .01em; }
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.b-in_stock { color: var(--green); background: var(--green-bg); border-color: var(--green-bd); }
.b-in_stock::before { box-shadow: 0 0 0 3px color-mix(in srgb, var(--green) 25%, transparent); animation: pulse 2s infinite; }
.b-sold_out, .b-pending, .b-gone { color: var(--grey); background: var(--grey-bg); border-color: var(--grey-bd); }
.b-error { color: var(--amber); background: var(--amber-bg); border-color: var(--amber-bd); }
.b-paused { color: var(--blue); background: var(--blue-bg); border-color: var(--blue-bd); }
.card .badge { background: color-mix(in srgb, var(--surface) 88%, transparent); }
.card .b-in_stock { background: color-mix(in srgb, var(--surface) 70%, #16a34a 30%); }
.tag { display: inline-block; font-size: .74rem; font-weight: 650; padding: .15rem .5rem; border-radius: 6px; background: var(--surface-3); color: var(--muted); margin: .1rem .2rem .1rem 0; }

/* switch */
.switch { position: relative; width: 46px; height: 28px; flex: none; border-radius: 999px; border: 0; padding: 0; cursor: pointer;
  background: var(--surface-3); box-shadow: inset 0 0 0 1px var(--border); transition: background .2s; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff;
  box-shadow: 0 2px 5px rgba(0, 0, 0, .3); transition: transform .22s cubic-bezier(.3, 1.4, .5, 1); }
.switch[aria-checked="true"] { background: #22c55e; box-shadow: none; }
.switch[aria-checked="true"]::after { transform: translateX(18px); }
.switch[disabled] { opacity: .5; cursor: progress; }

/* activity */
.activity-panel { position: sticky; top: 76px; max-height: calc(100vh - 96px); display: flex; flex-direction: column; }
.events { list-style: none; margin: 0; padding: 0; overflow-y: auto; }
.activity-panel .events { margin: 0 -.4rem; padding: 0 .4rem; }
.ev { display: grid; grid-template-columns: 28px 1fr; gap: .6rem; padding: .6rem 0; border-bottom: 1px solid var(--border); }
.ev:last-child { border-bottom: 0; }
.ev-icon { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; font-size: .85rem; }
.ev-change .ev-icon { background: var(--green-bg); color: var(--green); }
.ev-alert .ev-icon { background: var(--blue-bg); color: var(--blue); }
.ev-error .ev-icon { background: var(--amber-bg); color: var(--amber); }
.ev-info .ev-icon { background: var(--grey-bg); color: var(--grey); }
.ev-msg { font-size: .88rem; line-height: 1.4; word-break: break-word; }
.ev-time { color: var(--muted); font-size: .76rem; margin-top: .1rem; }
.events.big .ev-msg { font-size: .95rem; }
.events .none { color: var(--muted); padding: 1rem 0; }

/* add/edit + detail */
.url-row { display: flex; gap: .6rem; }
.url-row input { min-height: 46px; }
.url-row .btn { min-height: 46px; }
details.kw { margin-top: .9rem; }
details.kw summary { cursor: pointer; color: var(--muted); font-weight: 600; font-size: .9rem; }
details.kw[open] summary { margin-bottom: .6rem; }
.product { display: flex; gap: 1.1rem; align-items: center; margin-bottom: 1.1rem; }
.product-img { width: 112px; height: 112px; flex: none; border-radius: 14px; background: #fff; border: 1px solid var(--border); overflow: hidden; display: grid; place-items: center; }
.product-img img { width: 100%; height: 100%; object-fit: contain; padding: .4rem; }
.product-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .3rem; }
.product-info h1 { font-size: 1.5rem; }
.detail-head .product { margin-bottom: 0; }
.detail-toggle { display: flex; flex-direction: column; align-items: center; gap: .3rem; font-size: .78rem; color: var(--muted); font-weight: 600; }
.variants-head { display: flex; justify-content: space-between; align-items: center; gap: .6rem; flex-wrap: wrap; margin-bottom: .6rem; }
.variants-head h2 { margin: 0; }
.count { color: var(--muted); font-weight: 600; font-size: .9rem; margin-left: .3rem; }
.option-filters { display: flex; flex-wrap: wrap; gap: .4rem 1rem; margin-bottom: .7rem; }
.option-filters .grp { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem; }
.option-filters .grp-name { color: var(--muted); font-size: .8rem; font-weight: 700; margin-right: .2rem; }
.option-filters .chip { font-size: .8rem; padding: .25rem .65rem; }
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 12px; }
.vtable { width: 100%; border-collapse: collapse; }
.vtable th { text-align: left; font-size: .76rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: .65rem .8rem; background: var(--surface-2); border-bottom: 1px solid var(--border); }
.vtable td { padding: .65rem .8rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.vtable tr:last-child td { border-bottom: 0; }
.vtable td:first-child { width: 64px; }
.vtable tr.on { background: color-mix(in srgb, var(--accent) 7%, transparent); }
.vtable tr.gone td { opacity: .55; }
.vlabel { font-weight: 650; }
.vtable .price { font-variant-numeric: tabular-nums; white-space: nowrap; }
.vtable .when { color: var(--muted); font-size: .85rem; white-space: nowrap; }
.save-bar { position: sticky; bottom: 0; padding: .9rem 0; display: flex; justify-content: flex-end;
  background: linear-gradient(transparent, var(--bg) 35%); }
.save-bar .btn { min-width: 160px; min-height: 46px; }

/* channel picker */
.picker { position: relative; display: flex; flex-direction: column; gap: .35rem; }
.picker-label { font-weight: 600; font-size: .9rem; }
.picker-btn { display: flex; align-items: center; flex-wrap: wrap; gap: .3rem; min-height: 42px; padding: .4rem 2.2rem .4rem .6rem; text-align: left;
  font: inherit; color: var(--text); background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); cursor: pointer; position: relative; }
.picker-btn::after { content: ""; position: absolute; right: .9rem; top: 50%; width: 8px; height: 8px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: translateY(-70%) rotate(45deg); }
.picker-btn .ph { color: var(--muted); padding-left: .15rem; }
.picker-btn .pill { background: var(--surface-3); border-radius: 7px; padding: .15rem .5rem; font-size: .84rem; font-weight: 600; }
.picker-menu { position: absolute; top: 100%; left: 0; right: 0; margin-top: .3rem; z-index: 30; background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, .35); padding: .35rem; max-height: 300px; overflow-y: auto; }
.picker-menu label { flex-direction: row; align-items: center; gap: .6rem; font-weight: 500; padding: .5rem .55rem; border-radius: 8px; cursor: pointer; }
.picker-menu label:hover { background: var(--surface-2); }
.picker-menu .sub { color: var(--muted); font-size: .8rem; display: block; font-weight: 400; }
.picker-menu .add { width: 100%; text-align: left; font: inherit; font-weight: 650; color: var(--accent); background: none; border: 0; border-top: 1px solid var(--border); margin-top: .3rem; padding: .6rem .55rem; cursor: pointer; border-radius: 0 0 8px 8px; }
.picker-menu .add:hover { background: var(--surface-2); }
.picker-menu .none { color: var(--muted); padding: .5rem .55rem; font-size: .88rem; }

/* tabs + channel list */
.tabs { display: flex; gap: .3rem; margin-bottom: 1rem; overflow-x: auto; scrollbar-width: none; background: var(--surface); padding: .3rem; border-radius: 13px; border: 1px solid var(--border); width: fit-content; max-width: 100%; }
.tabs [role=tab] { font: inherit; font-weight: 600; padding: .5rem 1rem; border-radius: 10px; border: 0; background: none; color: var(--muted); cursor: pointer; white-space: nowrap; }
.tabs [role=tab][aria-selected="true"] { background: var(--surface-3); color: var(--text); }
.channel-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; }
.channel { display: flex; align-items: center; gap: .9rem; padding: .85rem 1rem; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); }
.channel-icon { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-3); flex: none; font-size: 1.05rem; }
.channel-main { flex: 1; min-width: 0; }
.channel-main strong { display: block; }
.channel-main .sub { color: var(--muted); font-size: .85rem; overflow-wrap: anywhere; }
.channel .actions { flex-wrap: wrap; justify-content: flex-end; }

/* dialogs */
dialog { border: 1px solid var(--border); border-radius: 18px; padding: 0; background: var(--surface); color: var(--text); width: min(480px, calc(100vw - 32px)); box-shadow: 0 30px 80px rgba(0, 0, 0, .5); }
dialog::backdrop { background: rgba(5, 8, 15, .6); backdrop-filter: blur(3px); }
dialog[open] { animation: pop .18s ease; }
.dlg { display: flex; flex-direction: column; gap: .9rem; padding: 1.4rem; }
.dlg h2 { margin: 0; font-size: 1.2rem; }
.dlg .row2 { margin: 0; }
.dlg-actions { display: flex; justify-content: flex-end; gap: .5rem; margin-top: .3rem; }

/* toasts */
.toasts { position: fixed; z-index: 100; bottom: 18px; right: 18px; display: flex; flex-direction: column; gap: .5rem; max-width: min(380px, calc(100vw - 32px)); }
.toast { display: flex; gap: .6rem; align-items: flex-start; padding: .8rem 1rem; border-radius: 12px; background: var(--surface); border: 1px solid var(--border);
  box-shadow: 0 12px 34px rgba(0, 0, 0, .35); font-weight: 550; animation: slidein .25s ease; border-left: 4px solid var(--accent); }
.toast.ok { border-left-color: #22c55e; }
.toast.err { border-left-color: #f59e0b; }
.toast.out { animation: fadeout .3s ease forwards; }

/* skeletons */
.skel { position: relative; overflow: hidden; color: transparent !important; background: var(--surface-3) !important; border-radius: 8px; }
.skel-card { background: var(--surface-2); }
.skel::after, .skel-card::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .07), transparent); animation: shimmer 1.3s infinite; }
[data-theme="light"] .skel::after, [data-theme="light"] .skel-card::after { background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .7), transparent); }
.skel-row td div { height: 14px; border-radius: 6px; background: var(--surface-3); position: relative; overflow: hidden; }
.skel-row td div::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .08), transparent); animation: shimmer 1.3s infinite; }

/* login */
.login-page { display: grid; place-items: center; padding: 16px; }
.login-card { width: min(400px, 100%); background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 2rem; box-shadow: var(--shadow); }
.login-card form { display: flex; flex-direction: column; gap: 1rem; margin-top: 1.4rem; }
.login-brand { display: flex; align-items: center; gap: .7rem; }
.login-brand .logo { width: 40px; height: 40px; border-radius: 12px; }

@keyframes rise { from { opacity: 0; transform: translateY(6px); } }
@keyframes pop { from { opacity: 0; transform: scale(.97); } }
@keyframes slidein { from { opacity: 0; transform: translateY(10px); } }
@keyframes fadeout { to { opacity: 0; transform: translateY(6px); } }
@keyframes shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px transparent; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* responsive */
@media (max-width: 1000px) {
  .dash { grid-template-columns: 1fr; }
  .activity-panel { position: static; max-height: 460px; }
}
@media (max-width: 720px) {
  .top { flex-wrap: wrap; gap: .5rem; padding: .6rem 16px; }
  .top nav { order: 3; flex-basis: 100%; }
  nav a { padding: .4rem .55rem; font-size: .9rem; }
  .tabs [role=tab] { padding: .5rem .7rem; font-size: .9rem; }
  .detail-head .product { flex-wrap: wrap; align-items: flex-start; }
  .detail-head .product-info { order: 3; flex-basis: 100%; }
  .detail-head .detail-toggle { margin-left: auto; }
  .product-info h1 { font-size: 1.3rem; }
  .top-actions { margin-left: auto; }
  h1 { font-size: 1.4rem; }
  .stats { grid-template-columns: 1fr 1fr; gap: .6rem; }
  .stat { padding: .8rem .9rem; }
  .stat-value { font-size: 1.55rem; }
  .row2 { grid-template-columns: 1fr; }
  .grid { grid-template-columns: 1fr; }
  .url-row { flex-direction: column; }
  .product { flex-wrap: wrap; }
  .product-img { width: 84px; height: 84px; }
  .page-head .actions { width: 100%; }
  .page-head .actions .btn { flex: 1; }
  .channel { flex-wrap: wrap; }
  .channel .actions { width: 100%; justify-content: flex-start; }
  .vtable thead { display: none; }
  .vtable, .vtable tbody, .vtable tr, .vtable td { display: block; width: 100%; }
  .vtable tr { display: grid; grid-template-columns: 58px 1fr auto; grid-template-areas: "sw label badge" "sw price when"; gap: .1rem .6rem; padding: .7rem .8rem; border-bottom: 1px solid var(--border); }
  .vtable tr:last-child { border-bottom: 0; }
  .vtable td { padding: 0; border: 0; }
  .vtable td:first-child { grid-area: sw; width: auto; align-self: center; }
  .vtable td.c-label { grid-area: label; }
  .vtable td.c-price { grid-area: price; color: var(--muted); }
  .vtable td.c-stock { grid-area: badge; text-align: right; }
  .vtable td.c-when { grid-area: when; text-align: right; }
  .toasts { left: 16px; right: 16px; bottom: 16px; max-width: none; }
  .tabs { width: 100%; }
}

/* ---------------------------------------------------------------- service additions (stage 1) */
.banner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding: .8rem 1rem; border-radius: 12px;
  margin-bottom: 1rem; font-weight: 550; border: 1px solid var(--grey-bd); background: var(--grey-bg); }
.banner.warn { color: var(--amber); background: var(--amber-bg); border-color: var(--amber-bd); }
.banner.ok { color: var(--green); background: var(--green-bg); border-color: var(--green-bd); }
.center { text-align: center; }
.auth-card { max-width: 440px; margin: 2rem auto; padding: 2rem; }
.auth-card h1 { margin-bottom: .3rem; }
.auth-card form { margin: 1.2rem 0; }
.big-ic { font-size: 3rem; margin-bottom: .4rem; }
.hero { text-align: center; max-width: 760px; margin: 2.5rem auto 2rem; }
.hero h1 { font-size: clamp(2rem, 5vw, 3.2rem); letter-spacing: -.035em; line-height: 1.08; margin: .4rem 0 1rem;
  background: linear-gradient(135deg, var(--text) 30%, var(--accent)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.eyebrow { color: var(--accent); font-weight: 700; font-size: .85rem; text-transform: uppercase; letter-spacing: .08em; margin: 0; }
.lede { color: var(--muted); font-size: 1.12rem; margin: 0 auto; max-width: 620px; }
.hero-actions { justify-content: center; margin-top: 1.6rem; }
.hero-actions .btn { min-width: 150px; min-height: 46px; }
.features { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin: 2.5rem 0; }
.feature h2 { margin: .5rem 0 .3rem; font-size: 1rem; }
.feature p { color: var(--muted); margin: 0; font-size: .92rem; }
.f-ic { font-size: 1.6rem; }
#pricing h2 { font-size: 1.5rem; margin-bottom: 1rem; }
.plan-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; max-width: 760px; margin: 0 auto; }
.plan-card { border: 1px solid var(--border); border-radius: var(--radius); padding: 1.3rem; background: var(--surface-2); display: flex; flex-direction: column; gap: .6rem; }
.plan-card.current { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), 0 10px 30px color-mix(in srgb, var(--accent) 22%, transparent); }
.plan-name { font-weight: 750; display: flex; align-items: center; gap: .5rem; }
.plan-price { font-size: 2rem; font-weight: 780; letter-spacing: -.03em; }
.plan-price small { font-size: .95rem; color: var(--muted); font-weight: 600; }
.plan-card ul { margin: 0; padding-left: 1.1rem; color: var(--muted); flex: 1; }
.plan-card .btn { margin-top: .4rem; }
.atable { width: 100%; border-collapse: collapse; font-size: .9rem; }
.atable th { text-align: left; font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: .6rem .8rem; background: var(--surface-2); border-bottom: 1px solid var(--border); white-space: nowrap; }
.atable td { padding: .6rem .8rem; border-top: 1px solid var(--border); vertical-align: top; }
.atable td .sub { color: var(--muted); font-size: .8rem; word-break: break-all; }
.atable select { min-height: 34px; padding: .25rem .5rem; width: auto; }
.outbox { list-style: none; padding: 0; margin: 0; display: grid; gap: .6rem; }
.outbox li { border: 1px solid var(--border); border-radius: 12px; padding: .8rem 1rem; background: var(--surface-2); }
.outbox pre { white-space: pre-wrap; word-break: break-word; font: inherit; font-size: .88rem; color: var(--muted); margin: .4rem 0 0; }
.picker-menu label.disabled { opacity: .55; cursor: not-allowed; }
@media (max-width: 900px) { .features { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .features { grid-template-columns: 1fr; } .top .btn.sm { padding: .3rem .55rem; } }
.channel.managed { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.channel.managed .sub a { font-weight: 600; }
.mono { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: .85em; word-break: break-all; }
