/* One ERP — editorial demo microsite */

:root {
  --paper: #f6f3ec;
  --paper-deep: #ebe6dc;
  --ink: #1c1c24;
  --ink-soft: #4a4a58;
  --ink-muted: #6b6b7a;
  --accent: #2d4a3e;
  --accent-light: #e8f0ec;
  --line: #d4cfc4;
  --line-soft: #e8e4dc;
  --link: #3d5a80;
  --calc: #e2efda;
  --input: #fff8e6;
  --ext: #e8e4f4;
  --sidebar: #faf8f4;
  --content-wide: 1140px;
  --grid-gap: 1.25rem;
  --tile-min: 240px;
  --font-display: "Instrument Serif", Georgia, serif;
  --font-body: "IBM Plex Sans", system-ui, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.05rem;
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

a {
  color: var(--link);
}

/* ── Header ── */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 2rem;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--paper) 92%, white);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(8px);
}

.logo {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -0.03em;
}

.logo span {
  font-style: italic;
  color: var(--accent);
}

.site-nav {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.25rem;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: 2px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.btn-primary:hover {
  background: #243d33;
}

.btn-secondary {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}

.btn-secondary:hover {
  background: var(--paper-deep);
}

.btn-ghost {
  background: transparent;
  color: var(--ink-soft);
  border-color: var(--line);
}

.btn-ghost:hover {
  background: var(--paper-deep);
  color: var(--ink);
}

.btn-xl {
  padding: 1.1rem 2.25rem;
  font-size: 1.05rem;
}

/* ── Hero ── */
.hero {
  position: relative;
  min-height: 88vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
  padding: 3rem 2rem 4rem;
  max-width: var(--content-wide);
  margin: 0 auto;
  align-items: center;
}

.hero-copy {
  max-width: 32rem;
}

.hero-eyebrow {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1rem;
}

.hero h1 {
  font-size: clamp(2.5rem, 5vw, 3.75rem);
  margin: 0 0 1.25rem;
}

.hero-lead {
  font-size: 1.15rem;
  color: var(--ink-soft);
  margin-bottom: 2rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.hero-visual {
  position: relative;
  aspect-ratio: 1;
  max-height: 520px;
  overflow: visible;
}

.hero-visual-inner {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  overflow: hidden;
  background: radial-gradient(
    circle at 50% 45%,
    var(--accent-light) 0%,
    color-mix(in srgb, var(--paper) 70%, var(--accent-light)) 55%,
    transparent 72%
  );
}

#focus-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.hero-visual-caption {
  position: absolute;
  top: 100%;
  left: 50%;
  margin-top: 0.85rem;
  transform: translateX(-50%) translateY(6px);
  width: min(24rem, 92%);
  padding: 0;
  font-size: 0.82rem;
  line-height: 1.55;
  text-align: center;
  color: var(--ink-soft);
  letter-spacing: 0.01em;
  opacity: 0;
  transition: opacity 1.4s ease, transform 1.4s ease;
}

.hero-visual-caption.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── Sections ── */
.section {
  max-width: 720px;
  margin: 0 auto;
  padding: 4rem 2rem;
}

.section-wide {
  max-width: var(--content-wide);
}

/* Problem + approach: two columns, same width as the facet tile grid */
.dual-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--grid-gap);
}

.story-col {
  padding: 2rem 1.75rem;
  border: 1px solid var(--line);
  background: var(--paper);
  transition: border-color 0.2s;
}

.story-col:hover {
  border-color: color-mix(in srgb, var(--accent) 35%, var(--line));
}

.story-col h2 {
  font-size: clamp(1.5rem, 2.5vw, 1.85rem);
  margin: 0 0 1.25rem;
}

.story-col p:last-child {
  margin-bottom: 0;
}

.section-label {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: 0.75rem;
}

.section h2 {
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  margin: 0 0 1.5rem;
}

.section p {
  color: var(--ink-soft);
  margin: 0 0 1rem;
}

.divider {
  border: none;
  border-top: 1px solid var(--line);
  margin: 0;
}

/* ── Facets with icons ── */
.facet-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(var(--tile-min), 1fr));
  gap: var(--grid-gap);
  margin-top: 2.5rem;
}

.facet-card {
  background: var(--paper);
  padding: 1.75rem 1.5rem;
  border: 1px solid var(--line);
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.facet-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: 0 6px 20px rgba(45, 74, 62, 0.1);
}

.facet-icon {
  width: 52px;
  height: 52px;
  margin-bottom: 1rem;
  color: var(--accent);
}

.facet-icon svg {
  width: 100%;
  height: 100%;
}

.facet-card strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 400;
  margin-bottom: 0.4rem;
  color: var(--ink);
}

.facet-card span {
  font-size: 0.9rem;
  color: var(--ink-muted);
  line-height: 1.45;
}

/* ── Prototype CTA band ── */
.prototype-band {
  text-align: center;
  padding: 4.5rem 2rem;
  background: var(--paper-deep);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.prototype-band h2 {
  font-size: clamp(1.85rem, 4vw, 2.75rem);
  margin: 0 0 1rem;
}

.prototype-band p {
  max-width: 36rem;
  margin: 0 auto 2rem;
  color: var(--ink-soft);
  font-size: 1.1rem;
}

.prototype-band .btn-primary {
  font-size: 1.1rem;
  padding: 1.15rem 2.5rem;
}

.prototype-band .note {
  margin-top: 1.25rem;
  font-size: 0.85rem;
  color: var(--ink-muted);
}

/* ── Response form ── */
.respond-section {
  max-width: 640px;
  margin: 0 auto;
  padding: 4rem 2rem 5rem;
}

.respond-section h2 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.respond-intro {
  color: var(--ink-soft);
  margin-bottom: 2rem;
}

.proposal-form {
  background: #fff;
  border: 1px solid var(--line);
  padding: 2rem;
}

.form-row {
  margin-bottom: 1.35rem;
}

.form-row label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 0.4rem;
}

.form-row input[type="text"],
.form-row input[type="email"],
.form-row select,
.form-row textarea {
  width: 100%;
  padding: 0.65rem 0.85rem;
  font-family: var(--font-body);
  font-size: 1rem;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: #fff;
  color: var(--ink);
}

.form-row textarea {
  min-height: 100px;
  resize: vertical;
}

.form-row input:focus,
.form-row select:focus,
.form-row textarea:focus {
  outline: 2px solid var(--accent-light);
  outline-offset: 1px;
  border-color: var(--accent);
}

.tier-options {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.tier-option {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: var(--paper);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.tier-option:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-light);
}

.tier-option input {
  margin-top: 0.25rem;
}

.tier-option div strong {
  display: block;
  font-size: 0.95rem;
  margin-bottom: 0.15rem;
}

.tier-option div span {
  font-size: 0.82rem;
  color: var(--ink-muted);
}

.checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  font-size: 0.9rem;
  color: var(--ink-soft);
}

.checkbox-row input {
  margin-top: 0.2rem;
}

.form-error {
  color: #9b2c2c;
  background: #fde8e8;
  padding: 0.75rem 1rem;
  border-radius: 2px;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.form-success {
  text-align: center;
  padding: 3rem 2rem;
  background: var(--accent-light);
  border: 1px solid var(--accent);
}

.form-success h3 {
  font-size: 1.75rem;
  color: var(--accent);
  margin-bottom: 0.75rem;
}

.form-success p {
  color: var(--ink-soft);
}

.site-footer {
  padding: 2rem;
  text-align: center;
  font-size: 0.8rem;
  color: var(--ink-muted);
  border-top: 1px solid var(--line);
}

/* ── Prototype shell ── */
.prototype-page {
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--paper);
}

.proto-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--paper) 92%, white);
  flex-shrink: 0;
  backdrop-filter: blur(8px);
}

.proto-brand {
  display: flex;
  align-items: baseline;
  gap: 0.85rem;
}

.proto-header .logo {
  color: var(--ink);
  text-decoration: none;
}

.proto-label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-muted);
  padding-left: 0.85rem;
  border-left: 1px solid var(--line);
}

.proto-shell {
  position: relative;
  display: flex;
  flex: 1;
  overflow: hidden;
  min-height: 0;
}

.proto-sidebar {
  width: 240px;
  flex-shrink: 0;
  background: var(--sidebar);
  border-right: 1px solid var(--line);
  overflow-y: auto;
  padding: 1rem 0;
}

.proto-sidebar.is-hidden {
  display: none;
}

.sidebar-context {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  padding: 0 1rem 0.75rem;
  margin: 0;
  border-bottom: 1px solid var(--line-soft);
}

.proto-nav-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.55rem 1rem;
  border: none;
  background: transparent;
  font-family: var(--font-body);
  font-size: 0.84rem;
  color: var(--ink-soft);
  cursor: pointer;
  border-left: 2px solid transparent;
}

.proto-nav-item:hover {
  background: var(--paper-deep);
  color: var(--ink);
}

.proto-nav-item.active {
  background: var(--accent-light);
  color: var(--accent);
  border-left-color: var(--accent);
  font-weight: 600;
}

.proto-main {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem 1.5rem 6rem;
  background: var(--paper);
  min-width: 0;
}

.proto-view {
  display: none;
  max-width: 1100px;
}

#view-hub.is-active {
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: none;
  width: 100%;
  min-height: calc(100vh - 4.5rem);
  padding: 2rem 1.5rem 5rem;
}

.proto-view.is-active:not(#view-hub) {
  display: block;
  animation: fadeIn 0.35s ease-out;
}

/* Facet hub landing grid */
.facet-hub-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--grid-gap);
  width: 100%;
  max-width: var(--content-wide);
  margin: 0 auto;
}

.facet-hub-card {
  border: 1px solid var(--line);
  background: #fff;
  padding: 1.35rem 1.25rem 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.facet-hub-card:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--accent) 35%, var(--line));
  box-shadow: 0 8px 24px rgba(45, 74, 62, 0.08);
}

.facet-hub-head {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.facet-hub-code {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}

.facet-hub-card h3 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 400;
  margin: 0;
  color: var(--ink);
  line-height: 1.2;
}

.submodule-tiles {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.submodule-tile {
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 500;
  padding: 0.4rem 0.6rem;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink-soft);
  cursor: pointer;
  border-radius: 2px;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}

.submodule-tile:hover {
  border-color: var(--accent);
  background: var(--accent-light);
  color: var(--accent);
}

/* Module / register view */
.module-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  color: var(--ink-muted);
  margin-bottom: 1rem;
}

.module-breadcrumb strong {
  color: var(--ink);
  font-weight: 600;
}

.register-note {
  font-size: 0.88rem;
  color: var(--ink-soft);
  margin-bottom: 1.25rem;
}

.proto-meta {
  font-size: 0.85rem;
  color: var(--ink-muted);
  margin-bottom: 1rem;
}

/* Quadrant AI dashboard overlay */
.quadrant-overlay {
  position: absolute;
  inset: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--paper) 94%, white);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: fadeIn 0.3s ease-out;
}

.quadrant-dashboard {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.quadrant-dashboard.is-hidden {
  display: none;
}

.quadrant-overlay.is-hidden {
  display: none;
}

.quadrant-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--paper) 92%, white);
  flex-shrink: 0;
}

.quadrant-answer {
  margin: 0;
  width: 100%;
  font-size: 0.95rem;
  line-height: 1.65;
  color: var(--ink-soft);
}

.quadrant-subhead {
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin: 1.25rem 0 0.65rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line-soft);
}

.quadrant-panel-legal .clause-list-compact {
  gap: 0.55rem;
}

.quadrant-panel-legal .clause-list-compact li {
  padding-bottom: 0.55rem;
  font-size: 0.78rem;
}

.quadrant-grid {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 1px;
  background: var(--line);
  overflow: auto;
  min-height: 0;
}

.quadrant-panel {
  background: #fff;
  padding: 1rem 1.15rem;
  overflow-y: auto;
  min-height: 0;
}

.quadrant-panel header {
  margin-bottom: 0.85rem;
}

.quadrant-module {
  display: block;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.25rem;
}

.quadrant-panel h3 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 400;
  margin: 0;
}

.data-table-compact {
  font-size: 0.75rem;
}

.data-table-compact th,
.data-table-compact td {
  padding: 0.4rem 0.55rem;
}

.detail-list {
  margin: 0;
  display: grid;
  gap: 0.65rem;
}

.detail-list div {
  display: grid;
  grid-template-columns: 7rem 1fr;
  gap: 0.5rem;
  font-size: 0.82rem;
}

.detail-list dt {
  font-weight: 600;
  color: var(--ink-muted);
  margin: 0;
}

.detail-list dd {
  margin: 0;
  color: var(--ink-soft);
}

.clause-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.75rem;
}

.clause-list li {
  font-size: 0.82rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--line-soft);
}

.clause-list li:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.clause-list strong {
  display: block;
  color: var(--ink);
  margin-bottom: 0.2rem;
  font-size: 0.85rem;
}

.clause-list span {
  color: var(--ink-soft);
  line-height: 1.45;
}

.quadrant-note {
  margin: 0.75rem 0 0;
  font-size: 0.75rem;
  color: var(--ink-muted);
}

/* Renegotiation dashboard visualizations */
.viz-block {
  margin-bottom: 1rem;
}

.viz-label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin: 0 0 0.65rem;
}

.bar-chart {
  display: grid;
  gap: 0.55rem;
}

.bar-row {
  display: grid;
  grid-template-columns: 6.5rem 1fr 2.5rem;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.78rem;
}

.bar-name {
  color: var(--ink-soft);
}

.bar-track {
  height: 0.65rem;
  background: var(--paper-deep);
  border-radius: 2px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: 2px;
}

.bar-market { background: #8aa8c8; }
.bar-zest { background: var(--accent); }
.bar-deal { background: #6b9e78; }

.bar-val {
  font-weight: 600;
  color: var(--ink);
  text-align: right;
}

.viz-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.viz-stat {
  padding: 0.55rem;
  background: var(--paper);
  border: 1px solid var(--line-soft);
  text-align: center;
}

.viz-stat-val {
  display: block;
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: var(--accent);
}

.viz-stat-lbl {
  font-size: 0.65rem;
  color: var(--ink-muted);
  line-height: 1.3;
}

.appetite-gauge {
  margin-bottom: 1rem;
}

.appetite-zones {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 2px;
  margin-bottom: 0.35rem;
}

.zone {
  text-align: center;
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.25rem;
  color: #fff;
}

.zone-red { background: #c45c5c; }
.zone-amber { background: #c9a227; }
.zone-green { background: #4a8f5f; }

.appetite-track {
  position: relative;
  height: 0.5rem;
  border-radius: 999px;
  background: linear-gradient(90deg, #c45c5c 0%, #c45c5c 33%, #c9a227 33%, #c9a227 66%, #4a8f5f 66%);
  margin-bottom: 0.65rem;
}

.appetite-marker {
  position: absolute;
  top: 50%;
  width: 14px;
  height: 14px;
  margin-left: -7px;
  transform: translateY(-50%);
  background: var(--ink);
  border: 2px solid #fff;
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

.appetite-score {
  font-family: var(--font-display);
  font-size: 1.75rem;
  color: var(--ink);
  margin: 0;
}

.appetite-score span {
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: #b8860b;
  font-weight: 600;
}

.appetite-factors {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.78rem;
  color: var(--ink-soft);
}

.appetite-factors li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--line-soft);
}

.appetite-factors li:last-child {
  border-bottom: none;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.dot-green { background: #4a8f5f; }
.dot-amber { background: #c9a227; }
.dot-red { background: #c45c5c; }

.minutes-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.85rem;
}

.minutes-list li {
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--line-soft);
}

.minutes-list li:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.minutes-list time {
  display: block;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.2rem;
}

.minutes-list strong {
  display: block;
  font-size: 0.88rem;
  color: var(--ink);
  margin-bottom: 0.25rem;
}

.minutes-list span {
  font-size: 0.78rem;
  color: var(--ink-soft);
  line-height: 1.45;
}

.quadrant-panel-split .people-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.bi-combo-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  align-items: start;
}

.bi-combo-col-appetite {
  padding-left: 1.25rem;
  border-left: 1px solid var(--line-soft);
}

.people-grid-stack {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.65rem;
}

.people-grid-stack .person-card {
  padding: 0.75rem 0.85rem;
}

.quadrant-panel-letter .letter-preview-full {
  max-height: none;
  flex: 1;
  min-height: 0;
}

.quadrant-panel-letter {
  display: flex;
  flex-direction: column;
}

.quadrant-panel-letter .letter-preview-full {
  flex: 1;
  overflow-y: auto;
}

.person-card {
  padding: 0.55rem 0.6rem;
  background: var(--paper);
  border: 1px solid var(--line-soft);
  font-size: 0.72rem;
}

.person-card strong {
  display: block;
  font-size: 0.82rem;
  color: var(--ink);
}

.person-card > span {
  display: block;
  font-size: 0.65rem;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.person-card p {
  margin: 0;
  color: var(--ink-muted);
  line-height: 1.4;
}

.letter-preview {
  font-size: 0.75rem;
  line-height: 1.55;
  color: var(--ink-soft);
  padding: 0.85rem 1rem;
  background: #fff;
  border: 1px solid var(--line);
  max-height: 9rem;
  overflow-y: auto;
}

.letter-preview p {
  margin: 0 0 0.65rem;
}

.letter-preview p:last-child {
  margin-bottom: 0;
}

/* Floating chat */
.proto-chat {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  width: min(36rem, calc(100% - 2rem));
  z-index: 200;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--paper) 96%, white);
  padding: 0.5rem 0.5rem 0.5rem 1rem;
  border-radius: 999px;
  box-shadow:
    0 4px 6px rgba(28, 28, 36, 0.04),
    0 16px 40px rgba(28, 28, 36, 0.1);
  backdrop-filter: blur(10px);
}

.chat-input-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.chat-input {
  flex: 1;
  padding: 0.55rem 0;
  font-family: var(--font-body);
  font-size: 0.88rem;
  border: none;
  background: transparent;
  color: var(--ink-soft);
  cursor: default;
}

.chat-input:focus {
  outline: none;
}

.chat-send {
  border-radius: 999px;
  padding: 0.65rem 1.5rem;
  flex-shrink: 0;
  animation: chatGlow 2.2s ease-in-out infinite;
}

@keyframes chatGlow {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(45, 74, 62, 0.45);
  }
  50% {
    box-shadow: 0 0 18px 4px rgba(45, 74, 62, 0.35);
  }
}

.chat-send:hover {
  animation: none;
  box-shadow: 0 0 22px 6px rgba(45, 74, 62, 0.4);
}

.chat-send:disabled {
  opacity: 0.55;
  cursor: wait;
  animation: none;
}

/* Ask loading overlay */
.proto-loader {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  background: color-mix(in srgb, var(--paper) 88%, white);
  backdrop-filter: blur(6px);
  transition: opacity 0.28s ease;
}

.proto-loader.is-hidden {
  display: none;
}

.proto-loader.is-fading {
  opacity: 0;
  pointer-events: none;
}

#loader-canvas {
  width: min(360px, 72vw);
  aspect-ratio: 1;
  border-radius: 50%;
}

.proto-loader-label {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--ink-muted);
  animation: loaderPulse 1.4s ease-in-out infinite;
}

@keyframes loaderPulse {
  0%, 100% { opacity: 0.55; }
  50% { opacity: 1; }
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

.proto-screen h2 {
  font-size: 1.75rem;
  margin: 0 0 0.25rem;
}

.entity-header {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  padding: 1.25rem;
  background: var(--paper);
  border: 1px solid var(--line);
  margin-bottom: 1.5rem;
}

.entity-stat label {
  display: block;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-muted);
  margin-bottom: 0.2rem;
}

.entity-stat .val {
  display: block;
  font-family: var(--font-display);
  font-size: 1.35rem;
}

.link-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.75rem;
}

.link-card {
  padding: 1rem;
  border: 1px solid var(--line);
  background: var(--ext);
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  border-radius: 2px;
  transition: border-color 0.15s;
}

.link-card:hover {
  border-color: var(--accent);
}

.link-card strong {
  display: block;
  font-size: 0.8rem;
  margin-bottom: 0.25rem;
}

.link-card span {
  font-size: 0.75rem;
  color: var(--ink-muted);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
  margin-top: 1rem;
}

.data-table th {
  text-align: left;
  padding: 0.5rem 0.75rem;
  background: var(--ink);
  color: #fff;
  font-weight: 500;
  font-size: 0.7rem;
  letter-spacing: 0.04em;
}

.data-table td {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--line);
}

.data-table tr:hover td {
  background: var(--paper);
}

.cell-input { background: var(--input); }
.cell-calc { background: var(--calc); }
.cell-link { background: var(--ext); color: var(--link); }

.trace-flow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin: 1.5rem 0;
  font-size: 0.8rem;
}

.trace-node {
  padding: 0.5rem 0.85rem;
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: 2px;
}

.trace-node.highlight {
  background: var(--accent-light);
  border-color: var(--accent);
  font-weight: 600;
}

.trace-arrow {
  color: var(--ink-muted);
}

.legend {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: 0.75rem;
  color: var(--ink-muted);
  margin-top: 1rem;
}

.legend i {
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-right: 0.35rem;
  vertical-align: middle;
  border: 1px solid var(--line);
}

.legend .i-input { background: var(--input); }
.legend .i-calc { background: var(--calc); }
.legend .i-link { background: var(--ext); }

@media (max-width: 800px) {
  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .hero-visual {
    order: -1;
    max-height: 280px;
    margin: 0 auto;
    max-width: 320px;
  }

  .dual-grid {
    grid-template-columns: 1fr;
  }

  .facet-grid {
    grid-template-columns: 1fr 1fr;
  }

  .facet-hub-grid {
    grid-template-columns: 1fr 1fr;
  }

  #view-hub.is-active {
    min-height: auto;
    padding: 1.5rem 1rem 5rem;
  }

  .quadrant-grid {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
  }

  .bi-combo-grid {
    grid-template-columns: 1fr;
  }

  .bi-combo-col-appetite {
    padding-left: 0;
    border-left: none;
    padding-top: 1rem;
    border-top: 1px solid var(--line-soft);
  }

  .quadrant-panel-split .people-grid {
    grid-template-columns: 1fr;
  }

  .viz-stats {
    grid-template-columns: 1fr;
  }

  .proto-shell {
    flex-direction: column;
  }

  .proto-sidebar {
    width: 100%;
    max-height: 160px;
    border-right: none;
    border-bottom: 1px solid var(--line);
  }
}

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

  .facet-hub-grid {
    grid-template-columns: 1fr;
  }

  .proto-chat {
    width: calc(100% - 1.25rem);
    bottom: 1rem;
    border-radius: 1rem;
    padding: 0.65rem;
  }

  .chat-input-row {
    flex-direction: column;
    align-items: stretch;
  }

  .chat-input {
    text-align: center;
    padding: 0.25rem 0.5rem;
  }

  .chat-send {
    width: 100%;
  }
}
