﻿/* ============================================================
   Relista — design system
   ============================================================ */
:root {
  --ink: #0f172a;
  --ink-2: #334155;
  --ink-3: #64748b;
  --ink-4: #94a3b8;
  --bg: #f4f6fb;
  --card: #ffffff;
  --line: #e2e8f0;
  --line-soft: #eef2f7;
  --brand: #6366f1;
  --brand-2: #22d3ee;
  --brand-deep: #4f46e5;
  --grad: linear-gradient(135deg, #6366f1 0%, #22d3ee 100%);
  --grad-soft: linear-gradient(135deg, rgba(99,102,241,.10), rgba(34,211,238,.10));
  --green: #10b981;
  --green-bg: #ecfdf5;
  --red: #ef4444;
  --red-bg: #fef2f2;
  --amber: #f59e0b;
  --amber-bg: #fffbeb;
  --sky: #0ea5e9;
  --sky-bg: #f0f9ff;
  --violet-bg: #f5f3ff;
  --sidebar: #101430;
  --sidebar-2: #181e42;
  --thead: #f8fafc;
  --hover: #f8faff;
  --topbar: rgba(255, 255, 255, .8);
  --radius: 14px;
  --shadow-sm: 0 1px 2px rgba(15,23,42,.05);
  --shadow: 0 1px 3px rgba(15,23,42,.06), 0 8px 24px -12px rgba(15,23,42,.12);
  --shadow-lg: 0 4px 12px rgba(15,23,42,.08), 0 24px 48px -16px rgba(15,23,42,.22);
  --font: 'Inter', 'Noto Sans JP', 'Hiragino Sans', 'Yu Gothic UI', sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }
a { color: var(--brand-deep); text-decoration: none; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 8px; border: 2px solid var(--bg); }
::-webkit-scrollbar-track { background: transparent; }

/* ============ Login ============ */
.login-screen {
  position: fixed; inset: 0; display: flex; align-items: center; justify-content: center;
  background: #0b1026; overflow: hidden;
}
.login-bg { position: absolute; inset: 0; }
.orb { position: absolute; border-radius: 50%; filter: blur(90px); opacity: .55; animation: drift 16s ease-in-out infinite alternate; }
.orb-1 { width: 480px; height: 480px; background: #4f46e5; top: -120px; left: -80px; }
.orb-2 { width: 420px; height: 420px; background: #0891b2; bottom: -140px; right: -60px; animation-delay: -5s; }
.orb-3 { width: 300px; height: 300px; background: #7c3aed; top: 40%; left: 55%; animation-delay: -9s; opacity: .35; }
@keyframes drift { from { transform: translate(0,0) scale(1); } to { transform: translate(60px,40px) scale(1.15); } }

.login-card {
  position: relative; width: 420px; max-width: calc(100vw - 32px);
  background: rgba(255,255,255,.97); border-radius: 24px; padding: 40px 36px 28px;
  box-shadow: 0 40px 100px -20px rgba(0,0,0,.6);
  animation: rise .5s cubic-bezier(.2,.9,.3,1.2);
}
@keyframes rise { from { opacity: 0; transform: translateY(24px) scale(.97); } }
.login-brand { display: flex; gap: 14px; align-items: center; margin-bottom: 28px; }
.logo-mark {
  width: 46px; height: 46px; border-radius: 13px; background: var(--grad);
  color: #fff; font-weight: 800; font-size: 24px; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 20px -6px rgba(99,102,241,.6); flex-shrink: 0;
}
.login-title { font-size: 26px; font-weight: 800; letter-spacing: -.5px; }
.login-sub { font-size: 12px; color: var(--ink-3); }
.login-tabs { display: flex; background: var(--line-soft); border-radius: 12px; padding: 4px; margin-bottom: 22px; }
.login-tab { flex: 1; border: 0; background: transparent; padding: 9px; border-radius: 9px; font-weight: 600; color: var(--ink-3); transition: all .2s; }
.login-tab.active { background: #fff; color: var(--ink); box-shadow: var(--shadow-sm); }
.login-form { display: flex; flex-direction: column; gap: 16px; }
.login-error { background: var(--red-bg); color: #b91c1c; border-radius: 10px; padding: 10px 14px; font-size: 13px; }
.login-note { margin-top: 20px; text-align: center; font-size: 12px; color: var(--ink-4); }
.login-note code { background: var(--line-soft); padding: 2px 8px; border-radius: 6px; }

/* ============ Layout ============ */
.app { display: flex; height: 100vh; }
.sidebar {
  width: 244px; flex-shrink: 0; background: linear-gradient(180deg, var(--sidebar) 0%, var(--sidebar-2) 100%);
  color: #cbd5e1; display: flex; flex-direction: column; padding: 20px 14px;
}
.sidebar-brand { display: flex; align-items: center; gap: 11px; padding: 2px 8px 20px; }
.sidebar-brand .logo-mark { width: 38px; height: 38px; font-size: 20px; border-radius: 11px; }
.brand-text { font-size: 20px; font-weight: 800; color: #fff; letter-spacing: -.4px; display: flex; align-items: center; gap: 8px; }
.brand-badge {
  font-size: 9px; font-weight: 700; letter-spacing: 1px; padding: 2.5px 7px; border-radius: 99px;
  background: rgba(99,102,241,.35); color: #c7d2fe; border: 1px solid rgba(129,140,248,.5);
}
.nav { display: flex; flex-direction: column; gap: 3px; flex: 1; overflow-y: auto; }
.nav a {
  display: flex; align-items: center; gap: 12px; color: #94a3c8; padding: 10px 12px;
  border-radius: 10px; font-weight: 500; font-size: 13.5px; transition: all .15s; position: relative;
}
.nav a:hover { background: rgba(255,255,255,.06); color: #e2e8f0; }
.nav a.active { background: linear-gradient(90deg, rgba(99,102,241,.28), rgba(34,211,238,.10)); color: #fff; font-weight: 600; }
.nav a.active::before {
  content: ''; position: absolute; left: -14px; top: 8px; bottom: 8px; width: 3.5px;
  background: var(--grad); border-radius: 0 4px 4px 0;
}
.nav-ico { width: 20px; text-align: center; font-size: 15px; filter: grayscale(.2); }

.sidebar-foot { display: flex; flex-direction: column; gap: 12px; padding-top: 14px; border-top: 1px solid rgba(255,255,255,.08); }
.health-chip { display: flex; align-items: center; gap: 10px; background: rgba(255,255,255,.05); padding: 10px; border-radius: 12px; }
.health-ring { position: relative; width: 34px; height: 34px; flex-shrink: 0; }
.health-ring span { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 9.5px; font-weight: 700; color: #fff; }
.health-label { font-size: 11px; font-weight: 600; color: #cbd5e1; }
.health-sub { font-size: 10.5px; color: #64748b; }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 4px 6px; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; background: var(--grad); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; flex-shrink: 0;
}
.user-meta { flex: 1; min-width: 0; }
.user-meta > div:first-child { font-size: 13px; font-weight: 600; color: #f1f5f9; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-plan { font-size: 10.5px; color: #64748b; }
.icon-btn { background: none; border: 0; color: #64748b; font-size: 16px; padding: 6px; border-radius: 8px; }
.icon-btn:hover { background: rgba(255,255,255,.08); color: #f87171; }

.main-col { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar {
  height: 60px; flex-shrink: 0; display: flex; align-items: center; justify-content: space-between;
  padding: 0 28px; background: var(--topbar); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.topbar-title { font-size: 17px; font-weight: 700; letter-spacing: -.2px; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.sync-pill {
  display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 600;
  color: #047857; background: var(--green-bg); border: 1px solid #a7f3d0; padding: 5px 12px; border-radius: 99px;
}
.pulse-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); animation: pulse 1.8s infinite; }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(16,185,129,.5); } 60% { box-shadow: 0 0 0 6px rgba(16,185,129,0); } }
.demo-pill {
  font-size: 10px; font-weight: 800; letter-spacing: 1.5px; padding: 4px 10px; border-radius: 99px;
  background: var(--violet-bg); color: #7c3aed; border: 1px solid #ddd6fe;
}

.content { flex: 1; overflow-y: auto; padding: 26px 28px 60px; }
.page { animation: fadein .3s ease; max-width: 1280px; margin: 0 auto; }
@keyframes fadein { from { opacity: 0; transform: translateY(8px); } }

/* ============ Common components ============ */
.card {
  background: var(--card); border-radius: var(--radius); border: 1px solid var(--line);
  box-shadow: var(--shadow-sm); padding: 20px 22px;
}
.card + .card, .grid + .card, .card + .grid { margin-top: 18px; }
.card-title { font-size: 15px; font-weight: 700; margin-bottom: 4px; letter-spacing: -.2px; }
.card-sub { font-size: 12.5px; color: var(--ink-3); margin-bottom: 16px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.card-head .card-title, .card-head .card-sub { margin-bottom: 0; }

.grid { display: grid; gap: 16px; }
.grid-kpi { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.grid-2 { grid-template-columns: 1fr 1fr; }
.grid-3-1 { grid-template-columns: 2fr 1fr; }
@media (max-width: 1100px) { .grid-2, .grid-3-1 { grid-template-columns: 1fr; } }

.kpi { position: relative; overflow: hidden; }
.kpi-label { font-size: 12px; font-weight: 600; color: var(--ink-3); display: flex; align-items: center; gap: 7px; }
.kpi-ico { font-size: 14px; }
.kpi-value { font-size: 27px; font-weight: 800; letter-spacing: -.8px; margin-top: 6px; font-variant-numeric: tabular-nums; }
.kpi-value small { font-size: 14px; font-weight: 600; color: var(--ink-4); margin-left: 2px; }
.kpi-foot { font-size: 11.5px; color: var(--ink-4); margin-top: 4px; }
.kpi-accent { position: absolute; top: 0; left: 0; right: 0; height: 3px; background: var(--grad); }
.kpi.k-green .kpi-accent { background: linear-gradient(90deg, #10b981, #84cc16); }
.kpi.k-amber .kpi-accent { background: linear-gradient(90deg, #f59e0b, #fb923c); }
.kpi.k-sky .kpi-accent { background: linear-gradient(90deg, #0ea5e9, #22d3ee); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border: 1px solid var(--line); background: var(--card); color: var(--ink-2);
  padding: 8px 16px; border-radius: 10px; font-size: 13px; font-weight: 600;
  transition: all .15s; white-space: nowrap;
}
.btn:hover { border-color: var(--ink-4); background: var(--hover); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary {
  background: var(--grad); color: #fff; border: 0;
  box-shadow: 0 4px 14px -4px rgba(99,102,241,.5);
}
.btn-primary:hover { filter: brightness(1.07); background: var(--grad); }
.btn-danger { color: var(--red); border-color: #fecaca; }
.btn-danger:hover { background: var(--red-bg); border-color: #fca5a5; }
.btn-green { background: var(--green); color: #fff; border: 0; }
.btn-green:hover { background: #059669; }
.btn-sm { padding: 5px 11px; font-size: 12px; border-radius: 8px; }
.btn-lg { padding: 12px 22px; font-size: 14.5px; border-radius: 12px; }
.btn-block { width: 100%; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 12px; font-weight: 600; color: var(--ink-2); }
.field input, .field select, .field textarea, .input {
  border: 1.5px solid var(--line); border-radius: 10px; padding: 9px 13px; font-size: 13.5px;
  background: var(--card); color: var(--ink); transition: border-color .15s, box-shadow .15s; width: 100%;
}
.field input:focus, .field select:focus, .input:focus, .field textarea:focus {
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(99,102,241,.13);
}
.form-row { display: flex; gap: 14px; flex-wrap: wrap; }
.form-row .field { flex: 1; min-width: 130px; }

.pill {
  display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 600;
  padding: 3px 10px; border-radius: 99px; white-space: nowrap;
}
.pill-green { background: var(--green-bg); color: #047857; }
.pill-red { background: var(--red-bg); color: #b91c1c; }
.pill-amber { background: var(--amber-bg); color: #b45309; }
.pill-sky { background: var(--sky-bg); color: #0369a1; }
.pill-gray { background: var(--line-soft); color: var(--ink-3); }
.pill-violet { background: var(--violet-bg); color: #7c3aed; }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--card); }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
thead th {
  text-align: left; font-size: 11px; font-weight: 700; letter-spacing: .4px; color: var(--ink-3);
  background: var(--thead); padding: 10px 14px; border-bottom: 1px solid var(--line);
  white-space: nowrap; position: sticky; top: 0; z-index: 1;
}
tbody td { padding: 10px 14px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr { transition: background .12s; }
tbody tr:hover { background: var(--hover); }
.num { text-align: right; font-variant-numeric: tabular-nums; }
td.title-cell { max-width: 330px; }
.nowrap { white-space: nowrap; }
.num-font { font-variant-numeric: tabular-nums; }
td.recipe-title { font-weight: 600; white-space: nowrap; max-width: 190px; overflow: hidden; text-overflow: ellipsis; }
td.recipe-cat, td.recipe-kw { white-space: nowrap; max-width: 150px; overflow: hidden; text-overflow: ellipsis; }
table.compact thead th, table.compact tbody td { padding: 9px 10px; }
table.compact .btn-sm { padding: 5px 8px; font-size: 12px; }
.tcell { display: flex; align-items: center; gap: 10px; min-width: 0; }
.thumb { width: 40px; height: 40px; border-radius: 9px; object-fit: cover; flex-shrink: 0; border: 1px solid var(--line-soft); }
.tmain { min-width: 0; }
.ttitle { font-weight: 600; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 280px; }
.ttitle.ng { color: var(--red); }
.ttitle-link { color: inherit; text-decoration: none; display: block; max-width: 460px; }
.ttitle-link:hover { color: var(--primary, #6366f1); text-decoration: underline; }
.thumb-lg { width: 52px; height: 52px; border-radius: 10px; }
.thumb-link:hover .thumb { transform: scale(1.06); transition: transform .15s; }
.sold-badge { display: inline-block; min-width: 28px; padding: 2px 8px; border-radius: 99px; font-weight: 700; font-size: 12px;
  background: rgba(34,197,94,.14); color: var(--green); }
.tsub { font-size: 11px; color: var(--ink-4); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.checkbox { width: 16px; height: 16px; accent-color: var(--brand); cursor: pointer; }

.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar .spacer { flex: 1; }
.search-input { max-width: 260px; }

.empty {
  text-align: center; padding: 46px 20px; color: var(--ink-4);
}
.empty .empty-ico { font-size: 34px; margin-bottom: 10px; opacity: .6; }
.empty .empty-title { font-weight: 700; color: var(--ink-3); font-size: 14px; }
.empty .empty-sub { font-size: 12.5px; margin-top: 3px; }

/* progress */
.progress-track { height: 8px; background: var(--line-soft); border-radius: 99px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--grad); border-radius: 99px; transition: width .4s ease; }

/* segmented */
.seg { display: inline-flex; background: var(--line-soft); border-radius: 10px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: transparent; padding: 6px 14px; border-radius: 8px; font-size: 12.5px; font-weight: 600; color: var(--ink-3); }
.seg button.active { background: var(--card); color: var(--ink); box-shadow: var(--shadow-sm); }

/* toggle switch */
.switch { position: relative; width: 38px; height: 22px; flex-shrink: 0; }
.switch input { opacity: 0; width: 100%; height: 100%; position: absolute; margin: 0; cursor: pointer; z-index: 1; }
.switch .track { position: absolute; inset: 0; background: #cbd5e1; border-radius: 99px; transition: background .18s; }
.switch .track::after {
  content: ''; position: absolute; top: 2.5px; left: 3px; width: 17px; height: 17px;
  background: #fff; border-radius: 50%; transition: transform .18s; box-shadow: 0 1px 3px rgba(0,0,0,.25);
}
.switch input:checked + .track { background: var(--brand); }
.switch input:checked + .track::after { transform: translateX(15px); }

/* toast */
.toast-root { position: fixed; bottom: 24px; right: 24px; display: flex; flex-direction: column; gap: 10px; z-index: 300; }
.toast {
  background: #101430; color: #f1f5f9; border-radius: 12px; padding: 12px 18px; font-size: 13px;
  font-weight: 500; box-shadow: var(--shadow-lg); display: flex; align-items: center; gap: 10px;
  animation: toast-in .3s cubic-bezier(.2,.9,.3,1.2); max-width: 380px;
}
.toast.ok::before { content: '✓'; color: #34d399; font-weight: 800; }
.toast.err::before { content: '!'; color: #f87171; font-weight: 800; }
@keyframes toast-in { from { opacity: 0; transform: translateY(14px) scale(.96); } }
.toast.out { opacity: 0; transform: translateY(8px); transition: all .3s; }

/* modal */
.modal-back {
  position: fixed; inset: 0; background: rgba(10,14,35,.55); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; z-index: 200; animation: fadein .18s;
  padding: 20px;
}
.modal {
  background: var(--card); border-radius: 18px; padding: 26px 28px; width: 560px; max-width: 100%;
  max-height: 88vh; overflow-y: auto; box-shadow: var(--shadow-lg);
  animation: rise .3s cubic-bezier(.2,.9,.3,1.15);
}
.modal-title { font-size: 17px; font-weight: 800; margin-bottom: 4px; letter-spacing: -.3px; }
.modal-sub { font-size: 12.5px; color: var(--ink-3); margin-bottom: 18px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }

/* chart */
.chart-box { position: relative; }
.chart-tip {
  position: absolute; pointer-events: none; background: #101430; color: #fff; font-size: 11.5px;
  padding: 7px 11px; border-radius: 9px; white-space: nowrap; transform: translate(-50%, -110%);
  opacity: 0; transition: opacity .12s; z-index: 5;
}
.chart-legend { display: flex; gap: 18px; font-size: 12px; color: var(--ink-3); margin-top: 8px; }
.chart-legend .dot { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 6px; }

/* activity feed */
.feed { display: flex; flex-direction: column; }
.feed-item { display: flex; gap: 12px; padding: 10px 2px; border-bottom: 1px solid var(--line-soft); }
.feed-item:last-child { border-bottom: 0; }
.feed-ico {
  width: 30px; height: 30px; border-radius: 9px; display: flex; align-items: center; justify-content: center;
  font-size: 14px; flex-shrink: 0;
}
.feed-msg { font-size: 12.5px; color: var(--ink-2); line-height: 1.45; }
.feed-time { font-size: 11px; color: var(--ink-4); margin-top: 1px; }

/* research grid cards */
.res-stats { display: flex; gap: 22px; flex-wrap: wrap; font-size: 12.5px; color: var(--ink-3); }
.res-stats b { color: var(--ink); font-size: 15px; font-weight: 800; }

/* sellers */
.seller-card { display: flex; align-items: center; gap: 16px; }
.seller-logo {
  width: 46px; height: 46px; border-radius: 12px; background: var(--grad-soft);
  display: flex; align-items: center; justify-content: center; font-size: 21px; flex-shrink: 0;
  border: 1px solid var(--line);
}
.step-list { counter-reset: step; display: flex; flex-direction: column; gap: 12px; }
.step-item { display: flex; gap: 12px; align-items: flex-start; font-size: 13px; color: var(--ink-2); }
.step-item::before {
  counter-increment: step; content: counter(step);
  width: 24px; height: 24px; border-radius: 50%; background: var(--grad); color: #fff;
  font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  margin-top: 1px;
}

/* label print */
.label-sheet {
  border: 2px solid var(--ink); border-radius: 8px; padding: 22px; font-size: 14px;
  background: #fff; line-height: 1.9;
}
.label-sheet .zip { font-size: 18px; font-weight: 700; letter-spacing: 2px; }
.label-sheet .addr { font-size: 15px; }
.label-sheet .name { font-size: 19px; font-weight: 800; margin-top: 6px; }
.label-sheet .meta { margin-top: 14px; padding-top: 12px; border-top: 1px dashed #94a3b8; font-size: 11.5px; color: var(--ink-3); }

@media print {
  body * { visibility: hidden; }
  .modal-back { position: static; background: none; backdrop-filter: none; }
  .modal, .modal * { visibility: visible; }
  .modal { box-shadow: none; width: 100%; }
  .modal-actions, .modal-sub { display: none; }
}

/* misc */
.mono { font-family: 'SF Mono', Consolas, monospace; font-size: 12px; }
.muted { color: var(--ink-4); font-size: 12px; }
.mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; }
.flex { display: flex; align-items: center; gap: 10px; }
.right { margin-left: auto; }
.wrap-gap { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-chip {
  display: inline-flex; align-items: center; gap: 7px; background: var(--card); border: 1px solid var(--line);
  border-radius: 99px; padding: 5px 7px 5px 13px; font-size: 12.5px; font-weight: 500;
}
.tag-chip.shared { background: var(--violet-bg); border-color: #ddd6fe; }
.tag-chip.ip { background: var(--red-bg); border-color: #fecaca; }
.tag-chip .x { border: 0; background: none; color: var(--ink-4); font-size: 13px; padding: 1px 5px; border-radius: 50%; }
.tag-chip .x:hover { color: var(--red); background: rgba(239,68,68,.1); }

@media (max-width: 900px) {
  .sidebar { width: 68px; padding: 16px 8px; }
  .brand-text, .health-chip, .user-meta, .nav a > :not(.nav-ico) { display: none; }
  .nav a { justify-content: center; font-size: 0; }
  .nav a .nav-ico { font-size: 17px; }
  .content { padding: 18px 14px 50px; }
}


/* ============ Theme toggle ============ */
.theme-btn {
  width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--card); font-size: 15px; display: flex; align-items: center; justify-content: center;
  transition: all .15s;
}
.theme-btn:hover { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(99,102,241,.13); }

/* ============ Dark theme ============ */
:root[data-theme="dark"] {
  --ink: #eef1fb;
  --ink-2: #c6cde4;
  --ink-3: #8e99bd;
  --ink-4: #616d95;
  --bg: #0c101f;
  --card: #151a30;
  --line: #262d4d;
  --line-soft: #1d2340;
  --green-bg: rgba(16,185,129,.13);
  --red-bg: rgba(239,68,68,.14);
  --amber-bg: rgba(245,158,11,.14);
  --sky-bg: rgba(14,165,233,.14);
  --violet-bg: rgba(139,92,246,.16);
  --grad-soft: linear-gradient(135deg, rgba(99,102,241,.18), rgba(34,211,238,.14));
  --sidebar: #0a0d1d;
  --sidebar-2: #10142c;
  --thead: #1a2040;
  --hover: #1b2142;
  --topbar: rgba(12,16,31,.8);
  --shadow-sm: 0 1px 2px rgba(0,0,0,.3);
  --shadow: 0 1px 3px rgba(0,0,0,.3), 0 8px 24px -12px rgba(0,0,0,.5);
  --shadow-lg: 0 4px 12px rgba(0,0,0,.4), 0 24px 48px -16px rgba(0,0,0,.7);
}
:root[data-theme="dark"] ::-webkit-scrollbar-thumb { background: #303a63; }
:root[data-theme="dark"] .pill-green { color: #34d399; }
:root[data-theme="dark"] .pill-red { color: #f87171; }
:root[data-theme="dark"] .pill-amber { color: #fbbf24; }
:root[data-theme="dark"] .pill-sky { color: #38bdf8; }
:root[data-theme="dark"] .pill-violet { color: #a78bfa; }
:root[data-theme="dark"] .sync-pill { color: #34d399; background: var(--green-bg); border-color: rgba(16,185,129,.3); }
:root[data-theme="dark"] .demo-pill { color: #a78bfa; border-color: rgba(139,92,246,.4); }
:root[data-theme="dark"] .tag-chip.shared { border-color: rgba(139,92,246,.4); }
:root[data-theme="dark"] .tag-chip.ip { border-color: rgba(239,68,68,.4); }
:root[data-theme="dark"] .seller-logo { border-color: var(--line); }
:root[data-theme="dark"] .thumb { border-color: var(--line); }
:root[data-theme="dark"] .label-sheet { background: #fff; color: #0f172a; border-color: #0f172a; }
:root[data-theme="dark"] .label-sheet .meta { color: #475569; }
:root[data-theme="dark"] .kpi-value { color: var(--ink); }

/* ---- billing ---- */
.plan-card { position: relative; display: flex; flex-direction: column; gap: 10px; }
.plan-card.plan-rec { border-color: var(--primary, #6366f1); box-shadow: 0 0 0 1px var(--primary, #6366f1) inset, var(--shadow-lg); }
.plan-card.plan-current { opacity: .92; }
.plan-ribbon { position: absolute; top: -11px; left: 18px; background: var(--grad); color: #fff; font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 99px; letter-spacing: .5px; }
.plan-name { font-weight: 800; font-size: 17px; }
.plan-price { font-size: 30px; font-weight: 800; letter-spacing: -.5px; }
.plan-price span { font-size: 13px; font-weight: 600; color: var(--ink-3); margin-left: 4px; }
.plan-list { list-style: none; margin: 4px 0 8px; padding: 0; font-size: 13px; display: grid; gap: 6px; flex: 1; }

/* ---- research progress ---- */
.rp { padding: 6px 2px 2px; }
.rp-head { display: flex; align-items: center; gap: 16px; margin-bottom: 12px; flex-wrap: wrap; }
.rp-pct { font-size: 34px; font-weight: 900; letter-spacing: -1.5px; line-height: 1; font-variant-numeric: tabular-nums;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; min-width: 84px; }
.rp-pct small { font-size: 16px; margin-left: 2px; }
.rp-text { flex: 1; min-width: 200px; }
.rp-main { font-weight: 700; font-size: 14px; }
.rp-sub { font-size: 12px; color: var(--ink-4); margin-top: 2px; }
.rp-badges { display: flex; gap: 6px; flex-wrap: wrap; }
.rp-track { height: 14px; border-radius: 99px; background: var(--line-soft); overflow: hidden; position: relative;
  box-shadow: inset 0 1px 3px rgba(0,0,0,.25); }
.rp-fill { height: 100%; border-radius: 99px; background: var(--grad); position: relative; transition: width .6s cubic-bezier(.2,.7,.2,1);
  box-shadow: 0 0 14px rgba(99,102,241,.55); }
.rp-fill:after { content: ''; position: absolute; inset: 0; border-radius: 99px;
  background: repeating-linear-gradient(-45deg, rgba(255,255,255,.18) 0 10px, transparent 10px 20px);
  background-size: 28px 28px; animation: rp-stripes 1s linear infinite; }
.rp-shine { position: absolute; top: 0; bottom: 0; width: 40%; left: -40%; border-radius: 99px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.35), transparent); animation: rp-shine 2.2s ease-in-out infinite; }
@keyframes rp-stripes { from { background-position: 0 0; } to { background-position: 28px 0; } }
@keyframes rp-shine { 0% { left: -40%; } 60%, 100% { left: 110%; } }
.rp-steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 14px; }
.rp-step { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--ink-4); padding: 8px 10px; border-radius: 10px;
  background: rgba(255,255,255,.03); border: 1px solid var(--line-soft); }
.rp-step i { width: 20px; height: 20px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  font-style: normal; font-size: 11px; font-weight: 800; background: var(--line-soft); color: var(--ink-3); }
.rp-step.active { color: var(--ink); border-color: rgba(99,102,241,.5); background: rgba(99,102,241,.1); }
.rp-step.active i { background: var(--grad); color: #fff; animation: pulse 1.6s infinite; }
.rp-step.done { color: var(--green); }
.rp-step.done i { background: rgba(34,197,94,.18); color: var(--green); }
.quota-line { font-size: 12px; color: var(--ink-4); }
@media (max-width: 800px) { .rp-steps { grid-template-columns: 1fr 1fr; } }
