/* ==========================================================================
   SafeRank — Literary Editorial Compliance Studio
   Reference Lock: Claude Warm Parchment (#F5F4ED / #FAF9F5 / #141413 / #C96442)
                   × Stripe Precision Typographic Rhythm & Controlled Density
   Hard guarantees: Terracotta single accent, hairline gaps, GPU scaleX motion, warm neutrals only.
   ========================================================================== */

:root {
  /* Claude Warm Surface Ladder */
  --bg-parchment: #F5F4ED;
  --bg-ivory: #FAF9F5;
  --bg-white: #FFFFFF;
  --bg-sand: #E8E6DC;
  --bg-sand-hover: #DFDDD1;
  --bg-near-black: #141413;
  --bg-dark-surface: #30302E;

  /* Claude Warm Ink Hierarchy */
  --ink-primary: #141413;
  --ink-charcoal: #4D4C48;
  --ink-olive: #5E5D59;
  --ink-stone: #87867F;
  --ink-dark-warm: #3D3D3A;
  --ink-ivory: #FAF9F5;
  --ink-silver: #B0AEA5;

  /* Single Brand Point & Muted Semantic Signals */
  --terracotta: #C96442;
  --terracotta-hover: #B55434;
  --terracotta-wash: rgba(201, 100, 66, 0.12);
  --coral: #D97757;

  --error-crimson: #B53333;
  --error-wash: rgba(181, 51, 51, 0.10);
  --warn-ochre: #9A5B13;
  --warn-wash: rgba(154, 91, 19, 0.11);
  --safe-sage: #2B6A4A;
  --safe-wash: rgba(43, 106, 74, 0.10);
  --focus-blue: #3898EC;

  /* Warm Borders & Ring Shadows */
  --border-cream: #F0EEE6;
  --border-warm: #E8E6DC;
  --ring-warm: #D1CFC5;
  --ring-deep: #C2C0B6;
  --ring-subtle: rgba(20, 20, 19, 0.08);

  /* Typography: Claude Serif (weight 500 cap) + Pretendard UI + JetBrains Mono */
  --font-serif: 'Newsreader', 'Noto Serif KR', 'AppleMyungjo', serif;
  --font-sans: 'Pretendard Variable', 'Pretendard', -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* Radius Scale */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  --container-max: 1160px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

  /* Claude Ring + Whisper Elevation (Stripe-calibrated vertical separation) */
  --shadow-studio:
    0 0 0 1px rgba(20, 20, 19, 0.07),
    0 24px 48px -24px rgba(20, 20, 19, 0.10),
    0 4px 20px rgba(20, 20, 19, 0.04);
  --shadow-card:
    0 0 0 1px #E8E6DC,
    0 4px 24px rgba(20, 20, 19, 0.05);
}

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

html {
  background-color: var(--bg-parchment);
  color: var(--ink-primary);
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--bg-parchment);
  color: var(--ink-primary);
  font-family: var(--font-sans);
  font-feature-settings: "liga" 1, "ss01" 1;
  line-height: 1.6;
  letter-spacing: -0.012em;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

button,
input,
textarea,
select,
a {
  font: inherit;
  color: inherit;
  -webkit-tap-highlight-color: transparent;
}

button {
  cursor: pointer;
}

:focus-visible {
  outline: 2px solid var(--focus-blue);
  outline-offset: 2px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: -100px;
  left: 16px;
  z-index: 200;
  padding: 10px 16px;
  background: var(--bg-near-black);
  color: var(--ink-ivory);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  border-radius: var(--radius-sm);
}

.skip-link:focus {
  top: 16px;
}

.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding-inline: clamp(16px, 3.6vw, 40px);
}

.br-mobile {
  display: none;
}

/* ==========================================================================
   HEADER (QUIET PARCHMENT BAR)
   ========================================================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 70;
  background-color: rgba(245, 244, 237, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-warm);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 58px;
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  text-decoration: none;
}

.brand-mark {
  display: inline-flex;
  flex-shrink: 0;
}

.brand-name {
  font-family: var(--font-serif);
  font-size: 1.12rem;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--ink-primary);
}

.brand-sep {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--ring-deep);
}

.brand-sub {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--ink-olive);
  white-space: nowrap;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-shrink: 0;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--ink-olive);
  text-decoration: none;
  transition: color 140ms var(--ease-out);
}

.nav-link:hover {
  color: var(--ink-primary);
}

/* ==========================================================================
   BUTTON SYSTEM (CLAUDE RING-SHADOW TACTILITY — TERRACOTTA SINGLE ACCENT)
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 42px;
  padding: 0 18px;
  border: none;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  text-decoration: none;
  white-space: nowrap;
  transition:
    background-color 150ms var(--ease-out),
    color 150ms var(--ease-out),
    box-shadow 150ms var(--ease-out),
    transform 100ms var(--ease-out);
}

.btn:active {
  transform: scale(0.985);
}

.btn:disabled {
  opacity: 0.56;
  cursor: wait;
}

.btn-terracotta {
  background-color: var(--terracotta);
  color: var(--ink-ivory);
  box-shadow:
    0 0 0 1px var(--terracotta),
    0 8px 20px -10px rgba(201, 100, 66, 0.55);
}

.btn-terracotta:hover {
  background-color: var(--terracotta-hover);
  box-shadow:
    0 0 0 1px var(--terracotta-hover),
    0 10px 24px -10px rgba(181, 84, 52, 0.6);
}

.btn-ink {
  background-color: var(--bg-near-black);
  color: var(--ink-ivory);
  box-shadow: 0 0 0 1px var(--bg-near-black);
}

.btn-ink:hover {
  background-color: var(--bg-dark-surface);
  box-shadow: 0 0 0 1px var(--bg-dark-surface);
}

.btn-sand {
  background-color: var(--bg-sand);
  color: var(--ink-charcoal);
  box-shadow: 0 0 0 1px var(--ring-warm);
}

.btn-sand:hover {
  background-color: var(--bg-sand-hover);
  color: var(--ink-primary);
  box-shadow: 0 0 0 1px var(--ring-deep);
}

.btn-sm {
  min-height: 36px;
  padding: 0 15px;
  border-radius: 10px;
  font-size: 0.8125rem;
}

.btn-block {
  width: 100%;
}

.text-action-btn {
  border: none;
  background: transparent;
  padding: 4px 6px;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--ink-stone);
  transition: color 140ms var(--ease-out), background-color 140ms var(--ease-out);
}

.text-action-btn:hover {
  color: var(--ink-primary);
  background: var(--bg-sand);
}

.text-action-btn.is-accent {
  color: var(--terracotta);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.inline-mini-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 10px;
  border: none;
  border-radius: 7px;
  background: var(--bg-white);
  color: var(--ink-charcoal);
  box-shadow: 0 0 0 1px var(--ring-warm);
  font-size: 0.75rem;
  font-weight: 500;
  transition: background-color 130ms var(--ease-out), color 130ms var(--ease-out);
}

.inline-mini-btn:hover {
  background: var(--bg-sand);
  color: var(--ink-primary);
}

.inline-mini-btn.is-emphasis {
  background: var(--bg-near-black);
  color: var(--ink-ivory);
  box-shadow: 0 0 0 1px var(--bg-near-black);
}

.inline-mini-btn.is-emphasis:hover {
  background: var(--bg-dark-surface);
}

/* ==========================================================================
   CHAPTER 1: EDITORIAL HERO + GRAMMARLY-STYLE SINGLE INLINE WORKSPACE
   ========================================================================== */

.hero-section {
  padding-block: clamp(22px, 3vw, 38px) clamp(56px, 7vw, 88px);
}

.hero-head {
  margin-bottom: clamp(18px, 2.4vw, 24px);
}

.hero-kicker {
  margin: 0 0 8px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--terracotta);
  letter-spacing: 0.01em;
}

.hero-title {
  margin: 0 0 10px;
  font-family: var(--font-serif);
  font-size: clamp(1.7rem, 3vw, 2.65rem);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.032em;
  color: var(--ink-primary);
  word-break: keep-all;
}

.title-accent {
  color: var(--terracotta);
}

.hero-lead {
  margin: 0;
  max-width: 64ch;
  font-size: 0.94rem;
  font-weight: 400;
  line-height: 1.6;
  color: var(--ink-olive);
  word-break: keep-all;
}

/* SCULPTURAL IVORY STUDIO SHELL (RING-SHADOW + HAIRLINE GAP) */

.studio-shell {
  background-color: var(--bg-ivory);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-studio);
  overflow: hidden;
}

/* SINGLE-ROW INSTRUMENT BAR */
.studio-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  padding: 11px 20px;
  background-color: var(--bg-ivory);
  border-bottom: 1px solid var(--border-cream);
}

.studio-selects {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.18fr);
  gap: 8px;
  flex: 1 1 380px;
  min-width: 0;
}

.control-select {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 0;
}

.control-select select {
  width: 100%;
  height: 36px;
  padding: 0 30px 0 12px;
  appearance: none;
  -webkit-appearance: none;
  background-color: var(--bg-parchment);
  border: none;
  border-radius: var(--radius-sm);
  box-shadow: 0 0 0 1px var(--ring-warm);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--ink-primary);
  text-overflow: ellipsis;
  cursor: pointer;
  transition: background-color 140ms var(--ease-out), box-shadow 140ms var(--ease-out);
}

.control-select select:hover {
  background-color: var(--bg-sand);
}

.control-select select:focus {
  outline: none;
  background-color: var(--bg-white);
  box-shadow: 0 0 0 1.5px var(--focus-blue);
}

.select-chevron {
  position: absolute;
  right: 10px;
  color: var(--ink-olive);
  pointer-events: none;
}

.studio-switches {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 14px;
}

.switch-control {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--ink-olive);
  cursor: pointer;
  user-select: none;
}

.switch-control input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.switch-track {
  position: relative;
  width: 30px;
  height: 18px;
  border-radius: 999px;
  background: var(--ring-warm);
  flex-shrink: 0;
  transition: background-color 160ms var(--ease-out);
}

.switch-track::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--bg-ivory);
  box-shadow: 0 1px 2px rgba(20, 20, 19, 0.22);
  transition: transform 160ms var(--ease-out);
}

.switch-control input:checked + .switch-track {
  background: var(--bg-near-black);
}

.switch-control input:checked + .switch-track::after {
  transform: translateX(12px);
}

.switch-control input:focus-visible + .switch-track {
  outline: 2px solid var(--focus-blue);
  outline-offset: 2px;
}

/* 2-COLUMN WORKSPACE DIVIDED BY 1px WARM HAIRLINE GAP */
.studio-body {
  display: grid;
  grid-template-columns: minmax(0, 1.38fr) minmax(0, 0.86fr);
  gap: 1px;
  background-color: var(--border-warm);
  align-items: stretch;
}

/* LEFT COLUMN: SINGLE INLINE WORKSPACE */
.editor-column {
  min-width: 0;
  display: flex;
  flex-direction: column;
  background-color: var(--bg-ivory);
}

.editor-subbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 14px;
  padding: 10px 22px;
  border-bottom: 1px solid var(--border-cream);
}

.editor-hint {
  font-size: 0.78rem;
  color: var(--ink-stone);
}

.editor-meta-right {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
}

.signal-legend {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 0.74rem;
  color: var(--ink-stone);
}

.signal-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
}

.dot-danger { background: var(--error-crimson); }
.dot-ftc { background: var(--terracotta); }
.dot-safe { background: var(--safe-sage); }

.meta-sep {
  color: var(--ring-deep);
}

.mono-meta {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--ink-olive);
  font-variant-numeric: tabular-nums;
}

.mono-pill {
  font-family: var(--font-mono);
  font-size: 0.71rem;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--bg-sand);
  color: var(--ink-charcoal);
  font-variant-numeric: tabular-nums;
}

/* ==========================================================================
   SINGLE OVERLAY INLINE EDITOR (ZERO-DRIFT METRIC LOCK + THIN SCROLLBAR)
   ========================================================================== */

.live-editor-wrap {
  position: relative;
  flex: 1 0 auto;
  min-height: 292px;
  max-height: 372px;
  background: var(--bg-ivory);
  cursor: text;
}

.live-backdrop,
.live-textarea {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 20px 24px 22px;
  border: 0;
  font-family: var(--font-sans);
  font-size: 0.985rem;
  font-weight: 400;
  line-height: 1.88;
  letter-spacing: -0.01em;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: break-word;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-gutter: stable;
  tab-size: 2;
}

.live-backdrop {
  z-index: 1;
  color: var(--ink-primary);
  pointer-events: none;
  scrollbar-width: thin;
  scrollbar-color: transparent transparent;
}

.live-backdrop::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.live-backdrop::-webkit-scrollbar-track,
.live-backdrop::-webkit-scrollbar-thumb {
  background: transparent;
}

.live-textarea {
  z-index: 2;
  background: transparent;
  color: transparent;
  -webkit-text-fill-color: transparent;
  caret-color: var(--ink-primary);
  resize: none;
  outline: none;
  scrollbar-width: thin;
  scrollbar-color: rgba(20, 20, 19, 0.22) transparent;
}

.live-textarea::-webkit-scrollbar,
.findings-list::-webkit-scrollbar,
.modal-body-scroll::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.live-textarea::-webkit-scrollbar-track,
.findings-list::-webkit-scrollbar-track,
.modal-body-scroll::-webkit-scrollbar-track {
  background: transparent;
}

.live-textarea::-webkit-scrollbar-thumb,
.findings-list::-webkit-scrollbar-thumb,
.modal-body-scroll::-webkit-scrollbar-thumb {
  background: rgba(20, 20, 19, 0.18);
  border-radius: 999px;
}

.live-textarea::-webkit-scrollbar-thumb:hover,
.findings-list::-webkit-scrollbar-thumb:hover,
.modal-body-scroll::-webkit-scrollbar-thumb:hover {
  background: rgba(20, 20, 19, 0.34);
}

.live-textarea::placeholder {
  color: var(--ink-stone);
  -webkit-text-fill-color: var(--ink-stone);
}

.live-textarea::selection {
  background: rgba(201, 100, 66, 0.16);
}

.live-editor-wrap:focus-within {
  box-shadow: inset 0 0 0 1.5px rgba(56, 152, 236, 0.38);
}

/* ZERO-PADDING-DRIFT INLINE MARKS (KOREAN PARTICLE SEPARATION = 0) */
.hl-mark {
  display: inline;
  padding: 0;
  margin: 0;
  border: 0;
  font-weight: inherit;
  border-radius: 3px;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

.hl-danger {
  background: var(--error-wash);
  color: #9A2626;
  box-shadow: inset 0 -1.8px 0 var(--error-crimson);
}

.hl-ftc {
  background: var(--terracotta-wash);
  color: #9D4527;
  box-shadow: inset 0 -1.8px 0 var(--terracotta);
}

.hl-warn {
  background: var(--warn-wash);
  color: var(--warn-ochre);
  box-shadow: inset 0 -1.5px 0 rgba(154, 91, 19, 0.72);
}

.hl-safe {
  background: var(--safe-wash);
  color: var(--safe-sage);
  box-shadow: inset 0 -1.5px 0 rgba(43, 106, 74, 0.55);
}

/* COMPACT 1-LINE INLINE APPLIED BAR (NO 3RD COPY TEXTAREA) */
.inline-applied-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  padding: 10px 22px;
  background: rgba(43, 106, 74, 0.08);
  border-top: 1px solid rgba(43, 106, 74, 0.18);
}

.inline-applied-bar[hidden] {
  display: none;
}

.applied-status {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--safe-sage);
}

.applied-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* EDITOR ACTION BAR */
.editor-footer {
  display: grid;
  grid-template-columns: 0.78fr 1.22fr;
  gap: 10px;
  padding: 14px 22px 16px;
  background: var(--bg-ivory);
  border-top: 1px solid var(--border-cream);
}

/* QUIET 2-COLUMN HAIRLINE FOOTNOTE (ZERO BOX NESTING) */
.editor-footnote-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  padding: 16px 22px 18px;
  background: var(--bg-parchment);
  border-top: 1px solid var(--border-warm);
}

.footnote-col {
  min-width: 0;
}

.footnote-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}

.footnote-head.is-between {
  justify-content: space-between;
}

.footnote-head strong {
  font-size: 0.77rem;
  font-weight: 600;
  color: var(--ink-primary);
}

.footnote-tag {
  font-family: var(--font-mono);
  font-size: 0.67rem;
  font-weight: 500;
  padding: 2px 6px;
  border-radius: 5px;
  background: var(--bg-near-black);
  color: var(--ink-ivory);
}

.footnote-col p {
  margin: 0;
  font-size: 0.75rem;
  line-height: 1.56;
  color: var(--ink-olive);
  word-break: keep-all;
}

.disclosure-copy {
  white-space: pre-wrap;
}

/* ==========================================================================
   RIGHT COLUMN: SINGLE AUTHORITATIVE RISK SIDEBAR (HAIRLINE LEDGER, ZERO BOXES)
   ========================================================================== */

.inspector-column {
  min-width: 0;
  padding: 18px 22px 20px;
  background-color: #F8F7F1;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.inspector-score {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.score-top-row {
  display: flex;
  align-items: baseline;
  gap: 14px;
}

.score-num-wrap {
  display: inline-flex;
  align-items: baseline;
  gap: 3px;
  flex-shrink: 0;
}

.score-number {
  font-family: var(--font-serif);
  font-size: 2.55rem;
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  color: var(--error-crimson);
}

.score-denom {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--ink-stone);
}

.score-copy {
  min-width: 0;
}

.score-grade {
  margin: 0 0 2px;
  font-size: 0.94rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--error-crimson);
}

.score-summary {
  margin: 0;
  font-size: 0.78rem;
  color: var(--ink-olive);
  line-height: 1.5;
  word-break: keep-all;
}

/* GPU-ONLY SCORE METER (SCALE-X TRANSFORM) */
.score-track {
  width: 100%;
  height: 5px;
  border-radius: 999px;
  background: var(--bg-sand);
  overflow: hidden;
}

.score-fill {
  width: 100%;
  height: 100%;
  border-radius: 999px;
  background: var(--error-crimson);
  transform-origin: left center;
  transform: scaleX(0);
  will-change: transform;
  transition: transform 280ms var(--ease-out), background-color 180ms var(--ease-out);
}

/* HAIRLINE PRECISION METRIC LEDGER (ZERO NESTED CARDS) */
.metric-ledger {
  margin: 0;
  padding: 10px 0;
  border-top: 1px solid var(--border-warm);
  border-bottom: 1px solid var(--border-warm);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px 18px;
}

.metric-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}

.metric-row dt {
  font-size: 0.75rem;
  color: var(--ink-stone);
}

.metric-row dd {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--ink-primary);
  font-variant-numeric: tabular-nums;
}

.metric-row dd.is-danger { color: var(--error-crimson); }
.metric-row dd.is-warn { color: var(--warn-ochre); }
.metric-row dd.is-safe { color: var(--safe-sage); }

/* HAIRLINE EDITORIAL FINDINGS LIST */
.findings-section {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.section-micro-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--ink-stone);
}

.mono-count {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 500;
  color: var(--ink-primary);
}

.findings-list {
  display: flex;
  flex-direction: column;
  max-height: 318px;
  overflow-y: auto;
  padding-right: 4px;
  border-top: 1px solid var(--border-cream);
  scrollbar-width: thin;
  scrollbar-color: rgba(20, 20, 19, 0.22) transparent;
}

.finding-item {
  padding: 11px 0;
  border-bottom: 1px solid var(--border-cream);
}

.finding-top {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}

.finding-term {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--error-crimson);
}

.finding-item.is-ftc .finding-term { color: var(--terracotta); }
.finding-item.is-warn .finding-term { color: var(--warn-ochre); }
.finding-item.is-safe .finding-term { color: var(--safe-sage); }

.finding-badge {
  font-size: 0.69rem;
  font-weight: 500;
  padding: 2px 7px;
  border-radius: 6px;
}

.badge-danger { background: var(--error-wash); color: var(--error-crimson); }
.badge-ftc { background: var(--terracotta-wash); color: var(--terracotta); }
.badge-warn { background: var(--warn-wash); color: var(--warn-ochre); }
.badge-safe { background: var(--safe-wash); color: var(--safe-sage); }

.finding-reason {
  margin: 0 0 5px;
  font-size: 0.76rem;
  color: var(--ink-olive);
  line-height: 1.5;
  word-break: keep-all;
}

.finding-replace {
  font-size: 0.79rem;
  color: var(--ink-primary);
  line-height: 1.48;
}

.finding-replace strong {
  color: var(--safe-sage);
  font-weight: 600;
  margin-right: 6px;
}

.inspector-cta {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: auto;
  padding-top: 4px;
}

.empty-state {
  margin: 0;
  padding: 14px 0;
  font-size: 0.82rem;
  color: var(--ink-stone);
}

/* ==========================================================================
   CHAPTER 2 (NEAR BLACK #141413): CLAUDE DARK/LIGHT ALTERNATION
   ========================================================================== */

.criteria-section {
  padding-block: clamp(64px, 7.5vw, 96px);
  background: var(--bg-near-black);
  color: var(--ink-ivory);
}

.section-header {
  max-width: 62ch;
  margin-bottom: clamp(28px, 3.8vw, 44px);
}

.section-kicker {
  display: inline-block;
  margin-bottom: 10px;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--terracotta);
  letter-spacing: 0.01em;
}

.section-kicker.is-coral {
  color: var(--coral);
}

.section-title {
  margin: 0 0 12px;
  font-family: var(--font-serif);
  font-size: clamp(1.6rem, 2.9vw, 2.5rem);
  font-weight: 500;
  line-height: 1.18;
  letter-spacing: -0.03em;
  color: var(--ink-primary);
  word-break: keep-all;
}

.section-title.is-on-dark {
  color: var(--ink-ivory);
}

.section-lead {
  margin: 0;
  font-size: 0.94rem;
  line-height: 1.62;
  color: var(--ink-olive);
  word-break: keep-all;
}

.criteria-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  background: var(--bg-dark-surface);
  border-radius: var(--radius-lg);
  box-shadow: 0 0 0 1px var(--bg-dark-surface);
  overflow: hidden;
}

.criteria-cell {
  display: flex;
  flex-direction: column;
  padding: clamp(24px, 3vw, 32px);
  background: var(--bg-near-black);
}

.criteria-index {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 500;
  color: var(--coral);
  margin-bottom: 14px;
}

.criteria-title {
  margin: 0 0 10px;
  font-family: var(--font-serif);
  font-size: 1.22rem;
  font-weight: 500;
  line-height: 1.28;
  color: var(--ink-ivory);
  word-break: keep-all;
}

.criteria-desc {
  margin: 0 0 22px;
  flex: 1;
  font-size: 0.875rem;
  line-height: 1.62;
  color: var(--ink-silver);
  word-break: keep-all;
}

.criteria-proof {
  margin: 0;
  padding-top: 14px;
  border-top: 1px solid var(--bg-dark-surface);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  font-weight: 500;
}

.diff-bad {
  color: #E0927D;
  text-decoration: line-through;
  text-decoration-thickness: 1.3px;
}

.diff-sep {
  color: var(--ink-stone);
}

.diff-good {
  color: var(--ink-ivory);
}

/* ==========================================================================
   CHAPTER 3 (PARCHMENT): EDITORIAL PRICING PAIR
   ========================================================================== */

.pricing-section {
  padding-block: clamp(64px, 7.5vw, 96px);
  background: var(--bg-parchment);
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.plan-card {
  display: flex;
  flex-direction: column;
  padding: clamp(24px, 3.2vw, 36px);
  border-radius: var(--radius-lg);
}

.plan-light {
  background: var(--bg-ivory);
  box-shadow: var(--shadow-card);
}

.plan-dark {
  background: var(--bg-near-black);
  color: var(--ink-ivory);
  box-shadow: 0 0 0 1px var(--bg-dark-surface), 0 24px 48px -20px rgba(20, 20, 19, 0.34);
}

.plan-code {
  display: inline-block;
  margin-bottom: 12px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--ink-stone);
}

.plan-code.is-coral {
  color: var(--coral);
}

.plan-name {
  margin: 0 0 14px;
  font-family: var(--font-serif);
  font-size: clamp(1.3rem, 2vw, 1.62rem);
  font-weight: 500;
  line-height: 1.28;
  word-break: keep-all;
}

.plan-price-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 22px;
}

.plan-price {
  font-size: 1.9rem;
  font-weight: 600;
  letter-spacing: -0.025em;
  font-variant-numeric: tabular-nums;
}

.plan-unit {
  font-size: 0.82rem;
  color: var(--ink-stone);
}

.plan-dark .plan-unit {
  color: var(--ink-silver);
}

.plan-list {
  list-style: none;
  margin: 0 0 28px;
  padding: 20px 0 0;
  border-top: 1px solid var(--border-warm);
  display: flex;
  flex-direction: column;
  gap: 11px;
  flex: 1;
}

.plan-dark .plan-list {
  border-top-color: var(--bg-dark-surface);
}

.plan-list li {
  position: relative;
  padding-left: 16px;
  font-size: 0.9rem;
  line-height: 1.58;
  color: var(--ink-olive);
  word-break: keep-all;
}

.plan-dark .plan-list li {
  color: rgba(250, 249, 245, 0.84);
}

.plan-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.72em;
  width: 6px;
  height: 1.5px;
  background: var(--terracotta);
}

.plan-dark .plan-list li::before {
  background: var(--coral);
}

/* ==========================================================================
   FOOTER
   ========================================================================== */

.site-footer {
  padding-block: 32px 44px;
  border-top: 1px solid var(--border-warm);
  background: var(--bg-parchment);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px 32px;
}

.footer-brand-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.footer-brand {
  font-family: var(--font-serif);
  font-size: 1.02rem;
  font-weight: 500;
}

.footer-divider {
  color: var(--ring-deep);
}

.footer-tag {
  font-size: 0.8rem;
  color: var(--ink-stone);
}

.footer-note {
  margin: 8px 0 0;
  max-width: 64ch;
  font-size: 0.78rem;
  line-height: 1.58;
  color: var(--ink-stone);
  word-break: keep-all;
}

.footer-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--ink-olive);
}

.footer-inquiry-btn {
  border: none;
  background: transparent;
  padding: 0;
  color: var(--ink-primary);
  font-size: 0.84rem;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 4px;
  transition: color 140ms var(--ease-out);
}

.footer-inquiry-btn:hover {
  color: var(--terracotta);
}

/* ==========================================================================
   MODAL & TOAST (SINGLE PRIMARY CTA, THIN SCROLLBAR, KEEP-ALL)
   ========================================================================== */

.modal-root {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 16px;
}

.modal-root[hidden] {
  display: none;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 20, 19, 0.54);
  backdrop-filter: blur(8px);
}

.modal-sheet {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 560px;
  max-height: min(90vh, 760px);
  display: flex;
  flex-direction: column;
  background: var(--bg-ivory);
  border-radius: var(--radius-lg);
  box-shadow: 0 0 0 1px rgba(20, 20, 19, 0.10), 0 32px 64px -18px rgba(20, 20, 19, 0.34);
  overflow: hidden;
}

.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border-cream);
  flex-shrink: 0;
}

.modal-head-copy {
  min-width: 0;
}

.modal-kicker {
  display: block;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--terracotta);
  margin-bottom: 4px;
  word-break: keep-all;
}

.modal-title {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 1.3rem;
  font-weight: 500;
  line-height: 1.26;
  word-break: keep-all;
}

.close-btn {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 999px;
  background: var(--bg-sand);
  color: var(--ink-charcoal);
  flex-shrink: 0;
  transition: background-color 140ms var(--ease-out), color 140ms var(--ease-out);
}

.close-btn:hover {
  background: var(--bg-sand-hover);
  color: var(--ink-primary);
}

.modal-form {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
}

.modal-body-scroll {
  padding: 18px 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 13px;
  flex: 1;
  scrollbar-width: thin;
  scrollbar-color: rgba(20, 20, 19, 0.22) transparent;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 0.79rem;
  font-weight: 500;
  color: var(--ink-olive);
}

.form-field em {
  font-style: normal;
  color: var(--terracotta);
}

.modal-select-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.modal-select-wrap select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 32px;
  cursor: pointer;
}

.form-field input,
.form-field select,
.form-field textarea {
  width: 100%;
  padding: 9px 12px;
  background: var(--bg-white);
  border: none;
  border-radius: var(--radius-md);
  box-shadow: 0 0 0 1px var(--ring-warm);
  font-size: 0.875rem;
  font-weight: 400;
  color: var(--ink-primary);
  transition: box-shadow 140ms var(--ease-out);
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  outline: none;
  box-shadow: 0 0 0 1.5px var(--focus-blue);
}

.form-field textarea[readonly] {
  background: var(--bg-parchment);
  font-size: 0.78rem;
  color: var(--ink-olive);
}

.form-feedback {
  padding: 11px 13px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  line-height: 1.54;
  font-weight: 500;
  word-break: keep-all;
}

.form-feedback.is-error {
  background: var(--error-wash);
  color: var(--error-crimson);
}

.form-feedback.is-success {
  background: var(--safe-wash);
  color: var(--safe-sage);
}

.modal-actions {
  display: flex;
  padding: 14px 24px 18px;
  background: var(--bg-parchment);
  border-top: 1px solid var(--border-warm);
  flex-shrink: 0;
}

.toast-region {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 160;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast-item {
  padding: 11px 16px;
  background: var(--bg-near-black);
  color: var(--ink-ivory);
  border-radius: var(--radius-md);
  font-size: 0.83rem;
  font-weight: 500;
  box-shadow: 0 14px 32px rgba(20, 20, 19, 0.28);
}

/* ==========================================================================
   RESPONSIVE: 390x844 ZERO TRUNCATION, ZERO CLIP, ZERO OVERFLOW
   ========================================================================== */

@media (max-width: 980px) {
  .studio-body,
  .criteria-grid,
  .pricing-grid,
  .editor-footnote-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .brand-sep,
  .brand-sub,
  .nav-link,
  .hero-lead,
  .editor-hint,
  .mono-pill,
  .meta-sep,
  .br-desktop {
    display: none;
  }

  .br-mobile {
    display: inline;
  }

  .header-inner {
    min-height: 50px;
  }

  .hero-section {
    padding-top: 14px;
    padding-bottom: 44px;
  }

  .hero-head {
    margin-bottom: 12px;
  }

  .hero-kicker {
    margin-bottom: 6px;
    font-size: 0.72rem;
  }

  .hero-title {
    margin-bottom: 0;
    font-size: 1.5rem;
    line-height: 1.22;
  }

  .studio-shell {
    border-radius: 14px;
  }

  .studio-bar {
    padding: 9px 12px;
    gap: 7px;
  }

  .studio-selects {
    grid-template-columns: minmax(0, 0.82fr) minmax(0, 1.18fr);
    gap: 6px;
  }

  .control-select select {
    height: 34px;
    padding: 0 22px 0 9px;
    font-size: 0.75rem;
  }

  .studio-switches {
    gap: 4px 12px;
  }

  .switch-control {
    min-height: 30px;
    font-size: 0.75rem;
  }

  .editor-subbar {
    padding: 7px 14px;
  }

  .editor-meta-right {
    width: 100%;
    justify-content: space-between;
  }

  .live-editor-wrap {
    min-height: 292px;
    max-height: 400px;
  }

  .live-backdrop,
  .live-textarea {
    padding: 13px 14px 15px;
    font-size: 0.86rem;
    line-height: 1.72;
  }

  .inline-applied-bar {
    padding: 9px 14px;
  }

  .editor-footer {
    padding: 10px 12px 12px;
    grid-template-columns: 0.78fr 1.22fr;
    gap: 8px;
  }

  .editor-footer .btn {
    min-height: 40px;
    padding: 0 10px;
    font-size: 0.81rem;
  }

  .editor-footnote-row {
    padding: 12px 14px 14px;
    gap: 12px;
  }

  .inspector-column {
    padding: 16px 14px;
  }

  .modal-root {
    padding: 10px;
  }

  .modal-sheet {
    max-height: 92vh;
    border-radius: 16px;
  }

  .modal-head {
    padding: 16px 16px 12px;
  }

  .modal-title {
    font-size: 1.14rem;
  }

  .modal-body-scroll {
    padding: 14px 16px;
    gap: 10px;
  }

  .form-row {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .modal-actions {
    padding: 12px 16px 14px;
  }

  .footer-right {
    align-items: flex-start;
  }

  .toast-region {
    left: 14px;
    right: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 1ms !important;
  }
}
