/* PrismMerit — Azure / Amber / Slate. NO green. Asymmetric layout ≠ BookPetal. */

:root {
  --paper: #F4F6FA;
  --paper-2: #E8ECF3;
  --ink: #0B1220;
  --muted: #5B6578;
  --line: rgba(11, 18, 32, 0.12);
  --line-dark: rgba(244, 246, 250, 0.14);
  --azure: #2563EB;
  --azure-2: #1D4ED8;
  --azure-soft: rgba(37, 99, 235, 0.1);
  --amber: #F59E0B;
  --amber-soft: rgba(245, 158, 11, 0.14);
  --rose: #E11D48;
  --flat: #94A3B8;
  --card: #FFFFFF;
  --void: #0B1220;
  --font: "DM Sans", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --radius: 8px;
  --wrap: min(1200px, calc(100% - 2rem));
  --wrap-narrow: min(720px, calc(100% - 2rem));
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: auto; }
body {
  margin: 0; font-family: var(--font); font-size: 15px; line-height: 1.55;
  color: var(--ink); background: var(--paper); -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--azure); text-decoration: none; }
a:hover { color: var(--azure-2); }
button, input, select, textarea { font: inherit; }
h1, h2, h3 { font-weight: 700; letter-spacing: -0.03em; line-height: 1.15; margin: 0 0 0.6rem; }
p { margin: 0 0 0.75rem; }
[hidden] { display: none !important; }

.wrap { width: var(--wrap); margin-inline: auto; }
.narrow { width: var(--wrap-narrow); margin-inline: auto; }
.mono, .kicker {
  font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted);
}
.kicker { display: block; margin-bottom: 0.55rem; color: var(--azure); font-weight: 600; }
.lead { color: var(--muted); max-width: 48ch; font-size: 1.02rem; }
.text-link { font-weight: 600; border-bottom: 1px solid currentColor; }
.rose { color: var(--rose); }
.gold { color: #B45309; font-weight: 700; }
.toast {
  margin-top: 1rem; padding: 0.75rem 1rem; background: var(--azure-soft);
  border: 1px solid rgba(37,99,235,0.3); border-radius: var(--radius);
}
.note { color: var(--muted); font-size: 0.92rem; }
.plain { list-style: none; margin: 0; padding: 0; }
.plain li { padding: 0.5rem 0; border-bottom: 1px solid var(--line); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.35rem;
  padding: 0.65rem 1.05rem; border-radius: var(--radius); font-weight: 600;
  border: 1px solid transparent; cursor: pointer; text-decoration: none; line-height: 1.2;
}
.btn-sm { padding: 0.4rem 0.75rem; font-size: 0.85rem; }
.btn-lg { padding: 0.85rem 1.25rem; font-size: 0.95rem; }
.btn-full { width: 100%; }
.btn-primary { background: var(--azure); color: #fff; border-color: var(--azure); }
.btn-primary:hover { background: var(--azure-2); color: #fff; }
.btn-outline { background: #fff; color: var(--ink); border-color: var(--line); }
.btn-outline:hover { border-color: var(--azure); color: var(--azure); }
.btn-ghost { background: transparent; color: var(--muted); border-color: var(--line); }
.btn-ghost:hover { color: var(--ink); border-color: var(--ink); }

.field { display: grid; gap: 0.3rem; margin-bottom: 0.85rem; font-size: 0.82rem; color: var(--muted); font-weight: 600; }
.field input, .field select, .field textarea {
  width: 100%; padding: 0.7rem 0.8rem; border: 1px solid var(--line); border-radius: var(--radius);
  background: #fff; color: var(--ink); font-weight: 400;
}
.file-field { display: grid; gap: 0.4rem; margin-bottom: 0.85rem; }
.file-name { font-family: var(--mono); font-size: 0.72rem; color: var(--muted); }

.site-shell { min-height: 100vh; display: flex; flex-direction: column; }
.site-shell > main { flex: 1; }

.site-announce {
  background: var(--void); color: #A8B0C0; text-align: center; padding: 0.55rem 1rem; font-size: 0.86rem;
}
.site-announce a { color: var(--amber); font-weight: 700; }
.site-header {
  position: sticky; top: 0; z-index: 40; background: rgba(244,246,250,0.96);
  border-bottom: 1px solid var(--line); backdrop-filter: blur(10px);
}
.header-inner {
  width: var(--wrap); margin-inline: auto; min-height: 60px;
  display: flex; align-items: center; gap: 1rem;
}
.brand {
  display: inline-flex; align-items: center; gap: 0.55rem; color: var(--ink); text-decoration: none; flex-shrink: 0;
}
.brand-text strong { display: block; font-size: 1.02rem; }
.brand-text span { display: block; font-size: 0.65rem; color: var(--muted); font-weight: 500; }
.brand-light { color: #fff; }
.brand-light .brand-text span { color: rgba(255,255,255,0.65); }
.logo-mark { width: 30px; height: 30px; }
.logo-mark svg { width: 100%; height: 100%; }
.nav-main { display: none; flex: 1; justify-content: center; gap: 0.15rem; }
.nav-link { color: var(--muted); padding: 0.45rem 0.65rem; font-size: 0.88rem; font-weight: 600; border-radius: 6px; }
.nav-link:hover, .nav-link.is-active { color: var(--azure); background: var(--azure-soft); }
.header-actions { display: flex; align-items: center; gap: 0.55rem; margin-left: auto; }
.header-link { color: var(--muted); font-weight: 600; font-size: 0.9rem; }
.nav-toggle { display: inline-flex; border: 1px solid var(--line); background: #fff; padding: 0.35rem 0.5rem; cursor: pointer; border-radius: 6px; }
.mobile-nav { display: none; width: var(--wrap); margin-inline: auto; padding: 0.75rem 0 1rem; border-top: 1px solid var(--line); flex-direction: column; gap: 0.4rem; }
.mobile-nav.is-open { display: flex; }
@media (min-width: 960px) {
  .nav-main { display: flex; }
  .nav-toggle { display: none; }
}

.site-footer { background: var(--void); color: #8B93A3; margin-top: 2.5rem; padding: 2.5rem 0 1.5rem; border-top: 2px solid var(--amber); }
.footer-grid { width: var(--wrap); margin-inline: auto; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1.25rem; }
.footer-col h4 { margin: 0 0 0.65rem; color: #E8ECF3; font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.08em; text-transform: uppercase; }
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col li { margin: 0.35rem 0; }
.footer-col a { color: #8B93A3; font-size: 0.88rem; }
.footer-col a:hover { color: #fff; }
.footer-bar { width: var(--wrap); margin: 1.5rem auto 0; padding-top: 1rem; border-top: 1px solid var(--line-dark); }
.footer-meta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.75rem; align-items: center; }
.footer-copy { color: #D5DAE3; font-size: 0.82rem; }
.footer-legal { display: flex; gap: 0.85rem; }
.footer-legal a { color: #8B93A3; font-size: 0.82rem; }
.footer-tag { margin: 0.65rem 0 0; font-size: 0.88rem; color: #9AA3B2; max-width: 70ch; }
.footer-tag strong { color: #D5DAE3; }
@media (max-width: 800px) { .footer-grid { grid-template-columns: 1fr 1fr; } }

/* HOME — asymmetric (not BookPetal centered bench) */
.announce-home {
  padding: 0.75rem 0 0; font-size: 0.9rem; color: var(--muted);
}
.announce-home a { font-weight: 700; }
.hero-asymm {
  display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 1.5rem; padding: 1.75rem 0 1.25rem; align-items: stretch;
}
.hero-copy { display: flex; flex-direction: column; justify-content: center; }
.hero-brand {
  display: flex; align-items: center; gap: 0.55rem; font-size: 1.1rem; margin-bottom: 0.75rem;
}
.hero-copy h1 { font-size: clamp(1.75rem, 3.4vw, 2.65rem); max-width: 14ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.65rem; margin-top: 0.35rem; }
.hero-meter {
  background: var(--void); color: #E8ECF3; border-radius: var(--radius);
  padding: 1.35rem 1.25rem; display: flex; flex-direction: column; gap: 0.5rem;
}
.hero-meter .mono { color: #8B93A3; }
.snap-score { font-size: clamp(2.2rem, 4vw, 3rem); color: var(--amber); line-height: 1; }
.snap-list { list-style: none; margin: auto 0 0; padding: 0.85rem 0 0; border-top: 1px solid var(--line-dark); }
.snap-list li { margin: 0.25rem 0; text-transform: none; letter-spacing: 0; font-size: 0.85rem; color: #C5CAD4; }

.phase-tabs {
  display: flex; flex-wrap: wrap; gap: 0.35rem; padding: 0.5rem 0 0.85rem;
  border-bottom: 1px solid var(--line);
}
.phase {
  padding: 0.5rem 0.85rem; border: 1px solid var(--line); border-radius: 999px;
  background: #fff; color: var(--muted); font-size: 0.78rem; font-weight: 600; cursor: pointer;
}
.phase.is-on { background: var(--azure); color: #fff; border-color: var(--azure); }

.canvas {
  display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1.15fr);
  gap: 0.75rem; padding: 1.15rem 0; min-height: 420px;
}
.canvas-left, .canvas-right {
  border: 1px solid var(--line); border-radius: var(--radius); background: #fff; padding: 0.85rem; display: flex; flex-direction: column; gap: 0.4rem;
}
.canvas-right { background: var(--void); color: #E8ECF3; border-color: transparent; }
.canvas-right .col-h { color: #8B93A3; }
.col-h { display: block; margin-bottom: 0.35rem; }
.src {
  display: grid; gap: 0.15rem; text-align: left; padding: 0.7rem 0.75rem;
  border: 1px solid var(--line); border-radius: 6px; background: var(--paper); color: inherit; cursor: pointer;
}
.src strong { font-size: 0.92rem; }
.src em { font-style: normal; font-size: 0.72rem; color: var(--muted); }
.src.is-on, .src:hover { border-color: var(--azure); box-shadow: inset 3px 0 0 var(--azure); }
.src.is-merit.is-on { box-shadow: inset 3px 0 0 var(--amber); border-color: var(--amber); }
.canvas-mid {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.45rem; padding: 0 0.25rem;
}
.mid-line { width: 2px; flex: 1; min-height: 3rem; background: linear-gradient(180deg, var(--azure), var(--amber)); border-radius: 1px; }
.mid-tag { font-family: var(--mono); font-size: 0.58rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); writing-mode: vertical-rl; transform: rotate(180deg); }

.cap {
  position: relative; padding: 0.65rem 0.75rem; border: 1px solid var(--line-dark);
  border-radius: 6px; display: grid; gap: 0.15rem; overflow: hidden;
}
.cap.is-dim { opacity: 0.4; }
.cap.is-on { outline: 1px solid var(--amber); }
.cap .mono { color: #8B93A3; }
.cap strong { color: var(--amber); font-size: 1.15rem; }
.cap.is-flat strong { color: var(--flat); }
.cap.is-lift strong { color: #93C5FD; }
.cap em { color: #C5CAD4; font-style: normal; font-size: 0.75rem; }
.cap p { margin: 0; font-size: 0.8rem; color: #A8B0C0; }
.meter {
  display: block; height: 4px; width: 55%; margin-top: 0.35rem;
  background: #3B82F6; border-radius: 2px;
}
.cap.is-merit .meter { width: 88%; background: var(--amber); }
.cap.is-flat .meter { width: 16%; background: var(--flat); }

.phase-note { color: var(--muted); margin: 0 0 1rem; text-transform: none; letter-spacing: 0; font-size: 0.78rem; }

.decision-ledger {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 0.75rem; padding: 1rem 1.15rem; background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  margin-bottom: 2rem;
}
.dec-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.55rem; font-weight: 700; font-size: 1.1rem; }
.sep { color: var(--amber); font-weight: 500; }
.dec:first-child { color: #B45309; }

.home-lower {
  display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; padding-bottom: 2.5rem;
}
.home-lower h2 { font-size: clamp(1.25rem, 2.2vw, 1.7rem); max-width: 18ch; }
.asks { list-style: none; margin: 0.75rem 0 0; padding: 0; }
.asks li { padding: 0.5rem 0; border-bottom: 1px solid var(--line); }
.motto { margin-top: 1rem; }

@media (max-width: 900px) {
  .hero-asymm, .canvas, .home-lower { grid-template-columns: 1fr; }
  .canvas-mid { flex-direction: row; padding: 0.5rem 0; }
  .mid-line { width: auto; flex: 1; height: 2px; min-height: 0; background: linear-gradient(90deg, var(--azure), var(--amber)); }
  .mid-tag { writing-mode: horizontal-tb; transform: none; }
}

/* Inner pages — left mast (not BookPetal centered hero) */
.page-mast {
  padding: 2rem 0 1.25rem; border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #fff 0%, var(--paper) 100%);
}
.page-mast h1 { font-size: clamp(1.55rem, 3vw, 2.2rem); max-width: 22ch; }
.page-mast .lead { margin-top: 0.35rem; }
.mast-actions { display: flex; flex-wrap: wrap; gap: 0.65rem; margin-top: 1rem; align-items: center; }
.page-body { padding: 1.5rem 0 2.5rem; }

.stack-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.75rem; }
.sc { padding: 1rem; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.sc.is-on { border-color: var(--azure); box-shadow: inset 0 3px 0 var(--amber); }
.sc .mono { display: block; color: var(--azure); margin-bottom: 0.35rem; }
.sc strong { display: block; margin-bottom: 0.25rem; }
.sc p { margin: 0; color: var(--muted); font-size: 0.88rem; }
@media (max-width: 800px) { .stack-cards { grid-template-columns: 1fr; } }

.table-card { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.table-card table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.table-card th, .table-card td { padding: 0.85rem 1rem; border-bottom: 1px solid var(--line); text-align: left; }
.table-card thead th { background: var(--paper-2); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.table-card .rec { background: var(--amber-soft); box-shadow: inset 0 3px 0 var(--amber); }

.two, .three { display: grid; gap: 0.85rem; }
.two { grid-template-columns: 1fr 1fr; }
.three { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 800px) { .two, .three { grid-template-columns: 1fr; } }
.panel { padding: 1.15rem; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.panel-dark { background: var(--void); color: #E8ECF3; border-color: transparent; }
.panel-dark .mono { color: #8B93A3; }
.panel-dark strong { display: block; color: var(--amber); font-size: 1.2rem; margin: 0.5rem 0; }
.center { text-align: center; padding: 1.75rem; }
.chips { display: flex; flex-wrap: wrap; gap: 0.45rem; margin-top: 0.65rem; }
.chips span { padding: 0.4rem 0.7rem; border: 1px solid var(--line); border-radius: 999px; font-size: 0.8rem; background: var(--paper); }
.chips .out { opacity: 0.45; outline: 2px dashed var(--amber); }
.strata { display: grid; gap: 0.45rem; }
.st { text-align: left; padding: 0.85rem 1rem; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; cursor: pointer; }
.st.is-on { border-color: var(--azure); background: var(--azure-soft); }
.up { color: var(--azure-2); font-size: 0.85rem; }
.down { color: var(--rose); font-size: 0.85rem; }
.code {
  margin: 0; padding: 0.9rem 1rem; background: var(--void); color: #D5DAE3;
  font-family: var(--mono); font-size: 0.78rem; border-radius: var(--radius); overflow-x: auto; white-space: pre-wrap;
}
.nb article { margin-bottom: 0.85rem; }
.tbar { display: flex; min-height: 2.75rem; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: #fff; }
.tbar span {
  display: flex; align-items: center; justify-content: center; padding: 0.25rem;
  font-family: var(--mono); font-size: 0.6rem; border-right: 1px solid rgba(0,0,0,0.06);
  background: rgba(37,99,235,0.12);
}
.narrow-form { max-width: 480px; }
.legal h2 { margin-top: 1.5rem; font-size: 1.05rem; }
.foot { margin-top: 2rem; color: var(--muted); }

/* Sign-in — top bar + dossier card (≠ BookPetal left brand split) */
.page-signin { min-height: 100vh; background: var(--paper); }
.signin-top {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 1rem clamp(1rem, 4vw, 2.5rem); background: var(--void); color: #fff;
}
.top-meta { color: #8B93A3; }
.signin-main {
  display: grid; place-items: center; padding: 2rem 1rem 3rem; min-height: calc(100vh - 64px);
}
.dossier {
  width: min(920px, 100%);
  display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #fff;
  box-shadow: 0 12px 40px rgba(11, 18, 32, 0.08);
}
.dossier-form { padding: 1.75rem 1.5rem; }
.dossier-form h1 { font-size: 1.65rem; }
.dossier-side {
  padding: 1.75rem 1.5rem; background: var(--void); color: #E8ECF3;
  display: flex; flex-direction: column;
}
.dossier-side .mono { color: #8B93A3; }
.dossier-side strong { display: block; font-size: 1.15rem; margin: 0.4rem 0 0.85rem; }
.ws { list-style: none; margin: 0 0 1rem; padding: 0; }
.ws li { padding: 0.65rem 0; border-bottom: 1px solid var(--line-dark); display: grid; gap: 0.15rem; }
.ws .mono { text-transform: none; letter-spacing: 0; font-size: 0.75rem; }
.side-note { margin-top: auto; text-transform: none; letter-spacing: 0; font-size: 0.75rem; }
.id-row { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 1rem 0; }
.auth-links { font-size: 0.88rem; color: var(--muted); }
@media (max-width: 800px) {
  .dossier { grid-template-columns: 1fr; }
}
