html,body {
  margin:0; padding:0;
  background:#1b1f22;
  color:#e9eef6; font-family:system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}
body {
  scrollbar-width:thin;
  scrollbar-color:rgba(110,150,210,0.55) rgba(10,16,26,0.7);
}
body.readme-open { overflow:hidden; }
#app { position:fixed; inset:0; }
.panel {
  position:absolute; left:16px; top:16px; width:360px;
  background:rgba(10,16,26,.85); border:1px solid #1b2a41; border-radius:12px; padding:14px;
  box-shadow:0 8px 24px rgba(0,0,0,.35); backdrop-filter:blur(6px);
  transition:transform .25s ease, opacity .25s ease;
}
.panel-head { display:flex; align-items:center; justify-content:space-between; gap:8px; }
.panel-title { display:flex; align-items:center; gap:10px; }
.panel-logo { width:48px; height:auto; object-fit:contain; }
.panel h1 { font-size:16px; margin:0; color:#cfe3ff; font-weight:700; letter-spacing:.2px; }
.panel .panel-btn { margin-top:0; }
.panel.is-collapsed { transform:translateX(calc(-100% - 32px)); opacity:0; pointer-events:none; }
.panel-btn {
  padding:6px 10px;
  border:1px solid #2a3d5e;
  border-radius:6px;
  background:#0f1722;
  color:#cfe3ff;
  font-size:12px;
  cursor:pointer;
  transition:background .2s ease, border-color .2s ease;
}
.panel-btn.small { font-size:11px; padding:5px 9px; }
.panel-btn:hover { background:#152235; border-color:#395580; }
.panel-btn:focus-visible { outline:2px solid #59a7ff; outline-offset:2px; }
.panel-reveal {
  position:absolute;
  left:16px;
  top:16px;
  padding:6px 12px;
  border:1px solid #2a3d5e;
  border-radius:6px;
  background:#0f1722;
  color:#cfe3ff;
  font-size:12px;
  cursor:pointer;
  box-shadow:0 6px 16px rgba(0,0,0,.3);
  opacity:0;
  pointer-events:none;
  transition:opacity .2s ease;
}
.panel-reveal.visible {
  opacity:1;
  pointer-events:auto;
}
.panel-reveal:hover { background:#152235; border-color:#395580; }
.panel-reveal:focus-visible { outline:2px solid #59a7ff; outline-offset:2px; }
.sec { margin-top:10px; padding-top:8px; border-top:1px dashed #243955; }
.row { margin:10px 0; }
.row label { display:block; font-size:12px; margin-bottom:6px; color:#a9b7c7; }
input[type="range"] { width:100%; }
input[type="checkbox"] { transform: translateY(2px); }
.readout { font-size:12px; color:#d7e4ff; opacity:.9; margin-top:4px; }
.toggle-block { padding-top:8px; }
.toggle-row { margin:6px 0; font-size:13px; color:#b6c9e6; }
.toggle-row label { font-size:inherit; color:inherit; display:flex; align-items:center; gap:6px; }
.toggle-row input[type="checkbox"] { transform: translateY(1px); }
.right-stack {
  position:fixed; right:16px; top:16px; width:300px;
  display:flex; flex-direction:column; gap:12px;
  z-index:5;
}
.legend {
  width:100%;
  background:rgba(10,16,26,.75); border:1px solid #1b2a41; border-radius:12px; padding:12px;
}
.legend h2 { margin:0 0 8px; font-size:14px; color:#cfe3ff; }
.chip { display:inline-block; width:14px; height:14px; border-radius:3px; vertical-align:middle; margin-right:6px; }
.slice-pane {
  background:rgba(10,16,26,.75); border:1px solid #1b2a41; border-radius:12px; padding:12px;
  display:flex; flex-direction:column; gap:8px; align-items:center;
}
.slice-pane h2 { margin:0; font-size:14px; color:#cfe3ff; }
.slice-pane canvas { width:100%; aspect-ratio:1 / 1; border-radius:8px; background:#14181d; pointer-events:none; }
.slice-readout { font-size:12px; color:#d7e4ff; }
.score {
  margin-top:8px; background:#0f1722; border:1px solid #223554; border-radius:8px; padding:10px;
}
.bar { height:10px; width:100%; background:#142033; border-radius:6px; overflow:hidden; }
.bar > div { height:100%; width:0%; background:linear-gradient(90deg, #44ffa1, #ffd166); transition:width .25s ease; }
.big { font-weight:700; color:#e9fff1; }
.footer {
  position:fixed;
  right:16px;
  bottom:12px;
  font-size:11px;
  color:#8aa3c7;
  opacity:.9;
  text-align:right;
  line-height:1.4;
  pointer-events:auto;
}
.footer-actions { margin-bottom:6px; pointer-events:auto; }
.footer-actions .panel-btn { pointer-events:auto; }

.footer > div:not(.footer-actions) { pointer-events:none; }


.readme-overlay {
  position:fixed;
  inset:0;
  background:rgba(8,12,20,0.92);
  display:none;
  align-items:center;
  justify-content:center;
  z-index:20;
}

.readme-overlay.is-visible { display:flex; }

.readme-frame {
  position:relative;
  width:min(1100px, 90vw);
  height:min(90vh, 820px);
  border:1px solid #23344f;
  border-radius:16px;
  overflow:hidden;
  background:rgba(10,16,26,0.85);
  box-shadow:0 18px 40px rgba(0,0,0,0.45);
}

#readmeCanvas {
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  display:block;
  pointer-events:none;
}

.readme-content {
  position:relative;
  z-index:2;
  height:100%;
  display:flex;
  flex-direction:column;
  padding:18px 22px;
  overflow:hidden;
  color:#dfe8ff;
}

.readme-header {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-bottom:14px;
}

.readme-header h2 {
  margin:0;
  font-size:18px;
  color:#f4f7ff;
  letter-spacing:0.2px;
}

.readme-images {
  flex:1;
  overflow-y:auto;
  padding-right:12px;
  display:flex;
  flex-direction:column;
  gap:16px;
  scrollbar-width:thin;
  scrollbar-color:rgba(120,168,220,0.5) rgba(16,24,36,0.6);
}

.readme-images img {
  width:100%;
  border-radius:10px;
  border:1px solid rgba(180,200,240,0.2);
  background:rgba(8,12,20,0.4);
}

.readme-images::-webkit-scrollbar {
  width:8px;
}

.readme-images::-webkit-scrollbar-track {
  background:rgba(16,24,36,0.6);
  border-radius:10px;
}

.readme-images::-webkit-scrollbar-thumb {
  background:linear-gradient(180deg, rgba(132,194,255,0.7), rgba(96,142,196,0.7));
  border-radius:10px;
  border:1px solid rgba(22,32,48,0.65);
}

.readme-images::-webkit-scrollbar-thumb:hover {
  background:linear-gradient(180deg, rgba(162,217,255,0.85), rgba(116,162,216,0.85));
}
a, a:visited { color:#b9d3ff; text-decoration:none; border-bottom:1px dotted #5c7db3; }
body::-webkit-scrollbar {
  width:10px;
}

body::-webkit-scrollbar-track {
  background:rgba(10,16,26,0.7);
}

body::-webkit-scrollbar-thumb {
  background:linear-gradient(180deg, rgba(122,182,255,0.8), rgba(84,132,196,0.75));
  border-radius:12px;
  border:1px solid rgba(18,28,44,0.65);
}

body::-webkit-scrollbar-thumb:hover {
  background:linear-gradient(180deg, rgba(152,206,255,0.9), rgba(104,152,216,0.85));
}
