:root {
  --bg-0: #040506;
  --bg-1: #0b0d12;
  --bg-2: #141820;
  --card: rgba(12, 15, 21, 0.88);
  --line: rgba(255, 255, 255, 0.16);
  --text: #f4f6f8;
  --muted: #9da5b3;
  --accent: #ff2f36;
  --accent-soft: rgba(255, 47, 54, 0.32);
  --ok: #7de3bf;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "IBM Plex Mono", monospace;
  color: var(--text);
  background: radial-gradient(80% 70% at 50% 20%, #20242e 0%, var(--bg-1) 34%, var(--bg-0) 100%);
}

.scene {
  min-height: 100vh;
  display: grid;
  justify-items: center;
  align-items: start;
  padding: 20px;
  position: relative;
}

.global-controls {
  width: min(1080px, 100%);
  display: flex;
  justify-content: flex-end;
  margin-bottom: 10px;
  z-index: 2;
}

.env-alert {
  width: min(1080px, 100%);
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 77, 87, 0.72);
  background: rgba(72, 10, 14, 0.62);
  color: #ffd8db;
  box-shadow: 0 0 24px rgba(255, 77, 87, 0.2);
  z-index: 2;
}

.env-alert-title {
  margin: 0 0 4px;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #ffd6d9;
}

.env-alert-sub {
  margin: 0 0 6px;
  font-size: 0.72rem;
  color: #ffb8bd;
}

.env-alert ul {
  margin: 0;
  padding-left: 18px;
  font-size: 0.72rem;
  line-height: 1.35;
}

.lang-switch {
  display: inline-flex;
  padding: 4px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(5, 7, 12, 0.72);
  gap: 4px;
}

.lang-btn {
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 5px 10px;
  background: transparent;
  color: #c5cedd;
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  cursor: pointer;
}

.lang-btn.active {
  background: rgba(255, 77, 87, 0.28);
  border-color: rgba(255, 77, 87, 0.8);
  color: #fff4f5;
}

.ambient {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(35% 40% at 55% 15%, rgba(255, 47, 54, 0.18), transparent 60%),
    radial-gradient(25% 30% at 65% 65%, rgba(255, 47, 54, 0.1), transparent 70%);
  pointer-events: none;
}

.phone {
  width: min(420px, 100%);
  border-radius: 34px;
  padding: 22px 18px 20px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: linear-gradient(180deg, rgba(2, 3, 7, 0.96), rgba(13, 16, 24, 0.94));
  box-shadow:
    0 30px 90px rgba(0, 0, 0, 0.7),
    inset 0 0 20px rgba(255, 255, 255, 0.04);
  position: relative;
  backdrop-filter: blur(8px);
}

.analysis-view {
  width: min(1080px, 100%);
  border-radius: 26px;
  padding: 20px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: linear-gradient(180deg, rgba(2, 3, 7, 0.97), rgba(10, 12, 18, 0.96));
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.65), inset 0 0 24px rgba(255, 255, 255, 0.03);
}

.analysis-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.analysis-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.analysis-brand {
  margin: 0;
  font-family: "Bebas Neue", sans-serif;
  font-size: 1.55rem;
  letter-spacing: 0.06em;
  color: #f4f7ff;
}

.analysis-brand span {
  color: #ff4d57;
}

.analysis-file {
  margin: 0;
  color: #ffb7bb;
  font-size: 0.75rem;
}

.analysis-new-btn {
  width: auto;
  min-width: 210px;
}

.analysis-hero {
  margin-bottom: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.05), rgba(20, 22, 30, 0.45));
}

.analysis-updated {
  margin: 0;
  color: #96a0af;
  font-size: 0.72rem;
}

.analysis-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.tab-btn {
  border: 1px solid rgba(255, 255, 255, 0.17);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: #d8deea;
  padding: 8px 12px;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: all 0.16s ease;
}

.tab-btn:hover {
  border-color: rgba(255, 77, 87, 0.6);
  color: #fff2f3;
}

.tab-btn.active {
  border-color: rgba(255, 77, 87, 0.9);
  background: rgba(255, 77, 87, 0.2);
  color: #fff6f7;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.quick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px;
}

.quick-card {
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  background: rgba(10, 12, 17, 0.7);
  padding: 8px;
}

.quick-meta {
  margin: 6px 0 0;
  color: #aeb8c9;
  font-size: 0.72rem;
}

.devlogs-actions {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

.devlogs-meta {
  margin: 0 0 8px;
  font-size: 0.72rem;
  color: #aeb8c9;
  white-space: pre-wrap;
}

.devlogs-output {
  margin: 0;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 10px;
  background: rgba(5, 7, 11, 0.72);
  color: #b7c2d4;
  min-height: 280px;
  max-height: 480px;
  overflow: auto;
  padding: 10px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.7rem;
  line-height: 1.35;
  white-space: pre-wrap;
}

.hero h1 {
  margin: 2px 0 6px;
  font-family: "Bebas Neue", sans-serif;
  letter-spacing: 1px;
  font-size: clamp(2.4rem, 5vw, 3rem);
  line-height: 1;
}

.hero-kicker {
  margin: 0 0 4px;
  color: #aeb6c2;
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.title-ai {
  color: var(--accent);
}

.tagline {
  margin: 0 0 12px;
  color: #ff777c;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.85rem;
  line-height: 1.3;
}

.wave-card {
  border-radius: 16px;
  border: 1px solid var(--line);
  background: linear-gradient(90deg, rgba(8, 8, 11, 1) 0%, rgba(18, 19, 27, 1) 55%, rgba(32, 11, 18, 1) 100%);
  padding: 8px;
  margin-bottom: 12px;
}

#waveCanvas {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 12px;
}

.consent {
  margin: 8px 0 12px;
  color: var(--muted);
  font-size: 0.74rem;
}

.consent input {
  margin-right: 8px;
  accent-color: var(--accent);
}

.ghost-suite {
  border-radius: 14px;
  border: 1px solid var(--line);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.1), rgba(130, 134, 143, 0.18));
  padding: 12px 12px 10px;
  margin-bottom: 12px;
}

.ghost-suite h2 {
  margin: 0 0 8px;
  font-size: 0.95rem;
  text-transform: uppercase;
}

.ghost-suite h2 span {
  color: var(--muted);
  font-size: 0.85rem;
}

.ghost-suite ul {
  margin: 0;
  padding: 0;
  list-style: none;
  color: #f2f4f9;
  line-height: 1.55;
  font-size: 0.88rem;
  filter: blur(2px);
  user-select: none;
}

.ghost-copy {
  margin: 8px 0 0;
  font-family: "Bebas Neue", sans-serif;
  letter-spacing: 0.04em;
  font-size: 1.2rem;
}

.loading {
  margin-bottom: 12px;
}

.loading-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: #cfd5df;
  margin-bottom: 6px;
}

.loading-bar {
  width: 100%;
  height: 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
}

.loading-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #ffffff, #ff4048);
  transition: width 0.2s linear;
}

.actions {
  display: grid;
  gap: 8px;
  margin-bottom: 10px;
}

.btn {
  width: 100%;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 11px 14px;
  font-family: "IBM Plex Mono", monospace;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: transform 0.16s ease, filter 0.16s ease;
  text-align: center;
}

.btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.1);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-primary {
  background: linear-gradient(90deg, #f8f9fd, #ff2f36);
  color: #05070a;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-outline {
  background: rgba(255, 47, 54, 0.11);
  border-color: rgba(255, 47, 54, 0.5);
  color: #ff8084;
}

.btn-pay {
  background: linear-gradient(90deg, #ff4b53, #d21c25);
  color: #fff;
}

.unlock {
  border: 1px solid rgba(255, 47, 54, 0.46);
  border-radius: 12px;
  padding: 10px;
  margin-bottom: 12px;
  background: rgba(255, 47, 54, 0.08);
}

.unlock p {
  margin: 0 0 8px;
  color: #ff9a9d;
}

.result {
  border: 1px solid rgba(125, 227, 191, 0.4);
  border-radius: 12px;
  padding: 10px;
  background: rgba(125, 227, 191, 0.05);
  margin-bottom: 10px;
}

.result h2 {
  margin: 0 0 8px;
  text-transform: uppercase;
  font-size: 0.95rem;
}

.result-lead {
  margin: 0 0 8px;
  color: #ffb0b2;
  font-size: 0.76rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-shadow: 0 0 12px rgba(255, 47, 54, 0.4);
}

.verdict {
  margin: 0 0 6px;
  font-family: "Bebas Neue", sans-serif;
  font-size: 2rem;
  letter-spacing: 0.04em;
}

.verdict.clean {
  color: #8ceec7;
}

.verdict.caution {
  color: #ffd166;
}

.verdict.toxic {
  color: #ff4d57;
}

.insight {
  margin: 0 0 10px;
  color: #d6dbe5;
  font-size: 0.85rem;
}

.vector {
  margin-bottom: 8px;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  background: linear-gradient(160deg, rgba(15, 19, 26, 0.8), rgba(12, 16, 22, 0.4));
}

.vector .label {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  color: #d4dae5;
  margin-bottom: 3px;
}

.meter {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
}

.meter-fill {
  height: 100%;
  background: linear-gradient(90deg, #a7f2d4, #ffd166, #ff4d57);
  box-shadow: 0 0 14px rgba(255, 77, 87, 0.35);
}

.evidence-list {
  margin: 6px 0 0;
  padding-left: 18px;
  color: #f2f4f8;
  font-size: 0.75rem;
  line-height: 1.35;
}

.evidence-list li {
  margin-bottom: 4px;
}

.evidence-empty {
  margin: 6px 0 0;
  color: #98a1b2;
  font-size: 0.72rem;
}

.tone-groups {
  margin-top: 8px;
  display: grid;
  gap: 6px;
}

.tone-group {
  padding: 7px 8px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(8, 10, 14, 0.55);
}

.tone-group-head {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  color: #d8deea;
  margin-bottom: 3px;
}

.tone-states {
  margin: 4px 0 0;
  font-size: 0.7rem;
  color: #aab4c6;
}

.speaker-split {
  margin-top: 8px;
  display: grid;
  gap: 6px;
}

.speaker-card {
  padding: 7px 8px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(10, 12, 17, 0.7);
}

.speaker-head {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  color: #e1e8f3;
  margin-bottom: 3px;
}

.behavior-matrix {
  border-color: rgba(255, 209, 102, 0.34);
  background: linear-gradient(160deg, rgba(30, 20, 8, 0.55), rgba(16, 10, 4, 0.35));
}

.context-grid {
  display: grid;
  gap: 6px;
  margin-top: 8px;
}

.context-row {
  padding: 7px 8px;
  border-radius: 8px;
  border: 1px solid rgba(255, 209, 102, 0.22);
  background: rgba(18, 13, 6, 0.45);
}

.context-head {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  color: #f8d99a;
  margin-bottom: 3px;
}

.hotspots-grid {
  display: grid;
  gap: 7px;
  margin-top: 10px;
}

.hotspot {
  padding: 8px;
  border-radius: 9px;
  border: 1px solid rgba(255, 209, 102, 0.18);
  background: rgba(9, 7, 4, 0.7);
}

.hotspot-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.72rem;
  color: #ffe2a8;
  margin-bottom: 4px;
}

.hotspot-copy {
  margin: 0 0 5px;
  font-size: 0.72rem;
  color: #d3d9e4;
  line-height: 1.35;
}

.hotspot-copy strong {
  color: #fff0d1;
}

.emotion-rows {
  margin-top: 6px;
  display: grid;
  gap: 5px;
}

.emotion-row {
  padding: 6px 7px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(6, 8, 12, 0.45);
}

.emotion-row-head {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  color: #dee4ee;
  margin-bottom: 3px;
}

.basis-block {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed rgba(255, 255, 255, 0.16);
}

.basis-title {
  margin: 0 0 6px;
  font-size: 0.72rem;
  color: #ffb7bb;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.status {
  min-height: 24px;
  color: #bbc3d0;
  font-size: 0.75rem;
  margin: 0 0 6px;
}

.legal {
  color: #808898;
  text-align: center;
  font-size: 0.62rem;
  letter-spacing: 0.05em;
}

.hidden {
  display: none !important;
}

@media (max-width: 420px) {
  .phone {
    border-radius: 24px;
    padding: 18px 14px 14px;
  }

  .analysis-view {
    border-radius: 16px;
    padding: 14px;
  }

  .analysis-top {
    flex-direction: column;
    align-items: flex-start;
  }

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

  .analysis-new-btn {
    width: 100%;
    min-width: 0;
  }

  .devlogs-actions {
    flex-direction: column;
  }
}
