:root {
  --ink: #17212b;
  --muted: #66717d;
  --line: #d9e0e7;
  --paper: #f5f7f9;
  --panel: #ffffff;
  --green: #128c7e;
  --green-dark: #0b6f63;
  --blue: #285da8;
  --red: #b43a3a;
  --gold: #b98218;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--ink);
  background: var(--paper);
}

.public-page {
  min-height: 100vh;
  background: #f3f6f7;
}

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

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 24px;
  background: #0f1d2a;
  color: #fff;
}

.eyebrow {
  margin: 0 0 4px;
  color: #9bb6ca;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 26px;
}

h2 {
  margin-bottom: 0;
  font-size: 18px;
}

.top-actions,
.script-actions,
.filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.layout {
  display: grid;
  grid-template-columns: minmax(320px, 1.2fr) minmax(320px, 1fr) minmax(280px, 0.8fr);
  gap: 16px;
  padding: 16px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  min-width: 0;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.grid {
  display: grid;
  gap: 10px;
}

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

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

form {
  display: grid;
  gap: 10px;
}

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

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 11px;
  color: var(--ink);
  background: #fff;
  outline: none;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(18, 140, 126, 0.12);
}

button {
  min-height: 38px;
  border: 0;
  border-radius: 6px;
  padding: 9px 12px;
  cursor: pointer;
  font-weight: 700;
}

.primary {
  background: var(--green);
  color: #fff;
}

.primary:hover {
  background: var(--green-dark);
}

.ghost {
  background: #e7edf2;
  color: var(--ink);
}

.danger {
  background: #ffe7e7;
  color: var(--red);
}

.filter {
  min-width: 40px;
  min-height: 32px;
  padding: 6px 10px;
  background: #edf1f4;
  color: var(--muted);
}

.filter.active {
  background: var(--ink);
  color: #fff;
}

.score-pill,
.grade {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  height: 32px;
  border-radius: 999px;
  background: var(--green);
  color: #fff;
  font-weight: 800;
}

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

.stat {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px;
  background: #fbfcfd;
}

.stat span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.stat strong {
  font-size: 22px;
}

.lead-list {
  display: grid;
  gap: 10px;
  max-height: calc(100vh - 230px);
  overflow: auto;
  padding-right: 4px;
}

.lead-card {
  border: 1px solid var(--line);
  border-left: 5px solid var(--green);
  border-radius: 8px;
  padding: 12px;
  background: #fff;
  cursor: pointer;
}

.lead-card:hover {
  border-color: #aab7c4;
}

.lead-card.selected {
  outline: 3px solid rgba(18, 140, 126, 0.18);
}

.lead-card.grade-B {
  border-left-color: var(--blue);
}

.lead-card.grade-C {
  border-left-color: var(--gold);
}

.lead-card.grade-D {
  border-left-color: var(--red);
}

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

.lead-head strong {
  overflow-wrap: anywhere;
}

.lead-meta {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.mini-grade {
  min-width: 34px;
  height: 28px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #edf1f4;
  font-weight: 800;
}

.selected-lead {
  min-height: 54px;
  color: var(--muted);
  line-height: 1.45;
}

#scriptBox {
  min-height: 230px;
  margin: 12px 0;
}

.tip {
  margin-top: 16px;
  padding: 12px;
  border-radius: 8px;
  background: #eef6f4;
  color: #21473f;
  line-height: 1.45;
  font-size: 13px;
}

.tip p {
  margin-bottom: 0;
}

.public-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(320px, 0.9fr) minmax(320px, 1.1fr);
}

.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 36px;
  padding: 42px;
  color: #fff;
  background:
    linear-gradient(rgba(11, 24, 35, 0.72), rgba(11, 24, 35, 0.86)),
    url("https://images.unsplash.com/photo-1486262715619-67b85e0b08d3?auto=format&fit=crop&w=1400&q=80") center / cover;
}

.brand-mark {
  width: fit-content;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 6px;
  padding: 10px 14px;
  font-size: 20px;
  font-weight: 900;
}

.language-switch {
  display: flex;
  gap: 8px;
}

.lang-btn {
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.lang-btn.active {
  color: #0f1d2a;
  background: #fff;
}

.hero-copy {
  max-width: 600px;
}

.hero-copy h1 {
  margin-bottom: 16px;
  font-size: 46px;
  line-height: 1.05;
}

.hero-copy p {
  margin-bottom: 0;
  color: #d9e4ec;
  font-size: 18px;
  line-height: 1.5;
}

.hidden {
  display: none;
}

.intake {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 20px;
  padding: 38px;
  background: #fff;
}

#publicLeadForm {
  max-width: 680px;
}

.public-submit {
  min-height: 48px;
  font-size: 16px;
}

.trust-row {
  max-width: 680px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.trust-row span {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  border-radius: 6px;
  padding: 8px 10px;
  background: #eef6f4;
  color: #21473f;
  font-size: 13px;
  font-weight: 700;
}

.admin-link {
  position: fixed;
  right: 12px;
  bottom: 12px;
  color: rgba(15, 29, 42, 0.5);
  font-size: 12px;
  text-decoration: none;
}

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

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

@media (max-width: 760px) {
  .topbar,
  .layout {
    padding: 12px;
  }

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

  .layout,
  .two,
  .three {
    grid-template-columns: 1fr;
  }

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

  .lead-list {
    max-height: none;
  }

  .public-shell {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
    padding: 24px;
  }

  .hero-copy h1 {
    font-size: 34px;
  }

  .intake {
    min-height: auto;
    padding: 24px;
  }
}
