/* Crochet Pattern Grid — Paper-Chart Editorial Design System */
:root {
  --paper: #FBF8F3;
  --surface: #FFFFFF;
  --surface-alt: #F6F1E8;
  --ink: #23211E;
  --muted: #6B665E;
  --line: #E4DED3;
  --grid-major: #9C9384;
  --accent: #B4492F;
  --accent-hover: #9B3D26;
  --accent-soft: #F4E4DD;
  --ok: #4F7A5A;
  --ok-soft: #EAF2EC;
  --warn: #9A6B12;
  --warn-soft: #FBF2DC;

  --font-display: "Source Serif 4", Georgia, "Times New Roman", serif;
  --font-sans: "Atkinson Hyperlegible", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  --radius-sm: 6px;
  --radius-md: 10px;
  --shadow-float: 0 1px 2px rgba(35, 33, 30, 0.08);
  --shadow-modal: 0 12px 32px rgba(35, 33, 30, 0.16);

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-6: 24px;
  --space-10: 40px;
  --space-16: 64px;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background-color: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img {
  max-width: 100%;
  display: block;
}

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

a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--accent-hover);
}

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

.tabular {
  font-variant-numeric: tabular-nums;
}

.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;
}

/* Container */
.container {
  width: 100%;
  max-width: 1380px;
  margin: 0 auto;
  padding: 0 var(--space-4);
}

.container-narrow {
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: 0 var(--space-4);
}

/* Typography */
h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.015em;
  margin: 0 0 var(--space-3);
}

h1 {
  font-size: clamp(1.85rem, 3.2vw, 2.5rem);
  line-height: 1.15;
}

h2 {
  font-size: clamp(1.4rem, 2.4vw, 1.85rem);
  line-height: 1.25;
}

h3 {
  font-size: 1.15rem;
  line-height: 1.35;
}

p {
  margin: 0 0 var(--space-4);
}

.muted {
  color: var(--muted);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease;
  white-space: nowrap;
}

.btn:hover {
  border-color: var(--grid-major);
  background: var(--surface-alt);
  color: var(--ink);
}

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #FFFFFF;
}

.btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: #FFFFFF;
}

.btn-soft {
  background: var(--accent-soft);
  border-color: transparent;
  color: var(--ink);
}

.btn-soft:hover {
  background: #ECD4CA;
  border-color: transparent;
}

.btn-sm {
  min-height: 36px;
  padding: 0 12px;
  font-size: 14px;
}

.btn-icon {
  min-width: 40px;
  min-height: 40px;
  padding: 0 10px;
}

.btn-google {
  width: 100%;
  min-height: 44px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink);
  font-weight: 700;
}

.btn-google:hover {
  background: var(--surface-alt);
  border-color: var(--grid-major);
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 14px 0;
  font-size: 13px;
  color: var(--muted);
}

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

.pro-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

/* Header */
.site-header {
  border-bottom: 1px solid var(--line);
  background: var(--paper);
  position: relative;
  z-index: 30;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  gap: var(--space-4);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 19px;
}

.brand:hover {
  color: var(--ink);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.nav-item {
  position: relative;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 44px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  color: var(--ink);
  text-decoration: none;
  font-size: 15px;
  font-weight: 700;
  background: transparent;
  border: none;
  cursor: pointer;
}

.nav-link:hover, .nav-link[aria-current="page"] {
  background: var(--surface-alt);
  color: var(--ink);
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: 240px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-float);
  padding: var(--space-2);
  display: none;
  z-index: 40;
}

.dropdown-menu.open {
  display: block;
}

.dropdown-menu a {
  display: block;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--ink);
  text-decoration: none;
  font-size: 15px;
}

.dropdown-menu a:hover {
  background: var(--surface-alt);
}

.dropdown-menu small {
  display: block;
  font-size: 12px;
  color: var(--muted);
}

.mobile-menu-btn {
  display: none;
}

/* Hero */
.hero {
  padding: var(--space-6) 0 var(--space-4);
}

.hero-top {
  max-width: 780px;
}

.hero-sub {
  font-size: 18px;
  color: var(--ink);
  margin-bottom: var(--space-2);
}

.trust-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  font-size: 14px;
  color: var(--muted);
}

.trust-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* Maker Workbench */
.workbench-wrap {
  padding-bottom: var(--space-10);
}

.workbench {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.wb-topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: 10px var(--space-4);
  border-bottom: 1px solid var(--line);
  background: var(--surface-alt);
}

.mode-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
}

.mode-tab {
  min-height: 40px;
  padding: 0 14px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.mode-tab:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.7);
}

.mode-tab[aria-selected="true"] {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--line);
  box-shadow: var(--shadow-float);
}

.wb-actions-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.zoom-readout {
  font-size: 13px;
  min-width: 44px;
  text-align: center;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  user-select: none;
}

.wb-main {
  display: grid;
  grid-template-columns: 256px minmax(0, 1fr) 248px;
  min-height: 680px;
}

.wb-main.canvas-focused {
  grid-template-columns: minmax(0, 1fr);
}

.wb-main.canvas-focused .wb-left,
.wb-main.canvas-focused .wb-right {
  display: none;
}

.wb-left {
  border-right: 1px solid var(--line);
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  background: var(--surface);
}

.wb-center {
  display: flex;
  flex-direction: column;
  background: var(--paper);
  min-width: 0;
}

.wb-right {
  border-left: 1px solid var(--line);
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  background: var(--surface);
}

.panel-label {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-bottom: 6px;
}

.source-box {
  display: grid;
  grid-template-columns: 76px 1fr;
  gap: 12px;
  align-items: center;
}

.source-thumb {
  width: 76px;
  height: 76px;
  border-radius: var(--radius-sm);
  object-fit: contain;
  border: 1px solid var(--line);
  background: var(--surface-alt);
}

.source-thumb.crop-square {
  object-fit: cover;
}

.source-btns {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.pulse-once {
  animation: gentle-ring 2.2s ease-out 1;
}

@keyframes gentle-ring {
  0% { box-shadow: 0 0 0 0 rgba(180, 73, 47, 0.45); }
  70% { box-shadow: 0 0 0 8px rgba(180, 73, 47, 0); }
  100% { box-shadow: 0 0 0 0 rgba(180, 73, 47, 0); }
}

.sample-hint {
  font-size: 13px;
  color: var(--accent);
  font-weight: 700;
}

.control-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.control-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 15px;
}

.num-input {
  width: 68px;
  height: 36px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  text-align: right;
  font-variant-numeric: tabular-nums;
  background: var(--surface);
}

.range-input {
  width: 100%;
  accent-color: var(--accent);
  height: 28px;
  cursor: pointer;
}

.preset-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.preset-btn {
  min-height: 38px;
  padding: 4px 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
  text-align: center;
}

.preset-btn:hover {
  border-color: var(--grid-major);
  background: var(--surface-alt);
}

.preset-btn.active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--ink);
}

.warn-inline {
  font-size: 13px;
  color: var(--warn);
  background: var(--warn-soft);
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  line-height: 1.4;
}

.warn-inline button {
  background: none;
  border: none;
  padding: 0;
  color: var(--accent);
  font-weight: 700;
  text-decoration: underline;
  cursor: pointer;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  min-height: 36px;
  cursor: pointer;
}

.check-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.select-input {
  width: 100%;
  min-height: 40px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-size: 14px;
}

.adjust-drawer {
  background: var(--surface-alt);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px;
  display: none;
  flex-direction: column;
  gap: 8px;
}

.adjust-drawer.open {
  display: flex;
}

/* Canvas Area */
.mode-hint-bar {
  padding: 7px 16px;
  font-size: 13px;
  color: var(--muted);
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.canvas-stage {
  position: relative;
  flex: 1;
  display: flex;
  align-items: safe center;
  justify-content: safe center;
  padding: var(--space-4);
  min-height: 640px;
  max-height: 82vh;
  overflow: auto;
}

.canvas-stage.drag-over {
  outline: 2px dashed var(--accent);
  outline-offset: -8px;
  background: var(--accent-soft);
}

.sample-badge {
  position: absolute;
  top: 8px;
  right: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  box-shadow: var(--shadow-float);
  z-index: 2;
}

#chartCanvas {
  display: block;
  flex-shrink: 0;
  border-radius: 4px;
  background: var(--surface);
  box-shadow: var(--shadow-float);
  cursor: crosshair;
  touch-action: none;
}

#chartCanvas.tool-pencil {
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Cpath d='M3 21l3.6-.9L20.2 6.5a1.5 1.5 0 0 0 0-2.1l-.6-.6a1.5 1.5 0 0 0-2.1 0L3.9 17.4 3 21z' fill='%23B4492F' stroke='%23FFFFFF' stroke-width='1.5' stroke-linejoin='round'/%3E%3Ccircle cx='2.5' cy='21.5' r='1.3' fill='%2323211E' stroke='%23FFFFFF' stroke-width='0.8'/%3E%3C/svg%3E") 2 22, crosshair;
}

#chartCanvas.tool-fill {
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Cpath d='M5 13l7-7 6 6-7 7H5v-6z' fill='%23B4492F' stroke='%23FFFFFF' stroke-width='1.5' stroke-linejoin='round'/%3E%3Cpath d='M4 18c0 1.4-1.5 2.5-1.5 3.3a1.5 1.5 0 0 0 3 0C5.5 20.5 4 19.4 4 18z' fill='%2323211E' stroke='%23FFFFFF' stroke-width='0.9'/%3E%3C/svg%3E") 4 21, crosshair;
}

#chartCanvas.tool-pick {
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Cpath d='M4 20l4.5-1.2 9.8-9.8-3.3-3.3-9.8 9.8L4 20z' fill='%2323211E' stroke='%23FFFFFF' stroke-width='1.5' stroke-linejoin='round'/%3E%3Cpath d='M14.5 5.2l3.8 3.8 1.5-1.5a1.5 1.5 0 0 0 0-2.1l-1.7-1.7a1.5 1.5 0 0 0-2.1 0l-1.5 1.5z' fill='%23B4492F' stroke='%23FFFFFF' stroke-width='1.3'/%3E%3C/svg%3E") 2 22, crosshair;
}

#chartCanvas.tool-make {
  cursor: pointer;
}

.canvas-subbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px var(--space-4);
  border-top: 1px solid var(--line);
  background: var(--surface);
  font-size: 14px;
}

.edit-tools {
  display: flex;
  align-items: center;
  gap: 4px;
}

.tool-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  font-size: 14px;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
}

.tool-btn:hover {
  background: var(--surface-alt);
  color: var(--ink);
}

.tool-btn[aria-pressed="true"] {
  background: var(--accent-soft);
  color: var(--ink);
  border-color: var(--accent);
}

.hover-readout {
  font-size: 13px;
  color: var(--muted);
}

/* Color Key */
.color-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 320px;
  overflow-y: auto;
}

.color-item {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  cursor: pointer;
  background: var(--surface);
}

.color-item.selected {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.color-item.merging {
  border-style: dashed;
  border-color: var(--accent);
  background: var(--accent-soft);
}

.color-item.merge-target:hover {
  border-color: var(--accent);
}

.color-swatch {
  width: 28px;
  height: 28px;
  border-radius: 4px;
  border: 1px solid rgba(35, 33, 30, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
}

.color-meta {
  min-width: 0;
}

.color-name {
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.color-stats {
  font-size: 12px;
  color: var(--muted);
}

.yarn-box {
  margin-top: auto;
  padding-top: var(--space-3);
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Written Rows & Make Mode Views */
.view-panel {
  display: none;
  padding: var(--space-4);
  background: var(--surface);
  min-height: 460px;
  flex-direction: column;
  gap: var(--space-3);
}

.view-panel.active {
  display: flex;
}

.written-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.seg-group {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.seg-btn {
  min-height: 36px;
  padding: 0 12px;
  border: none;
  background: var(--surface);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.seg-btn.active {
  background: var(--ink);
  color: #FFFFFF;
}

.rows-scroll {
  max-height: 350px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px;
  background: var(--paper);
  font-size: 15px;
}

.row-line {
  padding: 6px 8px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.row-line:last-child {
  border-bottom: none;
}

.row-line.warn {
  background: var(--warn-soft);
}

.make-bar {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px var(--space-4);
  background: var(--accent-soft);
  border-top: 1px solid var(--line);
}

.make-bar.active {
  display: flex;
}

.make-current {
  font-size: 16px;
  font-weight: 700;
}

/* Workbench Bottom Bar */
.wb-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: 12px var(--space-4);
  border-top: 1px solid var(--line);
  background: var(--surface);
}

.wb-bottom-left {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
}

.wb-summary {
  font-size: 14px;
  color: var(--muted);
}

.wb-export-btns {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

/* Sections */
.section {
  padding: var(--space-10) 0;
  border-top: 1px solid var(--line);
}

.section-intro {
  max-width: 680px;
  color: var(--muted);
  margin-bottom: var(--space-6);
}

.steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-4);
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: var(--space-4);
}

.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 10px;
}

/* Before / After */
.ba-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-4);
}

.ba-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.ba-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  background: var(--line);
  border-bottom: 1px solid var(--line);
}

.ba-pane {
  position: relative;
  background: var(--paper);
  aspect-ratio: 4 / 3;
  overflow: hidden;
}

.ba-pane img, .ba-pane canvas {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ba-tag {
  position: absolute;
  bottom: 6px;
  left: 6px;
  background: rgba(35, 33, 30, 0.78);
  color: #FFFFFF;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
}

.ba-body {
  padding: var(--space-4);
  font-size: 15px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ba-limit {
  font-size: 14px;
  color: var(--muted);
  margin: 0;
}

.ba-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0 20px;
}

.ba-filter-btn {
  min-height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.ba-filter-btn.active {
  background: var(--ink);
  border-color: var(--ink);
  color: #FFFFFF;
}

.ba-card.is-fail .ba-limit {
  color: var(--warn);
}

.ba-body .btn {
  margin-top: auto;
  align-self: flex-start;
}

/* Style cards */
.style-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-4);
}

.style-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: var(--space-3);
}

.style-card p {
  font-size: 15px;
  color: var(--muted);
  margin: 0;
}

/* Prose guide */
.prose {
  max-width: 720px;
}

/* Free vs Pro mini table */
.compare-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.compare-table th, .compare-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  font-size: 15px;
}

.compare-table th {
  background: var(--surface-alt);
  font-weight: 700;
}

.compare-table tr:last-child td {
  border-bottom: none;
}

/* FAQ */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 820px;
}

.faq-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}

.faq-item summary {
  padding: 16px 20px;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item[open] summary {
  border-bottom: 1px solid var(--line);
}

.faq-answer {
  padding: 14px 20px;
  font-size: 16px;
  color: var(--muted);
}

/* Pricing */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-4);
  align-items: stretch;
  margin-bottom: var(--space-10);
}

.price-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.price-card.featured {
  border: 2px solid var(--accent);
  box-shadow: var(--shadow-float);
  position: relative;
}

.price-badge {
  display: inline-block;
  align-self: flex-start;
  background: var(--accent);
  color: #FFFFFF;
  font-size: 12px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 4px;
}

.price-amount {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 600;
  line-height: 1.1;
}

.price-amount span {
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 400;
  color: var(--muted);
}

.feature-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 15px;
  flex: 1;
}

.feature-list li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.objection-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-4);
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--line);
  padding: var(--space-6) 0 var(--space-10);
  font-size: 14px;
  color: var(--muted);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
}

.footer-links a {
  color: var(--muted);
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--ink);
  text-decoration: underline;
}

/* Modals & Toast */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(35, 33, 30, 0.5);
  display: none;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
  z-index: 100;
}

.modal-backdrop.open {
  display: flex;
}

.modal {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-modal);
  width: 100%;
  max-width: 520px;
  padding: var(--space-6);
  position: relative;
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  min-width: 40px;
  min-height: 40px;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: var(--radius-sm);
  color: var(--muted);
}

.modal-close:hover {
  background: var(--surface-alt);
  color: var(--ink);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: var(--space-3);
}

.field label {
  font-size: 14px;
  font-weight: 700;
}

.field input,
.field textarea {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 15px;
  background: var(--surface);
}

.field input {
  min-height: 44px;
}

.field textarea {
  min-height: 96px;
  resize: vertical;
}

.feedback-cats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: var(--space-3);
}

.cat-btn {
  min-height: 40px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.cat-btn[aria-pressed="true"] {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--ink);
}

.paywall-tiers {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: var(--space-4) 0;
}

.tier-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 12px 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  cursor: pointer;
  text-align: center;
}

.tier-btn.best {
  border: 2px solid var(--accent);
  background: var(--accent-soft);
}

.tier-btn strong {
  font-size: 16px;
}

.tier-btn span {
  font-size: 12px;
  color: var(--muted);
}

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: #FFFFFF;
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  font-size: 15px;
  display: none;
  align-items: center;
  gap: 12px;
  z-index: 120;
  box-shadow: var(--shadow-modal);
}

.toast.open {
  display: flex;
}

.toast button {
  background: none;
  border: none;
  color: #F4E4DD;
  font-weight: 700;
  text-decoration: underline;
  cursor: pointer;
}

/* iPad Portrait (768 - 1023px) */
@media (max-width: 1023px) {
  .btn-focus-toggle {
    display: none;
  }
  .wb-main {
    grid-template-columns: 1fr 240px;
  }
  .wb-left {
    grid-column: 1 / -1;
    grid-row: 2;
    border-right: none;
    border-top: 1px solid var(--line);
    display: grid;
    grid-template-columns: repeat(2, 1fr);
  }
  .wb-center {
    grid-column: 1 / 2;
    grid-row: 1;
  }
  .wb-right {
    grid-column: 2 / 3;
    grid-row: 1;
  }
  .style-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .ba-list {
    grid-template-columns: 1fr;
  }
  .pricing-grid {
    grid-template-columns: 1fr;
  }
}

/* Mobile (< 768px) */
@media (max-width: 767px) {
  .nav-links {
    display: none;
  }
  .nav-links.mobile-open {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    padding: var(--space-3) var(--space-4);
    z-index: 50;
  }
  .mobile-menu-btn {
    display: inline-flex;
  }
  .wb-main {
    grid-template-columns: 1fr;
  }
  .wb-center {
    grid-column: 1;
    grid-row: 1;
  }
  .wb-left {
    grid-column: 1;
    grid-row: 2;
    grid-template-columns: 1fr;
  }
  .wb-right {
    grid-column: 1;
    grid-row: 3;
    border-left: none;
    border-top: 1px solid var(--line);
  }
  .canvas-stage {
    min-height: 300px;
    padding: var(--space-2);
  }
  .steps-grid, .style-grid, .objection-grid, .paywall-tiers {
    grid-template-columns: 1fr;
  }
  .wb-bottom {
    position: sticky;
    bottom: 0;
    z-index: 20;
    box-shadow: 0 -2px 8px rgba(35, 33, 30, 0.06);
  }
}

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