:root {
  --bg: #070807;
  --panel: #101310;
  --panel-soft: #161a16;
  --ink: #eef3ea;
  --muted: #a5b1a1;
  --line: #334033;
  --acid: #b7ff2a;
  --blue: #48c7ff;
  --red: #ff4d3f;
  --amber: #ffbd3e;
  --shadow: 0 22px 70px rgba(0, 0, 0, 0.48);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  overflow: hidden;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(183, 255, 42, 0.05) 1px, transparent 1px),
    linear-gradient(rgba(183, 255, 42, 0.045) 1px, transparent 1px),
    radial-gradient(circle at 72% 42%, rgba(72, 199, 255, 0.13), transparent 34%),
    var(--bg);
  background-size: 34px 34px, 34px 34px, auto, auto;
  font-family: "Bahnschrift", "Aptos", "Segoe UI", sans-serif;
}

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

.signal-shell {
  height: 100vh;
  padding: 10px;
  display: grid;
  grid-template-rows: 82px minmax(0, 1fr) 38px;
  gap: 8px;
}

.signal-header,
.safety-strip,
.entry-panel,
.radar-panel,
.queue-panel {
  border: 1px solid var(--line);
  background: rgba(16, 19, 16, 0.96);
  box-shadow: var(--shadow);
}

.signal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 12px 16px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--acid);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

h1,
h2 {
  margin: 0;
  line-height: 0.95;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(34px, 5vw, 58px);
}

h2 {
  font-size: clamp(20px, 2.5vw, 30px);
}

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

.language-switch {
  min-height: 34px;
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid var(--line);
  background: #090b09;
}

.language-switch button {
  min-width: 70px;
  border: 0;
  border-right: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  padding: 0 10px;
  font-size: 12px;
  font-weight: 950;
  cursor: pointer;
}

.language-switch button:last-child {
  border-right: 0;
}

.language-switch button.active {
  background: var(--acid);
  color: #071007;
}

.system-chip {
  min-height: 34px;
  display: inline-grid;
  place-items: center;
  padding: 0 12px;
  border: 1px solid var(--line);
  background: #090b09;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.system-chip.safe {
  color: #071007;
  background: var(--acid);
}

.signal-grid {
  min-height: 0;
  display: grid;
  grid-template-columns: 340px minmax(380px, 1fr) 380px;
  gap: 8px;
}

.entry-panel,
.radar-panel,
.queue-panel {
  min-height: 0;
  padding: 14px;
}

.entry-panel {
  display: grid;
  align-content: start;
  gap: 9px;
}

.panel-title {
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  background: #090b09;
  color: var(--ink);
  padding: 10px;
  outline: none;
}

textarea:focus,
select:focus {
  border-color: var(--acid);
  box-shadow: 0 0 0 3px rgba(183, 255, 42, 0.14);
}

.safety-message {
  margin: -2px 0 0;
  min-height: 28px;
  display: grid;
  align-items: center;
  border: 1px solid var(--line);
  padding: 6px 8px;
  font-size: 11px;
  font-weight: 900;
}

.demo-notice {
  margin: -2px 0 0;
  border: 1px solid rgba(255, 189, 62, 0.55);
  background: rgba(255, 189, 62, 0.1);
  color: #ffe7b4;
  padding: 7px 8px;
  font-size: 11px;
  font-weight: 900;
  line-height: 1.35;
}

.safety-message.safe {
  color: var(--acid);
  background: rgba(183, 255, 42, 0.08);
}

.safety-message.blocked {
  color: #ffe3df;
  border-color: rgba(255, 77, 63, 0.7);
  background: rgba(255, 77, 63, 0.16);
}

.form-row,
.slider-row,
.preset-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--acid);
}

.check-row {
  grid-template-columns: 18px 1fr;
  align-items: start;
  color: #d5dfcf;
  line-height: 1.35;
}

.check-row input {
  margin-top: 2px;
  accent-color: var(--acid);
}

#addSignal {
  min-height: 46px;
  border: 0;
  background: var(--acid);
  color: #071007;
  font-weight: 950;
  cursor: pointer;
}

#addSignal:disabled {
  cursor: not-allowed;
  background: #4a5147;
  color: #c2c9be;
}

#loadPreset {
  align-self: end;
  min-height: 42px;
  border: 1px solid var(--line);
  background: #090b09;
  color: var(--acid);
  font-weight: 950;
  cursor: pointer;
}

#loadPreset:hover {
  border-color: var(--acid);
}

.radar-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) 82px 112px;
  gap: 12px;
}

.radar-stage {
  position: relative;
  min-height: 0;
  overflow: hidden;
  border: 1px solid rgba(183, 255, 42, 0.32);
  background:
    radial-gradient(circle at center, rgba(183, 255, 42, 0.08), transparent 45%),
    #080a08;
}

.axis,
.ring {
  position: absolute;
  pointer-events: none;
}

.axis.horizontal {
  top: 50%;
  left: 0;
  right: 0;
  border-top: 1px solid rgba(183, 255, 42, 0.22);
}

.axis.vertical {
  top: 0;
  bottom: 0;
  left: 50%;
  border-left: 1px solid rgba(183, 255, 42, 0.22);
}

.ring {
  border: 1px solid rgba(183, 255, 42, 0.18);
  border-radius: 50%;
  inset: var(--inset);
}

.r1 {
  --inset: 12%;
}

.r2 {
  --inset: 25%;
}

.r3 {
  --inset: 38%;
}

.radar-point {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: var(--size);
  height: var(--size);
  border: 1px solid #061006;
  border-radius: 50%;
  background: var(--color);
  transform: translate(-50%, -50%);
  box-shadow: 0 0 22px var(--glow);
}

.radar-point::after {
  content: attr(data-label);
  position: absolute;
  left: 12px;
  top: -8px;
  width: 120px;
  color: var(--ink);
  font-size: 10px;
  font-weight: 900;
}

.verdict-strip {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.verdict-strip div {
  border: 1px solid var(--line);
  background: #090b09;
  padding: 12px;
}

.verdict-strip span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.verdict-strip strong {
  display: block;
  margin-top: 6px;
  color: var(--acid);
  font-size: 18px;
}

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

.review-card {
  min-height: 0;
  border: 1px solid var(--line);
  background: #090b09;
  padding: 10px;
}

.review-card strong {
  display: block;
  color: var(--amber);
  font-size: 12px;
  text-transform: uppercase;
}

.review-card p {
  margin: 6px 0 0;
  color: #dce5d8;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
}

.review-card.outcome {
  border-color: rgba(183, 255, 42, 0.58);
  background: linear-gradient(145deg, rgba(183, 255, 42, 0.12), #090b09);
}

.queue-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) 190px;
  gap: 12px;
}

.signal-list {
  min-height: 0;
  overflow: hidden;
  display: grid;
  align-content: start;
  gap: 8px;
}

.signal-card {
  border: 1px solid var(--line);
  background: #090b09;
  padding: 10px;
}

.signal-card header {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}

.signal-card strong {
  color: var(--acid);
  font-size: 12px;
}

.signal-card b {
  min-width: 38px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  color: var(--ink);
  padding: 4px 6px;
}

.signal-card p {
  margin: 0;
  color: #dce5d8;
  font-size: 12px;
  line-height: 1.35;
  font-weight: 700;
}

.signal-card footer {
  margin-top: 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.summary-panel {
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 8px;
  border: 1px solid var(--line);
  background: #090b09;
  padding: 10px;
}

.summary-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
}

.summary-head strong {
  color: var(--acid);
  font-size: 12px;
}

.summary-head span {
  color: var(--amber);
  font-size: 11px;
  font-weight: 950;
}

#copySummary {
  min-height: 0;
  resize: none;
  font-size: 12px;
  line-height: 1.45;
}

.safety-strip {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr);
  align-items: center;
  overflow: hidden;
}

.safety-strip span {
  height: 100%;
  display: grid;
  place-items: center;
  background: var(--red);
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
}

.safety-strip p {
  margin: 0;
  padding: 0 14px;
  color: #dce5d8;
  font-size: 13px;
  font-weight: 850;
}

@media (max-width: 1080px), (max-height: 720px) {
  body {
    overflow: auto;
  }

  .signal-shell {
    height: auto;
    min-height: 100vh;
  }

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

  .radar-stage {
    min-height: 420px;
  }
}

@media (max-width: 620px) {
  .signal-header,
  .form-row,
  .slider-row,
  .preset-row,
  .verdict-strip,
  .review-panel {
    grid-template-columns: 1fr;
  }

  .signal-header {
    display: grid;
  }
}
