/* AdPreflight — Vercel × Stripe Reference-Locked Design System
   Strict Tokens:
   - Canvas #FFFFFF, Subtle #FAFAFA, Ink #171717, Gray 600 #4D4D4D, Gray 500 #666666, Gray 100 #EBEBEB
   - Shadow-as-Border: 0 0 0 1px rgba(0, 0, 0, 0.08) (ZERO border-left anywhere)
   - 3 Semantic Accents: Risk #FF5B4F (#C42B22 AA text), Pass #108C3D, Focus #0072F5
   - GPU-only motion (transform and opacity only)
   - Geist (display -0.038em, lh 1.05, liga 1) + Geist Mono (tabular-nums)
*/

:root {
  --bg-canvas: #ffffff;
  --bg-subtle: #fafafa;
  --bg-muted: #f5f5f5;
  --ink-primary: #171717;
  --ink-secondary: #4d4d4d;
  --ink-tertiary: #666666;
  --ink-placeholder: #808080;
  --line-light: #ebebeb;

  /* Strict 3 Semantic Accents */
  --risk-accent: #ff5b4f;
  --risk-ink: #c42b22;
  --risk-wash: rgba(255, 91, 79, 0.12);
  --risk-underline: rgba(255, 91, 79, 0.72);

  --pass-accent: #108c3d;
  --pass-wash: rgba(16, 140, 61, 0.11);

  --focus-blue: #0072f5;
  --focus-wash: #ebf5ff;
  --focus-ring: rgba(0, 114, 245, 0.28);

  --caution-ink: #8a5300;
  --caution-wash: rgba(138, 83, 0, 0.10);

  /* Vercel Shadow-as-Border + Stripe Chromatic Depth */
  --ring-border: 0 0 0 1px rgba(0, 0, 0, 0.08);
  --ring-strong: 0 0 0 1px rgba(0, 0, 0, 0.16);
  --ring-light: 0 0 0 1px rgb(235, 235, 235);
  --shadow-card: 0 0 0 1px rgba(0, 0, 0, 0.08), 0 2px 2px rgba(0, 0, 0, 0.04), 0 8px 8px -8px rgba(0, 0, 0, 0.04), inset 0 0 0 1px #fafafa;
  --shadow-studio: 0 0 0 1px rgba(0, 0, 0, 0.08), 0 24px 48px -28px rgba(50, 50, 93, 0.22), 0 10px 24px -16px rgba(0, 0, 0, 0.08);
  --shadow-modal: 0 0 0 1px rgba(0, 0, 0, 0.08), 0 30px 45px -30px rgba(50, 50, 93, 0.25), 0 18px 36px -18px rgba(0, 0, 0, 0.10);

  --font-sans: 'Geist', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'Geist Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
  --radius-xl: 12px;
  --radius-pill: 9999px;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
  background-color: var(--bg-canvas);
  color: var(--ink-primary);
  font-family: var(--font-sans);
  font-feature-settings: "liga" 1;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
  overflow-x: clip;
}

body {
  margin: 0;
  background-color: var(--bg-canvas);
  color: var(--ink-primary);
  font-size: 15px;
  font-weight: 400;
  line-height: 1.5;
  overflow-x: clip;
  -webkit-tap-highlight-color: transparent;
}

.mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1, "liga" 1;
}

[hidden] {
  display: none !important;
}

.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: absolute;
  left: -9999px;
  top: 8px;
  z-index: 200;
  padding: 8px 14px;
  background: var(--ink-primary);
  color: #ffffff;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
}

.skip-link:focus {
  left: 12px;
}

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

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding-inline: 20px;
}

/* ==================== HEADER ==================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 1px 0 0 rgba(0, 0, 0, 0.08);
}

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

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-primary);
  text-decoration: none;
  flex-shrink: 0;
}

.brand-mark {
  width: 26px;
  height: 26px;
  border-radius: var(--radius-md);
  background: var(--ink-primary);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.brand-name {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.025em;
}

.brand-tag {
  font-size: 11px;
  font-weight: 500;
  color: var(--ink-tertiary);
  background: var(--bg-subtle);
  box-shadow: var(--ring-border);
  border-radius: var(--radius-pill);
  padding: 2px 7px;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 20px;
}

.nav-link {
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-secondary);
  text-decoration: none;
  transition: color 140ms ease;
}

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

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

.pro-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 500;
  color: var(--pass-accent);
  background: var(--pass-wash);
  box-shadow: 0 0 0 1px rgba(16, 140, 61, 0.24);
}

/* ==================== BUTTONS ==================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 40px;
  padding: 8px 16px;
  border: 0;
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.01em;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 140ms ease, color 140ms ease, box-shadow 140ms ease, transform 120ms var(--ease-out), opacity 140ms ease;
}

.btn:active:not(:disabled) {
  transform: translateY(1px);
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-dark {
  background: var(--ink-primary);
  color: #ffffff;
  box-shadow: 0 0 0 1px var(--ink-primary);
}

.btn-dark:hover:not(:disabled) {
  background: #2b2b2b;
}

.btn-secondary {
  background: #ffffff;
  color: var(--ink-primary);
  box-shadow: var(--ring-border), 0 1px 2px rgba(0, 0, 0, 0.04);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--bg-subtle);
  box-shadow: var(--ring-strong);
}

.btn-ghost {
  background: transparent;
  color: var(--ink-secondary);
  box-shadow: var(--ring-light);
}

.btn-ghost:hover:not(:disabled) {
  color: var(--ink-primary);
  background: var(--bg-subtle);
}

.btn-sm {
  min-height: 34px;
  padding: 6px 12px;
  font-size: 13px;
}

.btn-xs {
  min-height: 30px;
  padding: 4px 10px;
  font-size: 12px;
}

.btn-full {
  width: 100%;
}

.text-link-btn {
  border: 0;
  background: transparent;
  padding: 4px 6px;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 500;
  color: var(--focus-blue);
  cursor: pointer;
  border-radius: var(--radius-sm);
}

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

.icon-btn {
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--ink-tertiary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 120ms ease, color 120ms ease;
}

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

/* ==================== HERO ==================== */
.hero-section {
  padding: 28px 0 20px;
}

.hero-inner {
  max-width: 1200px;
}

.hero-kicker-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.hero-kicker {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--ink-tertiary);
  text-transform: uppercase;
}

.privacy-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  background: var(--focus-wash);
  color: #0058c0;
  font-size: 12px;
  font-weight: 500;
}

.hero-title {
  margin: 0;
  font-size: clamp(28px, 3.6vw, 44px);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.038em;
  color: var(--ink-primary);
  max-width: 820px;
}

.hero-subtitle {
  margin: 10px 0 0;
  font-size: 15px;
  font-weight: 400;
  line-height: 1.5;
  color: var(--ink-secondary);
  max-width: 720px;
}

/* ==================== WORKSPACE SHELL ==================== */
.workspace-section {
  padding: 4px 0 48px;
}

.studio-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(0, 0.82fr);
  gap: 1px;
  background: rgba(0, 0, 0, 0.08);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-studio);
}

.studio-left {
  background: var(--bg-canvas);
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.studio-right {
  background: var(--bg-subtle);
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* Left Toolbar */
.editor-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 16px;
  background: var(--bg-subtle);
  box-shadow: 0 1px 0 0 rgba(0, 0, 0, 0.06);
}

.platform-group {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px;
  background: #ffffff;
  border-radius: var(--radius-md);
  box-shadow: var(--ring-border);
}

.platform-pill {
  border: 0;
  background: transparent;
  color: var(--ink-secondary);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  padding: 5px 11px;
  min-height: 30px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background-color 140ms ease, color 140ms ease;
}

.platform-pill:hover {
  color: var(--ink-primary);
}

.platform-pill.is-active {
  background: var(--ink-primary);
  color: #ffffff;
}

.toolbar-right {
  display: flex;
  align-items: center;
  min-width: 0;
}

.sample-select {
  appearance: none;
  background-color: #ffffff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23666666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  color: var(--ink-primary);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  padding: 6px 28px 6px 10px;
  min-height: 34px;
  border: 0;
  border-radius: var(--radius-md);
  box-shadow: var(--ring-border);
  cursor: pointer;
  max-width: 220px;
}

/* Grammarly-Grade Zero-Drift Inline Editor */
.editor-stage {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.live-editor-wrap {
  position: relative;
  width: 100%;
  min-height: 220px;
  background: #ffffff;
}

.live-backdrop,
.live-textarea {
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.65;
  letter-spacing: -0.01em;
  padding: 20px 20px 18px;
  margin: 0;
  border: 0;
  width: 100%;
  min-height: 220px;
  max-height: 360px;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: break-word;
  tab-size: 2;
  scrollbar-gutter: stable;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(23, 23, 23, 0.2) transparent;
}

.live-backdrop {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  color: transparent;
  user-select: none;
}

.live-textarea {
  position: relative;
  z-index: 2;
  display: block;
  resize: none;
  background: transparent;
  color: var(--ink-primary);
  caret-color: var(--ink-primary);
  outline: none;
}

.live-textarea::placeholder {
  color: var(--ink-placeholder);
}

.live-textarea:focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 2px var(--focus-blue);
}

/* Zero-Drift Highlight Spans: padding 0, margin 0, border 0, clone decoration */
.hl-mark {
  padding: 0;
  margin: 0;
  border: 0;
  font-weight: inherit;
  color: transparent;
  border-radius: 2px;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

.hl-mark-critical {
  background-color: var(--risk-wash);
  box-shadow: inset 0 -2px 0 0 var(--risk-underline);
}

.hl-mark-warning {
  background-color: var(--caution-wash);
  box-shadow: inset 0 -2px 0 0 rgba(138, 83, 0, 0.55);
}

/* Rewrite Applied Banner */
.rewrite-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 16px;
  background: var(--pass-wash);
  box-shadow: inset 0 1px 0 0 rgba(16, 140, 61, 0.18), inset 0 -1px 0 0 rgba(16, 140, 61, 0.18);
  font-size: 13px;
  color: var(--pass-accent);
  font-weight: 500;
}

.rewrite-banner-text {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

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

/* Primary Action Bar */
.editor-actions-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 16px;
  background: #ffffff;
  box-shadow: 0 -1px 0 0 rgba(0, 0, 0, 0.06);
}

.primary-cta-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.editor-meta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--ink-tertiary);
}

.meta-dot {
  color: #c4c4c4;
}

/* Landing URL Pre-Flight Strip */
.url-strip {
  padding: 14px 16px 16px;
  background: var(--bg-subtle);
  box-shadow: 0 -1px 0 0 rgba(0, 0, 0, 0.07);
}

.url-strip-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.url-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-primary);
}

.url-input-row {
  display: flex;
  gap: 8px;
}

.url-input {
  flex: 1;
  min-width: 0;
  min-height: 36px;
  padding: 6px 12px;
  border: 0;
  border-radius: var(--radius-md);
  background: #ffffff;
  color: var(--ink-primary);
  font-family: var(--font-mono);
  font-size: 12.5px;
  box-shadow: var(--ring-border);
}

.url-input::placeholder {
  color: var(--ink-placeholder);
}

.url-fallback-panel {
  margin-top: 10px;
  padding: 12px;
  border-radius: var(--radius-lg);
  background: #ffffff;
  box-shadow: 0 0 0 1px rgba(255, 91, 79, 0.35);
}

.url-fallback-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.url-fallback-msg {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--risk-ink);
  font-weight: 500;
}

.url-fallback-msg svg {
  flex-shrink: 0;
  margin-top: 2px;
}

.paste-fallback-textarea {
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-radius: var(--radius-md);
  background: var(--bg-subtle);
  color: var(--ink-primary);
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1.5;
  box-shadow: var(--ring-border);
  resize: vertical;
}

.url-fallback-actions {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.fallback-hint {
  font-size: 11px;
  color: var(--ink-tertiary);
}

.landing-result-box {
  margin-top: 10px;
  padding: 12px;
  border-radius: var(--radius-lg);
  background: #ffffff;
  box-shadow: var(--ring-border);
}

.landing-result-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-bottom: 8px;
  box-shadow: 0 1px 0 0 rgba(0, 0, 0, 0.06);
}

.landing-result-title {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 340px;
}

.landing-checks-list {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.landing-check-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--ink-secondary);
}

.landing-check-main {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  min-width: 0;
}

.landing-check-fix {
  display: block;
  font-size: 11.5px;
  color: var(--ink-tertiary);
  margin-top: 2px;
}

/* ==================== RIGHT INSPECTOR ==================== */
.score-header {
  padding: 16px 18px 14px;
  background: #ffffff;
  box-shadow: 0 1px 0 0 rgba(0, 0, 0, 0.07);
}

.score-top-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.score-kicker {
  margin: 0;
  font-size: 11px;
  font-weight: 500;
  color: var(--ink-tertiary);
  letter-spacing: 0.04em;
}

.score-value-row {
  display: flex;
  align-items: baseline;
  gap: 3px;
  margin-top: 2px;
}

.score-number {
  font-size: 32px;
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.03em;
  color: var(--ink-primary);
}

.score-denom {
  font-size: 14px;
  color: var(--ink-tertiary);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 9px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.status-pill.is-risk {
  background: var(--risk-wash);
  color: var(--risk-ink);
  box-shadow: 0 0 0 1px rgba(255, 91, 79, 0.28);
}

.status-pill.is-caution {
  background: var(--caution-wash);
  color: var(--caution-ink);
  box-shadow: 0 0 0 1px rgba(138, 83, 0, 0.24);
}

.status-pill.is-ready {
  background: var(--pass-wash);
  color: var(--pass-accent);
  box-shadow: 0 0 0 1px rgba(16, 140, 61, 0.26);
}

.status-pill.is-empty {
  background: var(--bg-muted);
  color: var(--ink-tertiary);
  box-shadow: var(--ring-border);
}

/* GPU-ONLY Score Bar (transform scaleX only) */
.score-bar-track {
  margin-top: 10px;
  height: 5px;
  width: 100%;
  border-radius: var(--radius-pill);
  background: var(--line-light);
  overflow: hidden;
}

.score-bar-fill {
  height: 100%;
  width: 100%;
  border-radius: var(--radius-pill);
  background-color: var(--risk-accent);
  transform-origin: left center;
  transform: scaleX(0.27);
  transition: transform 280ms var(--ease-out), background-color 180ms var(--ease-out);
}

.score-breakdown {
  margin-top: 9px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--ink-tertiary);
}

/* Inspector Segmented Tabs */
.inspector-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  background: rgba(0, 0, 0, 0.07);
  box-shadow: 0 1px 0 0 rgba(0, 0, 0, 0.07);
}

.tab-btn {
  border: 0;
  background: var(--bg-subtle);
  color: var(--ink-secondary);
  font-family: var(--font-sans);
  font-size: 12.5px;
  font-weight: 500;
  min-height: 40px;
  padding: 8px 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  cursor: pointer;
  transition: background-color 140ms ease, color 140ms ease;
}

.tab-btn:hover {
  color: var(--ink-primary);
  background: #ffffff;
}

.tab-btn.is-active {
  background: #ffffff;
  color: var(--ink-primary);
  box-shadow: inset 0 -2px 0 0 var(--ink-primary);
}

.tab-count {
  font-size: 11px;
  padding: 1px 5px;
  border-radius: var(--radius-pill);
  background: var(--bg-muted);
  color: var(--ink-secondary);
}

.inspector-panel {
  flex: 1;
  min-height: 310px;
  max-height: 470px;
  overflow-y: auto;
  background: #ffffff;
  scrollbar-width: thin;
  scrollbar-color: rgba(23, 23, 23, 0.2) transparent;
}

/* Findings Hairline Ledger (Zero Nested Boxes) */
.findings-list {
  display: flex;
  flex-direction: column;
}

.finding-row {
  padding: 14px 18px;
  box-shadow: 0 1px 0 0 rgba(0, 0, 0, 0.06);
}

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

.rule-code-group {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.rule-code {
  font-size: 11px;
  font-weight: 500;
  padding: 2px 7px;
  border-radius: var(--radius-sm);
}

.rule-code.is-critical {
  background: var(--risk-wash);
  color: var(--risk-ink);
}

.rule-code.is-warning {
  background: var(--caution-wash);
  color: var(--caution-ink);
}

.rule-platform-tag {
  font-size: 11px;
  color: var(--ink-tertiary);
}

.penalty-tag {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--risk-ink);
}

.finding-title {
  margin: 0;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-primary);
  letter-spacing: -0.01em;
}

.finding-quote {
  margin: 5px 0 0;
  font-size: 12.5px;
  color: var(--risk-ink);
  background: var(--risk-wash);
  display: inline-block;
  padding: 2px 7px;
  border-radius: var(--radius-sm);
}

.finding-reason {
  margin: 6px 0 0;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--ink-secondary);
}

.finding-citation {
  margin: 5px 0 0;
  font-size: 11px;
  color: var(--ink-tertiary);
}

/* Clean Locked Preview Row */
.locked-row {
  padding: 13px 18px;
  background: var(--bg-subtle);
  box-shadow: 0 1px 0 0 rgba(0, 0, 0, 0.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.locked-row-main {
  min-width: 0;
}

.locked-blur-hint {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--ink-tertiary);
}

.empty-clean-state {
  padding: 28px 18px;
  text-align: left;
}

.clean-icon-badge {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-lg);
  background: var(--pass-wash);
  color: var(--pass-accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
}

.empty-clean-title {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink-primary);
}

.empty-clean-desc {
  margin: 5px 0 0;
  font-size: 13px;
  color: var(--ink-secondary);
  line-height: 1.5;
}

/* Safe Rewrites Tab */
.rewrites-list {
  display: flex;
  flex-direction: column;
}

.rewrite-row {
  padding: 14px 18px;
  box-shadow: 0 1px 0 0 rgba(0, 0, 0, 0.06);
}

.rewrite-row-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.rewrite-angle-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-primary);
}

.pill-pass {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
  flex-shrink: 0;
  background: var(--pass-wash);
  color: var(--pass-accent);
}

.pill-locked {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 500;
  background: var(--bg-muted);
  color: var(--ink-tertiary);
}

.rewrite-copy-text {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--ink-primary);
}

.rewrite-copy-text.is-masked {
  color: var(--ink-tertiary);
  user-select: none;
  filter: blur(4px);
}

.rewrite-desc {
  margin: 5px 0 0;
  font-size: 12px;
  color: var(--ink-tertiary);
}

.rewrite-row-actions {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* Appeal Draft Tab */
.appeal-controls {
  padding: 12px 16px;
  background: var(--bg-subtle);
  box-shadow: 0 1px 0 0 rgba(0, 0, 0, 0.06);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.appeal-platform-switch {
  display: inline-flex;
  gap: 4px;
}

.mini-pill {
  border: 0;
  background: #ffffff;
  color: var(--ink-secondary);
  box-shadow: var(--ring-border);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 500;
  padding: 5px 9px;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.mini-pill.is-active {
  background: var(--ink-primary);
  color: #ffffff;
  box-shadow: 0 0 0 1px var(--ink-primary);
}

.appeal-btn-row {
  display: inline-flex;
  gap: 6px;
}

.appeal-output {
  padding: 14px 16px;
}

.appeal-pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.65;
  color: var(--ink-primary);
}

.appeal-gate-banner {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-lg);
  background: var(--bg-subtle);
  box-shadow: var(--ring-border);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.appeal-gate-text {
  margin: 0;
  font-size: 12.5px;
  color: var(--ink-secondary);
}

/* Bulk CSV Tab */
.csv-dropzone {
  padding: 14px 16px;
  background: var(--bg-subtle);
  box-shadow: 0 1px 0 0 rgba(0, 0, 0, 0.06);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.csv-dropzone.is-dragover {
  background: var(--focus-wash);
  box-shadow: inset 0 0 0 1px var(--focus-blue);
}

.csv-drop-title {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-primary);
}

.csv-drop-sub {
  margin: 3px 0 0;
  font-size: 12px;
  color: var(--ink-tertiary);
  line-height: 1.45;
}

.csv-drop-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.csv-summary-bar {
  padding: 10px 16px;
  background: #ffffff;
  box-shadow: 0 1px 0 0 rgba(0, 0, 0, 0.06);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
}

.csv-row-item {
  padding: 10px 16px;
  box-shadow: 0 1px 0 0 rgba(0, 0, 0, 0.06);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.csv-row-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.csv-row-name {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.csv-row-copy {
  margin: 0;
  font-size: 12px;
  color: var(--ink-secondary);
  line-height: 1.45;
}

.csv-row-issue {
  font-size: 11px;
  color: var(--ink-tertiary);
}

.csv-footer-gate {
  padding: 12px 16px;
  background: var(--bg-subtle);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Inspector Persistent Pro Bar */
.inspector-pro-bar {
  padding: 14px 16px;
  background: var(--bg-subtle);
  box-shadow: 0 -1px 0 0 rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pro-bar-copy {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.pro-bar-price {
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-primary);
}

.pro-bar-desc {
  font-size: 12px;
  color: var(--ink-secondary);
}

/* ==================== PRICING SECTION ==================== */
.pricing-section {
  padding: 56px 0 64px;
  box-shadow: 0 -1px 0 0 rgba(0, 0, 0, 0.07);
}

.section-head {
  margin-bottom: 24px;
}

.section-kicker {
  margin: 0;
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-tertiary);
  letter-spacing: 0.03em;
}

.section-title {
  margin: 6px 0 0;
  font-size: clamp(24px, 3vw, 32px);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.035em;
  color: var(--ink-primary);
}

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

.pricing-card {
  background: #ffffff;
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 20px;
}

.pricing-card.is-featured {
  box-shadow: 0 0 0 1px var(--ink-primary), 0 16px 32px -24px rgba(50, 50, 93, 0.24);
}

.tier-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.tier-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-tertiary);
  letter-spacing: 0.03em;
}

.price-row {
  margin-top: 8px;
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}

.price-figure {
  font-size: 36px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--ink-primary);
}

.price-term {
  font-size: 13px;
  color: var(--ink-tertiary);
}

.tier-desc {
  margin: 8px 0 0;
  font-size: 14px;
  color: var(--ink-secondary);
}

.tier-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 9px;
  font-size: 13.5px;
  color: var(--ink-secondary);
}

.tier-list li {
  position: relative;
  padding-left: 18px;
}

.tier-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 7px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--pass-accent);
}

/* ==================== FOOTER ==================== */
.site-footer {
  padding: 28px 0 36px;
  background: var(--bg-subtle);
  box-shadow: 0 -1px 0 0 rgba(0, 0, 0, 0.07);
}

.footer-inner {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

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

.footer-meta {
  font-size: 12px;
  color: var(--ink-tertiary);
}

.footer-disclaimer {
  margin: 0;
  font-size: 12px;
  line-height: 1.55;
  color: var(--ink-tertiary);
}

/* ==================== MODAL ==================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(23, 23, 23, 0.44);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

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

.modal-card {
  width: 100%;
  max-width: 460px;
  max-height: 92dvh;
  overflow-y: auto;
  background: #ffffff;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-modal);
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 20px 14px;
  box-shadow: 0 1px 0 0 rgba(0, 0, 0, 0.07);
}

.modal-kicker {
  margin: 0;
  font-size: 11px;
  font-weight: 500;
  color: var(--ink-tertiary);
  letter-spacing: 0.03em;
}

.modal-title {
  margin: 4px 0 0;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.025em;
  color: var(--ink-primary);
}

.modal-body {
  padding: 18px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.modal-price-band {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius-lg);
  background: var(--bg-subtle);
  box-shadow: var(--ring-border);
}

.modal-price-band > div {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  column-gap: 8px;
  row-gap: 2px;
  min-width: 0;
}

.modal-price {
  font-size: 28px;
  font-weight: 600;
  line-height: 1;
  color: var(--ink-primary);
}

.modal-price-note {
  font-size: 12.5px;
  color: var(--ink-secondary);
}

.modal-benefits {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 13px;
  color: var(--ink-secondary);
}

.modal-benefits li {
  position: relative;
  padding-left: 16px;
}

.modal-benefits li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 7px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--pass-accent);
}

.polar-checkout-area {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.polar-checkout-area .btn,
.modal-card .btn-full {
  white-space: normal;
  text-align: center;
  line-height: 1.3;
  padding: 11px 16px;
  height: auto;
  min-height: 44px;
}

.modal-subhint {
  margin: 0;
  font-size: 11.5px;
  line-height: 1.45;
  color: var(--ink-tertiary);
}

.modal-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  color: var(--ink-tertiary);
}

.modal-divider::before,
.modal-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line-light);
}

.license-form {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.license-label {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink-primary);
}

.license-input-row {
  display: flex;
  gap: 8px;
}

.license-input {
  flex: 1;
  min-width: 0;
  min-height: 40px;
  padding: 8px 12px;
  border: 0;
  border-radius: var(--radius-md);
  background: var(--bg-subtle);
  color: var(--ink-primary);
  font-size: 13px;
  box-shadow: var(--ring-border);
  text-transform: uppercase;
}

.license-feedback {
  margin: 2px 0 0;
  min-height: 18px;
  font-size: 12px;
  line-height: 1.4;
}

.license-feedback.is-error {
  color: var(--risk-ink);
}

.license-feedback.is-ok {
  color: var(--pass-accent);
}

/* ==================== SINGLE REPLACEABLE TOAST ==================== */
.toast {
  position: fixed;
  left: 50%;
  bottom: 20px;
  z-index: 120;
  transform: translateX(-50%);
  max-width: calc(100vw - 32px);
  padding: 9px 14px;
  border-radius: var(--radius-pill);
  background: var(--ink-primary);
  color: #ffffff;
  font-size: 12px;
  box-shadow: 0 12px 28px -8px rgba(0, 0, 0, 0.32);
  text-align: center;
}

/* ==================== RESPONSIVE (390px MOBILE GUARANTEE) ==================== */
@media (max-width: 960px) {
  .studio-shell {
    grid-template-columns: 1fr;
  }

  .inspector-panel {
    max-height: none;
    min-height: 240px;
  }

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

@media (max-width: 640px) {
  .container {
    padding-inline: 14px;
  }

  .header-nav,
  .brand-tag {
    display: none;
  }

  #apHeaderKeyBtn span {
    display: none;
  }

  #apHeaderUnlockBtn {
    padding: 6px 10px;
    font-size: 12.5px;
  }

  .hero-section {
    padding: 16px 0 14px;
  }

  .hero-kicker-row {
    gap: 6px;
    margin-bottom: 8px;
  }

  .hero-kicker {
    font-size: 10.5px;
  }

  .privacy-pill {
    font-size: 11px;
    padding: 2px 8px;
  }

  .hero-title {
    font-size: 26px;
    line-height: 1.08;
    letter-spacing: -0.036em;
  }

  .hero-subtitle {
    margin-top: 8px;
    font-size: 13.5px;
    line-height: 1.45;
  }

  .editor-toolbar {
    padding: 10px 12px;
    flex-wrap: wrap;
    gap: 8px;
  }

  .platform-group {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .platform-pill {
    text-align: center;
    padding: 6px 8px;
    min-height: 36px;
  }

  .toolbar-right {
    width: 100%;
  }

  .sample-select {
    width: 100%;
    max-width: 100%;
  }

  .live-editor-wrap {
    min-height: 152px;
  }

  .live-backdrop,
  .live-textarea {
    min-height: 152px;
    font-size: 15px;
    padding: 14px 12px;
  }

  .editor-actions-bar {
    padding: 10px 12px;
    flex-direction: column;
    align-items: stretch;
  }

  .primary-cta-group {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .primary-cta-group .btn {
    width: 100%;
    min-height: 44px;
  }

  .editor-meta {
    justify-content: space-between;
  }

  .url-strip {
    padding: 12px;
  }

  .url-input-row {
    flex-direction: column;
  }

  .url-input-row .btn {
    width: 100%;
    min-height: 40px;
  }

  .score-header {
    padding: 14px;
  }

  .tab-btn {
    font-size: 12px;
    padding: 8px 4px;
    gap: 3px;
  }

  .finding-row,
  .rewrite-row,
  .locked-row {
    padding: 12px 14px;
  }

  .license-input-row {
    flex-direction: column;
  }

  .license-input-row .btn {
    width: 100%;
    min-height: 42px;
  }
}

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

  .btn,
  .score-bar-fill,
  .platform-pill,
  .tab-btn {
    transition-duration: 0ms !important;
  }
}
