
:root{
  --bg:#f3f4f6;
  --surface:#ffffff;
  --surface-2:#fbfbfc;
  --surface-3:#f6f7fa;
  --text:#121419;
  --muted:#667085;
  --line:#dde2ea;
  --line-strong:#c6ced8;
  --accent:#ff0033;
  --accent-2:#e91d2d;
  --accent-soft:rgba(255,0,51,.08);
  --shadow:0 18px 42px rgba(15,23,42,.10);
  --shadow-soft:0 8px 18px rgba(15,23,42,.08);
  --radius:22px;
  --radius-lg:28px;
  --radius-sm:14px;
  --sidebar-w:360px;
  --topbar-h:76px;
  --nav-h:68px;
  color-scheme:light;
}
body.dark{
  --bg:#0b0d12;
  --surface:#151922;
  --surface-2:#161b25;
  --surface-3:#1b2030;
  --text:#eef2f7;
  --muted:#a6afbe;
  --line:#2a3242;
  --line-strong:#3a4457;
  --accent:#ff3b58;
  --accent-2:#ff5773;
  --accent-soft:rgba(255,59,88,.12);
  --shadow:0 24px 54px rgba(0,0,0,.38);
  --shadow-soft:0 12px 24px rgba(0,0,0,.22);
  color-scheme:dark;
}
body.high-contrast{
  --bg:#000;
  --surface:#fff;
  --surface-2:#fff;
  --surface-3:#fff;
  --text:#000;
  --muted:#000;
  --line:#000;
  --line-strong:#000;
  --accent:#0000ff;
  --accent-2:#0000ff;
  --accent-soft:rgba(0,0,255,.18);
}
body.large-text .hero-copy h2{line-height:1.16}
body.reduced-motion *{
  animation:none !important;
  transition:none !important;
  scroll-behavior:auto !important;
}
body.reading-mode .banner,
body.reading-mode .video-card{
  box-shadow:none;
}
body.dense .main-shell,
body.dense .hero,
body.dense .sidebar .panel,
body.dense .panel,
body.dense .card-body{
  padding:12px !important;
}

.app-shell{
  min-height:100vh;
  display:grid;
  grid-template-rows:auto 1fr auto;
}
.overlay{
  position:fixed;
  inset:0;
  background:rgba(0,0,0,.34);
  opacity:0;
  pointer-events:none;
  transition:opacity .2s ease;
  z-index:50;
}
body.sidebar-open .overlay{
  opacity:1;
  pointer-events:auto;
}
.topbar{
  position:sticky;
  top:0;
  z-index:60;
  min-height:var(--topbar-h);
  display:grid;
  grid-template-columns:minmax(280px,1.3fr) minmax(260px,1fr) auto;
  gap:14px;
  align-items:center;
  padding:14px clamp(14px,2vw,24px);
  backdrop-filter:blur(16px);
  background:color-mix(in srgb, var(--surface) 82%, transparent);
  border-bottom:1px solid var(--line);
}
.topbar-left{
  display:flex;
  align-items:center;
  gap:12px;
  min-width:0;
}
.brand{
  display:flex;
  align-items:center;
  gap:12px;
  min-width:0;
}
.brand-mark{
  flex:0 0 auto;
  width:52px;height:52px;
  border-radius:18px;
  display:grid;place-items:center;
  background:linear-gradient(145deg,var(--accent),var(--accent-2));
  color:#fff;
  font-weight:900;
  letter-spacing:.08em;
  box-shadow:0 16px 30px rgba(255,0,51,.22);
}
.brand-copy{min-width:0}
.eyebrow{
  margin:0 0 2px;
  color:var(--muted);
  font-size:12px;
  letter-spacing:.08em;
  text-transform:uppercase;
}
.brand h1{
  margin:0;
  font-size:clamp(18px,2vw,28px);
  line-height:1.05;
  letter-spacing:-.03em;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.brand h1 span{color:var(--accent)}
.subcopy{
  margin:4px 0 0;
  color:var(--muted);
  font-size:13px;
  line-height:1.4;
}
.searchbar{
  display:flex;
  align-items:center;
  gap:10px;
  min-width:0;
  padding:0 14px;
  height:48px;
  border:1px solid var(--line);
  border-radius:999px;
  background:var(--surface);
  box-shadow:var(--shadow-soft);
}
.searchbar span{color:var(--muted)}
.searchbar input{
  width:100%;
  border:0;
  outline:0;
  background:transparent;
  color:var(--text);
}
.topbar-actions{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  justify-content:flex-end;
}
.main-shell{
  display:grid;
  grid-template-columns:var(--sidebar-w) minmax(0,1fr);
  gap:18px;
  align-items:start;
  padding:18px;
}
.sidebar{
  position:sticky;
  top:calc(var(--topbar-h) + 18px);
  align-self:start;
  max-height:calc(100vh - var(--topbar-h) - 36px);
  overflow:auto;
  padding-right:2px;
}
.sidebar-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:4px 4px 12px;
}
.sidebar-head h2{
  margin:0;
  font-size:24px;
  letter-spacing:-.03em;
}
.panel{
  background:var(--surface);
  border:1px solid var(--line);
  border-radius:var(--radius-lg);
  box-shadow:var(--shadow-soft);
}
.sidebar .panel{padding:16px}
.main{
  min-width:0;
  display:flex;
  flex-direction:column;
  gap:16px;
}
.hero{
  padding:18px;
  display:grid;
  grid-template-columns:minmax(0,1.3fr) minmax(320px,.8fr);
  gap:16px;
}
.hero-copy h2{
  margin:0;
  font-size:clamp(26px,3.1vw,44px);
  line-height:1.08;
  letter-spacing:-.05em;
}
.lead{
  margin:12px 0 0;
  color:var(--muted);
  line-height:1.75;
  max-width:70ch;
}
.hero-actions{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  margin-top:16px;
}
.stats{
  margin-top:16px;
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:12px;
}
.stat{
  padding:14px;
  border-radius:18px;
  background:var(--surface-2);
  border:1px solid var(--line);
}
.stat .label{display:block;color:var(--muted);font-size:12px;margin-bottom:8px}
.stat .value{font-size:20px;font-weight:800;letter-spacing:-.03em}
.hero-side{
  display:grid;
  gap:12px;
}
.hero-side .inner{
  padding:16px;
}
.panel-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  margin-bottom:12px;
}
.panel-head h3{
  margin:0;
  font-size:17px;
  line-height:1.2;
  letter-spacing:-.02em;
}
.panel-head p{margin:4px 0 0}
.badge, .chip{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:6px 10px;
  border-radius:999px;
  font-size:12px;
  font-weight:700;
  letter-spacing:.02em;
}
.badge.neutral, .chip.neutral{
  background:var(--surface-3);
  color:var(--muted);
  border:1px solid var(--line);
}
.stack{display:grid;gap:10px}
.field-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:10px;
}
.field{
  display:grid;
  gap:7px;
}
.field span{
  font-size:12px;
  color:var(--muted);
}
.field small{color:var(--muted)}
.field input,.field select{
  width:100%;
  min-width:0;
  min-height:44px;
  padding:0 14px;
  color:var(--text);
  background:var(--surface-2);
  border:1px solid var(--line);
  border-radius:16px;
  outline:none;
  transition:border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.field input:focus,.field select:focus{
  border-color:color-mix(in srgb, var(--accent) 45%, var(--line));
  box-shadow:0 0 0 4px var(--accent-soft);
}
.field input[type="range"]{
  min-height:auto;
  padding:0;
  border:0;
  background:transparent;
  accent-color:var(--accent);
}
.slider-grid{display:grid;gap:12px}
.slider-grid .field{gap:8px}
.chip-wrap{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
}
.chip-option{
  border:1px solid var(--line);
  background:var(--surface-2);
  color:var(--text);
  border-radius:999px;
  min-height:38px;
  padding:0 12px;
  display:inline-flex;
  align-items:center;
  gap:8px;
}
.chip-option[aria-pressed="true"]{
  background:var(--accent);
  border-color:var(--accent);
  color:#fff;
}
.checkline{
  display:flex;
  align-items:center;
  gap:10px;
  color:var(--text);
  padding:11px 12px;
  background:var(--surface-2);
  border:1px solid var(--line);
  border-radius:16px;
}
.checkline input{accent-color:var(--accent)}
.btn,.icon-btn,.tab,.seg,.nav-btn{
  border:1px solid var(--line);
  background:var(--surface-2);
  color:var(--text);
  border-radius:16px;
  transition:transform .15s ease, box-shadow .15s ease, border-color .15s ease, background .15s ease, color .15s ease;
}
.btn:hover,.icon-btn:hover,.tab:hover,.seg:hover,.nav-btn:hover{
  transform:translateY(-1px);
  border-color:var(--line-strong);
}
.btn{
  min-height:44px;
  padding:0 14px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  font-weight:700;
  box-shadow:var(--shadow-soft);
}
.btn.primary{
  background:linear-gradient(145deg,var(--accent),var(--accent-2));
  border-color:transparent;
  color:#fff;
}
.btn.ghost{
  background:var(--surface);
}
.btn.wide{width:100%}
.btn.tiny{
  min-height:34px;
  padding:0 10px;
  border-radius:12px;
  font-size:12px;
}
.icon-btn{
  width:42px;height:42px;
  display:grid;
  place-items:center;
  font-size:18px;
  box-shadow:var(--shadow-soft);
}
.section-tabs{
  display:flex;
  gap:10px;
  overflow:auto;
  padding-bottom:2px;
}
.tab,.seg,.nav-btn{
  min-height:42px;
  padding:0 15px;
  font-weight:700;
  white-space:nowrap;
}
.tab.active,.seg.active,.nav-btn.active{
  background:var(--accent);
  border-color:var(--accent);
  color:#fff;
  box-shadow:0 12px 24px rgba(255,0,51,.16);
}
.view-grid{min-width:0}
.view{display:none;gap:16px}
.view.active{display:grid}
.two-col{
  display:grid;
  grid-template-columns:minmax(0,1fr) minmax(0,1fr);
  gap:16px;
}
