:root {
  --bg-dark: #262526;
  --bg-light: #ffffff;
  --text-dark: #262526;
  --text-light: #ffffff;
  --accent: #06d6a0;
  --accent-strong: #04b58a;
  --accent-soft: rgba(6, 214, 160, 0.12);
  --border: rgba(38, 37, 38, 0.14);
  --border-soft: rgba(38, 37, 38, 0.08);
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.18), 0 2px 4px -1px rgba(0, 0, 0, 0.12);
  --danger: #e63946;
  --warning: #b7791f;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Inter", sans-serif;
  background: var(--bg-dark);
  color: var(--text-light);
}

button,
input {
  font: inherit;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg-dark);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.topbar__inner,
.page {
  width: min(1100px, calc(100vw - 32px));
  margin: 0 auto;
}

.topbar__inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.brand__logo {
  display: block;
  width: auto;
  height: 30px;
}

.topbar__link {
  color: rgba(255, 255, 255, 0.72);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}

.topbar__link:hover {
  color: var(--text-light);
}

.page {
  padding: 48px 0 64px;
}

.hero {
  text-align: center;
  margin-bottom: 28px;
}

.hero__eyebrow,
.section-label {
  margin: 0 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
}

.hero h1 {
  margin: 0;
  font-size: clamp(32px, 5vw, 48px);
  line-height: 1.05;
  font-weight: 800;
}

.hero h1 span {
  color: var(--accent);
}

.hero__copy {
  width: min(720px, 100%);
  margin: 16px auto 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: 18px;
}

.glass-card {
  background: var(--bg-light);
  color: var(--text-dark);
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: var(--shadow);
  padding: 28px;
  margin-bottom: 24px;
}

.panel-header,
.lookup-row,
.action-row,
.footer-actions,
.app-summary,
.category-list {
  display: flex;
}

.app-summary {
  justify-content: space-between;
  gap: 18px;
}

.panel-header {
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}

.panel-header--tight {
  margin-bottom: 14px;
}

.panel-header h2,
.panel-header h3,
.app-summary h3 {
  margin: 0;
}

.progress-pill,
.meta-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 700;
}

.progress-pill--light {
  background: rgba(38, 37, 38, 0.06);
}

.progress-pill,
.meta-chip--accent {
  background: var(--accent-soft);
  color: var(--text-dark);
}

.lookup-row,
.footer-actions,
.action-row {
  gap: 14px;
  align-items: end;
}

.footer-actions {
  margin-top: 24px;
  padding-top: 8px;
}

.field {
  display: block;
  flex: 1;
}

.field__label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 600;
}

input {
  width: 100%;
  border: 1px solid rgba(0, 0, 0, 0.15);
  border-radius: 14px;
  padding: 16px 18px;
  color: var(--text-dark);
  background: #fff;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(6, 214, 160, 0.18);
}

.btn {
  border: 0;
  border-radius: 14px;
  padding: 16px 20px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.btn:hover:not(:disabled) {
  transform: translateY(-1px);
}

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

.btn-primary {
  background: var(--accent-strong);
  color: var(--text-light);
  box-shadow: 0 4px 12px rgba(6, 214, 160, 0.35);
}

.btn-secondary {
  background: rgba(38, 37, 38, 0.08);
  color: var(--text-dark);
}

.btn-success {
  background: #16a34a;
  color: var(--text-light);
  box-shadow: 0 4px 12px rgba(22, 163, 74, 0.28);
}

.status {
  margin: 18px 0 0;
  padding: 12px 14px;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 600;
}

.text-neutral {
  background: rgba(38, 37, 38, 0.06);
  color: rgba(38, 37, 38, 0.82);
}

.text-success {
  background: rgba(6, 214, 160, 0.12);
  color: #047857;
}

.text-warning {
  background: rgba(183, 121, 31, 0.12);
  color: var(--warning);
}

.text-danger {
  background: rgba(230, 57, 70, 0.12);
  color: var(--danger);
}

.app-summary {
  margin-top: 20px;
  padding: 18px;
  border-radius: 18px;
  background: rgba(38, 37, 38, 0.04);
  align-items: start;
}

.muted {
  color: rgba(38, 37, 38, 0.7);
}

.panel-copy {
  margin: 8px 0 0;
  color: rgba(38, 37, 38, 0.72);
  font-size: 14px;
}

.app-summary__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.meta-chip {
  flex-direction: column;
  align-items: start;
  border-radius: 16px;
  background: rgba(38, 37, 38, 0.06);
}

.meta-chip__label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(38, 37, 38, 0.62);
  margin-bottom: 4px;
}

.category-section {
  margin-top: 24px;
  padding-top: 22px;
  border-top: 1px solid var(--border-soft);
}

.category-list {
  flex-wrap: wrap;
  gap: 10px;
}

.category-option {
  position: relative;
}

.category-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.category-option span {
  display: inline-flex;
  align-items: center;
  padding: 11px 14px;
  border-radius: 999px;
  border: 1px solid rgba(38, 37, 38, 0.12);
  background: #fff;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.category-option input:checked + span {
  background: var(--accent-soft);
  border-color: rgba(6, 214, 160, 0.45);
}

.category-action-row {
  display: block;
  margin-top: 32px;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border-soft);
  border-radius: 20px;
}

.table-wrap--step7-scroll {
  max-height: 780px;
  overflow-y: auto;
}

.results-table {
  width: 100%;
  border-collapse: collapse;
}

.results-table thead {
  background: rgba(38, 37, 38, 0.05);
}

.table-wrap--step7-scroll .results-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
}

.results-table th,
.results-table td {
  padding: 16px 18px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid rgba(38, 37, 38, 0.08);
}

.results-table th {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.results-table tbody tr:hover {
  background: rgba(38, 37, 38, 0.03);
}

.app-link {
  color: inherit;
  font-weight: 700;
  text-decoration: none;
}

.app-link:hover {
  color: var(--accent-strong);
  text-decoration: underline;
}

.checkbox-cell input {
  width: 18px;
  height: 18px;
}

.rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  padding: 6px 8px;
  border-radius: 999px;
  background: rgba(38, 37, 38, 0.06);
  font-weight: 700;
}

.match-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.match-chip {
  display: inline-flex;
  align-items: center;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(6, 214, 160, 0.12);
  font-size: 12px;
  font-weight: 700;
}

.similar-list {
  display: grid;
  gap: 12px;
}

.ranked-list,
.keyword-list {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
}

.similar-card {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 16px 18px;
  border: 1px solid var(--border-soft);
  border-radius: 18px;
  background: rgba(38, 37, 38, 0.03);
}

.similar-card__main {
  display: grid;
  gap: 6px;
}

.similar-card__title {
  color: var(--text-dark);
}

.similar-card__subtitle {
  color: rgba(38, 37, 38, 0.7);
  font-size: 14px;
}

.keyword-card {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 14px 16px;
  border: 1px solid var(--border-soft);
  border-radius: 16px;
  background: rgba(38, 37, 38, 0.03);
}

.ranked-card {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 16px 18px;
  border: 1px solid var(--border-soft);
  border-radius: 18px;
  background: rgba(38, 37, 38, 0.03);
}

.ranked-card__main {
  display: grid;
  gap: 8px;
  width: 100%;
}

.ranked-card__header {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}

.ranked-card__subtitle {
  color: rgba(38, 37, 38, 0.7);
  font-size: 14px;
}

.keyword-card strong {
  font-size: 15px;
}

.keyword-meta {
  display: grid;
  gap: 10px;
  margin-top: 18px;
  margin-bottom: 18px;
}

.step3-explainer {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: rgba(38, 37, 38, 0.82);
}

.step3-app-copy {
  display: grid;
  gap: 4px;
  padding: 14px 16px;
  border: 1px solid var(--border-soft);
  border-radius: 16px;
  background: rgba(38, 37, 38, 0.03);
}

@media (max-width: 720px) {
  .topbar__inner {
    gap: 12px;
    flex-wrap: wrap;
  }

  .brand__logo {
    height: 24px;
  }
}

.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.footer-actions--tight {
  justify-content: flex-start;
}

.section-break {
  margin-top: 26px;
}

.three-up-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.subcard {
  border: 1px solid var(--border-soft);
  border-radius: 18px;
  background: rgba(38, 37, 38, 0.03);
  padding: 18px;
}

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

.subcard__header h4 {
  margin: 0;
}

.btn-small {
  padding: 10px 12px;
  font-size: 13px;
}

.compact-table th,
.compact-table td {
  padding: 12px 14px;
  font-size: 13px;
}

.chart-shell {
  position: relative;
  border: 1px solid var(--border-soft);
  border-radius: 16px;
  background: #fff;
  min-height: 360px;
  padding: 16px;
}

.bubble-chart {
  width: 100%;
  height: auto;
  display: block;
}

.chart-caption {
  margin-top: 12px;
  color: rgba(38, 37, 38, 0.68);
  font-size: 13px;
}

.bubble-chart__point {
  cursor: pointer;
}

.chart-tooltip {
  position: absolute;
  min-width: 220px;
  max-width: 280px;
  border: 1px solid rgba(38, 37, 38, 0.16);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.16);
  padding: 12px;
  pointer-events: none;
}

.chart-tooltip[hidden] {
  display: none;
}

.chart-tooltip__title {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 800;
  color: var(--text-dark);
}

.chart-tooltip__table {
  width: 100%;
  border-collapse: collapse;
}

.chart-tooltip__table th,
.chart-tooltip__table td {
  padding: 4px 0;
  font-size: 12px;
  text-align: left;
  vertical-align: top;
}

.chart-tooltip__table th {
  width: 50%;
  color: rgba(38, 37, 38, 0.65);
  font-weight: 700;
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 12px;
}

.chart-legend__item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
}

.chart-legend__dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
}

.empty-state {
  text-align: center;
  color: rgba(38, 37, 38, 0.7);
  padding: 44px 18px;
}

@media (max-width: 860px) {
  .lookup-row,
  .app-summary,
  .footer-actions,
  .panel-header {
    flex-direction: column;
    align-items: stretch;
  }

  .page {
    width: min(1100px, calc(100vw - 20px));
    padding-top: 28px;
  }

  .three-up-grid {
    grid-template-columns: 1fr;
  }

  .subcard__header {
    flex-direction: column;
    align-items: stretch;
  }

  .glass-card {
    padding: 20px;
    border-radius: 20px;
  }
}
