/* Cornerstone P&O — royal blue from the live lockup
   Display: Literata · Body: Source Sans 3 · Mono: IBM Plex Mono
   Logo is #193E88. Do not restyle this seat in analog teal.
*/

/* ── Typography ───────────────────────────────────────────────────────────── */
body.app-shell, body.login-body {
  font-family: var(--sans);
  background-image: var(--paper-texture);
  background-color: var(--paper);
  background-size: 18px 18px, 100% 100%;
}

body.login-body {
  background: var(--login-bg);
  background-size: 18px 18px, auto;
}

/* Literata for all display text */
.page-title, .kpi-val, .job-title, .job-stat-v,
.login-org, .login-btn, .rail-name, h1, h2, h3 {
  font-family: var(--display);
}

/* Mono for labels, eyebrows, code */
.login-product, .page-eyebrow, .rail-sub, .rail-group,
.k, .funnel-k, code, pre {
  font-family: var(--mono);
}

/* ── Login ────────────────────────────────────────────────────────────────── */
.login-btn {
  background: var(--orange);
  color: var(--paper);
  border-radius: var(--radius);
}
.login-btn:hover { background: var(--orange-dim); }
.login-card { border-radius: var(--radius-lg); }
.login-input { background: var(--surface); border-radius: var(--radius); }

.mark-fallback {
  background: var(--orange);
  color: var(--paper);
  font-family: var(--display);
}

/* ── Special / deck frames ────────────────────────────────────────────────── */
.special-frame-wrap { background: var(--rail); }
iframe.deck, iframe.special-frame {
  width: 100%;
  height: calc(100vh - 48px);
  min-height: 640px;
  border: 0;
  display: block;
  background: var(--paper);
}

/* ── Clinic skin overrides ────────────────────────────────────────────────── */
html[data-skin="clinic"] .main { max-width: 1180px; }
html[data-skin="clinic"] .kpi-tile { border-radius: var(--radius-lg); }
html[data-skin="clinic"] .nc-banner { border-radius: var(--radius-lg); }

/* Teal accent for the clinic skin — nav top stripe, rail-link active */
html[data-skin="clinic"] .rail-link.on {
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
  box-shadow: inset 3px 0 0 #fff;
  border-radius: var(--radius);
}

/* ── Focus states — accessible, not aggressive ────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--orange);
  outline-offset: 2px;
  border-radius: 3px;
}
a:focus-visible,
button:focus-visible,
input:focus-visible,
[role="button"]:focus-visible {
  outline: 2px solid var(--orange);
  outline-offset: 3px;
  border-radius: var(--radius);
}
/* Remove focus ring for mouse users */
:focus:not(:focus-visible) { outline: none; }

/* ── Reduced motion ───────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ── PHI / Sentinel disclaimer banner ────────────────────────────────────── */
.phi-disclaimer {
  background: var(--orange-glow);
  border: 1px solid color-mix(in srgb, var(--orange) 22%, transparent);
  border-left: 3px solid var(--orange);
  border-radius: var(--radius);
  padding: 11px 15px;
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.55;
  margin-bottom: 14px;
}
.phi-disclaimer strong { color: var(--text); font-weight: 600; }
.phi-disclaimer em { font-style: italic; }

/* ── Section labels ───────────────────────────────────────────────────────── */
.section-label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 600;
  margin: 22px 0 10px;
  display: flex;
  align-items: center;
  gap: 0;
}
.section-label-link {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.05em;
  text-transform: none;
  color: var(--orange);
  text-decoration: none;
  font-weight: 500;
}
.section-label-link:hover { text-decoration: underline; }

/* ── Connector status dots ────────────────────────────────────────────────── */
.dot-not-connected { background: var(--text-muted); }
.dot-live          { background: #059669; }
.dot-error         { background: #DC2626; }
.dot-pending       { background: #D97706; }

/* ── Connector grid (telemetry page) ─────────────────────────────────────── */
.connector-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 10px;
  margin: 0 0 24px;
}
.connector-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.connector-card--fab {
  border-left: 3px solid var(--orange);
}
.connector-channel {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.connector-label {
  font-family: var(--display);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.connector-city {
  font-size: 11px;
  color: var(--text-dim);
  font-family: var(--mono);
}
.connector-status-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
}
.connector-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.connector-status-text {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-muted);
}
.connector-note {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.45;
  margin-top: 2px;
}

/* ── High legibility for P&O clinical context ────────────────────────────── */
html[data-skin="clinic"] .page-sub {
  font-size: 14px;
  line-height: 1.65;
  color: var(--text-dim);
  max-width: 680px;
}
html[data-skin="clinic"] .job-copy {
  font-size: 13.5px;
  line-height: 1.6;
}
html[data-skin="clinic"] .side-copy {
  font-size: 13px;
  line-height: 1.6;
}

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .connector-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }
}

/* ── Seat polish pass: shared interaction language ───────────────────────── */
html { scroll-behavior: smooth; }
body { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
.rail { box-shadow: 10px 0 30px rgba(0,0,0,.06); }
.rail-brand { min-height: 72px; }
.rail-logo { max-height: 40px; }
.rail-link { transition: background .16s ease, color .16s ease, opacity .16s ease, transform .16s ease; }
.rail-link:hover { transform: translateX(2px); }
.strip { box-shadow: 0 2px 12px rgba(0,0,0,.04); }
.main { scrollbar-gutter: stable; }
.page-header { max-width: 900px; }
.page-title { text-wrap: balance; }
.page-sub { max-width: 72ch; }
.kpi-tile, .kpi-card, .section-card, .job, .side-card, .agent-card, .chain-card,
.feat-card, .policy-item, .housing-kpi, .wf-kpi, .conn-card, .calaim-code-card,
.spine-flow, .aup-rung, .fnb-card, .portfolio-prop, .special-frame-wrap {
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
.kpi-tile:hover, .kpi-card:hover, .section-card:hover, .side-card:hover, .agent-card:hover,
.chain-card:hover, .feat-card:hover, .policy-item:hover, .housing-kpi:hover, .wf-kpi:hover,
.conn-card:hover, .calaim-code-card:hover, .aup-rung:hover, .fnb-card:hover, .portfolio-prop:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--orange) 48%, var(--border));
  box-shadow: 0 12px 28px color-mix(in srgb, var(--text) 9%, transparent);
}
.btn, .act, .ask-go, .strip-ask, .chat-send { transition: transform .16s ease, background .16s ease, border-color .16s ease, box-shadow .16s ease; }
.btn:hover, .act:hover, .ask-go:hover, .strip-ask:hover, .chat-send:hover:not(:disabled) { transform: translateY(-1px); }
.rail-logo, .login-logo { object-position: center; }
.login-card { animation: seat-card-in .35s ease both; }
@keyframes seat-card-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .kpi-tile, .kpi-card, .section-card, .job, .side-card, .agent-card, .chain-card,
  .feat-card, .policy-item, .housing-kpi, .wf-kpi, .conn-card, .calaim-code-card,
  .aup-rung, .fnb-card, .portfolio-prop, .btn, .act, .ask-go, .strip-ask, .chat-send {
    transition: none !important; transform: none !important;
  }
}

/* Logo is royal blue. Chrome matches the mark — no analog teal. */
body.app-shell { background: var(--paper); background-image: none; }
body.login-body {
  background: var(--orange);
  background-image: linear-gradient(180deg, #152E66 0%, #193E88 56%, #F8FAFC 56%, #F8FAFC 100%);
}
.login-brand-logo-only { justify-content: center; margin-bottom: 28px; }
.login-brand-logo-only .login-logo {
  height: auto; max-height: 72px; max-width: min(320px, 72vw);
  object-fit: contain; background: #fff; padding: 10px 14px; border-radius: 10px;
}
.login-card {
  background: #fff;
  border-color: rgba(25, 62, 136, 0.22);
  box-shadow: 0 2px 0 #193E88, 0 24px 56px rgba(23, 37, 84, 0.18);
}
.login-btn { background: #193E88; color: #fff; }
.login-btn:hover { background: #152E66; color: #fff; }

/* Rail: inverted swimmer mark on matching navy. Wordmark stays on login/deck. */
.rail { background: #193E88; }
.rail-brand { justify-content: center; min-height: 86px; padding: 18px 14px; }
.rail-brand > span:not(.mark-fallback) { display: none !important; }
.rail-logo {
  width: 52px; height: 52px; max-width: 52px; max-height: 52px;
  object-fit: contain; background: transparent; padding: 0; border-radius: 10px;
}
.mark-fallback { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; }
