:root {
  color-scheme: dark;
  --black: #060706;
  --panel: #101510;
  --panel-2: #151b15;
  --green: #80d92f;
  --green-2: #a6ff45;
  --blue: #0b96ff;
  --white: #f7f7f1;
  --muted: #a9b3a2;
  --line: rgba(166, 255, 69, 0.22);
  --danger: #ff5a4d;
  font-family: Arial, Helvetica, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.82), rgba(0, 0, 0, 0.96)),
    radial-gradient(circle at 10% 0%, rgba(128, 217, 47, 0.22), transparent 30%),
    radial-gradient(circle at 95% 15%, rgba(11, 150, 255, 0.22), transparent 30%),
    #050605;
  color: var(--white);
}

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

.app-shell {
  min-height: 100dvh;
  padding: env(safe-area-inset-top) 14px calc(84px + env(safe-area-inset-bottom));
}

.topbar {
  align-items: center;
  display: grid;
  gap: 12px;
  grid-template-columns: 58px 1fr 44px;
  padding: 14px 0 10px;
}

.brand-mark {
  align-items: center;
  background: #dfe8d8;
  border: 3px solid var(--green);
  border-radius: 14px;
  display: flex;
  height: 58px;
  justify-content: center;
  overflow: hidden;
  width: 58px;
}

.brand-mark img {
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.brand-fallback {
  color: #0b0d0b;
  font-weight: 950;
  letter-spacing: 0;
}

.eyebrow,
.muted,
small {
  color: var(--muted);
}

.eyebrow {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  margin: 0 0 2px;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 22px;
  letter-spacing: 0;
}

h2 {
  font-size: 18px;
}

.icon-button,
.small-button,
.primary-action,
.save-button,
.nav-button {
  border: 0;
  cursor: pointer;
  font-weight: 900;
}

.icon-button {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--white);
  height: 44px;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

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

.status-strip div,
.command-panel,
.lead-card,
.job-card,
.target-card {
  background: linear-gradient(180deg, rgba(24, 31, 24, 0.96), rgba(9, 12, 9, 0.98));
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22);
}

.status-strip div {
  min-height: 78px;
  padding: 10px;
}

.status-strip span,
.status-strip small {
  display: block;
  font-size: 11px;
}

.status-strip strong {
  color: var(--green-2);
  display: block;
  font-size: 22px;
  line-height: 1.2;
  margin: 3px 0;
}

.command-panel {
  margin: 12px 0;
  padding: 14px;
}

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

.sticky-title {
  background: rgba(5, 6, 5, 0.9);
  padding: 10px 0;
  position: sticky;
  top: 0;
  z-index: 3;
}

.brief-output {
  color: #edf4e8;
  font-size: 14px;
  line-height: 1.48;
  margin-top: 10px;
  white-space: pre-wrap;
}

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

.primary-action,
.save-button {
  align-items: center;
  background: linear-gradient(135deg, var(--green), #4ba80e);
  border-radius: 8px;
  color: #071005;
  display: flex;
  justify-content: center;
  min-height: 48px;
  padding: 10px;
  text-align: center;
  text-decoration: none;
}

.small-button {
  background: #111811;
  border: 1px solid var(--green);
  border-radius: 8px;
  color: var(--green-2);
  min-height: 36px;
  padding: 7px 11px;
}

.wide {
  margin-top: 8px;
  width: 100%;
}

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

.lead-card,
.target-card {
  padding: 12px;
}

.lead-card h3,
.target-card h3 {
  font-size: 16px;
  margin: 0;
}

.badge {
  background: rgba(128, 217, 47, 0.14);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--green-2);
  display: inline-flex;
  font-size: 12px;
  font-weight: 900;
  padding: 5px 8px;
}

.lead-meta,
.target-card p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
  margin-top: 8px;
}

.progress-shell {
  background: #050805;
  border: 1px solid rgba(166, 255, 69, 0.2);
  border-radius: 999px;
  height: 12px;
  margin-top: 12px;
  overflow: hidden;
}

.progress-bar {
  background: linear-gradient(90deg, var(--green), var(--blue));
  height: 100%;
  min-width: 4px;
}

.stage-row {
  display: flex;
  gap: 6px;
  margin-top: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.stage-pill {
  background: #0c110c;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  color: var(--muted);
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 900;
  min-height: 34px;
  padding: 7px 10px;
}

.stage-pill.active {
  background: rgba(128, 217, 47, 0.18);
  border-color: var(--green);
  color: var(--green-2);
}

.card-actions {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 10px;
}

.card-actions a,
.card-actions button {
  align-items: center;
  background: #0c110c;
  border: 1px solid rgba(11, 150, 255, 0.34);
  border-radius: 8px;
  color: var(--white);
  display: flex;
  font-size: 13px;
  font-weight: 900;
  justify-content: center;
  min-height: 38px;
  padding: 8px;
  text-decoration: none;
}

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

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

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

input,
select,
textarea {
  background: #070a07;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  color: var(--white);
  min-height: 42px;
  padding: 10px;
  width: 100%;
}

textarea {
  min-height: 88px;
  resize: vertical;
}

.save-button {
  grid-column: 1 / -1;
}

.checklist {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.checklist label {
  align-items: center;
  background: #070a07;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: var(--white);
  display: flex;
  font-size: 14px;
  min-height: 44px;
  padding: 8px 10px;
}

.checklist input {
  min-height: auto;
  width: auto;
}

.script-box {
  font-size: 14px;
  line-height: 1.45;
  margin-top: 10px;
  min-height: 180px;
}

.bottom-nav {
  backdrop-filter: blur(12px);
  background: rgba(5, 7, 5, 0.92);
  border-top: 1px solid var(--line);
  bottom: 0;
  display: grid;
  gap: 4px;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  left: 0;
  padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
  position: fixed;
  right: 0;
}

.nav-button {
  background: transparent;
  border-radius: 8px;
  color: var(--muted);
  min-height: 44px;
}

.nav-button.active {
  background: rgba(128, 217, 47, 0.16);
  color: var(--green-2);
}

dialog {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--white);
  max-width: 420px;
  width: calc(100% - 28px);
}

dialog::backdrop {
  background: rgba(0, 0, 0, 0.68);
}

.settings-form {
  display: grid;
  gap: 12px;
}

.toast {
  background: var(--green);
  border-radius: 8px;
  bottom: 80px;
  color: #061006;
  font-weight: 900;
  left: 50%;
  opacity: 0;
  padding: 10px 14px;
  pointer-events: none;
  position: fixed;
  transform: translateX(-50%) translateY(12px);
  transition: 180ms ease;
  z-index: 20;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (min-width: 760px) {
  .app-shell {
    margin: 0 auto;
    max-width: 960px;
  }

  main {
    display: block;
  }

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