:root {
  --r33-cyan: #72d9ff;
  --r33-gold: #f0ca68;
  --r33-panel: rgba(5, 12, 18, .96);
  --r33-line: rgba(114, 217, 255, .32);
}

details > summary {
  position: relative;
  padding-left: 1.55rem !important;
  cursor: pointer;
  list-style: none;
}

details > summary::-webkit-details-marker { display: none; }

details > summary::before {
  content: "▶";
  position: absolute;
  left: .35rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--r33-gold);
  font-size: .78rem;
  filter: drop-shadow(0 0 6px rgba(240, 202, 104, .55));
}

details[open] > summary::before { content: "▼"; }

.r33-section {
  margin-top: 1rem;
  border: 1px solid var(--r33-line);
  background: linear-gradient(145deg, rgba(7, 19, 28, .97), rgba(3, 7, 11, .98));
  box-shadow: inset 0 0 0 1px rgba(240, 202, 104, .08), 0 18px 42px rgba(0,0,0,.22);
}

.r33-section > summary {
  min-height: 3.25rem;
  display: flex;
  align-items: center;
  gap: .65rem;
  color: var(--r33-gold);
  font-weight: 800;
  letter-spacing: .04em;
}

.r33-body { padding: .9rem; }
.r33-note { color: #aebfc8; font-size: .8rem; line-height: 1.5; }
.r33-alert { border-left: 3px solid var(--r33-gold); padding: .7rem .8rem; background: rgba(240,202,104,.07); }
.r33-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
.r33-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.r33-card { border: 1px solid rgba(240,202,104,.28); padding: .75rem; background: rgba(3,8,12,.76); min-width: 0; }
.r33-card h3, .r33-card h4 { margin-top: 0; }

.r33-table-wrap { width: 100%; overflow: auto; max-height: 34rem; border: 1px solid rgba(114,217,255,.2); }
.r33-table { width: 100%; min-width: 1080px; border-collapse: collapse; font-size: .73rem; }
.r33-table th, .r33-table td { padding: .48rem .52rem; border: 1px solid rgba(114,217,255,.14); vertical-align: middle; text-align: left; }
.r33-table th { position: sticky; top: 0; z-index: 3; background: #0b1720; color: var(--r33-gold); white-space: nowrap; }
.r33-table th[data-sort] { cursor: pointer; }
.r33-table th[data-sort]::after { content: " ⇅"; color: var(--r33-cyan); }
.r33-table tbody tr:hover { background: rgba(114,217,255,.06); }
.r33-table .number { text-align: right; font-variant-numeric: tabular-nums; }

.r33-planet-thumb {
  width: 112px;
  height: 68px;
  border: 1px solid rgba(114,217,255,.34);
  background-image: linear-gradient(135deg, #0a1721, #03070c);
  background-size: 500% 400%;
  background-position: var(--atlas-x) var(--atlas-y);
  background-repeat: no-repeat;
  box-shadow: inset 0 0 20px rgba(0,0,0,.35);
  transform: scale(var(--planet-scale, 1));
  transform-origin: center;
}

.r33-toolbar { display: flex; flex-wrap: wrap; align-items: end; gap: .55rem; margin: .65rem 0; }
.r33-toolbar label { display: grid; gap: .25rem; min-width: 180px; font-size: .72rem; }
.r33-toolbar input, .r33-toolbar select { width: 100%; }
.r33-kpis { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: .45rem; margin: .6rem 0; }
.r33-kpis span { display: grid; gap: .12rem; padding: .55rem; border: 1px solid rgba(240,202,104,.22); background: rgba(0,0,0,.2); }
.r33-kpis b { color: var(--r33-gold); }
.r33-kpis small { color: #aebfc8; }

.r33-world-display { min-height: 320px; max-height: 62vh; overflow: auto; border: 1px solid var(--r33-line); padding: .7rem; }
.r33-stage-list { display: grid; gap: .45rem; }
.r33-stage { display: grid; grid-template-columns: 92px 1fr auto; gap: .65rem; align-items: center; padding: .55rem; border: 1px solid rgba(114,217,255,.18); }
.r33-stage strong { color: var(--r33-gold); }
.r33-tech-visual { min-height: 260px; background: radial-gradient(circle at 50% 45%, rgba(114,217,255,.18), transparent 38%), linear-gradient(150deg,#07131c,#020507); display:grid; place-items:center; overflow:hidden; }
.r33-tech-ring { width: min(75%, 360px); aspect-ratio: 2.4/1; border: 12px solid rgba(240,202,104,.7); border-radius: 50%; box-shadow: 0 0 34px rgba(114,217,255,.4), inset 0 0 26px rgba(114,217,255,.25); transform: rotate(-9deg); animation: r33-spin 24s linear infinite; }
#r33ComponentCanvas { display: block; width: 100%; height: auto; margin-top: .7rem; border: 1px solid var(--r33-line); background: #020407; }
#r33ComponentCanvas[hidden] { display: none; }
@keyframes r33-spin { to { transform: rotate(351deg); } }
@media (prefers-reduced-motion: reduce) { .r33-tech-ring { animation: none; } }

.r33-investment-bands { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap:.45rem; }
.r33-investment-bands span { padding:.65rem; border:1px solid rgba(240,202,104,.3); text-align:center; }
.r33-investment-bands b { display:block; color:var(--r33-gold); }

.r33-admin-private { border-color: rgba(255,118,118,.35); }
.r33-admin-private [data-private-value] { font-family: ui-monospace, Consolas, monospace; color: var(--r33-gold); }
.r33-admin-private .r33-table { min-width: 760px; }
.r33-admin-private select, .r33-admin-private input { min-width: 120px; }

.r33-status { display:inline-flex; align-items:center; gap:.3rem; padding:.18rem .4rem; border:1px solid currentColor; border-radius:999px; font-size:.68rem; }
.r33-status.unknown { color:#b8c2c8; }
.r33-status.model { color:var(--r33-cyan); }
.r33-status.confirmed { color:#73e2a7; }

@media (max-width: 980px) {
  .r33-grid, .r33-grid.three { grid-template-columns: 1fr; }
  .r33-kpis { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .r33-investment-bands { grid-template-columns: 1fr; }
}

@media print {
  .r33-toolbar, button { display:none !important; }
  .r33-table-wrap { overflow:visible; max-height:none; }
  .r33-table { min-width:0; font-size:7pt; }
  details.r33-section { display:block; break-inside:avoid; }
  details.r33-section > * { display:block !important; }
}
