:root {
  --bg: #f2f3ef;
  --surface: #fbfcf8;
  --surface-2: #eef4f5;
  --ink: #172024;
  --muted: #5d6b70;
  --line: rgba(23, 32, 36, 0.16);
  --accent: #245e68;
  --accent-2: #7b4e2f;
  --good: #276749;
  --bad: #9b2c2c;
  --pending: #7b5b18;
  --shadow: 0 12px 34px rgba(23, 32, 36, 0.08);
  --font-body: "Avenir Next", "Segoe UI", Arial, sans-serif;
  --font-display: "Iowan Old Style", "Palatino Linotype", Georgia, serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
}

button,
input {
  font: inherit;
}

input {
  width: 100%;
  min-height: 30px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  padding: 0 10px;
}

.app-shell {
  width: min(1480px, calc(100% - 24px));
  margin: 0 auto;
  padding: 10px 0 16px;
}

.topbar,
.surface {
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.topbar {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 9px 14px;
  margin-bottom: 10px;
}

.eyebrow {
  margin: 0 0 2px;
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

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

h1 {
  margin-bottom: 0;
  font-family: var(--font-display);
  font-size: 1.55rem;
  line-height: 1;
}

h2 {
  margin-bottom: 4px;
  font-size: 0.95rem;
}

h3 {
  margin-bottom: 8px;
  font-size: 0.86rem;
  text-transform: uppercase;
  color: var(--accent);
}

p {
  color: var(--muted);
  font-size: 0.82rem;
}

.ux-nav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.ux-nav a,
.ghost-button {
  min-height: 30px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  text-decoration: none;
  cursor: pointer;
}

.ux-nav a {
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
}

.ux-nav a.is-active {
  background: var(--accent);
  color: #fff;
}

.ghost-button {
  padding: 0 12px;
}

.analyzer-grid {
  display: grid;
  grid-template-columns: minmax(300px, 390px) minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.surface {
  padding: 12px;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: start;
  margin-bottom: 8px;
}

.section-heading.compact {
  margin-bottom: 8px;
}

.input-surface {
  display: grid;
  gap: 8px;
}

.input-group {
  border: 1px solid var(--line);
  background: var(--surface-2);
  padding: 9px 10px;
}

.input-group label {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(120px, 160px);
  gap: 10px;
  align-items: center;
  margin-top: 6px;
}

.input-group span {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
}

.hero-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 8px;
}

.hero-metrics article,
.readout-card {
  border: 1px solid var(--line);
  background: #fff;
  padding: 10px;
}

.hero-metrics span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.hero-metrics strong {
  display: block;
  margin-top: 8px;
  font-size: clamp(1.25rem, 2.3vw, 1.9rem);
  line-height: 1;
}

.terminal-card {
  margin-bottom: 8px;
}

.metric-list {
  display: grid;
  gap: 6px;
}

.metric-list div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  border-top: 1px solid var(--line);
  padding-top: 6px;
  font-size: 0.86rem;
}

.metric-list span {
  color: var(--muted);
  min-width: 0;
  overflow-wrap: anywhere;
}

.metric-list strong {
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.projection-section {
  border: 1px solid var(--line);
  background: var(--surface-2);
  padding: 10px;
}

.projection-table {
  display: grid;
  grid-template-columns: minmax(90px, 0.8fr) repeat(2, minmax(130px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}

.projection-table > div,
.projection-table > strong {
  background: #fff;
  min-height: 30px;
  padding: 6px 8px;
  font-weight: 700;
  font-size: 0.86rem;
}

.projection-head {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
}

.verdict-badge {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  background: #fff;
  padding: 0 10px;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  white-space: nowrap;
}

.verdict-badge.is-good {
  border-color: rgba(39, 103, 73, 0.3);
  background: rgba(39, 103, 73, 0.12);
  color: var(--good);
}

.verdict-badge.is-watch {
  border-color: rgba(123, 91, 24, 0.3);
  background: rgba(123, 91, 24, 0.12);
  color: var(--pending);
}

.verdict-badge.is-bad {
  border-color: rgba(155, 44, 44, 0.3);
  background: rgba(155, 44, 44, 0.12);
  color: var(--bad);
}

@media (max-width: 980px) {
  .topbar,
  .section-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .analyzer-grid,
  .hero-metrics {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .input-group label,
  .metric-list div,
  .projection-table {
    grid-template-columns: 1fr;
  }
}
