:root {
  color-scheme: dark;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #090711;
  color: #f4efff;
  --surface: rgba(24, 18, 43, 0.68);
  --surface-soft: rgba(18, 12, 35, 0.58);
  --line: rgba(188, 154, 255, 0.18);
  --line-strong: rgba(210, 184, 255, 0.32);
  --text-muted: #b6aeca;
  --text-soft: #8f86a8;
  --cyan: #7ee7f2;
  --gold: #f0c878;
  --danger: #ff8c9d;
  --button-hover-shift: -0.6px;
  --button-hover-scale: 1.005;
  --button-hover-shadow: 0 3px 9px rgba(184, 140, 255, 0.14);
  --button-hover-brightness: 1.025;
  --glass-shadow: 0 24px 70px rgba(0, 0, 0, 0.36);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 1100px;
  min-height: 720px;
  background:
    radial-gradient(1200px 760px at 18% -12%, rgba(102, 73, 176, 0.28), transparent 58%),
    linear-gradient(145deg, #080610 0%, #130b24 42%, #080811 100%);
}

button {
  font: inherit;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  transform: translateY(0);
  will-change: transform;
  transition:
    transform 140ms ease,
    box-shadow 140ms ease,
    filter 140ms ease,
    border-color 140ms ease,
    background 140ms ease;
  border-color: rgba(184, 140, 255, 0.28);
}

button:enabled svg,
[role="button"]:enabled svg {
  transition: transform 140ms ease;
}

[role="button"],
button,
button.clickable,
button[data-clickable="true"] {
  cursor: pointer;
}

button:hover:not(:disabled):not([aria-disabled="true"]),
button:focus-visible:not(:disabled):not([aria-disabled="true"]),
[role="button"]:hover:not(:disabled):not([aria-disabled="true"]),
[role="button"]:focus-visible:not(:disabled):not([aria-disabled="true"]),
button.clickable:hover:not(:disabled):not([aria-disabled="true"]),
button.clickable:focus-visible:not(:disabled):not([aria-disabled="true"]),
button[data-clickable="true"]:hover:not(:disabled):not([aria-disabled="true"]),
button[data-clickable="true"]:focus-visible:not(:disabled):not([aria-disabled="true"]) {
  transform: translateY(var(--button-hover-shift)) scale(var(--button-hover-scale));
  filter: brightness(var(--button-hover-brightness)) saturate(1.02);
  box-shadow: var(--button-hover-shadow);
  border-color: rgba(214, 183, 255, 0.58);
  background-color: rgba(255, 255, 255, 0.03);
}

button:hover:not(:disabled):not([aria-disabled="true"])::before,
button:focus-visible:not(:disabled):not([aria-disabled="true"])::before,
[role="button"]:hover:not(:disabled):not([aria-disabled="true"])::before,
[role="button"]:focus-visible:not(:disabled):not([aria-disabled="true"])::before,
button.clickable:hover:not(:disabled):not([aria-disabled="true"])::before,
button.clickable:focus-visible:not(:disabled):not([aria-disabled="true"])::before,
button[data-clickable="true"]:hover:not(:disabled):not([aria-disabled="true"])::before,
button[data-clickable="true"]:focus-visible:not(:disabled):not([aria-disabled="true"])::before {
  opacity: 0.35;
  transform: scaleX(1);
}

button:not(:disabled):not([aria-disabled="true"])::before,
[role="button"]:not(:disabled):not([aria-disabled="true"])::before,
button.clickable:not(:disabled):not([aria-disabled="true"])::before,
button[data-clickable="true"]:not(:disabled):not([aria-disabled="true"])::before {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 8px;
  height: 1px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, rgba(214, 183, 255, 0.38), transparent);
  opacity: 0;
  transform: scaleX(0);
  transform-origin: center;
  transition:
    transform 160ms ease,
    opacity 160ms ease;
  pointer-events: none;
}

.scan-cta:hover:not(:disabled):not([aria-disabled="true"]),
.scan-cta:focus-visible:not(:disabled):not([aria-disabled="true"]),
.review-button:hover:not(:disabled):not([aria-disabled="true"]),
.review-button:focus-visible:not(:disabled):not([aria-disabled="true"]) {
  transform: translateY(var(--button-hover-shift)) scale(var(--button-hover-scale));
  filter: brightness(var(--button-hover-brightness));
  box-shadow: var(--button-hover-shadow);
}

button:hover:not(:disabled):not([aria-disabled="true"]) svg,
button:focus-visible:not(:disabled):not([aria-disabled="true"]) svg,
[role="button"]:hover:not(:disabled):not([aria-disabled="true"]) svg,
[role="button"]:focus-visible:not(:disabled):not([aria-disabled="true"]) svg,
button.clickable:hover:not(:disabled):not([aria-disabled="true"]) svg,
button.clickable:focus-visible:not(:disabled):not([aria-disabled="true"]) svg,
button[data-clickable="true"]:hover:not(:disabled):not([aria-disabled="true"]) svg,
button[data-clickable="true"]:focus-visible:not(:disabled):not([aria-disabled="true"]) svg {
  transform: translateX(0.6px);
}

button:active:not(:disabled):not([aria-disabled="true"]),
[role="button"]:active:not(:disabled):not([aria-disabled="true"]),
button.clickable:active:not(:disabled):not([aria-disabled="true"]),
button[data-clickable="true"]:active:not(:disabled):not([aria-disabled="true"]) {
  transform: translateY(0px) scale(0.999);
  filter: brightness(0.985);
  box-shadow: 0 2px 4px rgba(184, 140, 255, 0.12);
}

button:hover:not(:disabled):not([aria-disabled="true"])::after,
button:focus-visible:not(:disabled):not([aria-disabled="true"])::after,
[role="button"]:hover:not(:disabled):not([aria-disabled="true"])::after,
[role="button"]:focus-visible:not(:disabled):not([aria-disabled="true"])::after,
button.clickable:hover:not(:disabled):not([aria-disabled="true"])::after,
button.clickable:focus-visible:not(:disabled):not([aria-disabled="true"])::after,
button[data-clickable="true"]:hover:not(:disabled):not([aria-disabled="true"])::after,
button[data-clickable="true"]:focus-visible:not(:disabled):not([aria-disabled="true"])::after {
  opacity: 1;
  transform: translateX(120%);
}

button:not(:disabled):not([aria-disabled="true"])::after,
[role="button"]:not(:disabled):not([aria-disabled="true"])::after,
button.clickable:not(:disabled):not([aria-disabled="true"])::after,
button[data-clickable="true"]:not(:disabled):not([aria-disabled="true"])::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-120%);
  background: linear-gradient(120deg, transparent, rgba(255, 255, 255, 0.12), transparent);
  opacity: 0;
  pointer-events: none;
  transition:
    transform 260ms ease,
    opacity 260ms ease;
}

button:focus-visible:not(:disabled):not([aria-disabled="true"]),
[role="button"]:focus-visible:not(:disabled):not([aria-disabled="true"]),
button.clickable:focus-visible:not(:disabled):not([aria-disabled="true"]),
button[data-clickable="true"]:focus-visible:not(:disabled):not([aria-disabled="true"]) {
  outline: 0;
  border-color: rgba(214, 183, 255, 0.6);
}

.ghost-button,
.primary-button,
.scan-cta,
.stop-button,
.review-button,
.nav-item,
.mode-option {
  transition: transform 120ms ease, box-shadow 120ms ease, border-color 120ms ease, background 120ms ease;
}

.app-shell {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.035), transparent 24%),
    linear-gradient(180deg, rgba(184, 140, 255, 0.06), transparent 42%);
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 24px;
  border-right: 1px solid var(--line);
  background: rgba(13, 9, 25, 0.72);
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(22px);
  padding: 24px 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid rgba(216, 190, 255, 0.32);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(222, 197, 255, 0.18), rgba(126, 231, 242, 0.08)),
    rgba(23, 16, 43, 0.82);
  color: #f5eaff;
  box-shadow: 0 16px 38px rgba(68, 43, 142, 0.32);
  font-weight: 800;
}

.brand-title {
  font-size: 15px;
  font-weight: 800;
}

.brand-subtitle,
.muted {
  color: var(--text-soft);
  font-size: 12px;
}

.nav-list {
  display: grid;
  gap: 8px;
}

.nav-item,
.ghost-button,
.primary-button,
.mode-option {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: #eee8ff;
  cursor: pointer;
}

.nav-item {
  width: 100%;
  justify-content: flex-start;
  padding: 11px 12px;
  background: transparent;
}

.nav-item:hover:not(:disabled),
.nav-item.active {
  border-color: rgba(214, 183, 255, 0.28);
  background: linear-gradient(135deg, rgba(184, 140, 255, 0.18), rgba(126, 231, 242, 0.05));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.nav-item:hover:not(:disabled),
.nav-item:focus-visible:not(:disabled) {
  transform: translateY(var(--button-hover-shift)) scale(1.002);
}

.nav-item:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  color: #7f8ca0;
}

.safety-card {
  display: flex;
  gap: 10px;
  margin-top: auto;
  border: 1px solid rgba(126, 231, 242, 0.24);
  border-radius: 8px;
  background: rgba(22, 28, 48, 0.62);
  box-shadow: var(--glass-shadow);
  backdrop-filter: blur(18px);
  padding: 14px;
  color: var(--cyan);
}

.safety-card span {
  display: block;
  margin-top: 4px;
  color: #9eb6c3;
  font-size: 12px;
  line-height: 1.4;
}

.main-panel {
  padding: 26px;
  min-width: 0;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

.topbar h1 {
  max-width: 780px;
  margin: 4px 0 0;
  color: #fbf8ff;
  font-size: 30px;
  letter-spacing: 0;
  text-shadow: 0 18px 48px rgba(184, 140, 255, 0.25);
}

.eyebrow {
  margin: 0;
  color: var(--cyan);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar-status {
  max-width: 320px;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ghost-button,
.primary-button {
  height: 40px;
  padding: 0 14px;
}

.ghost-button {
  border-color: var(--line);
  background: rgba(28, 20, 51, 0.66);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(14px);
}

.ghost-button:hover:not(:disabled),
.ghost-button:focus-visible:not(:disabled) {
  transform: translateY(var(--button-hover-shift)) scale(var(--button-hover-scale));
  border-color: rgba(214, 183, 255, 0.45);
  box-shadow:
    0 2px 6px rgba(137, 91, 255, 0.09),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  background: rgba(56, 38, 103, 0.84);
}

.ghost-button.success {
  border-color: rgba(126, 242, 207, 0.54);
  background: rgba(29, 88, 79, 0.42);
  color: #bfffee;
  box-shadow:
    0 10px 28px rgba(53, 220, 187, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.primary-button {
  border-color: rgba(216, 183, 255, 0.62);
  background: linear-gradient(135deg, #d9c0ff 0%, #a983ff 48%, #7ee7f2 100%);
  box-shadow:
    0 16px 42px rgba(137, 91, 255, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.42);
  color: #10091d;
  font-weight: 800;
}

.primary-button:hover:not(:disabled),
.primary-button:focus-visible:not(:disabled) {
  transform: translateY(var(--button-hover-shift)) scale(var(--button-hover-scale));
  filter: brightness(1.05);
  box-shadow:
    0 3px 8px rgba(137, 91, 255, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.52);
}

.primary-button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 24px 0;
}

.metric,
.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.018)),
    var(--surface);
  box-shadow: var(--glass-shadow);
  backdrop-filter: blur(22px);
}

.metric {
  position: relative;
  overflow: hidden;
  padding: 16px;
}

.metric::before {
  content: "";
  position: absolute;
  inset: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  pointer-events: none;
}

.metric span,
.metric small {
  display: block;
  color: var(--text-soft);
  font-size: 12px;
}

.metric strong {
  display: block;
  margin: 8px 0 4px;
  color: #ffffff;
  font-size: 28px;
}

.content-grid {
  display: grid;
  gap: 14px;
}

.scan-layout {
  grid-template-columns: 1.3fr 1fr;
}

.panel {
  padding: 18px;
}

.panel.wide {
  grid-column: 1 / -1;
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}

.panel-heading h2 {
  margin: 3px 0 0;
  font-size: 18px;
}

.scan-badge {
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  padding: 6px 10px;
  color: var(--text-muted);
  font-size: 12px;
}

.scan-badge.live {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(126, 231, 242, 0.08);
  color: var(--cyan);
}

.timeline {
  display: grid;
  gap: 14px;
}

.timeline-item {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 12px;
}

.timeline-dot {
  width: 10px;
  height: 10px;
  margin-top: 5px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 22px rgba(126, 231, 242, 0.72);
}

.timeline-item p {
  margin: 4px 0;
  color: var(--text-muted);
}

.timeline-item span {
  color: var(--text-soft);
  font-size: 12px;
}

.mode-list {
  display: grid;
  gap: 10px;
}

.mode-option {
  align-items: flex-start;
  flex-direction: column;
  padding: 13px;
  background: rgba(21, 15, 40, 0.66);
  text-align: left;
}

.mode-option:hover:not(.selected):not(:disabled),
.mode-option:focus-visible:not(.selected):not(:disabled) {
  border-color: rgba(188, 154, 255, 0.32);
  transform: translateY(var(--button-hover-shift)) scale(1.002);
}

.mode-option.selected {
  border-color: rgba(126, 231, 242, 0.5);
  background: linear-gradient(135deg, rgba(126, 231, 242, 0.16), rgba(184, 140, 255, 0.16));
}

.mode-option span {
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.4;
}

.character-row,
.build-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
}

.character-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
  padding: 14px;
}

.character-card span,
.character-card small {
  display: block;
  margin-top: 6px;
  color: var(--text-soft);
}

.artifact-table {
  display: grid;
  gap: 8px;
}

.artifact-row {
  display: grid;
  grid-template-columns: 230px 1fr 160px 120px;
  gap: 12px;
  align-items: center;
  border: 1px solid rgba(188, 154, 255, 0.14);
  border-radius: 8px;
  background: rgba(13, 9, 26, 0.56);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  padding: 12px;
}

.artifact-row span,
.reason span {
  display: block;
  color: var(--text-soft);
  font-size: 12px;
}

.substats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.substats span {
  border: 1px solid rgba(188, 154, 255, 0.16);
  border-radius: 999px;
  background: rgba(37, 27, 66, 0.68);
  padding: 5px 8px;
}

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 30px;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 800;
}

.keep,
.specific {
  border: 1px solid rgba(157, 240, 212, 0.22);
  background: rgba(53, 205, 156, 0.14);
  color: #9df0d4;
}

.maybe {
  border: 1px solid rgba(240, 200, 120, 0.24);
  background: rgba(240, 200, 120, 0.14);
  color: var(--gold);
}

.trash {
  border: 1px solid rgba(255, 140, 157, 0.22);
  background: rgba(255, 140, 157, 0.12);
  color: var(--danger);
}

.review {
  border: 1px solid rgba(255, 184, 112, 0.24);
  background: rgba(255, 184, 112, 0.13);
  color: #ffbf82;
}

.score {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border: 1px solid rgba(214, 183, 255, 0.42);
  border-radius: 8px;
  background: linear-gradient(145deg, rgba(184, 140, 255, 0.22), rgba(126, 231, 242, 0.08));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
  color: #f1e7ff;
}

.build-card {
  min-height: 330px;
}

.build-copy,
.overlay-settings p,
.overlay-card p {
  color: var(--text-muted);
  line-height: 1.5;
}

.build-pieces {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.build-pieces div {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 4px 8px;
  border: 1px solid rgba(188, 154, 255, 0.16);
  border-radius: 8px;
  background: rgba(15, 10, 29, 0.46);
  padding: 9px;
}

.build-pieces small {
  grid-column: 2;
  color: var(--text-soft);
}

.warning-list {
  display: grid;
  gap: 6px;
  margin-top: 14px;
}

.warning-list span {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #ffbf82;
  font-size: 13px;
}

.overlay-settings {
  display: grid;
  max-width: 720px;
  gap: 14px;
}

.overlay-settings-copy {
  display: grid;
  gap: 4px;
  border: 1px solid rgba(126, 231, 242, 0.16);
  border-radius: 8px;
  background: rgba(126, 231, 242, 0.06);
  padding: 12px;
}

.overlay-settings-copy strong {
  color: var(--text);
}

.overlay-settings-copy span {
  color: var(--muted);
  font-size: 13px;
}

.overlay-root {
  display: flex;
  justify-content: flex-end;
  align-items: flex-start;
  min-height: 100vh;
  padding: 80px 48px;
  background: transparent;
}

.overlay-card {
  width: 360px;
  border: 1px solid rgba(214, 183, 255, 0.34);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.025)),
    rgba(17, 10, 34, 0.82);
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.45);
  padding: 18px;
  backdrop-filter: blur(12px);
}

.overlay-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.overlay-card-head h2 {
  margin: 2px 0 0;
  font-size: 19px;
}

.overlay-card-head > strong {
  display: grid;
  min-width: 50px;
  height: 50px;
  place-items: center;
  border: 1px solid rgba(126, 231, 242, 0.34);
  border-radius: 8px;
  background: rgba(126, 231, 242, 0.1);
  color: var(--cyan);
  font-size: 18px;
}

.overlay-artifact-mini,
.overlay-character-list {
  display: grid;
  gap: 4px;
  margin-top: 12px;
  border: 1px solid rgba(188, 154, 255, 0.14);
  border-radius: 8px;
  background: rgba(8, 6, 18, 0.38);
  padding: 10px;
}

.overlay-artifact-mini span,
.overlay-artifact-mini small,
.overlay-character-list span,
.overlay-card p {
  color: var(--muted);
  font-size: 12px;
}

.overlay-artifact-mini strong {
  color: var(--text);
}

.overlay-character-list {
  display: flex;
  flex-wrap: wrap;
}

.overlay-character-list span {
  border: 1px solid rgba(126, 231, 242, 0.22);
  border-radius: 999px;
  background: rgba(126, 231, 242, 0.08);
  padding: 5px 8px;
}

@media (max-width: 1180px) {
  .app-shell {
    grid-template-columns: 220px 1fr;
  }

  .artifact-row {
    grid-template-columns: 1fr;
  }
}
.capture-controls {
  display: grid;
  gap: 12px;
}

.capture-controls select {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(15, 10, 29, 0.78);
  color: #f4efff;
  padding: 0 12px;
  outline: none;
}

.capture-controls select:focus {
  border-color: rgba(126, 231, 242, 0.52);
  box-shadow: 0 0 0 3px rgba(126, 231, 242, 0.08);
}

.capture-actions {
  display: flex;
  gap: 10px;
}

.capture-controls p {
  margin: 0;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.45;
}

.capture-preview {
  display: grid;
  min-height: 158px;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(188, 154, 255, 0.16);
  border-radius: 8px;
  background: rgba(10, 7, 19, 0.64);
}

.capture-preview img {
  display: block;
  width: 100%;
  height: 100%;
  max-height: 260px;
  object-fit: contain;
}

.capture-preview span {
  color: var(--text-soft);
  font-size: 13px;
}

.bridge-status {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 800;
}

.bridge-status.connected {
  border: 1px solid rgba(157, 240, 212, 0.24);
  background: rgba(53, 205, 156, 0.14);
  color: #9df0d4;
}

.bridge-status.missing {
  border: 1px solid rgba(255, 140, 157, 0.24);
  background: rgba(255, 140, 157, 0.12);
  color: var(--danger);
}

.crop-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.crop-card {
  overflow: hidden;
  border: 1px solid rgba(188, 154, 255, 0.16);
  border-radius: 8px;
  background: rgba(15, 10, 29, 0.52);
}

.crop-card img {
  display: block;
  width: 100%;
  height: 82px;
  object-fit: contain;
  background: rgba(4, 3, 10, 0.74);
  border-bottom: 1px solid rgba(188, 154, 255, 0.12);
}

.crop-card div {
  padding: 8px;
}

.crop-card strong,
.crop-card span {
  display: block;
}

.crop-card strong {
  font-size: 12px;
}

.crop-card span {
  margin-top: 3px;
  color: var(--text-soft);
  font-size: 11px;
}

.capture-hint {
  border-left: 2px solid rgba(240, 200, 120, 0.42);
  padding-left: 10px;
  color: #f0c878 !important;
}

.ocr-panel {
  display: grid;
  gap: 8px;
  border: 1px solid rgba(126, 231, 242, 0.18);
  border-radius: 8px;
  background: rgba(8, 6, 18, 0.56);
  padding: 12px;
}

.ocr-row {
  display: grid;
  grid-template-columns: 132px 1fr;
  gap: 10px;
  border-top: 1px solid rgba(188, 154, 255, 0.12);
  padding-top: 8px;
}

.ocr-row span,
.ocr-row small {
  display: block;
}

.ocr-row span {
  color: #f4efff;
  font-size: 12px;
  font-weight: 800;
}

.ocr-row small {
  margin-top: 3px;
  color: var(--text-soft);
  font-size: 11px;
}

.ocr-row pre {
  margin: 0;
  white-space: pre-wrap;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 12px;
  line-height: 1.35;
}

.capture-debug {
  color: var(--text-soft) !important;
  font-size: 12px !important;
}

.parsed-panel {
  display: grid;
  gap: 10px;
  border: 1px solid rgba(126, 231, 242, 0.24);
  border-radius: 8px;
  background: rgba(126, 231, 242, 0.08);
  padding: 12px;
}

.parsed-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.parsed-heading span {
  color: var(--cyan);
  font-size: 12px;
  font-weight: 800;
}

.parsed-grid {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 7px 12px;
}

.parsed-grid span {
  color: var(--text-soft);
  font-size: 12px;
}

.parsed-grid strong {
  color: #f4efff;
  font-size: 12px;
}

.parsed-notes {
  display: grid;
  gap: 4px;
  border-top: 1px solid rgba(188, 154, 255, 0.14);
  padding-top: 8px;
}

.parsed-notes span {
  color: #f0c878;
  font-size: 12px;
}

.scanner-workbench {
  display: grid;
  gap: 14px;
  width: 100%;
  justify-self: stretch;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.018)),
    rgba(18, 12, 35, 0.7);
  box-shadow: var(--glass-shadow);
  backdrop-filter: blur(22px);
  padding: 18px;
}

.scanner-header,
.scanner-toolbar,
.scanner-status-row,
.result-heading,
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.scanner-header h2,
.modal-header h2 {
  margin: 3px 0 0;
  font-size: 22px;
}

.scanner-subcopy {
  margin: 8px 0 0;
  max-width: 620px;
  color: var(--text-soft);
  font-size: 13px;
  line-height: 1.5;
}

.scanner-header-pills {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.scanner-toolbar {
  align-items: flex-end;
  display: grid;
  grid-template-columns: minmax(320px, 1fr) auto;
  border: 1px solid rgba(188, 154, 255, 0.14);
  border-radius: 8px;
  background: rgba(10, 7, 20, 0.42);
  padding: 12px;
}

.source-select {
  display: grid;
  min-width: 0;
  gap: 6px;
}

.source-select span {
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 800;
}

.source-select select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(15, 10, 29, 0.78);
  color: #f4efff;
  padding: 0 12px;
  outline: none;
}

.source-select select:focus {
  border-color: rgba(126, 231, 242, 0.52);
  box-shadow: 0 0 0 3px rgba(126, 231, 242, 0.08);
}

.scanner-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.scanner-status-row {
  align-items: flex-start;
  color: var(--text-muted);
  font-size: 12px;
}

.scanner-status-row span:first-child {
  color: var(--cyan);
  font-weight: 800;
}

.bridge-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(255, 140, 157, 0.3);
  border-radius: 10px;
  background: rgba(255, 140, 157, 0.08);
  color: var(--danger);
  font-size: 13px;
  font-weight: 700;
  padding: 12px 14px;
}

.dev-toggle {
  opacity: 0.65;
}

.dev-toggle.active {
  opacity: 1;
  border-color: rgba(126, 231, 242, 0.5);
  color: var(--cyan);
}

.player-scan-card {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(15, 10, 29, 0.6);
  padding: 16px;
}

.player-scan-row {
  display: flex;
  align-items: end;
  flex-wrap: wrap;
  gap: 10px;
}

.player-scan-row .source-select {
  min-width: 260px;
  flex: 1;
}

.mini-config {
  display: grid;
  gap: 6px;
  width: 150px;
}

.mini-config span {
  color: var(--text-soft);
  font-size: 11px;
  font-weight: 800;
}

.mini-config input {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(15, 10, 29, 0.78);
  color: #f4efff;
  padding: 0 10px;
  outline: none;
}

.mini-config input:focus {
  border-color: rgba(126, 231, 242, 0.52);
  box-shadow: 0 0 0 3px rgba(126, 231, 242, 0.08);
}

.player-scan-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.learning-strip {
  display: grid;
  gap: 8px;
  border: 1px solid rgba(188, 154, 255, 0.14);
  border-radius: 8px;
  background: rgba(10, 7, 20, 0.36);
  padding: 10px 12px;
}

.learning-strip span {
  display: grid;
  gap: 3px;
  min-width: 0;
  color: var(--text-soft);
  font-size: 11px;
  font-weight: 700;
}

.learning-strip strong {
  color: #f4efff;
  font-size: 13px;
}

.learning-strip {
  grid-template-columns: auto auto 1fr;
  align-items: center;
  border-color: rgba(126, 231, 242, 0.18);
  background: rgba(126, 231, 242, 0.06);
}

.learning-strip small {
  color: var(--text-muted);
  font-size: 11px;
}

.runtime-pill {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(188, 154, 255, 0.22);
  background: rgba(15, 10, 29, 0.55);
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 900;
}

.runtime-pill.elevated {
  border-color: rgba(109, 244, 197, 0.36);
  background: rgba(33, 214, 155, 0.13);
  color: var(--mint);
}

.runtime-pill.standard {
  border-color: rgba(255, 207, 109, 0.3);
  background: rgba(255, 207, 109, 0.11);
  color: var(--warning);
}

.scan-cta {
  min-height: 44px;
  padding: 0 22px;
  font-size: 14px;
}

.stop-button {
  min-height: 44px;
  padding: 0 20px;
  border: 1px solid rgba(255, 140, 157, 0.5);
  border-radius: 10px;
  background: rgba(255, 140, 157, 0.14);
  color: var(--danger);
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
}

.stop-button:hover:not(:disabled):not([aria-disabled="true"]),
.stop-button:focus-visible:not(:disabled):not([aria-disabled="true"]) {
  transform: translateY(var(--button-hover-shift)) scale(var(--button-hover-scale));
  box-shadow: 0 3px 8px rgba(255, 140, 157, 0.12);
}

.player-status {
  margin: 0;
  color: var(--text-soft);
  font-size: 13px;
  line-height: 1.5;
}

.scanner-preflight {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.scanner-preflight div {
  min-height: 52px;
  display: grid;
  align-content: center;
  gap: 3px;
  border: 1px solid rgba(188, 154, 255, 0.16);
  border-radius: 8px;
  background: rgba(15, 10, 29, 0.34);
  padding: 9px 11px;
}

.scanner-preflight span {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 800;
}

.scanner-preflight strong {
  color: var(--text);
  font-size: 13px;
}

.scanner-preflight .ok {
  border-color: rgba(126, 242, 207, 0.28);
  background: rgba(33, 214, 155, 0.09);
}

.scanner-preflight .ok strong {
  color: var(--mint);
}

.scanner-preflight .blocked {
  border-color: rgba(255, 207, 109, 0.3);
  background: rgba(255, 207, 109, 0.1);
}

.scanner-preflight .blocked strong {
  color: var(--warning);
}

.player-progress {
  display: grid;
  gap: 8px;
}

.player-progress-bar {
  height: 8px;
  border-radius: 999px;
  background: rgba(188, 154, 255, 0.12);
  overflow: hidden;
}

.player-progress-bar div {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(126, 231, 242, 0.85), rgba(188, 154, 255, 0.9));
  transition: width 0.35s ease;
}

.player-progress-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  color: var(--text-muted);
  font-size: 12px;
}

.player-progress-stats strong {
  color: #f4efff;
}

.player-progress-stats .collection {
  margin-left: auto;
}

.dev-section {
  display: grid;
  gap: 10px;
  border: 1px dashed rgba(126, 231, 242, 0.25);
  border-radius: 12px;
  padding: 12px;
}

.dev-section-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.scanner-diagnostics-modal {
  width: min(1040px, 94vw);
}

.scanner-settings-modal {
  width: min(760px, 92vw);
}

.diagnostics-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.diagnostics-preflight {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.diagnostics-status {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border: 1px solid rgba(188, 154, 255, 0.14);
  border-radius: 8px;
  background: rgba(10, 7, 20, 0.36);
  padding: 10px 12px;
}

.artifact-result-card {
  display: grid;
  gap: 10px;
}

.artifact-result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.artifact-result-head .artifact-set {
  color: var(--cyan);
  font-size: 12px;
  font-weight: 800;
}

.quality-chip {
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  padding: 4px 10px;
  white-space: nowrap;
}

.quality-chip.good {
  background: rgba(157, 240, 212, 0.14);
  color: #9df0d4;
}

.quality-chip.mid {
  background: rgba(255, 214, 140, 0.14);
  color: #ffd68c;
}

.quality-chip.low {
  background: rgba(255, 140, 157, 0.14);
  color: var(--danger);
}

.artifact-slot {
  color: var(--text-muted);
  font-size: 12px;
}

.artifact-mainstat {
  display: flex;
  align-items: baseline;
  gap: 8px;
  border: 1px solid rgba(188, 154, 255, 0.16);
  border-radius: 10px;
  background: rgba(8, 6, 18, 0.42);
  padding: 10px 12px;
}

.artifact-mainstat span {
  color: var(--text-soft);
  font-size: 11px;
  font-weight: 800;
}

.artifact-mainstat strong {
  color: #f4efff;
  font-size: 15px;
}

.artifact-mainstat em {
  margin-left: auto;
  color: var(--cyan);
  font-size: 18px;
  font-style: normal;
  font-weight: 800;
}

.artifact-substats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.artifact-substats span {
  border: 1px solid rgba(188, 154, 255, 0.2);
  border-radius: 999px;
  background: rgba(188, 154, 255, 0.08);
  color: #e8defc;
  font-size: 12px;
  padding: 4px 10px;
}

.artifact-substats span.none {
  border-style: dashed;
  color: var(--text-muted);
}

.artifact-equipped {
  color: var(--text-muted);
  font-size: 12px;
}

.scan-summary-dev {
  margin: 0;
  color: var(--text-muted);
  font-size: 11px;
}

.auto-scan-strip {
  display: grid;
  grid-template-columns: 1fr repeat(8, auto auto);
  gap: 6px 8px;
  align-items: center;
  border: 1px solid rgba(126, 231, 242, 0.18);
  border-radius: 8px;
  background: rgba(126, 231, 242, 0.07);
  padding: 10px 12px;
}

.auto-scan-strip span {
  color: var(--cyan);
  font-size: 12px;
  font-weight: 800;
}

.auto-scan-strip strong {
  color: #f4efff;
  font-size: 13px;
}

.auto-scan-strip small {
  color: var(--text-soft);
  font-size: 11px;
}

.scan-config-strip {
  display: grid;
  grid-template-columns: 170px 170px minmax(0, 1fr);
  gap: 10px;
  align-items: end;
  border: 1px solid rgba(188, 154, 255, 0.14);
  border-radius: 8px;
  background: rgba(10, 7, 20, 0.36);
  padding: 12px;
}

.scan-config-strip label {
  display: grid;
  gap: 6px;
}

.scan-config-strip span {
  color: var(--text-soft);
  font-size: 11px;
  font-weight: 800;
}

.scan-config-strip input {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(15, 10, 29, 0.78);
  color: #f4efff;
  padding: 0 10px;
  outline: none;
}

.scan-config-strip input:focus {
  border-color: rgba(126, 231, 242, 0.52);
  box-shadow: 0 0 0 3px rgba(126, 231, 242, 0.08);
}

.scan-config-strip p {
  margin: 0;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.45;
}

.grid-detection-strip {
  display: grid;
  grid-template-columns: auto auto 1fr;
  gap: 8px;
  align-items: center;
  border: 1px solid rgba(157, 240, 212, 0.2);
  border-radius: 8px;
  background: rgba(157, 240, 212, 0.07);
  padding: 9px 12px;
  box-shadow: 0 0 0 1px rgba(126, 231, 242, 0.035) inset;
}

.grid-detection-strip span {
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 800;
}

.grid-detection-strip strong {
  color: #9df0d4;
  font-size: 13px;
}

.grid-detection-strip small {
  color: var(--text-muted);
  font-size: 11px;
}

.grid-detection-strip.missing {
  border-color: rgba(255, 140, 157, 0.24);
  background: rgba(255, 140, 157, 0.06);
}

.grid-detection-strip.missing strong {
  color: var(--danger);
}

.automation-log {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: start;
  border: 1px solid rgba(126, 231, 242, 0.2);
  border-radius: 8px;
  background: rgba(126, 231, 242, 0.06);
  padding: 8px 12px;
}

.automation-log-lines {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 118px;
  overflow-y: auto;
}

.automation-log span {
  color: var(--cyan);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.automation-log strong {
  color: #f4efff;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.scanner-main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
  gap: 14px;
  align-items: stretch;
}

.capture-stage-shell {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.capture-stage {
  display: grid;
  min-height: clamp(440px, 58vh, 700px);
  max-height: 720px;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(188, 154, 255, 0.16);
  border-radius: 8px;
  background: rgba(5, 4, 12, 0.72);
}

.capture-stage img {
  display: block;
  width: auto;
  height: auto;
  max-width: min(100%, 980px);
  max-height: min(100%, 680px);
  object-fit: contain;
}

.capture-stage-meta {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.capture-stage-meta div {
  display: grid;
  gap: 3px;
  border: 1px solid rgba(188, 154, 255, 0.14);
  border-radius: 8px;
  background: rgba(8, 6, 18, 0.34);
  padding: 10px 12px;
}

.capture-stage-meta span {
  color: var(--text-soft);
  font-size: 11px;
  font-weight: 800;
}

.capture-stage-meta strong {
  color: #f4efff;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.empty-stage {
  display: grid;
  place-items: center;
  gap: 8px;
  color: var(--text-soft);
  text-align: center;
}

.empty-stage strong {
  color: #f4efff;
}

.scanner-result-panel {
  display: grid;
  align-content: start;
  max-width: 360px;
  gap: 12px;
  border: 1px solid rgba(126, 231, 242, 0.18);
  border-radius: 8px;
  background: rgba(126, 231, 242, 0.07);
  padding: 14px;
}

.result-heading h3 {
  margin: 3px 0 0;
  font-size: 18px;
}

.result-score {
  display: grid;
  width: 64px;
  height: 64px;
  place-items: center;
  border: 1px solid rgba(126, 231, 242, 0.4);
  border-radius: 8px;
  background: rgba(126, 231, 242, 0.1);
  color: var(--cyan);
  font-size: 20px;
  font-weight: 900;
}

.result-empty {
  margin: 0;
  color: var(--text-muted);
  line-height: 1.5;
}

.scanner-result-brief {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.scanner-result-brief span {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid rgba(188, 154, 255, 0.14);
  border-radius: 999px;
  background: rgba(8, 6, 18, 0.38);
  color: var(--text-soft);
  font-size: 11px;
  font-weight: 800;
}

.scanner-result-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.scanner-result-caption {
  margin: 0;
  color: var(--text-soft);
  font-size: 11px;
  line-height: 1.45;
}

.parsed-grid.compact {
  grid-template-columns: 74px 1fr;
}

.parsed-notes.compact {
  border-top: 0;
  padding-top: 0;
}

.field-confidence-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.field-confidence {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 6px;
  align-items: center;
  border: 1px solid rgba(188, 154, 255, 0.14);
  border-radius: 8px;
  background: rgba(8, 6, 18, 0.42);
  padding: 7px 8px;
}

.field-confidence span,
.field-confidence small {
  color: var(--text-soft);
  font-size: 10px;
}

.field-confidence strong {
  font-size: 12px;
}

.field-confidence small {
  grid-column: 1 / -1;
  text-transform: uppercase;
}

.field-confidence.high strong {
  color: #9df0d4;
}

.field-confidence.medium strong {
  color: #f0c878;
}

.field-confidence.low {
  border-color: rgba(255, 140, 157, 0.28);
}

.field-confidence.low strong {
  color: var(--danger);
}

.review-button {
  justify-content: center;
  width: 100%;
}

.review-status {
  margin: 0;
  color: var(--text-soft);
  font-size: 11px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  background: rgba(4, 3, 10, 0.72);
  padding: 28px;
}

.modal-panel {
  display: grid;
  width: min(980px, 94vw);
  max-height: 88vh;
  overflow: hidden;
  border: 1px solid rgba(214, 183, 255, 0.3);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.02)),
    rgba(14, 9, 29, 0.96);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.52);
}

.modal-header {
  border-bottom: 1px solid rgba(188, 154, 255, 0.14);
  padding: 16px;
}

.modal-body {
  display: grid;
  gap: 14px;
  overflow: auto;
  padding: 16px;
}

.details-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.details-grid .crop-card img {
  height: 132px;
  object-fit: contain;
}

.review-queue-modal {
  width: min(860px, calc(100vw - 72px));
}

.review-queue-summary {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(126, 231, 242, 0.18);
  border-radius: 8px;
  background: rgba(126, 231, 242, 0.06);
  padding: 10px 12px;
}

.review-queue-summary strong {
  color: var(--cyan);
  font-size: 22px;
}

.review-analysis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.review-analysis div {
  display: grid;
  gap: 4px;
  border: 1px solid rgba(188, 154, 255, 0.14);
  border-radius: 8px;
  background: rgba(15, 10, 29, 0.42);
  padding: 10px;
}

.review-analysis span {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 800;
}

.review-analysis strong {
  min-width: 0;
  color: var(--text);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.review-sample-list {
  display: grid;
  gap: 10px;
}

.review-sample-card {
  display: grid;
  gap: 10px;
  border: 1px solid rgba(188, 154, 255, 0.16);
  border-radius: 8px;
  background: rgba(12, 8, 25, 0.72);
  padding: 12px;
}

.review-sample-head,
.review-sample-meta,
.review-sample-parsed,
.review-sample-ocr {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
}

.review-sample-head {
  justify-content: space-between;
}

.review-sample-head div {
  display: grid;
  gap: 3px;
}

.review-sample-head strong {
  color: var(--text);
}

.review-sample-head span,
.review-sample-head time,
.review-sample-meta span,
.review-sample-parsed span,
.review-sample-ocr span {
  color: var(--muted);
  font-size: 12px;
}

.review-sample-parsed strong {
  color: var(--text);
  font-size: 13px;
}

.empty-stage.compact {
  min-height: 180px;
}

@media (max-width: 1024px) {
  .scanner-main-grid {
    grid-template-columns: 1fr;
  }

  .scanner-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .scanner-actions {
    justify-content: flex-start;
  }

  .scan-config-strip {
    grid-template-columns: 1fr 1fr;
  }

  .scan-config-strip p {
    grid-column: 1 / -1;
  }

  .capture-stage-meta {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.capture-stage img {
  max-height: 640px;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.modal-backdrop {
  align-items: center;
  justify-items: center;
  overflow: hidden;
}

.modal-panel {
  width: min(900px, calc(100vw - 72px));
  max-height: min(760px, calc(100vh - 72px));
  grid-template-rows: auto minmax(0, 1fr);
}

.scan-summary-backdrop {
  position: fixed !important;
  inset: 0 !important;
  z-index: 999;
  display: grid;
  place-items: center;
  width: 100vw;
  height: 100vh;
  padding: 24px;
}

.scan-summary-modal {
  display: grid;
  gap: 16px;
  width: min(520px, calc(100vw - 48px));
  max-height: calc(100vh - 48px);
  overflow: auto;
  border: 1px solid rgba(214, 183, 255, 0.32);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.025)),
    rgba(15, 10, 30, 0.97);
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.55);
  padding: 22px;
}

.scan-summary-icon {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  border: 1px solid rgba(126, 231, 242, 0.34);
  border-radius: 8px;
  background: rgba(126, 231, 242, 0.1);
  color: var(--cyan);
}

.scan-summary-modal h2 {
  margin: 4px 0 0;
  color: #f4efff;
  font-size: 24px;
}

.scan-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.scan-summary-grid div {
  display: grid;
  gap: 4px;
  border: 1px solid rgba(188, 154, 255, 0.16);
  border-radius: 8px;
  background: rgba(8, 6, 18, 0.42);
  padding: 10px;
}

.scan-summary-grid strong {
  color: var(--cyan);
  font-size: 22px;
}

.scan-summary-grid span,
.scan-summary-copy {
  color: var(--text-soft);
  font-size: 12px;
  line-height: 1.45;
}

.scan-summary-copy {
  margin: 0;
}

.modal-body {
  min-height: 0;
  overscroll-behavior: contain;
}

.details-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (max-width: 900px) {
  .modal-panel {
    width: calc(100vw - 32px);
    max-height: calc(100vh - 32px);
  }

  .details-grid {
    grid-template-columns: 1fr;
  }
}

