*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --era-red: #C8102E;
  --era-dark-red: #990033;
  --era-blue: #250E62;

  --era-red-50: #FDE3E7;
  --era-red-100: #FAC6CF;
  --era-red-200: #F692A3;
  --era-blue-50: #E3DBFA;
  --neutral-50: #F5F5F5;
  --neutral-100: #EBEBEB;
  --neutral-200: #D4D4D4;
  --neutral-300: #B8B8B8;
  --neutral-400: #9A9A9A;
  --neutral-500: #767676;
  --neutral-600: #5A5A5A;
  --neutral-700: #404040;
  --neutral-800: #2B2B2B;
  --neutral-900: #1A1A1A;
  --positive: #048848;
  --white: #ffffff;
  --shadow-xs: 0 1px 2px rgba(0,0,0,0.06);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08), 0 2px 4px rgba(0,0,0,0.05);
  --shadow-lg: 0 12px 32px rgba(0,0,0,0.10), 0 4px 8px rgba(0,0,0,0.06);
  --radius: 7px;
  --radius-lg: 16px;
  --sidebar-w: 216px;
  --header-h: 54px;
  /* Chart colors matching screenshot */
  --t1: #F5C842; /* D04 - gold/yellow */
  --t2: #E05252; /* D07 - red/coral */
  --t3: #7B5EA7; /* D11 - purple */
  --t4: #E87FA0; /* D15 - pink */
  --t5: #F5A623; /* D17 - orange */
}

body { font-family:'Inter',sans-serif; background:#ffffff; color:var(--neutral-900); min-height:100vh; overflow-x:hidden; font-size:14px; }

/* ── SCREENS ── */
.screen { display:none; min-height:100vh; flex-direction:column; }
.screen.active { display:flex; }

/* ================================================================ S1 LANDING */
#s1 {
  background: #ffffff;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  min-height: 100vh;
}
.s1-accent-line {
  position:absolute; top:0; left:0; width:3px; height:100%;
  background:linear-gradient(to bottom, var(--era-red), var(--era-dark-red));
}
.s1-card { width:440px; position:relative; z-index:1; animation:fadeUp .5s ease both; }
@keyframes fadeUp { from{opacity:0;transform:translateY(16px)} to{opacity:1;transform:translateY(0)} }
.s1-logo-wrap { margin-bottom:36px; }
.s1-era-logo { height:56px; display:block; }
.s1-divider { width:36px; height:2px; background:#000000; margin:18px 0; }
.s1-heading { font-family:'Playfair Display',serif; font-size:30px; font-weight:700; color:var(--neutral-900); line-height:1.2; margin-bottom:7px; }
.s1-sub { font-size:13px; color:var(--neutral-500); line-height:1.6; margin-bottom:32px; }
.s1-label { display:block; font-size:11px; font-weight:600; text-transform:uppercase; letter-spacing:1.2px; color:var(--neutral-500); margin-bottom:5px; margin-top:16px; }
.s1-label:first-of-type { margin-top:0; }
.name-row { display:flex; gap:10px; }
.s1-input { width:100%; background:white; border:1.5px solid var(--neutral-200); border-radius:var(--radius); padding:10px 13px; font-family:'Inter',sans-serif; font-size:14px; color:var(--neutral-900); outline:none; transition:border-color .18s; }
.s1-input::placeholder { color:var(--neutral-300); }
.s1-input:focus { border-color:var(--era-red); }
select.s1-input { padding-right:32px; min-width:90px; width:auto; flex-shrink:0; appearance:none; -webkit-appearance:none; background-image:url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%239A9A9A' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); background-repeat:no-repeat; background-position:right 10px center; }
.s1-add-row { display:flex; align-items:center; gap:7px; margin-top:10px; cursor:pointer; color:var(--neutral-400); font-size:13px; font-weight:500; width:fit-content; transition:color .15s; }
.s1-add-row:hover { color:var(--era-red); }
.s1-btn { width:100%; margin-top:28px; background:var(--era-red); border:none; border-radius:var(--radius); padding:12px; color:white; font-family:'Inter',sans-serif; font-size:14px; font-weight:600; cursor:pointer; display:flex; align-items:center; justify-content:center; gap:7px; transition:background .18s, transform .1s; }
.s1-btn:hover { background:var(--era-dark-red); }
.s1-btn:active { transform:scale(0.98); }

/* ── PAGE FOOTER ── */
.page-footer {
  text-align:center;
  padding:10px 24px;
  font-size:11px;
  color:var(--neutral-400);
  border-top:1px solid var(--neutral-100);
  background:white;
  flex-shrink:0;
  letter-spacing:0.2px;
}

/* ================================================================ APP SHELL */
.app-shell { width:100%; display:flex; flex-direction:row; align-items:flex-start; background:#ffffff; }
.topbar {
  height:var(--header-h); background:white; border-bottom:1px solid var(--neutral-100);
  display:flex; align-items:center; padding:0 24px; gap:14px;
  box-shadow:var(--shadow-xs); position:sticky; top:0; z-index:100; flex-shrink:0;
}
.topbar-era-img { height:26px; }
.topbar-divider { width:1px; height:18px; background:var(--neutral-200); margin:0 4px; }
.topbar-folio { font-family:'Manrope',sans-serif; font-size:18px; font-weight:800; color:var(--neutral-900); }
.topbar-spacer { flex:1; }
.topbar-client {
  display:flex; align-items:center; gap:7px;
  background:var(--neutral-50); border:1px solid var(--neutral-200);
  border-radius:20px; padding:4px 12px 4px 7px; font-size:12px; color:var(--neutral-600);
}
.topbar-client-dot { width:22px; height:22px; background:var(--era-red); border-radius:50%; display:flex; align-items:center; justify-content:center; color:white; font-size:10px; font-weight:700; flex-shrink:0; }
.topbar-client strong { color:var(--neutral-900); font-weight:600; }
.topbar-avatar { width:30px; height:30px; background:var(--neutral-100); border:1.5px solid var(--neutral-200); border-radius:50%; display:flex; align-items:center; justify-content:center; cursor:pointer; color:var(--neutral-500); }
.body-layout { flex:1; min-width:0; display:flex; flex-direction:column; }
.sidebar { width:var(--sidebar-w); flex-shrink:0; background:white; border-right:1px solid var(--neutral-100); padding:0; display:flex; flex-direction:column; position:sticky; top:0; height:100vh; overflow:hidden; }

.sidebar-nav-wrap { flex:1; overflow-y:auto; padding-top:16px; min-height:0; }
.sidebar-spacer { flex:1; }
.sidebar-section { font-size:10px; font-weight:700; text-transform:uppercase; letter-spacing:1.5px; color:var(--neutral-400); padding:0 18px; margin:20px 0 6px; }
.sidebar-section:first-child { margin-top:0; }
.sidebar-item { display:flex; align-items:center; gap:9px; padding:8px 18px; cursor:pointer; font-size:13px; font-weight:500; color:var(--neutral-600); transition:background .12s, color .12s; border-left:2px solid transparent; }
.sidebar-item:hover { background:rgba(0,0,0,0.05); color:var(--neutral-900); }
.sidebar-item.active { background:var(--era-red-50); color:var(--era-red); border-left-color:var(--era-red); font-weight:600; }
.sidebar-item .ico { color:inherit; opacity:.7; flex-shrink:0; width:20px; display:flex; align-items:center; justify-content:center; }
.sidebar-item.active .ico { opacity:1; }
.main-content { flex:1; padding:24px 28px; display:flex; flex-direction:column; background:#ffffff; min-width:0; }
.page-header { margin-bottom:20px; display:flex; align-items:flex-start; justify-content:space-between; flex-shrink:0; }
.page-title { font-family:'Manrope',sans-serif; font-size:21px; font-weight:800; color:var(--neutral-900); }
.page-desc { font-size:12px; color:var(--neutral-500); margin-top:3px; }

/* ── BUTTONS ── */
.btn { display:inline-flex; align-items:center; gap:6px; padding:8px 15px; border-radius:20px; font-family:'Inter',sans-serif; font-size:13px; font-weight:600; cursor:pointer; transition:all .18s; border:none; white-space:nowrap; }
.btn-ghost { background:white; border:1.5px solid var(--neutral-200); color:var(--neutral-700); }
.btn-ghost:hover { border-color:var(--neutral-400); color:var(--neutral-900); }
.btn-primary { background:var(--era-red); color:white; }
.btn-primary:hover { background:var(--era-dark-red); }
.btn-primary:active { transform:scale(0.97); }
.btn-outline { background:white; border:1.5px solid var(--era-red); color:var(--era-red); }
.btn-outline:hover { background:var(--era-red-50); }
.btn-sm { padding:6px 11px; font-size:12px; }

/* ── CARDS ── */
.card { background:white; border-radius:var(--radius-lg); border:1px solid var(--neutral-100); overflow:hidden; box-shadow:none; }
.card-section { padding:12px 20px; }

.card-section-title { font-size:10px; font-weight:600; text-transform:uppercase; letter-spacing:1.2px; color:var(--neutral-300); margin-bottom:10px; }

/* ── TOGGLE ── */
.toggle-group { display:inline-flex; background:var(--neutral-100); border-radius:20px; padding:3px; gap:0; }
.toggle-btn { flex:none; padding:5px 18px; border:none; background:transparent; border-radius:17px; font-family:'Inter',sans-serif; font-size:12px; font-weight:600; color:var(--neutral-500); cursor:pointer; transition:all .15s; white-space:nowrap; }
.toggle-btn:hover { color:var(--neutral-900); }
.toggle-btn.active { background:white; color:var(--era-red); box-shadow:0 1px 3px rgba(0,0,0,0.12); }

/* ── DISTRICTS ── */
.district-grid { display:grid; grid-template-columns:repeat(8,1fr); gap:5px; }
.district-chip { padding:6px 4px; background:var(--neutral-50); border:1.5px solid var(--neutral-200); border-radius:20px; font-size:11px; font-weight:600; color:var(--neutral-600); cursor:pointer; text-align:center; transition:all .12s; user-select:none; }
.district-chip:hover { border-color:var(--era-red); color:var(--era-red); }
.district-chip.selected { background:var(--era-red); border-color:var(--era-red); color:white; }
.district-chip.no-data { opacity:0.28; cursor:not-allowed; pointer-events:none; }

/* ── PROPERTY CHIPS ── */
.prop-chips { display:flex; flex-wrap:wrap; gap:7px; }
.prop-chip { padding:6px 13px; background:white; border:1.5px solid var(--neutral-200); border-radius:20px; font-size:13px; font-weight:500; color:var(--neutral-600); cursor:pointer; transition:all .12s; user-select:none; }
.prop-chip:hover { border-color:var(--era-red); color:var(--era-red); }
.prop-chip.selected { background:var(--era-red-50); border-color:var(--era-red); color:var(--era-red); font-weight:600; }
.sub-chips { display:flex; flex-wrap:wrap; gap:6px; margin-top:10px; padding-top:10px; border-top:1px dashed var(--neutral-100); }
.sub-chip { padding:4px 10px; background:white; border:1.5px solid var(--neutral-200); border-radius:14px; font-size:12px; font-weight:500; color:var(--neutral-600); cursor:pointer; transition:all .12s; }
.sub-chip:hover { border-color:var(--era-red); color:var(--era-red); }
.sub-chip.selected { background:var(--era-red); border-color:var(--era-red); color:white; font-weight:600; }

/* ── RANGE INPUTS ── */
.range-row { display:flex; gap:10px; align-items:flex-end; }
.range-col { flex:1; }
.range-label { font-size:11px; font-weight:600; text-transform:uppercase; letter-spacing:.8px; color:var(--neutral-400); margin-bottom:5px; }
.range-input { width:100%; padding:9px 12px; border:1.5px solid var(--neutral-200); border-radius:var(--radius); font-family:'Inter',sans-serif; font-size:13px; color:var(--neutral-800); outline:none; background:white; transition:border-color .18s; }
.range-input:focus { border-color:var(--era-red); }
.range-sep { color:var(--neutral-300); font-size:13px; padding-bottom:9px; }

/* ── TABLE ── */
.table-toolbar { display:flex; align-items:center; gap:7px; margin-bottom:13px; flex-wrap:wrap; flex-shrink:0; }
.filter-pill { display:inline-flex; align-items:center; gap:4px; font-size:12px; color:var(--neutral-500); }
.filter-pill::after { content:'/'; color:var(--neutral-300); margin-left:4px; }
.filter-pill:last-of-type::after { display:none; }
.filter-pill strong { color:var(--neutral-800); font-weight:600; }
.toolbar-spacer { flex:1; }
.results-meta { font-size:12px; color:var(--neutral-400); }
.results-meta strong { color:var(--neutral-700); }
.data-table-wrap { background:white; border-radius:var(--radius-lg); border:1px solid var(--neutral-100); box-shadow:none; overflow:visible; }
table { width:100%; border-collapse:collapse; }
thead th { background:var(--neutral-50); padding:10px 12px; text-align:left; font-size:10px; font-weight:700; text-transform:uppercase; letter-spacing:.8px; color:var(--neutral-500); border-bottom:1px solid var(--neutral-100); white-space:nowrap; }
thead th.sorted { color:var(--era-red); }
tbody tr { border-bottom:1px solid var(--neutral-100); transition:background .08s; }
tbody tr:last-child { border-bottom:none; }
tbody tr:hover { background:var(--neutral-50); }
tbody tr.row-selected { background:var(--neutral-100) !important; }
tbody td { padding:10px 12px; font-size:13px; color:var(--neutral-600); white-space:nowrap; }
.td-district { font-weight:700; color:var(--neutral-900); }
.td-vol { color:var(--era-blue); font-weight:600; }
.td-avg { font-weight:600; color:var(--neutral-800); }
.row-check { width:15px; height:15px; border:2px solid var(--neutral-300); border-radius:3px; cursor:pointer; display:inline-flex; align-items:center; justify-content:center; transition:all .12s; }
.row-check.checked { background:var(--era-red); border-color:var(--era-red); }
.selection-bar { display:flex; align-items:center; gap:9px; padding:10px 14px; background:white; border-top:1px solid var(--neutral-100); font-size:12px; color:var(--neutral-600); font-weight:400; }

.table-foot { padding:10px 14px; background:white; border-top:1px solid var(--neutral-100); display:flex; align-items:center; justify-content:space-between; }
.pagination { display:flex; gap:3px; }
.pgbtn { min-width:27px; height:27px; border:1.5px solid var(--neutral-200); background:white; border-radius:5px; font-family:'Inter',sans-serif; font-size:11px; font-weight:600; color:var(--neutral-600); cursor:pointer; display:flex; align-items:center; justify-content:center; padding:0 5px; transition:all .12s; }
.pgbtn:hover { border-color:var(--era-red); color:var(--era-red); }
.pgbtn.active { background:var(--era-red); border-color:var(--era-red); color:white; }

/* ── MODAL ── */
.modal-overlay { position:fixed; inset:0; background:rgba(0,0,0,0.4); backdrop-filter:blur(3px); display:none; align-items:center; justify-content:center; z-index:1000; }
.modal-overlay.open { display:flex; animation:fadeIn .18s ease; }
@keyframes fadeIn { from{opacity:0} to{opacity:1} }
.modal { background:white; border-radius:20px; box-shadow:var(--shadow-lg); width:500px; max-width:90vw; animation:slideUp .22s ease; overflow:hidden; }
@keyframes slideUp { from{transform:translateY(16px);opacity:0} to{transform:translateY(0);opacity:1} }
.modal-head { padding:16px 20px 13px; border-bottom:1px solid var(--neutral-100); display:flex; align-items:center; justify-content:space-between; }
.modal-title { font-family:'Manrope',sans-serif; font-size:17px; font-weight:800; }
.modal-close { background:none; border:none; cursor:pointer; color:var(--neutral-400); font-size:18px; line-height:1; padding:2px; }
.modal-close:hover { color:var(--neutral-700); }
.modal-body { padding:16px 20px; }
.modal-row { margin-bottom:14px; }
.modal-row:last-child { margin-bottom:0; }
.modal-lbl { font-size:10px; font-weight:700; text-transform:uppercase; letter-spacing:1px; color:var(--neutral-400); margin-bottom:6px; }
.d-tags { display:flex; flex-wrap:wrap; gap:5px; }
.d-tag { background:var(--neutral-200); color:var(--neutral-700); border-radius:4px; padding:3px 9px; font-size:12px; font-weight:600; }
.d-tag-removable { background:var(--era-red); color:white; border-radius:4px; padding:3px 10px; font-size:12px; font-weight:600; cursor:pointer; display:inline-flex; align-items:center; gap:2px; transition:background .15s; user-select:none; }
.d-tag-removable:hover { background:var(--era-dark-red); }
.metric-tabs { display:flex; gap:5px; }
.metric-tab { flex:1; padding:8px 8px; border:1.5px solid var(--neutral-200); background:white; border-radius:5px; font-family:'Inter',sans-serif; font-size:12px; font-weight:600; color:var(--neutral-500); cursor:pointer; text-align:center; transition:all .12s; }
.metric-tab:hover { border-color:var(--era-red); color:var(--era-red); }
.metric-tab.active { background:var(--era-red); border-color:var(--era-red); color:white; }
.time-badge { display:inline-flex; align-items:center; gap:7px; background:var(--neutral-50); border:1px solid var(--neutral-200); border-radius:5px; padding:7px 12px; font-size:13px; font-weight:500; color:var(--neutral-700); }
/* AI prompt field */
.ai-prompt-wrap { position:relative; }
.ai-prompt-icon { position:absolute; left:10px; top:50%; transform:translateY(-50%); width:16px; height:16px; display:flex; align-items:center; justify-content:center; color:var(--era-blue); pointer-events:none; }
.ai-area { width:100%; height:68px; border:1.5px solid var(--era-blue-50); border-radius:var(--radius); padding:10px 12px 10px 34px; resize:none; font-family:'Inter',sans-serif; font-size:13px; color:var(--neutral-700); line-height:1.5; outline:none; transition:border-color .18s; background:linear-gradient(to right, rgba(37,14,98,0.03), white); }
.ai-area:focus { border-color:var(--era-blue); }
.ai-area::placeholder { color:var(--neutral-400); font-style:italic; }
.ai-hint { font-size:11px; color:var(--neutral-400); margin-top:4px; }
.modal-foot { padding:13px 20px; background:white; border-top:1px solid var(--neutral-100); display:flex; justify-content:flex-end; gap:8px; }

/* ── CHART SCREEN ── */
.chart-screen-layout {
  display:flex;
  flex:1;
  min-height:0;
  overflow:hidden;
  position:relative;
}
.chart-main-area {
  flex:1;
  display:flex;
  flex-direction:column;
  min-width:0;
  overflow:hidden;
  width:100%;
}
.chart-card-full {
  background:white;
  border-radius:var(--radius-lg);
  border:none;
  box-shadow:none;
  overflow:hidden;
  display:flex;
  flex-direction:column;
  min-height:600px;
}
.chart-head { padding:14px 18px; border-bottom:1px solid var(--neutral-100); display:flex; align-items:center; justify-content:space-between; flex-shrink:0; }
.chart-meta-lbl { font-size:10px; font-weight:700; text-transform:uppercase; letter-spacing:1px; color:var(--neutral-400); }
.chart-meta-val { font-family:'Manrope',sans-serif; font-size:18px; font-weight:800; color:var(--neutral-900); }
.chart-actions { display:flex; gap:7px; align-items:center; }
.chart-body { padding:18px; position:relative; flex:1; display:flex; flex-direction:column; min-height:0; }
.chart-svg-wrap { position:relative; flex:1; min-height:300px; }
svg.trend { width:100%; height:100%; min-height:300px; overflow:visible; }
.chart-tooltip { position:absolute; background:white; border:1px solid var(--neutral-100); border-radius:8px; padding:10px 14px; font-size:12px; pointer-events:none; display:none; z-index:10; min-width:160px; box-shadow:var(--shadow-md); }
.tt-date { font-weight:700; font-size:13px; color:var(--neutral-900); margin-bottom:2px; }
.tt-metric { font-size:11px; color:var(--neutral-400); margin-bottom:6px; }
.tt-row { display:flex; align-items:center; gap:6px; margin-top:3px; }
.tt-dot { width:10px; height:10px; border-radius:2px; flex-shrink:0; }

/* Legend drawer - floating overlay */
.legend-drawer {
  position:absolute;
  right:-240px;
  top:0;
  width:224px;
  height:100%;
  overflow:hidden;
  transition:right .28s ease;
  display:flex;
  flex-direction:column;
  background:white;
  border:1px solid var(--neutral-100);
  border-radius:var(--radius-lg);
  box-shadow:var(--shadow-lg);
  z-index:20;
}
.legend-drawer.open { right:8px; }
/* Unhide button that shows when drawer is closed */
.drawer-unhide-btn {
  position:absolute;
  right:8px;
  top:14px;
  z-index:21;
  display:none;
  align-items:center;
  gap:5px;
  background:white;
  border:1px solid var(--neutral-200);
  border-radius:20px;
  padding:5px 12px;
  font-size:12px;
  font-weight:600;
  color:var(--neutral-600);
  cursor:pointer;
  box-shadow:var(--shadow-sm);
  font-family:'Inter',sans-serif;
  transition:all .15s;
}
.drawer-unhide-btn:hover { border-color:var(--era-red); color:var(--era-red); }
.drawer-unhide-btn.visible { display:flex; }
.legend-head { padding:12px 14px; border-bottom:1px solid var(--neutral-100); display:flex; align-items:center; justify-content:space-between; flex-shrink:0; }
.legend-title { font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:1px; color:var(--neutral-500); }
.legend-close-btn { background:none; border:none; cursor:pointer; color:var(--neutral-400); font-size:14px; line-height:1; padding:2px; }
.legend-close-btn:hover { color:var(--neutral-700); }
.legend-rows { overflow-y:auto; flex:1; }
.legend-row { display:flex; align-items:center; gap:9px; padding:10px 14px; border-bottom:1px solid var(--neutral-100); }
.legend-row:last-of-type { border-bottom:none; }
.legend-color { width:12px; height:12px; border-radius:3px; flex-shrink:0; }
.legend-info { flex:1; min-width:0; }
.legend-d { font-size:13px; font-weight:700; color:var(--neutral-900); }
.legend-v { font-size:11px; color:var(--neutral-500); margin-top:1px; }
.legend-del { background:none; border:none; cursor:pointer; color:var(--neutral-300); font-size:13px; transition:color .12s; }
.legend-del:hover { color:#E11900; }
.legend-foot { padding:10px 14px; flex-shrink:0; display:flex; flex-direction:column; gap:6px; border-top:1px solid var(--neutral-100); }

/* AI insight in drawer */
.ai-insight { padding:12px 14px; border-top:1px solid var(--neutral-100); flex-shrink:0; }
.ai-insight-title { font-size:10px; font-weight:700; text-transform:uppercase; letter-spacing:1px; color:var(--neutral-500); margin-bottom:6px; display:flex; align-items:center; gap:5px; }
.ai-badge { background:var(--era-red-50); color:var(--era-red); border-radius:8px; padding:1px 7px; font-size:10px; font-weight:700; }
.ai-insight p { font-size:12px; color:var(--neutral-600); line-height:1.6; }
.ai-insight p + p { margin-top:6px; }

/* Scrub */
.scrub-wrap { margin:6px 18px 2px; position:relative; height:24px; flex-shrink:0; }
.scrub-track { position:absolute; top:50%; transform:translateY(-50%); left:0; right:0; height:3px; background:var(--neutral-100); border-radius:2px; }
.scrub-fill { position:absolute; height:3px; background:var(--era-red); border-radius:2px; top:50%; transform:translateY(-50%); left:0%; right:0%; }
.scrub-h { position:absolute; width:13px; height:13px; background:white; border:2px solid var(--era-red); border-radius:50%; top:50%; cursor:ew-resize; box-shadow:var(--shadow-xs); }
.scrub-h.l { left:0%; transform:translate(-50%,-50%); }
.scrub-h.r { right:0%; transform:translate(50%,-50%); }
.timeline-labels { display:flex; justify-content:space-between; padding:0 18px 6px; font-size:10px; color:var(--neutral-400); flex-shrink:0; }

/* Chart legend bar (bottom) */
.chart-legend-bar { padding:10px 18px; border-top:1px solid var(--neutral-100); display:flex; align-items:center; gap:16px; flex-wrap:wrap; flex-shrink:0; background:white; }
.legend-pill { display:flex; align-items:center; gap:5px; font-size:12px; color:var(--neutral-700); font-weight:500; }
.legend-pill-dot { width:12px; height:12px; border-radius:50%; flex-shrink:0; }
.chart-footer-actions { margin-left:auto; display:flex; gap:7px; }

/* Drawer toggle button */
.drawer-toggle {
  position:absolute; right:-1px; top:50%;
  transform:translateY(-50%);
  width:20px; height:48px;
  background:white;
  border:1px solid var(--neutral-100);
  border-right:none;
  border-radius:6px 0 0 6px;
  cursor:pointer;
  display:flex; align-items:center; justify-content:center;
  color:var(--neutral-400);
  font-size:11px;
  box-shadow:var(--shadow-xs);
  z-index:10;
  transition:color .15s, background .15s;
}
.drawer-toggle:hover { color:var(--neutral-700); background:var(--neutral-50); }

/* Mini data table */
.mini-table-wrap { padding:0 18px 16px; display:none; border-top:1px solid var(--neutral-100); }
.mini-table-wrap.vis { display:block; }
.mini-table-wrap table { width:100%; }
.mini-table-wrap th { font-size:10px; text-transform:uppercase; letter-spacing:.7px; color:var(--neutral-400); padding:5px 7px; font-weight:700; border-bottom:1px solid var(--neutral-100); text-align:left; }
.mini-table-wrap td { font-size:11px; padding:5px 7px; color:var(--neutral-700); border-bottom:1px solid var(--neutral-50); }
.mini-table-wrap tr:last-child td { border-bottom:none; }

/* LOADING */
.loading-overlay { position:fixed; inset:0; background:rgba(255,255,255,0.85); backdrop-filter:blur(4px); display:none; align-items:center; justify-content:center; flex-direction:column; z-index:2000; gap:14px; }
.loading-overlay.show { display:flex; }
.spinner { width:34px; height:34px; border:2.5px solid var(--neutral-200); border-top-color:var(--era-red); border-radius:50%; animation:spin .65s linear infinite; }
@keyframes spin { to{transform:rotate(360deg)} }
.loading-txt { font-size:13px; font-weight:500; color:var(--neutral-600); }

/* TOAST */
.toast { position:fixed; bottom:20px; right:20px; background:var(--neutral-900); color:white; border-radius:var(--radius); padding:10px 15px; font-size:13px; font-weight:500; box-shadow:var(--shadow-lg); z-index:3000; transform:translateY(70px); opacity:0; transition:all .28s ease; max-width:260px; }
.toast.show { transform:translateY(0); opacity:1; }
.toast.success { border-left:3px solid var(--positive); }
.toast.info { border-left:3px solid var(--era-red); }

/* ── FIXED LEFT RED BAR ── */
.fixed-red-bar {
  position:fixed; left:0; top:0;
  width:6px; height:100vh;
  background:linear-gradient(to bottom, var(--era-red), var(--era-dark-red));
  z-index:1000;
}
.fixed-red-bar a {
  position:absolute; left:6px;
  display:flex; align-items:center; justify-content:center;
  background:var(--era-red); color:white;
  text-decoration:none;
  font-family:'Inter',sans-serif; font-size:11px; font-weight:700;
  letter-spacing:0.8px; text-transform:uppercase; white-space:nowrap;
  padding:8px 10px;
  border-radius:0 6px 6px 0;
  box-shadow:3px 0 10px rgba(0,0,0,0.18);
  transition:background .15s;
  writing-mode:vertical-rl;
}
.fixed-red-bar a:hover { background:var(--era-dark-red); }
.fixed-red-bar .tab-wireframes { bottom:calc(10% + 8px); transform:translateY(-100%); }
.fixed-red-bar .tab-designdoc  { bottom:10%; }
body { padding-left:6px; }.sidebar-folio-title { cursor:pointer; transition:color .15s; } .sidebar-folio-title:hover { color:var(--era-red); }

.s1-icon-btn { width:44px; height:44px; border-radius:50%; border:1.5px solid var(--neutral-200); background:white; cursor:pointer; display:flex; align-items:center; justify-content:center; color:var(--neutral-500); box-shadow:var(--shadow-sm); transition:border-color .15s, color .15s, background .15s; }
.s1-icon-btn:hover { border-color:var(--era-red); color:var(--era-red); background:var(--era-red-50); }

/* ── MOBILE BLOCKER ── */
.mobile-blocker { display:none; position:fixed; inset:0; background:white; z-index:9999; align-items:center; justify-content:center; padding:32px; }
.mobile-blocker-card { max-width:320px; text-align:left; }
@media (max-width: 768px) { .mobile-blocker { display:flex; } }
