:root {
  --bg: #f5f7fb;
  --panel: #ffffff;
  --ink: #172033;
  --muted: #667085;
  --line: #d9e1ee;
  --blue: #2563eb;
  --green: #16835a;
  --amber: #b7791f;
  --red: #c2410c;
  --violet: #6941c6;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.06), 0 10px 28px rgba(16, 24, 40, 0.06);
}

html,
body {
  background: var(--bg);
}

body {
  color: var(--ink);
  font-feature-settings: "cv02", "cv03", "cv04", "cv11";
  padding-bottom: 92px;
}

main {
  width: min(1440px, calc(100% - 40px)) !important;
  padding: 24px 0 48px !important;
}

.topbar {
  position: relative;
  margin-bottom: 18px !important;
  padding: 0 0 4px;
}

h1 {
  color: #101828;
  font-size: clamp(30px, 2.5vw, 40px) !important;
  font-weight: 780;
  letter-spacing: 0 !important;
}

h2,
h3 {
  color: #101828;
}

.subhead {
  max-width: 860px !important;
  color: #667085 !important;
  font-size: 14px !important;
}

.nav {
  position: sticky;
  top: 10px;
  z-index: 10;
  align-items: center;
  padding: 5px !important;
  border-color: #d6e0ef !important;
  background: rgba(255, 255, 255, 0.92) !important;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.06), 0 12px 28px rgba(16, 24, 40, 0.08) !important;
  backdrop-filter: blur(12px);
}

.button {
  min-height: 38px !important;
  color: #344054 !important;
  font-size: 13px !important;
  font-weight: 720 !important;
  text-decoration: none !important;
}

.button:hover {
  background: #f2f6fc !important;
  color: #1d4ed8 !important;
  text-decoration: none !important;
}

.button.primary {
  background: #1d4ed8 !important;
  color: #ffffff !important;
}

.utility-dock {
  position: fixed;
  left: 18px;
  bottom: 18px;
  z-index: 40;
  display: grid;
  gap: 8px;
  width: 180px;
  padding: 10px;
  border: 1px solid #d6e0ef;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.utility-group {
  display: grid;
  gap: 4px;
}

.utility-label {
  color: #667085;
  font-size: 10px;
  font-weight: 780;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.utility-dock a {
  display: flex;
  align-items: center;
  min-height: 32px;
  padding: 0 10px;
  border-radius: 7px;
  color: #344054;
  font-size: 13px;
  font-weight: 740;
  text-decoration: none;
}

.utility-dock a:hover {
  background: #f2f6fc;
  color: #1d4ed8;
}

.panel,
.metric,
.project,
.card,
.map-card,
.opportunity,
.snapshot-card,
.method-card,
.universe-card,
.topic-card,
.theme-card,
.signal-card,
.hierarchy-card,
.record,
.cluster,
.source,
.rule,
.policy {
  border-color: #d9e1ee !important;
  border-radius: 10px !important;
  background: #ffffff !important;
  box-shadow: var(--shadow) !important;
}

.panel {
  padding: 18px !important;
}

.panel-title {
  padding-bottom: 10px;
  border-bottom: 1px solid #edf1f7;
}

.panel-title h2 {
  font-size: 16px !important;
  font-weight: 760;
}

.metric {
  min-height: 110px;
  padding: 16px !important;
}

.metric-label,
.snapshot-label,
.map-label,
.universe-label,
.hierarchy-level,
.label,
.eyebrow,
.record-label {
  color: #667085 !important;
  font-size: 11px !important;
  font-weight: 780 !important;
  letter-spacing: 0.04em !important;
  text-transform: uppercase;
}

.metric-value {
  color: #101828;
  font-size: 28px !important;
  font-weight: 800 !important;
}

.metric-note,
.small,
.copy,
.project-meta,
.snapshot-copy,
.method-copy,
.record-note,
.cluster p,
.source span,
.rule span {
  color: #667085 !important;
}

.tag {
  min-height: 24px !important;
  border: 1px solid transparent;
  border-radius: 999px !important;
  background: #f2f4f7 !important;
  color: #344054 !important;
  font-weight: 700 !important;
}

.tag.blue,
.tag.buyer,
.tag.solution-aware,
.tag.comment {
  border-color: #bfdbfe;
  background: #eff6ff !important;
  color: #1d4ed8 !important;
}

.tag.green,
.tag.high,
.tag.positive {
  border-color: #bbf7d0;
  background: #ecfdf3 !important;
  color: #067647 !important;
}

.tag.amber,
.tag.medium,
.tag.mixed {
  border-color: #fedf89;
  background: #fffaeb !important;
  color: #b54708 !important;
}

.tag.violet,
.tag.owner,
.tag.post-purchase,
.tag.regret,
.tag.reddit {
  border-color: #d9d6fe;
  background: #f4f3ff !important;
  color: #5925dc !important;
}

.tag.red,
.tag.negative {
  border-color: #fecaca;
  background: #fff1f3 !important;
  color: #c01048 !important;
}

.bar,
.track,
.score-track {
  background: #e9eef6 !important;
}

.score-badge,
.priority-badge,
.score {
  border-color: #bfdbfe !important;
  background: #eff6ff !important;
  color: #1d4ed8 !important;
}

.decision-hero .block,
.topic-decision,
.flow-item {
  border-color: #c7d7fe !important;
  background: #f8fbff !important;
}

input,
select {
  border-color: #d0d5dd !important;
  border-radius: 8px !important;
  background: #ffffff !important;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
}

input:focus,
select:focus {
  outline: 2px solid rgba(37, 99, 235, 0.18);
  border-color: #93b4fd !important;
}

.table-wrap {
  border-color: #d9e1ee !important;
  border-radius: 10px !important;
}

th {
  background: #f8fafc !important;
  color: #475467 !important;
}

td {
  color: #344054;
}

.project,
.opportunity,
.record,
.topic-card {
  transition: border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.project:hover,
.opportunity:hover,
.record:hover,
.topic-card:hover {
  border-color: #bfdbfe !important;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.06), 0 16px 34px rgba(29, 78, 216, 0.1) !important;
}

.workspace-entry {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  gap: 14px;
  align-items: stretch;
  margin-bottom: 16px;
}

.url-entry-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  margin-top: 14px;
}

.url-entry-form input {
  min-height: 42px;
}

.url-entry-form button {
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  background: #1d4ed8;
  color: #ffffff;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 760;
  padding: 0 14px;
}

.basis-preview {
  display: grid;
  gap: 10px;
}

.basis-row {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 10px 0;
  border-bottom: 1px solid #edf1f7;
}

.basis-row:last-child {
  border-bottom: 0;
}

.basis-row strong {
  color: #667085;
  font-size: 11px;
  font-weight: 780;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.basis-row span {
  color: #344054;
  font-size: 13px;
  overflow-wrap: anywhere;
}

.spine-board {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
}

.spine-board .panel-title {
  margin-bottom: 0;
}

.spine-row {
  display: grid;
  grid-template-columns: 1.05fr 1.2fr 1.05fr 0.78fr;
  gap: 0;
  overflow: hidden;
  border: 1px solid #d9e1ee;
  border-radius: 10px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.spine-cell {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 7px;
  padding: 14px;
  border-right: 1px solid #edf1f7;
}

.spine-cell:last-child {
  border-right: 0;
}

.spine-label {
  color: #667085;
  font-size: 10px;
  font-weight: 820;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.spine-title {
  color: #101828;
  font-size: 16px;
  font-weight: 820;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.spine-copy {
  color: #526173;
  font-size: 13px;
  line-height: 1.42;
  overflow-wrap: anywhere;
}

.spine-link {
  width: fit-content;
  margin-top: 2px;
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 780;
  text-decoration: none;
}

.spine-link:hover {
  text-decoration: underline;
}

.spine-cell.risk {
  border-top: 4px solid #c01048;
}

.spine-cell.brief {
  border-top: 4px solid #1d4ed8;
}

.spine-cell.action {
  border-top: 4px solid #067647;
}

.spine-cell.proof {
  border-top: 4px solid #b54708;
}

@media (max-width: 760px) {
  main {
    width: min(100% - 20px, 1440px) !important;
  }

  .nav {
    top: 6px;
  }

  .utility-dock {
    left: 10px;
    right: 10px;
    bottom: 10px;
    width: auto;
    grid-template-columns: 1fr 1fr;
  }

  .workspace-entry,
  .url-entry-form,
  .basis-row,
  .spine-row {
    grid-template-columns: 1fr;
  }

  .spine-cell {
    border-right: 0;
    border-bottom: 1px solid #edf1f7;
  }

  .spine-cell:last-child {
    border-bottom: 0;
  }
}
