:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  color: #fff4d6;
  background: #080d20;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-width: 320px; min-height: 100%; }
body {
  min-height: 100vh;
  background:
    radial-gradient(circle at 84% 4%, #315e7466, transparent 32rem),
    linear-gradient(145deg, #111934, #080d20 62%);
}
.masthead {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 28px;
  padding: clamp(22px, 4vw, 52px);
  border-bottom: 1px solid #fff4d626;
}
.eyebrow { color: #5dd6e8; letter-spacing: .16em; font-size: 10px; font-weight: 850; }
h1, h2, p { margin: 0; }
h1 { margin-top: 6px; font: clamp(32px, 5vw, 68px)/.95 Georgia, serif; }
.masthead p { max-width: 720px; margin-top: 15px; color: #b9cbd3; line-height: 1.55; }
.summary { min-width: 138px; padding: 16px 18px; border: 1px solid #5dd6e855; border-radius: 16px; background: #0e1735cc; }
.summary strong, .summary span { display: block; }
.summary strong { color: #5dd6e8; font-size: 30px; }
.summary span { color: #b9cbd3; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; }
.workspace { display: grid; grid-template-columns: minmax(250px, 330px) minmax(0, 1fr); gap: 20px; padding: 20px; min-height: 720px; }
.inventory, .viewer { border: 1px solid #fff4d626; border-radius: 20px; background: #10172fe0; box-shadow: 0 24px 70px #02061655; }
.inventory { padding: 16px; overflow: auto; }
.section-heading, .viewer-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.section-heading { margin-bottom: 14px; color: #dce7e8; font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.status { padding: 5px 8px; border-radius: 999px; font-size: 9px; }
.status.pending { color: #ffdd82; background: #674e1d66; }
.status.pass { color: #9df4c4; background: #1b674866; }
.status.fail { color: #ff9b9b; background: #67292966; }
.character-list { display: grid; gap: 10px; }
.character-card { width: 100%; min-height: 110px; padding: 14px; border: 1px solid #fff4d62d; border-radius: 14px; color: inherit; background: #172041; text-align: left; cursor: pointer; }
.character-card:hover, .character-card.active { border-color: #5dd6e8aa; background: #1d3150; }
.character-card strong, .character-card span { display: block; }
.character-card strong { font-size: 17px; }
.character-card span { margin-top: 7px; color: #aebfca; font-size: 11px; line-height: 1.4; }
.viewer { min-width: 0; padding: 18px; }
.viewer-bar { min-height: 58px; }
.viewer-bar h2 { margin-top: 4px; font: 26px/1.1 Georgia, serif; }
.open-lab { min-height: 42px; display: inline-flex; align-items: center; padding: 0 14px; border: 1px solid #fff4d64d; border-radius: 10px; color: #fff4d6; text-decoration: none; font-size: 12px; font-weight: 800; }
.audit-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 16px 0; }
.audit-grid div { min-width: 0; padding: 10px 12px; border-radius: 11px; background: #091027; }
.audit-grid span, .audit-grid strong { display: block; overflow: hidden; text-overflow: ellipsis; }
.audit-grid span { color: #8fa4b2; font-size: 9px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.audit-grid strong { margin-top: 4px; color: #ffdd82; font-size: 13px; white-space: nowrap; }
.audit-grid strong.pass { color: #9df4c4; }
.audit-grid strong.fail { color: #ff9b9b; }
.frame-shell { display: grid; grid-template-rows: minmax(0, 1fr) auto; height: min(660px, calc(100vh - 260px)); min-height: 480px; overflow: hidden; border: 1px solid #fff4d626; border-radius: 15px; background: #080d20; }
#lab-frame { width: 100%; height: 100%; min-height: 0; border: 0; display: block; }
.audit-message { max-width: none; padding: 9px 12px; border-top: 1px solid #fff4d633; background: #080d20; color: #b9cbd3; font: 11px/1.45 ui-monospace, monospace; pointer-events: none; }
.audit-message.pass { border-color: #48d89466; color: #9df4c4; }
.audit-message.fail { border-color: #ff666677; color: #ffb0b0; }
@media (max-width: 820px) {
  .masthead { align-items: start; flex-direction: column; }
  .workspace { grid-template-columns: 1fr; }
  .character-list { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
  .frame-shell { height: 650px; }
}
@media (max-width: 540px) {
  .masthead, .workspace { padding: 14px; }
  .workspace { gap: 12px; }
  .viewer { padding: 10px; }
  .viewer-bar { align-items: start; flex-direction: column; }
  .audit-grid { grid-template-columns: 1fr 1fr; }
  .frame-shell { min-height: 620px; }
}
