/* ---------- Design tokens ---------- */
:root {
  --bg: #09090b;
  --surface: #131316;
  --surface-hover: #18181c;
  --surface-selected: #1b1b22;
  --border: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(255, 255, 255, 0.16);
  --border-selected: rgba(139, 148, 255, 0.55);

  --text-primary: #f4f4f5;
  --text-secondary: #a1a1aa;
  /* WCAG AA requires >=4.5:1 against --bg for normal-size text; the
     original #6b6b74 measured ~3.78:1 (fails). #8a8a93 measures ~5.8:1. */
  --text-tertiary: #8a8a93;

  --accent-1: #818cf8;
  --accent-2: #c084fc;
  --accent-gradient: linear-gradient(120deg, var(--accent-1), var(--accent-2));

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --radius-pill: 999px;

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --dur-fast: 0.16s;
  --dur-med: 0.4s;
  --dur-height: 0.5s;

  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.4), 0 16px 40px -16px rgba(0, 0, 0, 0.6);
  --shadow-glow: 0 0 0 1px rgba(129, 140, 248, 0.18), 0 10px 28px -10px rgba(129, 140, 248, 0.4);
}

* { box-sizing: border-box; cursor: none !important; }
html { color-scheme: dark; scroll-behavior: smooth; }

/* Author rules with an explicit `display` otherwise beat the UA [hidden]
   rule in the cascade, which would leave "hidden" elements fully rendered
   and clickable. This guarantees the attribute always wins. */
[hidden] { display: none !important; }

/* Visually hidden but still exposed to assistive tech / crawlable in the
   HTML source — used for pages whose real page title lives in a smaller
   .step-kicker/.step-title above the fold rather than a single H1. */
.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;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .cursor-inner {
    animation: none !important;
  }
}

@media (hover: none), (pointer: coarse) {
  * { cursor: auto !important; }
  .cursor, .coord-readout { display: none !important; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text-primary);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  overflow-x: hidden;
}

h1, h2 {
  font-family: "Inter Tight", "Inter", sans-serif;
  margin: 0;
  letter-spacing: -0.02em;
}

button, input, textarea {
  font-family: inherit;
  color: inherit;
}

/* ---------- Ambient background ---------- */
.spotlight {
  position: fixed;
  inset: 0;
  background: radial-gradient(240px circle at var(--mx, 50%) var(--my, 20%),
    rgba(145, 153, 255, 0.34), rgba(129, 140, 248, 0.12) 45%, transparent 70%);
  pointer-events: none;
  z-index: 0;
  transition: opacity var(--dur-med) var(--ease);
}

/* ---------- Custom crosshair cursor ---------- */
.cursor {
  position: fixed;
  top: 0;
  left: 0;
  width: 22px;
  height: 22px;
  z-index: 999;
  pointer-events: none;
  transform: translate3d(-999px, -999px, 0);
  opacity: 0;
  transition: opacity 0.25s var(--ease);
}

.cursor.visible {
  opacity: 1;
}

.cursor-inner {
  position: relative;
  width: 100%;
  height: 100%;
  animation: cursor-spin 9s linear infinite;
  transition: opacity 0.2s var(--ease);
}

.cursor-tick {
  position: absolute;
  background: #fff;
  mix-blend-mode: difference;
  border-radius: 1px;
}

.tick-top,
.tick-bottom {
  left: 50%;
  width: 1.5px;
  height: 6px;
  transform: translateX(-50%);
}

.tick-top { top: 0; }
.tick-bottom { bottom: 0; }

.tick-left,
.tick-right {
  top: 50%;
  height: 1.5px;
  width: 6px;
  transform: translateY(-50%);
}

.tick-left { left: 0; }
.tick-right { right: 0; }

@keyframes cursor-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.cursor-dot {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #fff;
  mix-blend-mode: difference;
  transform: translate(-50%, -50%) scale(1);
  transition: transform 0.28s var(--ease-spring);
}

.cursor-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 34px;
  height: 34px;
  border: 1px solid #fff;
  border-radius: 50%;
  mix-blend-mode: difference;
  transform: translate(-50%, -50%) scale(0.35);
  opacity: 0;
  transition: transform 0.32s var(--ease-spring), opacity 0.2s var(--ease);
}

.cursor-caret {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 1.5px;
  height: 18px;
  background: #fff;
  mix-blend-mode: difference;
  border-radius: 1px;
  transform: translate(-50%, -50%) scaleY(0);
  opacity: 0;
  transition: transform 0.22s var(--ease-spring), opacity 0.18s var(--ease);
}

/* Snap: expand + invert on interactive elements */
.cursor.hover .cursor-inner {
  opacity: 0;
}

.cursor.hover .cursor-dot {
  transform: translate(-50%, -50%) scale(2.1);
}

.cursor.hover .cursor-ring {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
}

/* Text mode: collapse into a thin caret over inputs */
.cursor.text-mode .cursor-inner,
.cursor.text-mode .cursor-dot,
.cursor.text-mode .cursor-ring {
  opacity: 0;
}

.cursor.text-mode .cursor-caret {
  transform: translate(-50%, -50%) scaleY(1);
  opacity: 1;
}

/* ---------- Coordinate readout (cursor quirk) ---------- */
.coord-readout {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 6;
  transform: translate3d(-999px, -999px, 0);
  pointer-events: none;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--text-secondary);
  background: rgba(19, 19, 22, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  padding: 4px 8px;
  border-radius: 6px;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.3s var(--ease);
}

.coord-readout.visible {
  opacity: 1;
}

.coord-readout span {
  font-variant-numeric: tabular-nums;
}

.bg-grid {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 70% 55% at 50% 0%, black 40%, transparent 90%);
  pointer-events: none;
  z-index: 0;
}

/* ---------- Single-column layout (contact page) ---------- */
.layout.layout-single {
  grid-template-columns: 1fr;
  max-width: 640px;
}

/* ---------- Persistent tab navigation ---------- */
@keyframes nav-pill-in {
  from { opacity: 0; transform: translateX(-50%) translateY(-12px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.nav-pill {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  display: flex;
  animation: nav-pill-in 0.5s var(--ease);
  align-items: center;
  gap: 10px;
  padding: 8px 8px 8px 16px;
  background: rgba(19, 19, 22, 0.6);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-card);
  transition: opacity 0.4s var(--ease), transform 0.4s var(--ease);
}

.nav-pill-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.15);
  flex-shrink: 0;
}

.nav-tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-pill);
}

.nav-tab {
  display: flex;
  align-items: center;
  gap: 7px;
  background: transparent;
  border: none;
  border-radius: var(--radius-pill);
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-tertiary);
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}

.nav-tab:hover {
  color: var(--text-secondary);
}

.nav-tab.active {
  background: var(--surface);
  color: var(--text-primary);
}

.nav-tab-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--border-hover);
  flex-shrink: 0;
  transition: background var(--dur-fast) var(--ease);
}

.nav-tab-dot.partial {
  background: #fbbf24;
}

.nav-tab-dot.complete {
  background: #4ade80;
}

/* ---------- In-page section nav (questionnaire pages) ---------- */
.section-nav {
  display: flex;
  width: max-content;
  max-width: 100%;
  margin: 0 auto 32px;
  gap: 4px;
  padding: 4px;
  background: rgba(19, 19, 22, 0.6);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-card);
  position: sticky;
  top: 88px;
  z-index: 5;
}

/* ---------- Account menu ---------- */
.menu-root {
  position: fixed;
  top: 24px;
  right: 2rem;
  z-index: 11;
}

.menu-toggle {
  width: 40px;
  height: 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: rgba(19, 19, 22, 0.6);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-card);
  transition: border-color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
}

.menu-toggle:hover {
  border-color: var(--border-hover);
  background: rgba(24, 24, 28, 0.7);
}

.menu-toggle-line {
  width: 15px;
  height: 1.5px;
  border-radius: 1px;
  background: var(--text-secondary);
  transition: transform var(--dur-fast) var(--ease), opacity var(--dur-fast) var(--ease), width var(--dur-fast) var(--ease);
}

.menu-toggle[aria-expanded="true"] .menu-toggle-line:nth-child(1) {
  transform: translateY(5.5px) rotate(45deg);
}

.menu-toggle[aria-expanded="true"] .menu-toggle-line:nth-child(2) {
  opacity: 0;
}

.menu-toggle[aria-expanded="true"] .menu-toggle-line:nth-child(3) {
  transform: translateY(-5.5px) rotate(-45deg);
}

.menu-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 180px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 6px;
  background: rgba(19, 19, 22, 0.75);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  transform-origin: top right;
  animation: menu-in 0.22s var(--ease-spring);
}

@keyframes menu-in {
  from { opacity: 0; transform: scale(0.92) translateY(-6px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-secondary);
  text-align: left;
  transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}

.menu-item svg {
  color: var(--text-tertiary);
  flex-shrink: 0;
  transition: color var(--dur-fast) var(--ease);
}

.menu-item:hover {
  background: var(--surface-hover);
  color: var(--text-primary);
}

.menu-item:hover svg {
  color: var(--accent-1);
}

/* ---------- Modal ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(5, 5, 6, 0.6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity 0.25s var(--ease);
}

.modal-overlay.visible {
  opacity: 1;
}

.modal {
  position: relative;
  width: 100%;
  max-width: 380px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px 28px 28px;
  box-shadow: var(--shadow-card);
  transform: scale(0.94) translateY(8px);
  opacity: 0;
  transition: transform 0.3s var(--ease-spring), opacity 0.25s var(--ease);
}

.modal-overlay.visible .modal {
  transform: scale(1) translateY(0);
  opacity: 1;
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--text-tertiary);
  transition: color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
}

.modal-close:hover {
  color: var(--text-primary);
  border-color: var(--border-hover);
}

.modal-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(129, 140, 248, 0.1);
  color: var(--accent-1);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}

.modal-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 10px;
}

.modal-text {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.55;
  margin-bottom: 24px;
}

.modal-switch {
  margin-top: 16px;
  font-size: 13px;
  color: var(--text-tertiary);
  text-align: center;
}

.modal-switch button {
  background: none;
  border: none;
  color: var(--accent-1);
  font-weight: 600;
  padding: 0;
}

/* ---------- Layout ---------- */
@keyframes layout-in {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

.layout {
  position: relative;
  z-index: 1;
  max-width: 1120px;
  margin: 0 auto;
  padding: 110px 40px 64px;
  animation: layout-in 0.5s var(--ease);
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 48px;
  align-items: start;
}

.form-column {
  min-width: 0;
}

.form-frame {
  overflow: hidden;
}

/* ---------- Height-animated step container ---------- */
.step-content {
  position: relative;
  transition: height var(--dur-height) var(--ease);
}

.step-panel {
  display: none;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity var(--dur-med) var(--ease), transform var(--dur-med) var(--ease);
}

.step-panel.visible {
  display: block;
}

.step-panel.active {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 0.08s;
}

.step-panel.leaving {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  pointer-events: none;
}

.step-panel.measuring {
  display: block;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transform: none;
  transition: none;
}

.step-header {
  margin-bottom: 36px;
}

.step-kicker {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--accent-1);
  text-transform: uppercase;
  margin-bottom: 14px;
}

.step-title {
  font-size: 34px;
  font-weight: 700;
  line-height: 1.12;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.text-gradient {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.step-desc {
  font-size: 15px;
  color: var(--text-secondary);
  max-width: 46ch;
}

/* ---------- Brand asset uploads (web-design intake) ---------- */
.asset-upload-dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 24px;
  border: 1px dashed var(--border-hover);
  border-radius: var(--radius-md);
  cursor: pointer;
  text-align: center;
  transition: border-color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
}

.asset-upload-dropzone:hover {
  border-color: var(--border-selected);
  background: var(--surface-hover);
}

/* The actual <input type="file"> inside this label is visually hidden via
   .sr-only (not display:none, so it stays focusable/operable) — without
   this, a keyboard user tabbing to it has no visible indication of where
   focus is at all. :focus-within (not :focus-visible on the input itself)
   so the visible label element is what gets the ring, matching how this
   control actually looks to a sighted user. */
.asset-upload-dropzone:focus-within {
  border-color: var(--border-selected);
  background: var(--surface-hover);
  box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.45);
}

.asset-upload-label {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-secondary);
}

.asset-upload-hint {
  font-size: 12px;
  color: var(--text-tertiary);
}

.asset-list {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.asset-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-secondary);
}

.asset-item-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.asset-item-remove {
  background: none;
  border: none;
  color: var(--text-tertiary);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  padding: 0 2px;
  flex-shrink: 0;
}

.asset-item-remove:hover {
  color: #f87171;
}

.asset-upload-status {
  font-size: 12px;
  color: var(--text-tertiary);
  margin: 8px 0 0;
}

/* ---------- Draft restore banner ---------- */
.draft-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 24px;
  padding: 14px 20px;
  border-radius: var(--radius-md);
  background: rgba(129, 140, 248, 0.06);
  border: 1px solid rgba(129, 140, 248, 0.2);
}

.draft-banner-text {
  font-size: 13.5px;
  color: var(--text-secondary);
  margin: 0;
}

.draft-banner-actions {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}

/* ---------- Cookie/analytics consent banner ---------- */
.consent-banner {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  max-width: 720px;
  margin: 0 auto;
  padding: 16px 20px;
  border-radius: var(--radius-md);
  background: var(--surface-selected);
  border: 1px solid var(--border-hover);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

.consent-banner-text {
  font-size: 13.5px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin: 0;
}

.consent-banner-actions {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}

/* ---------- Field groups ---------- */
.field-group {
  margin-bottom: 32px;
}

.field-group-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 14px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field + .field {
  margin-top: 16px;
}

.field-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}

.field-optional {
  font-weight: 400;
  color: var(--text-tertiary);
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.field-input {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 14px;
  color: var(--text-primary);
  outline: none;
  width: 100%;
  transition: border-color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
}

.field-input::placeholder { color: var(--text-tertiary); }

.field-input:focus {
  border-color: var(--border-selected);
  background: var(--surface-hover);
}

.field-textarea {
  resize: vertical;
  min-height: 84px;
  font-family: inherit;
}

/* ---------- Bento grid ---------- */
.bento-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(2, auto);
  gap: 12px;
  perspective: 800px;
}

.toggle-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  perspective: 800px;
}

.bento-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  cursor: pointer;
  will-change: transform;
  transition: border-color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}

.bento-card-lg {
  grid-column: span 2;
  grid-row: span 2;
  justify-content: center;
  padding: 28px;
}

.bento-card-lg .bento-icon { font-size: 22px; }
.bento-card-lg .bento-title { font-size: 18px; }
.bento-card-lg .bento-desc { font-size: 13.5px; max-width: 30ch; }

.bento-card-wide {
  grid-column: span 3;
}

.bento-card:hover {
  background: var(--surface-hover);
  border-color: var(--border-hover);
}

.bento-card.selected {
  background: var(--surface-selected);
  border-color: var(--border-selected);
  box-shadow: var(--shadow-glow);
}

.bento-card.selected::after {
  content: "✓";
  position: absolute;
  top: 16px;
  right: 16px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: #0a0a0c;
}

.bento-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(129, 140, 248, 0.1);
  color: var(--accent-1);
  display: flex;
  align-items: center;
  justify-content: center;
}

.bento-icon svg {
  width: 18px;
  height: 18px;
}

.bento-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.bento-desc {
  font-size: 13px;
  color: var(--text-tertiary);
  line-height: 1.5;
}

/* ---------- Pill selectors ---------- */
.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.pill {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 10px 18px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: border-color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
}

.pill:hover {
  border-color: var(--border-hover);
  color: var(--text-primary);
  transform: translateY(-1px);
}

.pill.selected {
  background: var(--accent-gradient);
  border-color: transparent;
  color: #0a0a0c;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  padding: 11px 18px;
  cursor: pointer;
  transition: transform var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease), opacity var(--dur-fast) var(--ease);
}

.btn-primary {
  background: var(--text-primary);
  color: #0a0a0c;
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px -6px rgba(255, 255, 255, 0.25);
}

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

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.btn-ghost:hover {
  color: var(--text-primary);
  border-color: var(--border-hover);
  background: var(--surface);
}

.btn-ghost:disabled {
  opacity: 0.45;
  pointer-events: none;
}

/* Pagination's Prev/Next specifically want to vanish rather than just dim
   when there's no other page — this is what keeps the pagination bar's
   width stable instead of a dimmed dead button sitting there. Every other
   disabled .btn-ghost (the several async "Loading…"/"Saving…" states added
   since) should stay visible and dimmed — a login button that opacity:0'd on
   click looked like nothing was happening. */
.btn-ghost-collapse:disabled {
  opacity: 0;
}

.btn-large {
  padding: 14px 22px;
  font-size: 15px;
}

/* ---------- Home hero ---------- */
.home-hero {
  position: relative;
  z-index: 1;
  max-width: 1100px;
  margin: 0 auto;
  padding: 150px 2rem 70px;
  text-align: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  color: var(--accent-1);
  background: rgba(129, 140, 248, 0.1);
  border: 1px solid rgba(129, 140, 248, 0.25);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 7px 14px;
  border-radius: var(--radius-pill);
  margin-bottom: 20px;
}

.home-title {
  font-size: 50px;
  font-weight: 800;
  line-height: 1.14;
  letter-spacing: -0.01em;
  margin-bottom: 20px;
}

.home-sub {
  font-size: 16px;
  color: var(--text-secondary);
  line-height: 1.6;
  max-width: 54ch;
  margin: 0 auto 32px;
}

.home-highlights {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin: 0 auto 32px;
}

/* Narrower, tighter-spaced variants used on the SEO/web-design-services
   pages — previously inline style="" on the element; pulled into real
   classes so the site can run under a CSP with no style-src
   'unsafe-inline' exception. */
.home-highlights-narrow {
  max-width: 820px;
}

.home-highlights-narrow.home-highlights-tight {
  margin-bottom: 8px;
}

.home-highlights-narrow:not(.home-highlights-tight) {
  margin-bottom: 0;
}

.home-highlight {
  display: flex;
  align-items: center;
  gap: 9px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: var(--radius-pill);
  padding: 7px 16px 7px 7px;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.2;
  color: var(--text-secondary);
  transition: border-color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
}

.home-highlight:hover {
  border-color: rgba(129, 140, 248, 0.3);
  background: rgba(255, 255, 255, 0.035);
}

.home-highlight-icon {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  border-radius: 8px;
  background: rgba(129, 140, 248, 0.12);
  color: var(--accent-1);
  display: flex;
  align-items: center;
  justify-content: center;
}

.home-highlight-icon svg {
  width: 13px;
  height: 13px;
}

.home-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 14px;
}

.payment-callout {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 20px 0 0;
  padding: 8px 16px 8px 10px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-secondary);
  background: rgba(129, 140, 248, 0.06);
  border: 1px solid rgba(129, 140, 248, 0.22);
  border-radius: var(--radius-pill);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.payment-callout-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--accent-gradient);
  color: #0a0a0c;
}

.payment-callout-icon svg {
  width: 11px;
  height: 11px;
}

/* Compact variant of .home-hero for pages that put a form or other content
   directly below it, instead of being the only thing above the fold. */
.home-hero-compact {
  padding-bottom: 20px;
}

/* Used when a .home-hero-compact already provides top clearance for the
   fixed nav pill, so .layout doesn't need to double that spacing. */
.layout-tight {
  padding-top: 40px;
}

/* ---------- FAQ ---------- */
.faq-container {
  position: relative;
  z-index: 1;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 2rem 110px;
}

.faq-header {
  text-align: center;
  margin-bottom: 40px;
}

.faq-header .eyebrow {
  margin-bottom: 18px;
}

.faq-heading {
  font-size: 30px;
  font-weight: 700;
  margin-bottom: 10px;
}

.faq-sub {
  font-size: 15px;
  color: var(--text-secondary);
  max-width: 52ch;
  margin: 0 auto;
}

.faq-panel {
  max-width: 780px;
  margin: 0 auto;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 20px;
  padding: 8px;
}

.accordion-item {
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.accordion-item:last-child {
  border-bottom: none;
}

.accordion-item-heading {
  margin: 0;
}

.accordion-question {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 12px;
  text-align: left;
  padding: 18px 14px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  transition: border-color var(--dur-fast) var(--ease), background var(--dur-med) var(--ease), box-shadow var(--dur-med) var(--ease);
}

.accordion-question:hover {
  background: rgba(255, 255, 255, 0.02);
}

.accordion-question:focus-visible {
  outline: none;
  border-color: rgba(129, 140, 248, 0.5);
  box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.35);
}

/* ---------- Focus-visible (keyboard focus ring, consistent across all
   interactive controls that only had hover states before) ---------- */
.bento-card:focus-visible,
.pill:focus-visible,
.nav-tab:focus-visible,
.btn:focus-visible,
.menu-toggle:focus-visible,
.modal-close:focus-visible,
.section-continue:focus-visible,
.cta-banner-secondary-link:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.45);
}

/* Plain inline text links in body copy (FAQ answers, footer, .section-copy,
   etc.) — the rules above only ever covered specific button/pill/tab
   classes, so a bare <a> in prose fell back to the browser default. A class
   selector always outranks this on specificity, so it can't override any of
   the more specific rules above — it only fills the gap they didn't cover. */
a:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.45);
  border-radius: 3px;
}

.accordion-item.open .accordion-question {
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.025);
  box-shadow: 0 0 28px -10px rgba(129, 140, 248, 0.45);
}

.accordion-icon {
  position: relative;
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.16);
  transition: transform var(--dur-med) var(--ease), border-color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
}

.accordion-icon::before,
.accordion-icon::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  background: var(--text-secondary);
  transition: background var(--dur-fast) var(--ease);
}

.accordion-icon::before {
  width: 9px;
  height: 1.4px;
  transform: translate(-50%, -50%);
}

.accordion-icon::after {
  width: 1.4px;
  height: 9px;
  transform: translate(-50%, -50%);
}

.accordion-item.open .accordion-icon {
  transform: rotate(45deg);
  background: rgba(129, 140, 248, 0.12);
  border-color: rgba(129, 140, 248, 0.5);
}

.accordion-item.open .accordion-icon::before,
.accordion-item.open .accordion-icon::after {
  background: var(--accent-1);
}

.accordion-answer-wrap {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.35s var(--ease);
}

.accordion-item.open .accordion-answer-wrap {
  grid-template-rows: 1fr;
}

.accordion-answer-inner {
  overflow: hidden;
}

.accordion-answer-inner p {
  margin: 0;
  padding: 0 34px 18px 14px;
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.section-continue {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  margin-top: 8px;
  transition: color var(--dur-fast) var(--ease), gap var(--dur-fast) var(--ease);
}

.section-continue:hover {
  color: var(--text-primary);
  gap: 10px;
}

.submit-area {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  margin-top: 8px;
}

.submit-hint {
  font-size: 13px;
  color: var(--text-tertiary);
  margin: 0;
}

.submit-hint .hint-link {
  color: var(--accent-1);
  cursor: pointer;
  font-weight: 600;
}

.submit-hint .hint-link:hover {
  text-decoration: underline;
}

/* Draws attention to the submit hint when a click on the (disabled-looking)
   submit action needs to visibly tell the visitor why nothing happened,
   instead of silently doing nothing. */
.submit-hint.hint-flash {
  color: var(--accent-1);
  animation: hint-flash-pulse 1.2s ease;
}

@keyframes hint-flash-pulse {
  0%, 100% { opacity: 1; }
  25%, 75% { opacity: 0.35; }
}

/* ---------- Live summary drawer ---------- */
.summary-drawer {
  position: sticky;
  top: 110px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.summary-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}

.summary-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.summary-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.summary-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.summary-row-label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.summary-row-value {
  font-size: 13.5px;
  color: var(--text-primary);
  line-height: 1.45;
  transition: opacity var(--dur-fast) var(--ease);
}

.summary-row-value.empty {
  color: var(--text-tertiary);
  font-style: italic;
}

/* ---------- Success state ---------- */
.success-state {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  animation: step-in var(--dur-med) var(--ease);
}

@keyframes step-in {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

.success-inner {
  text-align: center;
  max-width: 440px;
}

.success-icon {
  width: 60px;
  height: 60px;
  margin: 0 auto 26px;
  border-radius: 50%;
  background: var(--accent-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 700;
  color: #0a0a0c;
}

.success-title {
  font-size: 30px;
  font-weight: 700;
  margin-bottom: 12px;
}

.success-sub {
  font-size: 15px;
  color: var(--text-secondary);
  margin-bottom: 28px;
}

.success-summary {
  display: inline-flex;
  flex-direction: column;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px 26px;
  font-size: 13.5px;
  text-align: left;
  min-width: 280px;
}

.success-summary-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: var(--text-tertiary);
}

.success-summary-row strong {
  color: var(--text-primary);
  font-weight: 600;
}

/* ---------- Admin gate ---------- */
.admin-gate {
  position: relative;
  z-index: 1;
  min-height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}

.admin-gate-card {
  max-width: 380px;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px 32px;
  box-shadow: var(--shadow-card);
}

.admin-gate-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: rgba(129, 140, 248, 0.1);
  color: var(--accent-1);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
}

.admin-gate-title {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 10px;
}

.admin-gate-desc {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.55;
  margin-bottom: 26px;
}

/* ---------- Admin dashboard ---------- */
.admin-dashboard {
  position: relative;
  z-index: 1;
  max-width: 1000px;
  margin: 0 auto;
  padding: 130px 40px 80px;
}

.admin-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}

.admin-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ollama-control {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
}

.ollama-status {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-tertiary);
  flex-shrink: 0;
}

.ollama-status.is-running {
  background: #4ade80;
  box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.18);
}

.ollama-status.is-stopped {
  background: #f87171;
}

.guardian-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 16px;
  font-size: 13px;
}

.guardian-panel-status {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
}

.guardian-status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--text-tertiary);
  flex-shrink: 0;
}

.guardian-status-dot.is-healthy {
  background: #4ade80;
  box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.18);
}

.guardian-status-dot.is-warning {
  background: #fbbf24;
  box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.18);
}

.guardian-status-dot.is-failed {
  background: #f87171;
  box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.18);
}

.guardian-last-check {
  color: var(--text-tertiary);
  font-size: 12px;
}

.guardian-history {
  margin-bottom: 16px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 13px;
  color: var(--text-secondary);
}

.guardian-history-item {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 4px 0;
  border-bottom: 1px solid var(--border);
}

.guardian-history-item:last-child {
  border-bottom: none;
}

.guardian-history-time {
  color: var(--text-tertiary);
  font-size: 12px;
  flex-shrink: 0;
}

.ai-control-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 16px;
  font-size: 13px;
  flex-wrap: wrap;
}

.ai-control-status {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
}

.ai-control-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--text-tertiary);
  flex-shrink: 0;
}

.ai-control-dot.is-enabled {
  background: #4ade80;
  box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.18);
}

.ai-control-dot.is-disabled {
  background: #fbbf24;
  box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.18);
}

.ai-control-dot.is-lockdown {
  background: #f87171;
  box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.18);
}

.ai-control-reason {
  color: var(--text-tertiary);
  font-size: 12px;
}

.ai-control-actions {
  display: flex;
  gap: 8px;
}

.security-events-panel {
  margin-bottom: 16px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 13px;
}

.security-events-panel[hidden] {
  display: none;
}

.security-events-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin: 0 0 8px;
}

.security-event-item {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.security-event-item:last-child {
  border-bottom: none;
}

.security-event-time {
  color: var(--text-tertiary);
  font-size: 12px;
  flex-shrink: 0;
}

.security-event-severity {
  font-size: 11px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: var(--radius-pill);
  flex-shrink: 0;
}

.security-event-severity.sev-info {
  color: #a1a1aa;
  background: rgba(161, 161, 170, 0.15);
}

.security-event-severity.sev-warning {
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.15);
}

.security-event-severity.sev-high {
  color: #fb923c;
  background: rgba(251, 146, 60, 0.15);
}

.security-event-severity.sev-critical {
  color: #f87171;
  background: rgba(248, 113, 113, 0.18);
}

.security-event-ack-btn {
  margin-left: auto;
  font-size: 12px;
  padding: 2px 10px;
}

.admin-title {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 4px;
}

.admin-sub {
  font-size: 14px;
  color: var(--text-tertiary);
}

.admin-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}

.admin-empty {
  text-align: center;
  padding: 60px 24px;
  color: var(--text-tertiary);
  font-size: 14px;
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
}

.admin-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 24px;
}

.admin-pagination:empty {
  display: none;
}

.pagination-status {
  font-size: 13px;
  color: var(--text-tertiary);
}

.submission-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.submission-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px 22px;
}

.submission-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.submission-card-head-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.submission-type {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: rgba(129, 140, 248, 0.1);
  color: var(--accent-1);
}

.submission-time {
  font-size: 12px;
  color: var(--text-tertiary);
}

.submission-fields {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
}

.submission-field-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-tertiary);
  margin-bottom: 4px;
}

.submission-field-value {
  font-size: 13.5px;
  color: var(--text-primary);
  line-height: 1.4;
}

.submission-assets {
  margin-top: 14px;
}

.submission-asset-list {
  list-style: none;
  margin: 6px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.submission-asset-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-secondary);
}

.submission-asset-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.submission-asset-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.submission-status {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
}

.submission-status-reviewed {
  background: rgba(251, 191, 36, 0.12);
  color: #fbbf24;
}

.submission-status-contacted,
.submission-status-won {
  background: rgba(74, 222, 128, 0.12);
  color: #4ade80;
}

.submission-status-qualified {
  background: rgba(129, 140, 248, 0.12);
  color: #818cf8;
}

.submission-status-discovery {
  background: rgba(192, 132, 252, 0.12);
  color: #c084fc;
}

.submission-status-proposal_sent {
  background: rgba(56, 189, 248, 0.12);
  color: #38bdf8;
}

.submission-status-lost {
  background: rgba(248, 113, 113, 0.12);
  color: #f87171;
}

.submission-actions {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.submission-delete-btn {
  color: #f87171;
}

/* ---------- AI project analysis (admin-only) ---------- */
.analysis-section {
  margin-top: 16px;
  padding: 18px 20px;
  border-radius: var(--radius-md);
  background: rgba(129, 140, 248, 0.04);
  border: 1px solid rgba(129, 140, 248, 0.16);
}

.analysis-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.analysis-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent-1);
}

.contract-inline-section {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.contract-inline-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  text-decoration: none;
}
.contract-inline-link:hover { color: var(--accent-1); }

.contract-inline-more {
  font-size: 12px;
  color: var(--text-tertiary);
}

.analysis-status-badge {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
}

.analysis-status-processing,
.analysis-status-pending {
  background: rgba(251, 191, 36, 0.12);
  color: #fbbf24;
}

.analysis-status-completed {
  background: rgba(74, 222, 128, 0.12);
  color: #4ade80;
}

.analysis-status-failed {
  background: rgba(248, 113, 113, 0.12);
  color: #f87171;
}

.analysis-empty {
  font-size: 13px;
  color: var(--text-tertiary);
  font-style: italic;
  margin: 0 0 12px;
}

.stage-list {
  list-style: none;
  margin: 0 0 10px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.stage-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-tertiary);
}

.stage-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-tertiary);
  opacity: 0.35;
  flex-shrink: 0;
}

.stage-item.done {
  color: var(--text-secondary);
}

.stage-item.done .stage-dot {
  background: #4ade80;
  opacity: 1;
}

.stage-item.active {
  color: var(--text-primary);
  font-weight: 600;
}

.stage-item.active .stage-dot {
  background: var(--accent-1);
  opacity: 1;
  box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.18);
}

.analysis-feeding-in {
  font-size: 12px;
  color: var(--text-tertiary);
  margin: 0 0 12px;
  line-height: 1.5;
}

.analysis-error {
  font-size: 13px;
  color: #f87171;
  margin: 0 0 12px;
  word-break: break-word;
}

.analysis-summary {
  font-size: 14px;
  color: var(--text-primary);
  line-height: 1.55;
  margin: 0 0 14px;
}

.analysis-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.analysis-pill {
  font-size: 12px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.analysis-pill-low {
  color: #4ade80;
  border-color: rgba(74, 222, 128, 0.3);
}

.analysis-pill-medium {
  color: #fbbf24;
  border-color: rgba(251, 191, 36, 0.3);
}

.analysis-pill-high {
  color: #f87171;
  border-color: rgba(248, 113, 113, 0.3);
}

.analysis-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 16px;
}

.analysis-block-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-tertiary);
  margin-bottom: 6px;
}

.analysis-block-text {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin: 0;
}

.analysis-block-notes {
  grid-column: 1 / -1;
}

.analysis-list {
  margin: 0;
  padding-left: 18px;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.analysis-reasoning {
  margin-top: 16px;
  padding: 14px 16px;
  border: 1px solid var(--border-selected);
  border-radius: var(--radius-md);
  background: rgba(129, 140, 248, 0.05);
}

.analysis-reasoning .analysis-block-label {
  color: var(--accent-1);
}

.risk-item {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.risk-item:last-child {
  border-bottom: none;
}

.risk-item-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}

.risk-name {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-primary);
}

.risk-severity {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
}

.risk-severity-low {
  background: rgba(74, 222, 128, 0.12);
  color: #4ade80;
}

.risk-severity-medium {
  background: rgba(251, 191, 36, 0.12);
  color: #fbbf24;
}

.risk-severity-high {
  background: rgba(248, 113, 113, 0.12);
  color: #f87171;
}

.risk-explanation {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin: 0;
}

/* SEO/feature recommendation cards (seo_recommendations/
   feature_recommendations) — reuses .risk-severity's priority-color
   badges directly, since both use the same low/medium/high enum. */
.reco-item {
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.reco-item:last-child {
  border-bottom: none;
}

.reco-item-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.reco-name {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-primary);
}

.reco-field {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin: 0 0 4px;
}

.reco-field strong {
  color: var(--text-primary);
  font-weight: 600;
}

.reco-sources a {
  color: var(--accent-1);
}

/* Ranked recommendations (ai/servicesSchema.js's `recommendations`) — the
   requested-vs-suggested distinction gets its own badge so it's never
   ambiguous which is which at a glance. */
.reco-origin-badge {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
}

.reco-origin-requested {
  background: rgba(96, 165, 250, 0.12);
  color: #60a5fa;
}

.reco-origin-suggested {
  background: rgba(167, 139, 250, 0.12);
  color: #a78bfa;
}

/* Per-service field groups on a type: "services" submission card
   (frontend/js/admin.js's renderServicesFields). */
.submission-service-block {
  grid-column: 1 / -1;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.submission-service-block:first-child {
  padding-top: 0;
  border-top: none;
}

.submission-service-block-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-tertiary);
  margin-bottom: 6px;
}

.analysis-raw {
  margin: 16px 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
}

.analysis-raw summary {
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-tertiary);
}

.analysis-raw pre {
  margin: 10px 0 0;
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--text-secondary);
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

.analysis-meta {
  font-size: 11px;
  color: var(--text-tertiary);
  margin: 0 0 12px;
}

/* ---------- AI chat (admin-only) — see js/chat.js ---------- */
.chat-drawer-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  justify-content: flex-end;
  background: rgba(5, 5, 6, 0.6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.chat-drawer {
  position: relative;
  width: 100%;
  max-width: 560px;
  height: 100%;
  background: var(--surface);
  border-left: 1px solid var(--border);
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
}

.chat-drawer-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}

.chat-drawer-title {
  font-size: 17px;
  font-weight: 700;
  margin: 0 0 4px;
}

.chat-drawer-sub {
  font-size: 13px;
  color: var(--text-tertiary);
  margin: 0;
}

.chat-drawer-header .modal-close {
  position: static;
  flex-shrink: 0;
}

.chat-thread {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chat-bubble {
  max-width: 88%;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

.chat-bubble-admin {
  align-self: flex-end;
  background: var(--accent-gradient);
  color: #0a0a0c;
  font-weight: 500;
}

.chat-bubble-assistant {
  align-self: flex-start;
  background: var(--surface-hover);
  border: 1px solid var(--border);
  color: var(--text-primary);
}

.chat-bubble-thinking {
  color: var(--text-tertiary);
  font-style: italic;
}

/* Wraps a bubble plus its action row (Copy / Retry) so they align and move
   together — the bubble itself keeps its own max-width/align-self from the
   rules above, since js/chat.js's "Thinking…" placeholder is still a bare
   .chat-bubble with no group wrapper and needs those to keep working
   unchanged. */
.chat-bubble-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-width: 88%;
}

.chat-bubble-group-admin {
  align-self: flex-end;
  align-items: flex-end;
}

.chat-bubble-group-assistant {
  align-self: flex-start;
  align-items: flex-start;
}

.chat-bubble-actions {
  display: flex;
  gap: 6px;
}

.chat-action-btn {
  background: transparent;
  border: none;
  color: var(--text-tertiary);
  font-size: 11px;
  font-weight: 600;
  padding: 2px 4px;
  cursor: pointer;
  transition: color var(--dur-fast) var(--ease);
}

.chat-action-btn:hover:not(:disabled) {
  color: var(--text-primary);
}

.chat-action-btn:disabled {
  cursor: default;
  opacity: 0.7;
}

.chat-bubble-analysis {
  align-self: stretch;
  max-width: 100%;
  background: var(--surface-hover);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
}

.chat-analysis-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-tertiary);
  margin-bottom: 8px;
}

.chat-pasted-text {
  margin-bottom: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
}

.chat-pasted-text summary {
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-tertiary);
}

.chat-pasted-text pre {
  margin: 8px 0 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-secondary);
  white-space: pre-wrap;
  word-break: break-word;
}

.chat-analysis-card .analysis-summary {
  margin-top: 0;
}

.chat-analysis-card .chat-save-analysis-btn,
.chat-analysis-card .chat-save-standalone-btn {
  margin-top: 12px;
}

.chat-error {
  color: var(--text-tertiary);
  font-size: 13px;
}

.chat-paste-panel {
  border-top: 1px solid var(--border);
  padding: 16px 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.chat-paste-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-tertiary);
}

.chat-paste-input {
  resize: vertical;
  min-height: 120px;
}

.chat-paste-standalone-fields {
  display: flex;
  gap: 10px;
}

.chat-paste-standalone-fields .field-input {
  flex: 1;
}

.chat-paste-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.chat-paste-error {
  color: #f87171;
  font-size: 12.5px;
  margin: 0;
}

.chat-drawer-footer {
  border-top: 1px solid var(--border);
  padding: 16px 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.chat-footer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.chat-input-row {
  display: flex;
  gap: 10px;
  align-items: flex-end;
}

.chat-input {
  flex: 1;
  resize: none;
}

.chat-send-buttons {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.chat-input-error {
  color: #f87171;
  font-size: 12.5px;
  margin: 0;
}

/* "Researched N sources" — kept collapsed and quiet by default so a
   research-backed reply doesn't look any busier than a normal one until
   the admin actually wants to see where it came from. */
.chat-sources {
  align-self: flex-start;
  max-width: 88%;
  font-size: 11.5px;
}

.chat-sources summary {
  cursor: pointer;
  color: var(--text-tertiary);
  font-weight: 600;
}

.chat-sources summary:hover {
  color: var(--text-primary);
}

.chat-sources-list {
  margin: 6px 0 0;
  padding-left: 18px;
}

.chat-sources-list a {
  color: var(--accent-1);
}

@media (max-width: 640px) {
  .chat-drawer {
    max-width: 100%;
  }
}

/* ---------- AI-drafted outreach email (admin-only) ---------- */
.email-draft-section {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px dashed var(--border);
}

.email-draft-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.email-draft-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent-1);
}

.email-draft-subject {
  font-size: 13.5px;
  color: var(--text-primary);
  margin: 0 0 10px;
}

.email-draft-body {
  font-size: 13.5px;
  color: var(--text-secondary);
  line-height: 1.6;
  white-space: pre-wrap;
  margin: 0 0 14px;
}

.email-draft-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.email-draft-copy-msg {
  font-size: 12px;
  color: var(--text-tertiary);
}

/* ---------- Project outcome (admin-only, manually recorded) ---------- */
.outcome-section {
  margin-top: 16px;
  padding: 14px 20px;
  border-radius: var(--radius-md);
  background: rgba(74, 222, 128, 0.04);
  border: 1px solid rgba(74, 222, 128, 0.16);
}

.outcome-section[open] {
  padding-bottom: 20px;
}

.outcome-summary {
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #4ade80;
}

.outcome-body {
  margin-top: 16px;
}

.outcome-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 4px;
}

.outcome-save-msg {
  font-size: 12px;
  color: var(--text-tertiary);
}

.submission-status-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-tertiary);
}

.submission-status-select {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  outline: none;
}

.submission-status-select:focus {
  border-color: var(--border-selected);
}

/* ---------- Login form (inside modal) ---------- */
.modal-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 18px;
}

.modal-error {
  display: none;
  font-size: 12.5px;
  color: #f87171;
  margin: -6px 0 4px;
}

.modal-error.visible {
  display: block;
}

/* ---------- Section copy (plain prose within a centered section) ---------- */
.section-copy {
  max-width: 640px;
  margin: 0 auto;
  text-align: left;
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.7;
}

.section-copy + .section-copy {
  margin-top: 14px;
}

/* Centered, narrower variant used under the SEO/web-design-services intake
   teasers — previously an inline style="" on the element; pulled into a
   real class so the site can run under a CSP with no style-src
   'unsafe-inline' exception. */
.section-copy-centered {
  text-align: center;
  margin-top: 20px;
}

.section-copy-wide {
  max-width: 720px;
  text-align: center;
}

/* ---------- Info grid (informational cards, e.g. "what's included") ---------- */
.info-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

/* 2-column variant (e.g. homepage "two ways to work together"). A plain
   inline style here would beat the .info-grid mobile media query below
   (inline always wins over any stylesheet rule, media query or not), so
   this needs to be its own class to actually collapse to 1 column on
   narrow screens. */
.info-grid-2col {
  grid-template-columns: repeat(2, 1fr);
  max-width: 820px;
  margin: 0 auto;
}

.info-grid-spaced {
  margin-top: 24px;
}

/* ---------- Process steps ---------- */
.process-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.process-step {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px 22px;
}

.process-step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent-gradient);
  color: #0a0a0c;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 14px;
}

.process-step-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 8px;
}

.process-step-desc {
  font-size: 13.5px;
  color: var(--text-secondary);
  line-height: 1.55;
  margin: 0;
}

/* ---------- CTA banner ---------- */
.cta-banner {
  max-width: 780px;
  margin: 0 auto;
  text-align: center;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  padding: 48px 32px;
}

.cta-banner-title {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 10px;
}

.cta-banner-sub {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

.cta-banner-links {
  display: flex;
  gap: 16px;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
}

.cta-banner-secondary-link {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-secondary);
}

.cta-banner-secondary-link:hover {
  color: var(--text-primary);
}

/* ---------- Site footer ---------- */
.site-footer {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 32px 2rem 48px;
  font-size: 12.5px;
  color: var(--text-tertiary);
}

.site-footer a {
  color: var(--text-secondary);
}

.site-footer a:hover {
  color: var(--text-primary);
}

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .layout {
    grid-template-columns: 1fr;
    padding: 100px 24px 48px;
  }
  .summary-drawer {
    position: static;
    order: -1;
  }
  .summary-list {
    flex-direction: row;
    flex-wrap: wrap;
  }
  .summary-row {
    flex: 1 1 45%;
    border-bottom: none;
    padding-bottom: 0;
  }
  .home-title {
    font-size: 40px;
  }
  .info-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .process-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .nav-tab-label { display: none; }
  .nav-tab { padding: 8px; }
  .bento-grid, .toggle-grid, .info-grid { grid-template-columns: 1fr; }
  .bento-card-lg, .bento-card-wide { grid-column: span 1; grid-row: span 1; }
  .field-row { grid-template-columns: 1fr; }
  .step-title { font-size: 26px; }
  .summary-row { flex: 1 1 100%; }
  .home-title { font-size: 32px; }
  .home-highlights { flex-direction: column; align-items: stretch; }
  .faq-panel { padding: 4px; }
  .accordion-question { padding: 16px 10px; font-size: 14px; }
  .accordion-answer-inner p { padding: 0 24px 16px 10px; }
  .admin-dashboard { padding: 110px 20px 60px; }
  .admin-header { flex-direction: column; }

  /* iOS Safari auto-zooms the viewport when a focused input's font-size is
     under 16px — jarring on every tap into a form field. Desktop keeps the
     smaller 14px; this only applies below the tablet breakpoint. */
  .field-input {
    font-size: 16px;
  }

  /* Slightly larger tap target on touch-sized screens without changing the
     desktop pill size. */
  .pill {
    padding: 12px 18px;
  }

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

  .admin-pagination {
    flex-direction: column;
    gap: 10px;
  }
}

/* Narrow phones (iPhone SE and similar, ~375px and under): four nav-pill
   tabs at full padding can crowd the separate fixed menu-toggle button in
   the top-right corner. Shrink the pill's own footprint instead of hiding
   any nav item. */
@media (max-width: 420px) {
  .nav-pill {
    padding: 6px 6px 6px 12px;
    gap: 6px;
  }
  .nav-pill-dot {
    display: none;
  }
  .nav-tabs .nav-tab {
    padding: 6px 8px;
    font-size: 11.5px;
  }
  .menu-root {
    right: 1rem;
  }
}

/* ---------- Contracts ---------- */

.contracts-toolbar {
  margin-bottom: 16px;
}

.contracts-search-input {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 14px;
  color: var(--text-primary);
  outline: none;
  width: 100%;
  max-width: 420px;
  transition: border-color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
}
.contracts-search-input::placeholder { color: var(--text-tertiary); }
.contracts-search-input:focus {
  border-color: var(--border-selected);
  background: var(--surface-hover);
}

.contracts-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-top: 16px;
}

.contracts-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.contracts-table th {
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-tertiary);
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.contracts-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
}

.contracts-row {
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease);
}
.contracts-row:hover,
.contracts-row:focus-visible {
  background: var(--surface-hover);
  outline: none;
}
.contracts-row:last-child td { border-bottom: none; }

.contracts-number {
  font-weight: 600;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

.contracts-empty {
  text-align: center;
  color: var(--text-tertiary);
  font-style: italic;
  padding: 32px 16px !important;
}

.contract-status-badge {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
  white-space: nowrap;
}
.contract-status-draft { background: rgba(255, 255, 255, 0.06); color: var(--text-secondary); }
.contract-status-needs_review { background: rgba(251, 191, 36, 0.12); color: #fbbf24; }
.contract-status-ready_for_approval { background: rgba(56, 189, 248, 0.12); color: #38bdf8; }
.contract-status-approved,
.contract-status-signed,
.contract-status-completed { background: rgba(74, 222, 128, 0.12); color: #4ade80; }
.contract-status-sent { background: rgba(129, 140, 248, 0.12); color: #818cf8; }
.contract-status-cancelled { background: rgba(248, 113, 113, 0.12); color: #f87171; }

.contract-builder-page {
  max-width: 880px;
  margin: 0 auto;
}

.contract-back-link {
  display: inline-block;
  font-size: 13px;
  color: var(--text-tertiary);
  text-decoration: none;
  margin-bottom: 8px;
  transition: color var(--dur-fast) var(--ease);
}
.contract-back-link:hover { color: var(--text-primary); }

.contract-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 20px;
}

.contract-section-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 12px;
}

.contract-section-footnote {
  font-size: 13px;
  color: var(--text-tertiary);
  margin-bottom: 14px;
  line-height: 1.5;
}

.contract-imported-note {
  font-size: 12px;
  color: var(--accent-1);
  margin-bottom: 14px;
}

.contract-field-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin-bottom: 18px;
}

.contract-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.contract-field-wide {
  grid-column: 1 / -1;
}

.contract-field input,
.contract-field textarea {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 14px;
  font-weight: 400;
  font-family: inherit;
  color: var(--text-primary);
  outline: none;
  width: 100%;
  text-transform: none;
  letter-spacing: normal;
  transition: border-color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
}
.contract-field input::placeholder,
.contract-field textarea::placeholder { color: var(--text-tertiary); }
.contract-field input:focus,
.contract-field textarea:focus {
  border-color: var(--border-selected);
  background: var(--surface-hover);
}
.contract-field textarea { resize: vertical; }
.contract-field input[readonly] { opacity: 0.55; cursor: not-allowed; }

.contract-textarea-wide {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 14px;
  font-family: inherit;
  color: var(--text-primary);
  outline: none;
  resize: vertical;
  margin-bottom: 14px;
  transition: border-color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
}
.contract-textarea-wide::placeholder { color: var(--text-tertiary); }
.contract-textarea-wide:focus {
  border-color: var(--border-selected);
  background: var(--surface-hover);
}

.scope-category {
  margin-bottom: 16px;
}

.scope-category-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-tertiary);
  margin-bottom: 8px;
}

.scope-checklist {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 8px 16px;
}

.scope-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
}
.scope-checkbox input { accent-color: var(--accent-1); }

.scope-custom-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}

.scope-custom-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-secondary);
  padding: 8px 12px;
  background: var(--bg);
  border-radius: var(--radius-sm);
}

.scope-custom-form {
  display: grid;
  grid-template-columns: 2fr 1fr 2fr auto;
  gap: 8px;
  margin: 12px 0 20px;
}
.scope-custom-form input {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 10px;
  font-size: 13px;
  color: var(--text-primary);
  outline: none;
  font-family: inherit;
}
.scope-custom-form input:focus {
  border-color: var(--border-selected);
  background: var(--surface-hover);
}

.btn-small {
  padding: 6px 12px;
  font-size: 12px;
}

@media (max-width: 720px) {
  .contract-field-grid {
    grid-template-columns: 1fr;
  }
  .scope-custom-form {
    grid-template-columns: 1fr;
  }
}

.review-result {
  margin-top: 16px;
  padding: 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}
.review-result.review-ready { border-color: rgba(74, 222, 128, 0.3); background: rgba(74, 222, 128, 0.05); }
.review-result.review-not-ready { border-color: rgba(251, 191, 36, 0.3); background: rgba(251, 191, 36, 0.05); }

.review-ready-line {
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 10px;
}
.review-ready .review-ready-line { color: #4ade80; }
.review-not-ready .review-ready-line { color: #fbbf24; }

.review-warning-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.review-warning {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.review-severity-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 2px 7px;
  border-radius: var(--radius-pill);
  margin-right: 6px;
}
.review-severity-error .review-severity-badge { background: rgba(248, 113, 113, 0.15); color: #f87171; }
.review-severity-warning .review-severity-badge { background: rgba(251, 191, 36, 0.15); color: #fbbf24; }
.review-severity-info .review-severity-badge { background: rgba(255, 255, 255, 0.08); color: var(--text-tertiary); }

.draft-actions {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}

.draft-section {
  margin-bottom: 14px;
}
.draft-section textarea {
  min-height: 90px;
}

.version-item {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
}
.version-item:last-child { border-bottom: none; }

.version-number {
  font-weight: 600;
  color: var(--text-primary);
  min-width: 90px;
}

.version-source {
  color: var(--text-tertiary);
  flex: 1;
}

.version-date {
  color: var(--text-tertiary);
  font-size: 12px;
}

.contract-status-select {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  font-size: 13px;
  color: var(--text-primary);
  outline: none;
  font-family: inherit;
}
.contract-status-select:focus {
  border-color: var(--border-selected);
}
