:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #080a0d;
  color: #f5f7fa;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 20% 10%, rgba(239, 35, 60, 0.08), transparent 28rem),
    radial-gradient(circle at 80% 0%, rgba(37, 99, 235, 0.09), transparent 30rem),
    #080a0d;
}

button,
textarea,
select,
input {
  font: inherit;
}

.shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 56px 0 72px;
}

.hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 30px;
}

.eyebrow,
.kicker {
  margin: 0 0 8px;
  color: #99a3b3;
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.14em;
}

h1 {
  margin: 0;
  font-size: clamp(34px, 5vw, 62px);
  line-height: 0.98;
  letter-spacing: -0.055em;
}

h2 {
  margin: 0;
  font-size: 22px;
  letter-spacing: -0.025em;
}

.sub {
  max-width: 690px;
  margin: 16px 0 0;
  color: #aeb6c4;
  line-height: 1.65;
}

.badge {
  border: 1px solid #2b313b;
  border-radius: 999px;
  padding: 8px 12px;
  color: #c6ccd6;
  background: #11151a;
  font-size: 13px;
}

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

.panel {
  border: 1px solid #20252d;
  border-radius: 20px;
  padding: 22px;
  background: rgba(15, 18, 23, 0.9);
  box-shadow: 0 22px 80px rgba(0, 0, 0, 0.24);
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}

label {
  display: block;
  margin-bottom: 8px;
  color: #bbc2ce;
  font-size: 13px;
  font-weight: 650;
}

textarea,
select,
input {
  width: 100%;
  border: 1px solid #2a3039;
  border-radius: 12px;
  outline: none;
  background: #0b0e12;
  color: #f6f8fb;
}

textarea {
  resize: vertical;
  min-height: 160px;
  padding: 14px;
  line-height: 1.55;
}

textarea:focus,
select:focus,
input:focus {
  border-color: #535d6c;
}

.row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 14px;
}

.field {
  margin: 0;
}

.field span {
  display: block;
  margin-bottom: 7px;
}

select,
input {
  height: 42px;
  padding: 0 11px;
}

.actions {
  display: flex;
  gap: 10px;
  margin-top: 18px;
}

button {
  border: 0;
  border-radius: 12px;
  padding: 11px 15px;
  cursor: pointer;
  font-weight: 750;
}

button:disabled {
  cursor: default;
  opacity: 0.45;
}

.primary {
  background: #f3f5f8;
  color: #090b0e;
}

.secondary {
  border: 1px solid #2c323b;
  background: #15191f;
  color: #eef1f5;
}

.pill {
  border-radius: 999px;
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 750;
}

.pill.neutral {
  background: #1b2027;
  color: #a9b1bd;
}

.pill.good {
  background: rgba(22, 163, 74, 0.15);
  color: #73e69a;
}

.pill.bad {
  background: rgba(239, 35, 60, 0.14);
  color: #ff8493;
}

.canvas-wrap {
  display: grid;
  min-height: 420px;
  place-items: center;
  overflow: auto;
  border: 1px solid #20252d;
  border-radius: 16px;
  padding: 18px;
  background:
    linear-gradient(45deg, #10141a 25%, transparent 25%) 0 0 / 16px 16px,
    linear-gradient(-45deg, #10141a 25%, transparent 25%) 0 0 / 16px 16px,
    linear-gradient(45deg, transparent 75%, #10141a 75%) 0 0 / 16px 16px,
    linear-gradient(-45deg, transparent 75%, #10141a 75%) 0 0 / 16px 16px,
    #0c0f13;
}

canvas {
  display: block;
  max-width: 100%;
  height: auto;
  image-rendering: pixelated;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  overflow: hidden;
  margin: 16px 0 0;
  border: 1px solid #20252d;
  border-radius: 14px;
  background: #20252d;
}

.stats div {
  padding: 12px;
  background: #101419;
}

.stats dt {
  margin-bottom: 5px;
  color: #7f8998;
  font-size: 11px;
}

.stats dd {
  margin: 0;
  color: #f5f7fa;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
}

.drop {
  display: grid;
  min-height: 150px;
  place-items: center;
  align-content: center;
  gap: 7px;
  border: 1px dashed #363d48;
  border-radius: 16px;
  padding: 18px;
  text-align: center;
  cursor: pointer;
  background: #0b0e12;
}

.drop input {
  display: none;
}

.drop strong {
  color: #f3f5f8;
  font-size: 15px;
}

.drop span {
  max-width: 480px;
  color: #7e8795;
  line-height: 1.5;
  font-size: 12px;
}

.scan-result {
  margin-top: 14px;
  border-radius: 14px;
  padding: 14px;
  background: #0c1014;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.scan-result.empty {
  color: #747e8c;
}

.scan-result.good {
  border: 1px solid rgba(22, 163, 74, 0.25);
  color: #dff9e7;
}

.scan-result.bad {
  border: 1px solid rgba(239, 35, 60, 0.25);
  color: #ffdce1;
}

.info-panel p:not(.kicker) {
  color: #a7afbb;
  line-height: 1.7;
}

.info-panel .warning {
  border-left: 3px solid #e3ad36;
  padding-left: 12px;
  color: #d6c89e;
}

.error {
  margin-top: 14px;
  border: 1px solid rgba(239, 35, 60, 0.22);
  border-radius: 12px;
  padding: 12px;
  background: rgba(239, 35, 60, 0.08);
  color: #ffb0ba;
}

.hidden {
  display: none;
}

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

  .hero {
    align-items: flex-start;
  }
}

@media (max-width: 560px) {
  .shell {
    width: min(100% - 20px, 1180px);
    padding-top: 30px;
  }

  .row,
  .stats {
    grid-template-columns: 1fr 1fr;
  }

  .actions {
    flex-direction: column;
  }

  .canvas-wrap {
    min-height: 300px;
  }
}

.row.three {
  grid-template-columns: repeat(3, 1fr);
}

.camera-panel {
  min-width: 0;
}

.camera-stage {
  position: relative;
  overflow: hidden;
  min-height: 300px;
  border: 1px solid #20252d;
  border-radius: 16px;
  background: #05070a;
}

.camera-stage video {
  display: block;
  width: 100%;
  min-height: 300px;
  max-height: 520px;
  object-fit: cover;
  background: #05070a;
}

.camera-guide {
  position: absolute;
  inset: 12%;
  pointer-events: none;
}

.camera-guide span {
  position: absolute;
  width: 42px;
  height: 42px;
  border-color: rgba(255,255,255,.8);
}

.camera-guide span:nth-child(1) {
  top: 0;
  left: 0;
  border-top: 2px solid;
  border-left: 2px solid;
}

.camera-guide span:nth-child(2) {
  top: 0;
  right: 0;
  border-top: 2px solid;
  border-right: 2px solid;
}

.camera-guide span:nth-child(3) {
  bottom: 0;
  left: 0;
  border-bottom: 2px solid;
  border-left: 2px solid;
}

.camera-guide span:nth-child(4) {
  right: 0;
  bottom: 0;
  border-right: 2px solid;
  border-bottom: 2px solid;
}

.camera-note {
  margin: 12px 0 0;
  color: #7e8795;
  font-size: 12px;
  line-height: 1.55;
}

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

.feature-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px 24px;
}

.feature-grid p {
  margin: 0;
}

.feature-grid strong {
  color: #edf1f6;
}

@media (max-width: 860px) {
  .row.three,
  .feature-grid {
    grid-template-columns: 1fr;
  }
}

.tabs {
  display: inline-flex;
  gap: 6px;
  margin: 0 0 18px;
  padding: 5px;
  border: 1px solid #20252d;
  border-radius: 14px;
  background: #0d1116;
}

.tab {
  border: 1px solid transparent;
  background: transparent;
  color: #8f99a8;
  padding: 9px 13px;
}

.tab.active {
  border-color: #2c333d;
  background: #171c23;
  color: #f4f6f8;
}

.tab-view[hidden] {
  display: none !important;
}

.camera-page {
  display: grid;
  place-items: start center;
}

.camera-only {
  width: min(820px, 100%);
}

.camera-only .camera-stage {
  min-height: 440px;
}

.camera-only .camera-stage video {
  min-height: 440px;
  max-height: 680px;
}

@media (max-width: 560px) {
  .tabs {
    display: flex;
    width: 100%;
  }

  .tab {
    flex: 1;
    padding-inline: 8px;
  }

  .camera-only .camera-stage,
  .camera-only .camera-stage video {
    min-height: 320px;
  }
}

.benchmark-page {
  display: grid;
  place-items: start center;
}

.benchmark-panel {
  width: min(1060px, 100%);
}

.benchmark-intro,
.benchmark-note {
  color: #9aa4b3;
  line-height: 1.65;
}

.benchmark-controls {
  max-width: 520px;
}

.benchmark-panel h3 {
  margin: 28px 0 10px;
  font-size: 14px;
  color: #dbe1e9;
  letter-spacing: 0.01em;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid #20252d;
  border-radius: 14px;
}

.benchmark-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
  background: #0c1014;
}

.benchmark-table th,
.benchmark-table td {
  padding: 11px 12px;
  border-bottom: 1px solid #1d232b;
  text-align: left;
  white-space: nowrap;
  font-size: 12px;
}

.benchmark-table th {
  color: #828d9d;
  background: #10151b;
  font-weight: 750;
}

.benchmark-table td {
  color: #e4e9ef;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.benchmark-table tr:last-child td {
  border-bottom: 0;
}

.benchmark-table .muted-cell {
  color: #7d8795;
  font-family: inherit;
}

.benchmark-note code {
  color: #e8edf3;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

/* --------------------------------------------------------------------------
   Render-style controls + responsive refinements
   -------------------------------------------------------------------------- */

html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

.shell,
.grid,
.panel,
.tab-view,
.camera-page,
.benchmark-page,
.benchmark-panel,
.table-wrap {
  min-width: 0;
}

.badge {
  display: inline-flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.badge span + span::before {
  content: "·";
  margin-right: 8px;
  color: #606a78;
}

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

.style-hint {
  margin: 10px 0 0;
  color: #747f8f;
  font-size: 12px;
  line-height: 1.55;
}

.benchmark-panel {
  width: 100%;
  max-width: 1060px;
}

.table-wrap {
  width: 100%;
  max-width: 100%;
}

.benchmark-controls {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: min(100%, 520px);
}

@media (max-width: 860px) {
  .shell {
    width: min(100% - 24px, 1180px);
    padding-top: 32px;
  }

  .hero {
    flex-direction: column;
    gap: 18px;
  }

  .hero > div:first-child {
    width: 100%;
  }

  .sub {
    max-width: 100%;
  }

  .badge {
    align-self: flex-start;
  }

  .tabs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
    gap: 4px;
  }

  .tab {
    min-width: 0;
    padding: 10px 8px;
    font-size: 13px;
    white-space: nowrap;
  }

  .benchmark-page,
  .camera-page {
    display: block;
  }

  .benchmark-panel,
  .camera-only {
    width: 100%;
    max-width: 100%;
  }
}

@media (max-width: 820px) {
  .shell {
    width: min(100% - 20px, 1180px);
    padding: 24px 0 44px;
  }

  .hero {
    margin-bottom: 22px;
  }

  .eyebrow,
  .kicker {
    font-size: 11px;
    letter-spacing: 0.12em;
  }

  h1 {
    font-size: clamp(42px, 14vw, 56px);
  }

  h2 {
    font-size: 21px;
    line-height: 1.2;
  }

  .sub {
    margin-top: 14px;
    font-size: 15px;
    line-height: 1.6;
  }

  .badge {
    gap: 6px;
    padding: 7px 10px;
    font-size: 12px;
  }

  .badge span + span::before {
    margin-right: 6px;
  }

  .tabs {
    margin-bottom: 14px;
    padding: 4px;
    border-radius: 13px;
  }

  .tab {
    min-height: 42px;
    border-radius: 10px;
    font-size: 12.5px;
  }

  .grid {
    gap: 12px;
  }

  .panel {
    padding: 16px;
    border-radius: 16px;
  }

  .panel-head {
    align-items: flex-start;
    flex-wrap: wrap;
    margin-bottom: 16px;
  }

  .panel-head .pill {
    max-width: 100%;
  }

  textarea {
    min-height: 140px;
    padding: 12px;
    font-size: 15px;
  }

  .generator-options,
  .row.three,
  .benchmark-controls,
  .feature-grid {
    grid-template-columns: 1fr;
  }

  .row {
    gap: 10px;
  }

  select {
    height: 44px;
  }

  .actions {
    width: 100%;
    flex-direction: column;
  }

  .actions button {
    width: 100%;
    min-height: 44px;
  }

  .canvas-wrap {
    min-height: 260px;
    padding: 12px;
  }

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

  .stats div {
    min-width: 0;
    padding: 10px;
  }

  .stats dd {
    overflow-wrap: anywhere;
    font-size: 12px;
  }

  .drop {
    min-height: 130px;
    padding: 16px;
  }

  .camera-only .camera-stage,
  .camera-only .camera-stage video {
    min-height: 0;
  }

  .camera-stage {
    min-height: 0;
    aspect-ratio: 3 / 4;
  }

  .camera-stage video {
    min-height: 0;
    height: 100%;
    max-height: none;
  }

  .benchmark-intro,
  .benchmark-note {
    font-size: 13px;
    line-height: 1.6;
  }

  .benchmark-panel h3 {
    margin-top: 24px;
  }

  /* On phones benchmark rows become readable cards instead of forcing the
     entire page wider than the viewport. */
  .table-wrap {
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: transparent;
  }

  .benchmark-table {
    min-width: 0;
    width: 100%;
    background: transparent;
  }

  .benchmark-table thead {
    display: none;
  }

  .benchmark-table tbody {
    display: grid;
    gap: 10px;
  }

  .benchmark-table tr {
    display: grid;
    overflow: hidden;
    border: 1px solid #20252d;
    border-radius: 13px;
    background: #0c1014;
  }

  .benchmark-table td {
    display: flex;
    min-width: 0;
    align-items: baseline;
    justify-content: space-between;
    gap: 14px;
    padding: 10px 12px;
    border-bottom: 1px solid #1d232b;
    white-space: normal;
    text-align: right;
    overflow-wrap: anywhere;
  }

  .benchmark-table td::before {
    content: attr(data-label);
    flex: 0 0 auto;
    color: #7f8998;
    font-family: Inter, ui-sans-serif, system-ui, sans-serif;
    font-size: 11px;
    font-weight: 750;
    text-align: left;
  }

  .benchmark-table tr td:last-child {
    border-bottom: 0;
  }

  .benchmark-table td[colspan] {
    display: block;
    text-align: left;
  }

  .benchmark-table td[colspan]::before {
    display: none;
  }

  .benchmark-note code {
    overflow-wrap: anywhere;
  }
}

@media (max-width: 390px) {
  .shell {
    width: min(100% - 16px, 1180px);
  }

  .panel {
    padding: 14px;
  }

  .tab {
    padding-inline: 5px;
    font-size: 11.5px;
  }

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

.security-box {
  margin-top: 16px;
  border: 1px solid #252c35;
  border-radius: 14px;
  padding: 14px;
  background: #0b0e12;
}

.security-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.security-head .kicker {
  margin-bottom: 4px;
}

.security-head strong {
  font-size: 14px;
}

.security-badge {
  border: 1px solid #303844;
  border-radius: 999px;
  padding: 5px 8px;
  color: #aeb8c7;
  font-size: 11px;
  white-space: nowrap;
}

.security-fields {
  margin-top: 12px;
}

button.compact {
  margin-top: 10px;
  padding: 8px 11px;
  font-size: 12px;
}

.decrypt-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  margin-top: 12px;
}

.decrypt-controls button {
  align-self: end;
}

.decrypt-label {
  margin: 10px 0 0;
  color: #9ca6b5;
  font-size: 12px;
}

.security-meta {
  margin-top: 6px;
  color: #9aa5b5;
  font-size: 12px;
}

@media (max-width: 560px) {
  .decrypt-controls {
    grid-template-columns: 1fr;
  }
}


.secure-scan-note {
  margin: 14px 0;
  padding: 12px 14px;
  border: 1px solid #2b313b;
  border-radius: 12px;
  background: #11151a;
  font-size: 0.9rem;
  line-height: 1.5;
  color: #aeb6c4;
}

.scan-result.secure-locked {
  border-style: dashed;
}
