
:root{
  --bg:#0b0f14; --card:#111826; --muted:#93a4b6; --text:#e8eef6; --line:#243246;
  --radius:16px; --shadow: 0 12px 30px rgba(0,0,0,.35);
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  --sans: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
}
*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  background: radial-gradient(1200px 600px at 20% -10%, rgba(96,165,250,.18), transparent 55%),
              radial-gradient(1000px 600px at 90% 0%, rgba(52,211,153,.10), transparent 55%),
              var(--bg);
  color:var(--text);
  font-family:var(--sans);
}
.topbar{
  position:sticky; top:0; z-index:10;
  display:flex; align-items:center; justify-content:space-between;
  padding:14px 16px;
  border-bottom:1px solid rgba(36,50,70,.7);
  background: rgba(11,15,20,.72);
  backdrop-filter: blur(10px);
}
.brand{display:flex; gap:12px; align-items:center}
.logo{
  width:42px;height:42px;border-radius:14px;
  display:flex;align-items:center;justify-content:center;
  background: linear-gradient(135deg, rgba(96,165,250,.28), rgba(52,211,153,.14));
  border:1px solid rgba(96,165,250,.25);
  box-shadow: var(--shadow);
}
.title{font-weight:900}
.subtitle{font-size:12px;color:var(--muted); margin-top:2px}
.topActions{display:flex; gap:10px}
.container{max-width:1100px;margin:0 auto;padding:14px 12px 22px}
.controls{
  display:flex; gap:10px; align-items:flex-end; flex-wrap:wrap;
  padding:12px;
  border-radius: var(--radius);
  background: rgba(17,24,38,.72);
  border: 1px solid rgba(36,50,70,.7);
  box-shadow: var(--shadow);
}
.controls.mini{margin-top:12px}
.control{display:flex; flex-direction:column; gap:6px; min-width:180px}
.control.grow{flex:1}
.control span{font-size:12px;color:var(--muted)}
.row{display:flex; gap:8px; align-items:center}
select,input{
  height:42px; border-radius:12px; border:1px solid rgba(36,50,70,.9);
  background: rgba(11,15,20,.75); color:var(--text); padding:0 12px; outline:none; width:100%;
}
select:focus,input:focus{border-color:rgba(96,165,250,.55); box-shadow:0 0 0 3px rgba(96,165,250,.18)}
.btn{
  height:42px; border-radius:12px; border:1px solid rgba(36,50,70,.9);
  background: rgba(96,165,250,.18); color: var(--text); padding:0 14px; font-weight:800; cursor:pointer;
}
.btn:hover{border-color:rgba(96,165,250,.55)}
.btn.ghost{background:transparent}
.btn.tiny{width:42px; padding:0; font-size:18px; line-height:1}
.tabs{display:flex; gap:8px; flex-wrap:wrap; margin-top:12px}
.tab{
  border-radius:999px; border:1px solid rgba(36,50,70,.9);
  background: rgba(11,15,20,.6); color:var(--muted); padding:10px 12px; font-weight:800; cursor:pointer;
}
.tab.active{background: rgba(96,165,250,.18); color: var(--text); border-color: rgba(96,165,250,.55)}
.panel{
  margin-top:12px; padding:12px; border-radius: var(--radius);
  background: rgba(17,24,38,.65); border: 1px solid rgba(36,50,70,.7); box-shadow: var(--shadow);
}
.panel.hidden{display:none}
.sectionHeader{display:flex; justify-content:space-between; align-items:flex-start; gap:10px; flex-wrap:wrap}
.sectionTitle{font-weight:900; margin:10px 0 8px}
.sectionSub,.note{font-size:12px; color:var(--muted)}
.cards{display:grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap:10px}
.card{padding:12px; border-radius:14px; border:1px solid rgba(36,50,70,.8); background: rgba(11,15,20,.55)}
.card .k{font-size:12px;color:var(--muted); margin-bottom:8px}
.card .v{font-family:var(--mono); font-size:18px; font-weight:900}
.card .s{margin-top:6px; font-size:12px; color:rgba(147,164,182,.9)}
.editTableWrap{overflow:auto; margin-top:10px}
.editTable{border-collapse:separate;border-spacing:0; width:100%; min-width:520px}
.editTable th,.editTable td{padding:10px; border-bottom:1px solid rgba(36,50,70,.55); text-align:left}
.editTable th{font-size:12px; color:var(--muted)}
.editTable td.right,.editTable th.right{text-align:right}
.editTable input{height:38px; border-radius:10px; padding:0 10px}
.iconBtn{height:38px; width:38px; border-radius:10px; border:1px solid rgba(36,50,70,.9);
  background: rgba(248,113,113,.10); color: var(--text); cursor:pointer; font-weight:900}
.trendGrid{display:grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap:10px; margin-top:10px}
.trendCard{padding:12px; border-radius:14px; border:1px solid rgba(36,50,70,.8); background: rgba(11,15,20,.55)}
.spark{width:100%; height:70px; margin-top:10px; border-radius:12px; border:1px solid rgba(36,50,70,.7); background: rgba(17,24,38,.55)}
.footer{padding:14px 12px 18px; color:rgba(147,164,182,.75); font-size:12px; text-align:center}
.banner{
  position:sticky; top:72px; z-index:20;
  margin:10px auto 0; max-width:1100px;
  padding:10px 12px; border-radius:14px;
  border:1px solid rgba(129 248 113 / 55%);
  background: rgba(132 255 165 / 10%); color: rgba(232,238,246,.95);
}
.banner.hidden{display:none}
/* workbook viewer extras */
.filters{margin-top:12px; padding:12px; border-radius: var(--radius); background: rgba(17,24,38,.65); border:1px solid rgba(36,50,70,.7)}
.filters.hidden{display:none}
.filtersGrid{display:grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap:10px; margin-top:10px}
.tableWrap{margin-top:12px; border-radius: var(--radius); background: rgba(17,24,38,.65); border:1px solid rgba(36,50,70,.7); overflow:hidden}
.tableMeta{display:flex; gap:10px; align-items:center; flex-wrap:wrap; padding:10px 12px; border-bottom:1px solid rgba(36,50,70,.7)}
.pill{display:inline-flex; align-items:center; gap:8px; padding:6px 10px; border-radius:999px; border:1px solid rgba(36,50,70,.9); background: rgba(11,15,20,.65); font-size:12px; color:var(--muted)}
.tableScroller{overflow:auto; max-height:55vh}
table{border-collapse:separate;border-spacing:0; width:max-content; min-width:100%}
thead th{position:sticky; top:0; background: rgba(11,15,20,.92); border-bottom:1px solid rgba(36,50,70,.9); font-size:12px; color:var(--muted); padding:10px 10px; white-space:nowrap; cursor:pointer}
tbody td{border-bottom:1px solid rgba(36,50,70,.55); font-size:13px; padding:10px 10px; white-space:nowrap; max-width:320px; overflow:hidden; text-overflow:ellipsis}
tbody tr:hover{background: rgba(96,165,250,.08)}
.detail{position:fixed; left:0; right:0; bottom:0; max-height:78vh; background: rgba(11,15,20,.92); border-top:1px solid rgba(36,50,70,.9); padding:12px; border-top-left-radius:22px; border-top-right-radius:22px; z-index:50}
.detail.hidden{display:none}
.detailBody{margin-top:10px; display:grid; gap:10px; overflow:auto; max-height: calc(78vh - 58px)}
.kv{padding:10px 12px; border-radius:14px; border:1px solid rgba(36,50,70,.8); background: rgba(17,24,38,.72)}
.k{font-size:12px;color:var(--muted); margin-bottom:6px}
.v{font-family:var(--mono); font-size:13px; white-space:pre-wrap; word-break:break-word}
/* modal */
.modal::backdrop{background: rgba(0,0,0,.6)}
.modal{border:none; padding:0; background:transparent}
.modalCard{width:min(520px, 92vw); border-radius:18px; border:1px solid rgba(36,50,70,.9); background: rgba(11,15,20,.95); padding:14px; color:var(--text); box-shadow: var(--shadow)}
.modalActions{display:flex; justify-content:flex-end; gap:10px; margin-top:12px}
