:root {
  --bg: #f7f8fb;
  --surface: #ffffff;
  --surface-soft: #f1f5ff;
  --ink: #172033;
  --muted: #657085;
  --line: #dfe5ef;
  --primary: #6d5dfc;
  --primary-dark: #4b3fd8;
  --accent: #ff5f9e;
  --blue: #2f80ed;
  --yellow: #f7c948;
  --green: #18a058;
  --danger: #de3151;
  --shadow: 0 18px 50px rgba(36, 44, 68, 0.12);
  --radius: 8px;
  --max: 1180px;
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

body.has-mobile-cta {
  padding-bottom: 96px;
}

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 100;
  padding: 10px 14px;
  border: 2px solid #1d4ed8;
  border-radius: 8px;
  background: #fff;
  color: #172033;
  font-weight: 800;
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: translateY(0);
}

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

#main-content:focus {
  outline: 0 !important;
}

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

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select {
  font: inherit;
  letter-spacing: 0;
}

:where(a, button, input, select, [tabindex]):focus-visible {
  outline: 3px solid #1d4ed8 !important;
  outline-offset: 3px !important;
}

:where(.button.primary, .button.dark, .button.accent):focus-visible {
  outline: 3px solid #fff !important;
  box-shadow: 0 0 0 5px #1d4ed8;
}

.page {
  min-height: 100vh;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid rgba(223, 229, 239, 0.9);
  backdrop-filter: blur(18px);
}

.nav-shell {
  width: min(100% - 32px, var(--max));
  margin: 0 auto;
  min-height: 74px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  color: var(--ink);
  white-space: nowrap;
}

.logo-mark {
  width: 34px;
  height: 34px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 20px rgba(33, 42, 70, 0.08);
}

.logo-mark span {
  border-radius: 50%;
}

.logo-mark span:nth-child(1),
.logo-mark span:nth-child(5),
.logo-mark span:nth-child(9) {
  background: var(--primary);
}

.logo-mark span:nth-child(2),
.logo-mark span:nth-child(7) {
  background: var(--accent);
}

.logo-mark span:nth-child(3),
.logo-mark span:nth-child(6) {
  background: var(--yellow);
}

.logo-mark span:nth-child(4),
.logo-mark span:nth-child(8) {
  background: var(--blue);
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-link {
  padding: 10px 12px;
  border-radius: 8px;
  color: #435069;
  font-weight: 650;
  font-size: 0.95rem;
}

.nav-link:hover,
.nav-link.is-active {
  background: var(--surface-soft);
  color: var(--primary-dark);
}

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

.language-select {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  position: relative;
  padding: 0 34px 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: #344057;
  font-weight: 750;
  white-space: nowrap;
}

.language-select svg {
  width: 17px;
  height: 17px;
  color: var(--primary-dark);
  pointer-events: none;
}

.language-select svg:last-child {
  position: absolute;
  right: 10px;
  color: var(--muted);
}

.language-select select {
  width: 116px;
  min-height: 40px;
  border: 0;
  appearance: none;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font-weight: 750;
}

.language-select-mobile {
  display: none;
}

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
}

.button,
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 1px solid transparent;
  border-radius: 8px;
  min-height: 44px;
  padding: 0 16px;
  cursor: pointer;
  font-weight: 750;
  line-height: 1;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease, background 160ms ease;
}

.button:hover,
.icon-button:hover {
  transform: translateY(-1px);
}

.button.primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 12px 24px rgba(109, 93, 252, 0.28);
}

.button.primary:hover {
  background: var(--primary-dark);
}

.button.secondary {
  background: #fff;
  border-color: var(--line);
  color: var(--ink);
}

.button.secondary:hover {
  border-color: #c7d2fe;
  box-shadow: 0 10px 24px rgba(36, 44, 68, 0.08);
}

.button.dark {
  background: var(--ink);
  color: #fff;
}

.button.accent {
  background: var(--accent);
  color: #fff;
}

.button.ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--ink);
}

.button.full {
  width: 100%;
}

.icon-button {
  width: 44px;
  padding: 0;
  background: #fff;
  color: var(--ink);
  border-color: var(--line);
}

.icon-button.is-active,
.icon-button[aria-pressed="true"] {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.button svg,
.icon-button svg,
.nav-toggle svg {
  width: 18px;
  height: 18px;
  stroke-width: 2.25;
}

.section {
  padding: 76px 0;
}

#live-preview,
#maker,
#guides {
  scroll-margin-top: 88px;
}

.section.tight {
  padding: 48px 0;
}

.section.alt {
  background: #fff;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.container {
  width: min(100% - 32px, var(--max));
  margin: 0 auto;
}

.hero {
  position: relative;
  padding: 78px 0 54px;
  overflow: hidden;
  background:
    linear-gradient(180deg, #ffffff 0%, #f7f8fb 100%),
    radial-gradient(circle at 20% 20%, rgba(255, 221, 87, 0.18), transparent 24%);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.88fr) minmax(520px, 1.12fr);
  align-items: center;
  gap: 46px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  padding: 0 11px;
  border: 1px solid #d9defa;
  border-radius: 999px;
  background: #fff;
  color: var(--primary-dark);
  font-weight: 800;
  font-size: 0.82rem;
}

.eyebrow::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(24, 160, 88, 0.12);
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 780px;
  margin-bottom: 18px;
  font-size: clamp(2.45rem, 5vw, 4.8rem);
  line-height: 0.98;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 14px;
  font-size: clamp(1.65rem, 3vw, 2.55rem);
  line-height: 1.08;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 10px;
  font-size: 1.1rem;
  line-height: 1.25;
}

.lead {
  max-width: 760px;
  color: var(--muted);
  font-size: clamp(1rem, 1.8vw, 1.22rem);
  line-height: 1.65;
}

.hero-copy .lead {
  margin-bottom: 28px;
}

.hero-actions,
.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.trust-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  max-width: 640px;
  margin-top: 28px;
}

.trust-item {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.84);
}

.trust-item strong {
  display: block;
  font-size: 1.25rem;
}

.trust-item span {
  color: var(--muted);
  font-size: 0.9rem;
}

.comparison-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.comparison-head,
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.comparison-head strong,
.card-head strong {
  font-size: 0.98rem;
}

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--primary-dark);
  font-weight: 800;
  font-size: 0.78rem;
  white-space: nowrap;
}

.pill.green {
  background: #e7f8ee;
  color: #107846;
}

.pill.yellow {
  background: #fff7db;
  color: #8a5b00;
}

.pill.pink {
  background: #ffeaf3;
  color: #b72b67;
}

.comparison-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 320px;
}

.output-preview-card {
  align-self: center;
  max-width: 760px;
}

.output-preview-body {
  display: grid;
  grid-template-columns: minmax(190px, 0.78fr) minmax(260px, 1.22fr);
  min-height: 260px;
}

.output-pattern-panel {
  min-width: 0;
  display: grid;
  align-content: start;
  border-right: 1px solid var(--line);
  background: #f8fafc;
}

.output-pattern-panel img,
.output-pattern-panel canvas {
  width: min(100%, 204px);
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  object-position: center;
  display: block;
  margin: 16px auto 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(223, 229, 239, 0.48) 1px, transparent 1px),
    linear-gradient(rgba(223, 229, 239, 0.48) 1px, transparent 1px),
    #fff;
  background-size: 18px 18px;
}

.output-details-panel {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 16px;
  background: #fff;
}

.output-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.output-mini-section {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.output-mini-section strong {
  display: block;
  margin-bottom: 10px;
  font-size: 0.9rem;
}

.output-swatches {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px 10px;
  color: #435069;
  font-size: 0.78rem;
  font-weight: 750;
}

.output-swatches span {
  display: flex;
  align-items: center;
  min-width: 0;
  white-space: nowrap;
}

.output-summary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

.output-summary-grid div {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.output-summary-grid span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
}

.output-summary-grid strong {
  display: block;
  margin-top: 4px;
  font-size: 1.2rem;
}

.output-export-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

.output-export-row > span {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--primary-dark);
  font-size: 0.82rem;
  font-weight: 850;
}

.output-export-row svg {
  width: 16px;
  height: 16px;
}

.hero-demo-card {
  align-self: center;
  overflow: visible;
}

.hero-demo-card .comparison-head {
  background: #fff;
  border-radius: 8px 8px 0 0;
}

.hero-demo-card .before-after-stage {
  min-height: 520px;
  background-size: 24px 24px;
}

.hero-demo-card .before-after-label-row {
  border-radius: 0;
}

.hero-demo-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 14px 14px;
  border-top: 1px solid var(--line);
  border-radius: 0 0 8px 8px;
  background: #fff;
}

.hero-demo-meta > span,
.hero-demo-meta > button {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  color: #344057;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 800;
}

.hero-demo-meta > button {
  cursor: pointer;
  background: var(--surface-soft);
  color: var(--primary-dark);
}

.hero-demo-meta > button:hover {
  border-color: #b8c2ff;
}

.hero-demo-meta svg {
  width: 15px;
  height: 15px;
}

.compare-pane {
  position: relative;
  min-width: 0;
  background: #f8fafc;
}

.compare-pane + .compare-pane {
  border-left: 1px solid var(--line);
}

.compare-pane img {
  width: 100%;
  height: 100%;
  min-height: 320px;
  object-fit: cover;
}

.pane-label {
  position: absolute;
  left: 12px;
  top: 12px;
  z-index: 2;
  padding: 7px 9px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 800;
  box-shadow: 0 8px 24px rgba(20, 30, 52, 0.12);
}

.compare-feature {
  padding: 58px 0;
  background:
    linear-gradient(180deg, #f7f8fb 0%, #ffffff 100%);
  border-top: 1px solid rgba(223, 229, 239, 0.65);
  border-bottom: 1px solid rgba(223, 229, 239, 0.75);
}

.compare-feature-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.82fr) minmax(420px, 1.18fr);
  gap: 32px;
  align-items: center;
}

.compare-feature-grid > * {
  min-width: 0;
}

.compare-feature-copy h2 {
  max-width: 560px;
}

.compare-feature-copy .lead {
  margin-bottom: 18px;
}

.feature-checklist {
  display: grid;
  gap: 10px;
  padding: 0;
  margin: 0 0 22px;
  list-style: none;
}

.feature-checklist li {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #344057;
  font-weight: 780;
}

.feature-checklist svg {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  padding: 3px;
  border-radius: 50%;
  background: #e7f8ee;
  color: var(--green);
}

.before-after-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
  overflow: visible;
}

.before-after-label-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  border-radius: 8px 8px 0 0;
  background: #fff;
}

.before-after-stage {
  position: relative;
  aspect-ratio: 1 / 1;
  min-height: 390px;
  overflow: visible;
  background:
    linear-gradient(90deg, rgba(223, 229, 239, 0.5) 1px, transparent 1px),
    linear-gradient(rgba(223, 229, 239, 0.5) 1px, transparent 1px),
    #ffffff;
  background-size: 26px 26px;
  cursor: ew-resize;
  touch-action: none;
}

.before-after-image,
.before-after-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.before-after-image {
  object-fit: contain;
  object-position: center;
}

.before-after-layer {
  clip-path: inset(0 0 0 var(--split));
  pointer-events: none;
  overflow: hidden;
}

.before-after-divider {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--split);
  width: 2px;
  z-index: 4;
  background: #fff;
  box-shadow: 0 0 0 1px rgba(23, 32, 51, 0.14), 0 0 24px rgba(109, 93, 252, 0.28);
  transform: translateX(-1px);
  pointer-events: none;
}

.before-after-handle {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border: 3px solid #fff;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  box-shadow: 0 14px 28px rgba(34, 43, 72, 0.22);
  transform: translate(-50%, -50%);
}

.before-after-handle svg {
  width: 22px;
  height: 22px;
}

.before-after-range {
  position: absolute;
  inset: 0;
  z-index: 8;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: ew-resize;
}

.before-after-stage:focus-within {
  outline: 3px solid #1d4ed8;
  outline-offset: 4px;
}

.before-after-stage:focus-within .before-after-handle {
  box-shadow: 0 0 0 4px #fff, 0 0 0 7px #1d4ed8, 0 14px 28px rgba(34, 43, 72, 0.22);
}

.before-after-label {
  padding: 8px 10px;
  border-radius: 8px;
  background: #f8fafc;
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 850;
  box-shadow: inset 0 0 0 1px rgba(223, 229, 239, 0.95);
  pointer-events: none;
  transition: opacity 0.18s ease, visibility 0.18s ease;
}

.before-after-card[data-compare-mode="pattern"] .before-label,
.before-after-card[data-compare-mode="original"] .after-label {
  opacity: 0;
  visibility: hidden;
}

.after-label {
  background: #f4f1ff;
  color: var(--primary-dark);
}

.compare-helper {
  margin: 0;
  padding: 13px 16px;
  border-top: 1px solid var(--line);
  border-radius: 0 0 8px 8px;
  background: #fff;
  color: var(--muted);
  font-weight: 680;
  font-size: 0.92rem;
}

.maker-layout {
  display: grid;
  grid-template-columns: minmax(300px, 380px) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.maker-layout > *,
.detail-layout > *,
.hero-grid > * {
  min-width: 0;
}

.tool-panel,
.preview-panel,
.material-panel,
.info-panel,
.filter-panel,
.chart-panel,
.faq-item,
.gallery-card,
.summary-card,
.upload-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 34px rgba(37, 46, 72, 0.06);
}

.tool-panel {
  padding: 18px;
  position: sticky;
  top: 94px;
}

.tool-stack {
  display: grid;
  gap: 16px;
  width: 100%;
  min-width: 0;
  position: sticky;
  top: 94px;
}

.tool-stack .tool-panel {
  position: static;
}

.step-list {
  display: grid;
  gap: 14px;
}

.step-item {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 12px;
  align-items: start;
}

.step-number {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--surface-soft);
  color: var(--primary-dark);
  font-weight: 900;
}

.step-copy strong {
  display: block;
  margin-bottom: 6px;
}

.step-copy p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
}

.upload-card {
  padding: 22px;
  border-style: dashed;
  background:
    linear-gradient(#fff, #fff) padding-box,
    repeating-linear-gradient(45deg, rgba(109, 93, 252, 0.2) 0 8px, rgba(255, 95, 158, 0.18) 8px 16px) border-box;
  text-align: center;
}

.upload-icon {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  margin: 0 auto 14px;
  border-radius: 50%;
  background: var(--surface-soft);
  color: var(--primary-dark);
}

.upload-icon svg {
  width: 26px;
  height: 26px;
}

.upload-card p {
  color: var(--muted);
  line-height: 1.5;
}

.upload-error {
  display: none;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 10px;
  margin-top: 14px;
  padding: 12px;
  border: 1px solid #f0b7b7;
  border-radius: 8px;
  color: #8f2424;
  background: #fff5f5;
  text-align: left;
}

.upload-error.is-visible {
  display: grid;
}

.upload-error[hidden] {
  display: none;
}

.upload-error svg {
  width: 20px;
  height: 20px;
  margin-top: 1px;
}

.upload-error strong,
.upload-error span {
  display: block;
  overflow-wrap: anywhere;
}

.upload-error strong {
  margin-bottom: 3px;
  font-size: 0.9rem;
}

.upload-error span {
  font-size: 0.82rem;
  line-height: 1.45;
}

.hidden-input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.control-group {
  margin-top: 18px;
}

.control-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 9px;
  color: #2d3750;
  font-weight: 850;
  font-size: 0.92rem;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.segmented.single {
  grid-template-columns: minmax(0, 1fr);
}

.segmented.four {
  grid-template-columns: repeat(4, 1fr);
}

.segmented.five {
  grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
}

.select-chip,
.filter-chip {
  min-width: 0;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: #344057;
  cursor: pointer;
  font-weight: 750;
}

.segmented.five .select-chip {
  padding: 0 10px;
  white-space: nowrap;
}

.custom-size-field {
  display: grid;
  gap: 8px;
  margin-top: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.custom-size-field[hidden] {
  display: none;
}

.custom-size-label {
  color: #2d3750;
  font-size: 0.86rem;
  font-weight: 850;
}

.custom-size-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.custom-size-row input {
  width: 100%;
  min-width: 0;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-weight: 800;
}

.custom-size-row input:focus {
  outline: 3px solid rgba(109, 93, 252, 0.14);
  border-color: var(--primary);
}

.custom-size-suffix {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  font-weight: 850;
}

.custom-size-field p {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 650;
}

.select-chip:hover,
.filter-chip:hover {
  border-color: #b8c2ff;
}

.select-chip.is-active,
.filter-chip.is-active,
.select-chip[aria-pressed="true"],
.filter-chip[aria-pressed="true"] {
  border-color: var(--primary);
  background: var(--surface-soft);
  color: var(--primary-dark);
}

.generate-box {
  margin-top: 20px;
  display: grid;
  gap: 10px;
}

.status-line {
  min-height: 22px;
  color: var(--muted);
  font-size: 0.88rem;
}

.palette-notice {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid #e5b94f;
  border-radius: 8px;
  background: #fff9e8;
  color: #654b0b;
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.palette-notice[hidden] {
  display: none;
}

.palette-notice svg {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  margin-top: 1px;
}

.workspace {
  display: grid;
  gap: 18px;
  width: 100%;
  min-width: 0;
}

.workspace > *,
.preview-grid > *,
.complete-state,
.preview-panel {
  min-width: 0;
  max-width: 100%;
}

.preview-panel {
  overflow: hidden;
}

.preview-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.preview-toolbar h2,
.preview-toolbar h3 {
  margin: 0;
}

.toolbar-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.preview-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.86fr) minmax(0, 1.14fr);
  min-height: 430px;
}

.original-pane,
.pattern-pane {
  min-width: 0;
  background: #f8fafc;
}

.original-pane {
  border-right: 1px solid var(--line);
}

.pane-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 48px;
  padding: 0 14px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.8);
  font-weight: 850;
}

.original-frame {
  height: calc(100% - 48px);
  min-height: 360px;
  display: grid;
  place-items: center;
  padding: 18px;
}

.original-frame img,
.original-frame canvas {
  max-height: 360px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.original-frame img {
  width: 100%;
  height: 100%;
}

.original-frame canvas {
  width: min(100%, 360px);
  height: auto;
  aspect-ratio: 1 / 1;
}

.pattern-demo-canvas,
.pattern-source-canvas,
.original-preview-canvas,
.pattern-preview-canvas {
  image-rendering: auto;
}

.empty-state,
.loading-state {
  min-height: 430px;
  display: grid;
  place-items: center;
  padding: 28px;
  text-align: center;
  color: var(--muted);
}

.empty-state svg,
.loading-state svg {
  width: 42px;
  height: 42px;
  margin: 0 auto 16px;
  color: var(--primary);
}

.loading-card {
  width: min(100%, 420px);
}

.progress-shell {
  height: 12px;
  border-radius: 999px;
  overflow: hidden;
  background: #e8edf8;
}

.progress-bar {
  width: var(--progress, 12%);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary), var(--accent), var(--yellow));
  transition: width 220ms ease;
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
  font-weight: 750;
  color: #3f4b64;
}

.maker-workspace[data-state="empty"] .loading-state,
.maker-workspace[data-state="empty"] .complete-state,
.maker-workspace[data-state="loading"] .empty-state,
.maker-workspace[data-state="loading"] .complete-state,
.maker-workspace[data-state="complete"] .empty-state,
.maker-workspace[data-state="complete"] .loading-state {
  display: none;
}

.bead-grid-wrap {
  --bead-size: clamp(6px, calc((100vw - 170px) / 31), 10.5px);
  width: 100%;
  height: calc(100% - 48px);
  min-height: 360px;
  display: grid;
  place-items: center;
  overflow: auto;
  padding: 18px;
  background:
    linear-gradient(90deg, rgba(223, 229, 239, 0.55) 1px, transparent 1px),
    linear-gradient(rgba(223, 229, 239, 0.55) 1px, transparent 1px),
    #ffffff;
  background-size: 24px 24px;
}

.bead-grid-wrap canvas {
  width: min(100%, 480px);
  height: auto;
  max-height: 100%;
  aspect-ratio: 1 / 1;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 30px rgba(25, 35, 58, 0.08);
}

.bead-grid-wrap.no-grid {
  background: #ffffff;
}

.bead-grid {
  display: grid;
  grid-template-columns: repeat(var(--cols, 29), var(--bead-size));
  grid-auto-rows: var(--bead-size);
  gap: max(1px, calc(var(--bead-size) * 0.16));
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  box-shadow: 0 12px 30px rgba(25, 35, 58, 0.08);
}

.bead {
  position: relative;
  border-radius: 50%;
  background: var(--c);
  border: 1px solid rgba(23, 32, 51, 0.16);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

.bead::after {
  content: "";
  position: absolute;
  inset: 35%;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.38);
}

.bead-grid.hide-colors .bead {
  background: #f5f7fb;
}

.bead-grid.show-numbers .bead::before {
  content: attr(data-n);
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #1e293b;
  font-size: max(6px, calc(var(--bead-size) * 0.45));
  font-weight: 850;
  z-index: 2;
}

.material-panel {
  padding: 18px;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}

.summary-card {
  padding: 16px;
  box-shadow: none;
}

.summary-card span {
  color: var(--muted);
  font-size: 0.86rem;
}

.summary-card strong {
  display: block;
  margin-top: 6px;
  font-size: 1.4rem;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 680px;
}

th,
td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

th {
  color: #3f4b64;
  font-size: 0.8rem;
  text-transform: uppercase;
  background: #f8fafc;
}

td {
  color: #243049;
  font-weight: 650;
}

.swatch,
.mini-swatch {
  display: inline-block;
  width: 28px;
  height: 28px;
  border: 1px solid rgba(23, 32, 51, 0.16);
  border-radius: 50%;
  background: var(--swatch);
  vertical-align: middle;
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.55);
}

.mini-swatch {
  width: 22px;
  height: 22px;
  margin-right: 8px;
}

.export-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 34px rgba(37, 46, 72, 0.06);
}

.section-heading {
  max-width: 820px;
  margin-bottom: 28px;
}

.section-heading h2 {
  margin-top: 12px;
}

.section-heading .lead {
  margin-bottom: 0;
}

.split-heading {
  max-width: none;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
}

.split-heading > div {
  max-width: 780px;
}

.section-cta {
  display: flex;
  justify-content: center;
  margin-top: 24px;
}

.tutorial-timeline {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
  counter-reset: tutorial;
}

.tutorial-step-card,
.ready-pattern-card,
.use-case-card,
.testimonial-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 34px rgba(37, 46, 72, 0.06);
}

.tutorial-step-card {
  position: relative;
  min-height: 238px;
  padding: 18px;
  overflow: hidden;
}

.tutorial-step-card::after {
  content: "";
  position: absolute;
  right: -38px;
  bottom: -38px;
  width: 112px;
  height: 112px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(109, 93, 252, 0.13), transparent 68%);
}

.tutorial-step-number {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  margin-bottom: 16px;
  border-radius: 50%;
  background: var(--surface-soft);
  color: var(--primary-dark);
  font-weight: 900;
}

.tutorial-step-card h3,
.ready-pattern-card h3,
.use-case-card h3 {
  margin-bottom: 8px;
}

.tutorial-step-card p,
.ready-pattern-card p,
.use-case-card p,
.testimonial-card p {
  color: var(--muted);
  line-height: 1.6;
  margin-bottom: 0;
}

.ready-patterns-section {
  background: linear-gradient(180deg, #f7f8fb 0%, #ffffff 100%);
}

.ready-pattern-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.ready-pattern-card {
  overflow: hidden;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.ready-pattern-card:hover {
  transform: translateY(-2px);
  border-color: #c7d2fe;
  box-shadow: 0 18px 42px rgba(37, 46, 72, 0.11);
}

.ready-pattern-canvas {
  width: 100%;
  height: auto;
  aspect-ratio: 1.2 / 1;
  display: block;
  background:
    linear-gradient(90deg, rgba(223, 229, 239, 0.5) 1px, transparent 1px),
    linear-gradient(rgba(223, 229, 239, 0.5) 1px, transparent 1px),
    #ffffff;
  background-size: 22px 22px;
  border-bottom: 1px solid var(--line);
}

.pattern-library-preview {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-bottom: 1px solid var(--line);
  background: #f8fafc;
}

.pattern-library-preview figure {
  display: grid;
  grid-template-rows: 1fr auto;
  min-width: 0;
  margin: 0;
  background:
    linear-gradient(90deg, rgba(223, 229, 239, 0.48) 1px, transparent 1px),
    linear-gradient(rgba(223, 229, 239, 0.48) 1px, transparent 1px),
    #fff;
  background-size: 18px 18px;
}

.pattern-library-preview figure + figure {
  border-left: 1px solid var(--line);
}

.pattern-library-preview img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  padding: 12px;
}

.pattern-library-preview figcaption {
  padding: 8px 10px;
  border-top: 1px solid rgba(207, 214, 230, 0.72);
  background: rgba(248, 250, 252, 0.86);
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  text-align: center;
}

.cute-pattern-card {
  min-height: 100%;
}

.cute-pattern-preview {
  display: grid;
  place-items: center;
  padding: 14px;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(90deg, rgba(223, 229, 239, 0.38) 1px, transparent 1px),
    linear-gradient(rgba(223, 229, 239, 0.38) 1px, transparent 1px),
    #ffffff;
  background-size: 20px 20px;
}

.cute-pattern-preview img {
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  display: block;
  object-fit: contain;
}

.ready-pattern-body {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.ready-pattern-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

.ready-pattern-actions .button.primary {
  grid-column: 1 / -1;
}

.ready-pattern-actions .button {
  min-height: 40px;
  padding: 0 12px;
  font-size: 0.86rem;
}

.use-case-grid,
.testimonial-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.testimonial-grid {
  gap: 20px;
}

.use-case-card {
  min-height: 360px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.use-case-media {
  width: 100%;
  aspect-ratio: 4 / 3;
  display: block;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background: #f8fafc;
}

.use-case-media img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.use-case-card h3 {
  padding: 18px 18px 0;
}

.use-case-card p {
  flex: 1;
  padding: 0 18px 18px;
}

.testimonial-card {
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: 22px;
}

.testimonial-person {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-bottom: 16px;
}

.testimonial-avatar {
  width: 52px;
  height: 52px;
  flex: 0 0 52px;
  display: block;
  object-fit: cover;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px #dfe5ef, 0 6px 16px rgba(37, 46, 72, 0.12);
}

.testimonial-person-copy {
  min-width: 0;
}

.testimonial-person strong {
  display: block;
  color: var(--ink);
  font-size: 1rem;
}

.testimonial-role {
  max-width: 100%;
  display: inline-flex;
  margin-top: 5px;
  padding: 3px 7px;
  border: 1px solid #e0e4f3;
  border-radius: 4px;
  background: #f7f7fc;
  color: #59647a;
  font-size: 0.76rem;
  font-weight: 800;
  line-height: 1.3;
}

.testimonial-proof {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 15px;
}

.testimonial-stars {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  color: #d69b18;
}

.testimonial-stars svg {
  width: 15px;
  height: 15px;
  fill: currentColor;
  stroke-width: 1.8;
}

.testimonial-result {
  max-width: 100%;
  padding: 5px 8px;
  border: 1px solid #e1e6ef;
  border-radius: 4px;
  background: #f8fafc;
  color: #46536a;
  font-size: 0.76rem;
  font-weight: 800;
  line-height: 1.35;
}

.testimonial-quote {
  margin: 0;
}

.testimonial-card .testimonial-quote p {
  color: #4d596f;
  line-height: 1.72;
}

.content-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.content-block {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.content-block p {
  color: var(--muted);
  line-height: 1.65;
  margin-bottom: 0;
}

.faq-list {
  display: grid;
  gap: 10px;
  margin-top: 22px;
}

.faq-heading {
  max-width: 760px;
  margin-top: 48px;
  margin-bottom: 0;
}

.faq-button {
  width: 100%;
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 0;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  padding: 0 18px;
  text-align: left;
  font-weight: 850;
}

.faq-button svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  transition: transform 160ms ease;
}

.faq-item.is-open .faq-button svg {
  transform: rotate(180deg);
}

.faq-answer {
  display: none;
  max-width: 980px;
  padding: 0 18px 18px;
  color: var(--muted);
  line-height: 1.6;
}

.faq-answer[hidden] {
  display: none;
}

.faq-item.is-open .faq-answer {
  display: block;
}

.detail-hero {
  padding: 54px 0;
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
  color: var(--muted);
  font-size: 0.92rem;
}

.breadcrumb a {
  color: var(--primary-dark);
  font-weight: 750;
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  gap: 24px;
  align-items: start;
}

.pattern-preview-large {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.pattern-preview-large img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.info-panel {
  padding: 20px;
}

.info-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 18px 0;
}

.info-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.info-card span {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
}

.info-card strong {
  display: block;
  margin-top: 4px;
  font-size: 1.02rem;
}

.related-grid,
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.gallery-grid {
  grid-template-columns: repeat(4, 1fr);
}

.pattern-library-grid > [data-pattern-card][hidden] {
  display: none;
}

.gallery-card {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
}

.gallery-card > img {
  width: 100%;
  aspect-ratio: 1.28 / 1;
  object-fit: cover;
  background: #f8fafc;
}

.gallery-card-body {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 12px;
  padding: 14px;
}

.gallery-card h3 {
  margin: 0;
}

.gallery-pattern-comparison {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(90deg, rgba(223, 229, 239, 0.45) 1px, transparent 1px),
    linear-gradient(rgba(223, 229, 239, 0.45) 1px, transparent 1px),
    #fff;
  background-size: 18px 18px;
}

.gallery-pattern-comparison .before-after-stage {
  min-height: 0;
  overflow: hidden;
  background: transparent;
  touch-action: pan-y;
}

.gallery-pattern-comparison canvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 0.18s ease;
}

.gallery-pattern-comparison.is-ready canvas,
.pattern-quick-detail[open] .gallery-pattern-comparison canvas {
  opacity: 1;
}

.gallery-pattern-source {
  clip-path: inset(0 50% 0 0);
}

.gallery-pattern-generated {
  clip-path: inset(0 0 0 50%);
}

.gallery-pattern-comparison[data-pattern-card-comparison] .gallery-pattern-source,
.gallery-pattern-comparison[data-pattern-card-comparison] .gallery-pattern-generated {
  clip-path: none;
}

.gallery-pattern-comparison[data-pattern-card-comparison] .before-after-layer {
  z-index: 1;
}

.gallery-pattern-comparison[data-pattern-card-comparison] .before-after-divider {
  z-index: 4;
}

.gallery-pattern-comparison[data-pattern-card-comparison] .before-after-handle {
  width: 40px;
  height: 40px;
  border-width: 2px;
  box-shadow: 0 8px 20px rgba(34, 43, 72, 0.22);
}

.gallery-pattern-comparison[data-pattern-card-comparison] .before-after-handle svg {
  width: 18px;
  height: 18px;
}

.gallery-pattern-comparison[data-pattern-card-comparison] .before-after-stage:focus-within {
  outline-offset: -3px;
}

.gallery-pattern-divider {
  position: absolute;
  z-index: 2;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  background: #fff;
  box-shadow: 0 0 0 1px rgba(23, 32, 51, 0.15);
  transform: translateX(-1px);
}

.gallery-comparison-label {
  position: absolute;
  z-index: 5;
  top: 10px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--ink);
  font-size: 0.7rem;
  font-weight: 850;
  line-height: 1;
}

.gallery-comparison-label.source-label {
  left: 10px;
}

.gallery-comparison-label.generated-label {
  right: 10px;
  border-color: rgba(109, 93, 252, 0.24);
  background: rgba(246, 243, 255, 0.96);
  color: var(--primary-dark);
}

.gallery-pattern-details {
  display: grid;
  gap: 8px;
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.gallery-pattern-details div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
}

.gallery-pattern-details dt,
.gallery-pattern-details dd {
  margin: 0;
}

.gallery-pattern-details dt {
  font-weight: 700;
}

.gallery-pattern-details dd {
  color: var(--ink);
  font-weight: 800;
  text-align: right;
}

.content-narrow {
  max-width: 820px;
}

.inventory-status {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 18px;
  margin-top: 18px;
  color: var(--muted);
}

.inventory-status strong {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  padding: 8px 12px;
  border: 1px solid rgba(109, 93, 252, 0.24);
  border-radius: 999px;
  background: rgba(109, 93, 252, 0.08);
  color: var(--primary-dark);
}

.collection-link-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 20px;
}

.collection-link-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  text-decoration: none;
  box-shadow: 0 8px 24px rgba(36, 44, 68, 0.08);
}

.collection-link-card:hover,
.collection-link-card:focus-visible {
  border-color: rgba(109, 93, 252, 0.5);
  box-shadow: var(--shadow);
}

.collection-link-card span {
  min-width: 0;
  font-weight: 800;
}

.collection-link-card strong {
  display: grid;
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 50%;
  background: rgba(109, 93, 252, 0.1);
  color: var(--primary-dark);
}

.pattern-collection-hero .lead {
  max-width: 820px;
}

.gallery-pattern-cta {
  margin-top: auto;
}

.gallery-pattern-summary {
  min-height: 4.5em;
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.gallery-card-actions {
  display: grid;
  gap: 9px;
  margin-top: auto;
}

.gallery-card-actions .button {
  width: 100%;
}

.gallery-hub-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 360px);
  gap: 32px;
  align-items: center;
}

.gallery-hub-layout .lead {
  margin-bottom: 0;
}

.gallery-hub-actions {
  display: grid;
  gap: 10px;
}

.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.meta-chip {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 8px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #475569;
  font-size: 0.78rem;
  font-weight: 800;
}

.gallery-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 0.88rem;
}

.filter-panel {
  padding: 16px;
  margin-bottom: 22px;
}

.filter-top {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
}

.gallery-result-count {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 750;
  text-align: right;
}

.search-field {
  position: relative;
}

.search-field svg {
  position: absolute;
  left: 13px;
  top: 50%;
  width: 18px;
  height: 18px;
  transform: translateY(-50%);
  color: var(--muted);
}

.search-field input,
.select-field,
.text-input {
  width: 100%;
  min-height: 46px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
}

.search-field input {
  padding-left: 42px;
}

.search-field input:focus,
.select-field:focus,
.text-input:focus {
  outline: 3px solid rgba(109, 93, 252, 0.16);
  border-color: var(--primary);
}

.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.filter-chip {
  gap: 7px;
  border-color: #cbd5e1;
  background: #fff;
  transition: border-color 0.16s ease, background 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
}

.filter-chip:hover {
  border-color: rgba(109, 93, 252, 0.48);
  background: #faf9ff;
}

.filter-chip.is-active,
.filter-chip[aria-pressed="true"] {
  border-color: var(--primary);
  background: rgba(109, 93, 252, 0.12);
  color: var(--primary-dark);
  box-shadow: 0 0 0 2px rgba(109, 93, 252, 0.12);
}

.filter-chip strong {
  min-width: 22px;
  min-height: 22px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(71, 85, 105, 0.1);
  font-size: 0.72rem;
}

.filter-chip.is-active strong,
.filter-chip[aria-pressed="true"] strong {
  background: rgba(109, 93, 252, 0.14);
  color: var(--primary-dark);
}

.collection-guide-links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 14px;
  padding-top: 14px;
  margin-top: 14px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 750;
}

.collection-guide-links a {
  color: var(--primary-dark);
  font-weight: 850;
}

.gallery-empty {
  margin: 24px 0 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  text-align: center;
}

.gallery-empty[hidden] {
  display: none;
}

.retired-pattern-page {
  min-height: calc(100vh - 210px);
  display: grid;
  align-items: center;
}

.pattern-detail-hero .lead {
  max-width: 920px;
}

.pattern-detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  gap: 28px;
  align-items: start;
}

.pattern-detail-visual,
.pattern-detail-panel {
  min-width: 0;
}

.pattern-detail-preview {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.pattern-detail-label {
  min-height: 44px;
  display: flex;
  align-items: center;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
  color: #344057;
  font-size: 0.88rem;
  font-weight: 850;
}

.pattern-detail-preview canvas {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  background: #fff;
}

.pattern-detail-preview.before-after-card {
  overflow: hidden;
}

.pattern-detail-preview .before-after-stage {
  min-height: 0;
  overflow: hidden;
}

.pattern-detail-preview .before-after-layer canvas,
.pattern-detail-preview > .before-after-stage > canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.pattern-detail-preview .before-after-layer canvas {
  background: #fff;
}

.pattern-detail-start-note {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 14px;
  border: 1px solid rgba(109, 93, 252, 0.22);
  border-radius: 8px;
  background: #f8f7ff;
}

.pattern-detail-start-note svg {
  width: 22px;
  height: 22px;
  margin: 2px auto 0;
  color: var(--primary-dark);
}

.pattern-detail-start-note strong,
.pattern-detail-start-note span {
  display: block;
}

.pattern-detail-start-note span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.45;
}

.pattern-quick-detail {
  width: min(920px, calc(100% - 32px));
  max-width: none;
  max-height: min(820px, calc(100dvh - 32px));
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  box-shadow: 0 28px 80px rgba(23, 32, 51, 0.28);
}

.pattern-quick-detail::backdrop {
  background: rgba(23, 32, 51, 0.56);
}

.pattern-quick-detail-shell {
  position: relative;
  max-height: inherit;
  overflow: auto;
  padding: 28px;
}

.pattern-quick-detail-close {
  position: absolute;
  z-index: 4;
  top: 18px;
  right: 18px;
}

.pattern-quick-detail h2 {
  max-width: calc(100% - 48px);
  margin: 10px 0 8px;
  font-size: 1.6rem;
}

.pattern-quick-detail-summary {
  max-width: 720px;
  margin: 0 0 20px;
  color: var(--muted);
}

.pattern-quick-detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(280px, 0.92fr);
  gap: 24px;
  align-items: start;
}

.quick-detail-comparison {
  border: 1px solid var(--line);
  border-radius: 8px;
}

.pattern-quick-detail-info .pattern-detail-stats {
  margin-top: 0;
}

.pattern-quick-detail-status {
  min-height: 44px;
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.45;
}

.pattern-quick-detail-info .button {
  width: 100%;
}

.pattern-detail-status {
  min-height: 24px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 750;
}

.pattern-detail-status[role="alert"] {
  color: #8f2424;
}

.pattern-detail-panel {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.pattern-detail-panel h2 {
  margin-bottom: 16px;
}

.pattern-detail-source {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.pattern-detail-source img {
  width: 82px;
  height: 82px;
  border: 1px solid var(--line);
  border-radius: 8px;
  object-fit: contain;
  background: #fff;
}

.pattern-detail-source strong,
.pattern-detail-source span {
  display: block;
}

.pattern-detail-source span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.45;
}

.pattern-detail-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 18px 0;
}

.pattern-detail-stats div {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.pattern-detail-stats dt,
.pattern-detail-stats dd {
  margin: 0;
}

.pattern-detail-stats dt {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
}

.pattern-detail-stats dd {
  margin-top: 5px;
  color: var(--ink);
  font-size: 1.06rem;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.pattern-detail-actions {
  display: grid;
  gap: 9px;
  margin-top: 18px;
}

.pattern-detail-actions .button {
  width: 100%;
}

.pattern-detail-export-note {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.5;
}

.pattern-detail-table-wrap {
  background: #fff;
}

.pattern-detail-material-table {
  min-width: 620px;
}

.pattern-detail-material-table code {
  color: #243049;
  font: 750 0.88rem ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  letter-spacing: 0;
  white-space: nowrap;
}

.pattern-detail-notes {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.pattern-detail-notes .text-link {
  display: inline-flex;
  margin-top: 12px;
  color: var(--primary-dark);
  font-weight: 850;
}

.size-guide-hero .lead {
  max-width: 900px;
}

.size-guide-heading {
  margin-bottom: 22px;
}

.size-guide-selector {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 22px;
}

.size-guide-selector .select-chip {
  min-width: 112px;
  min-height: 44px;
}

.size-guide-selector .select-chip:disabled {
  cursor: wait;
  opacity: 0.62;
}

.size-guide-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  gap: 28px;
  align-items: start;
}

.size-guide-stat-wide {
  grid-column: 1 / -1;
}

.size-guide-upload {
  margin-top: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fafbff;
}

.size-guide-upload > div > strong {
  display: block;
  color: var(--ink);
  font-size: 0.96rem;
}

.size-guide-upload > div > p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.5;
}

.size-guide-upload-actions {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.size-guide-upload-actions .button {
  width: 100%;
}

.size-guide-upload-actions [hidden] {
  display: none;
}

.size-guide-upload .upload-error {
  margin-top: 12px;
}

.size-guide-retry-copy {
  min-width: 0;
}

.size-guide-retry-copy > span {
  display: block;
}

.size-guide-retry-button {
  min-height: 36px;
  margin-top: 9px;
  padding: 7px 11px;
  font-size: 0.8rem;
}

.size-guide-approx-note {
  margin: -4px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.5;
}

.size-guide-table-wrap {
  background: #fff;
}

.size-guide-table {
  min-width: 900px;
}

.size-guide-table tbody tr.is-selected {
  background: #f1efff;
}

.size-guide-table tbody th {
  color: var(--ink);
  white-space: nowrap;
}

.size-guide-table td:nth-child(n + 3) {
  white-space: nowrap;
}

.size-guide-notes {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.size-guide-notes h3 {
  margin-bottom: 10px;
  font-size: 1.1rem;
}

.size-guide-source-list span {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.size-guide-link-row {
  flex-wrap: wrap;
}

.size-guide-link-row .button {
  flex: 1 1 220px;
}

[data-size-guide].is-unavailable [data-size-guide-canvas] {
  opacity: 0.28;
}

.chart-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 320px);
  gap: 14px;
  align-items: end;
  margin: 22px 0;
}

.chart-panel {
  overflow: hidden;
}

.color-chart-hero {
  padding-bottom: 48px;
}

.color-chart-hero .lead {
  max-width: 820px;
}

.color-chart-hero h1 {
  overflow-wrap: anywhere;
}

.chart-summary-line {
  width: fit-content;
  max-width: 100%;
  margin: 24px 0 0;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: #344057;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.chart-heading {
  max-width: 880px;
  margin-bottom: 0;
}

.chart-filter-field {
  min-width: 0;
  display: grid;
  gap: 7px;
  color: #2d3750;
  font-size: 0.88rem;
  font-weight: 850;
}

.chart-input-wrap {
  position: relative;
  display: block;
}

.chart-input-wrap input {
  width: 100%;
}

.chart-results-line {
  min-height: 24px;
  margin: -6px 0 10px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 750;
}

.chart-message,
.chart-empty {
  min-height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 0;
  padding: 28px;
  color: var(--muted);
  text-align: center;
  font-weight: 750;
}

.chart-message svg {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
}

.chart-message[role="alert"] {
  color: #8f2424;
  background: #fff5f5;
}

.chart-message[hidden],
.chart-empty[hidden],
[data-color-table-wrap][hidden] {
  display: none !important;
}

.color-chart-table {
  min-width: 780px;
}

.color-chart-table tbody tr:last-child td {
  border-bottom: 0;
}

.color-chart-table code {
  color: #243049;
  font: 750 0.88rem ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  letter-spacing: 0;
  white-space: nowrap;
}

.color-swatch-cell {
  width: 72px;
}

.color-name-cell {
  min-width: 180px;
  font-weight: 850;
}

.color-value-stack {
  display: grid;
  gap: 4px;
  min-width: 150px;
}

.color-value-stack > span {
  color: var(--muted);
  font-size: 0.82rem;
  white-space: nowrap;
}

.confidence-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid currentColor;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 850;
}

.confidence-badge.high {
  color: #107846;
  background: #e7f8ee;
}

.confidence-badge.medium {
  color: #745000;
  background: #fff7db;
}

.confidence-badge.low {
  color: #8f2424;
  background: #fff5f5;
}

.chart-notes {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.chart-notes h3 {
  margin-bottom: 10px;
  font-size: 1.1rem;
}

.chart-source-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.9fr);
  gap: 42px;
  align-items: start;
}

.chart-source-date {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.chart-source-list {
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line);
  list-style: none;
}

.chart-source-list li {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 12px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}

.chart-source-list svg {
  width: 20px;
  height: 20px;
  color: var(--primary-dark);
}

.chart-source-list strong,
.chart-source-list a {
  display: block;
}

.chart-source-list a {
  margin-top: 5px;
  color: var(--primary-dark);
  font-size: 0.88rem;
  font-weight: 750;
  overflow-wrap: anywhere;
}

.chart-example-band {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 28px;
  align-items: center;
}

.chart-example-band p {
  max-width: 850px;
  margin-bottom: 0;
  color: var(--muted);
}

.chart-cta {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  margin-top: 24px;
  padding: 22px;
  border-radius: 8px;
  background: #172033;
  color: #fff;
}

.chart-cta p {
  margin-bottom: 0;
  color: rgba(255, 255, 255, 0.74);
}

.print-preview {
  min-height: 520px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.print-preview .bead-grid-wrap {
  min-height: 440px;
  height: auto;
}

.mobile-bottom-cta {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  display: none;
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(14px);
}

.mobile-bottom-cta .button {
  min-height: 52px;
  width: 100%;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 80;
  max-width: 320px;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #172033;
  color: #fff;
  box-shadow: var(--shadow);
  transform: translateY(16px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
  font-weight: 750;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.site-footer {
  padding: 34px 0;
  border-top: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
}

.footer-inner {
  width: min(100% - 32px, var(--max));
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  font-weight: 700;
}

.footer-links a:hover {
  color: var(--primary-dark);
}

.not-found-page {
  display: flex;
  min-height: 100vh;
  flex-direction: column;
}

.not-found-page > main {
  display: grid;
  flex: 1;
}

.not-found-section {
  display: grid;
  align-items: center;
  padding: 72px 0;
}

.not-found-layout {
  display: grid;
  grid-template-columns: minmax(220px, 0.7fr) minmax(0, 1.3fr);
  align-items: center;
  gap: 64px;
}

.not-found-mark {
  display: grid;
  justify-items: center;
  gap: 18px;
  color: var(--primary-dark);
}

.not-found-mark img {
  width: 168px;
  height: 168px;
}

.not-found-mark strong {
  font-size: 4.5rem;
  line-height: 1;
}

.not-found-copy {
  min-width: 0;
}

.not-found-copy h1 {
  max-width: 16ch;
  margin: 14px 0 18px;
  font-size: 3rem;
  line-height: 1.08;
}

.not-found-copy .lead {
  max-width: 58ch;
}

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

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

@media (prefers-contrast: more) {
  :root {
    --muted: #485266;
    --line: #aab3c2;
    --primary: #5144d6;
    --primary-dark: #3327aa;
  }

  :where(.button, .icon-button, .select-chip, .filter-chip, .faq-item, .summary-card, .upload-card) {
    border-color: currentColor;
  }
}

@media (forced-colors: active) {
  :where(a, button, input, select, [tabindex]):focus-visible,
  .before-after-stage:focus-within {
    outline: 3px solid Highlight !important;
    outline-offset: 3px !important;
  }

  .before-after-divider {
    background: CanvasText;
    box-shadow: none;
  }

  .before-after-handle {
    border-color: ButtonText;
    background: ButtonFace;
    color: ButtonText;
    box-shadow: none;
  }

  .swatch,
  .mini-swatch {
    forced-color-adjust: none;
    border: 2px solid CanvasText;
  }

  .pill,
  .eyebrow,
  .button,
  .icon-button,
  .select-chip,
  .filter-chip {
    border: 1px solid currentColor;
  }
}

@media (max-width: 980px) {
  .hero-grid,
  .maker-layout,
  .detail-layout,
  .pattern-detail-layout,
  .size-guide-layout,
  .gallery-hub-layout,
  .chart-source-layout,
  .compare-feature-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .tool-panel,
  .tool-stack {
    position: static;
  }

  .content-grid,
  .summary-grid,
  .related-grid,
  .gallery-grid,
  .tutorial-timeline,
  .ready-pattern-grid,
  .use-case-grid,
  .testimonial-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .split-heading {
    align-items: start;
    flex-direction: column;
  }

  .chart-controls {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 1024px) {
  .nav-shell {
    width: min(100% - 24px, var(--max));
    min-height: 64px;
  }

  .main-nav,
  .header-actions .button,
  .language-select-desktop {
    display: none;
  }

  .nav-toggle {
    display: inline-grid;
    place-items: center;
  }

  .site-header.is-open .main-nav {
    position: absolute;
    left: 12px;
    right: 12px;
    top: 68px;
    display: grid;
    gap: 4px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    box-shadow: var(--shadow);
  }

  .site-header.is-open .nav-link {
    min-height: 44px;
    display: flex;
    align-items: center;
  }

  .site-header.is-open .language-select-mobile {
    display: flex;
    width: 100%;
    margin-top: 4px;
  }

  .site-header.is-open .language-select-mobile select {
    width: 100%;
  }
}

@media (max-width: 760px) {
  body[data-page-title-key="gallery.metaTitle"] .detail-hero {
    padding: 24px 0 20px;
  }

  body[data-page-title-key="gallery.metaTitle"] .section.tight {
    padding: 16px 0 32px;
  }

  body[data-page-title-key="gallery.metaTitle"] .filter-panel {
    margin-bottom: 10px;
  }

  .collection-link-grid {
    grid-template-columns: 1fr;
  }

  body.has-mobile-cta {
    padding-bottom: 112px;
  }

  .hero {
    padding: 42px 0 34px;
  }

  .compare-feature {
    padding: 42px 0;
  }

  .section {
    padding: 48px 0;
  }

  h1 {
    font-size: clamp(2.2rem, 12vw, 3.4rem);
  }

  .color-chart-hero h1 {
    font-size: 2.35rem;
    line-height: 1.04;
  }

  .hero-actions .button,
  .button-row .button,
  .export-strip .button {
    flex: 1 1 100%;
  }

  .hero-copy {
    display: contents;
  }

  .hero-copy .eyebrow {
    order: 1;
    justify-self: start;
  }

  .hero-copy h1 {
    order: 2;
  }

  .hero-copy .lead {
    order: 3;
  }

  .hero-actions {
    order: 4;
  }

  .output-preview-card {
    order: 5;
  }

  .hero-demo-card {
    order: 5;
  }

  .trust-row {
    order: 6;
    width: 100%;
  }

  .trust-row,
  .comparison-body,
  .output-preview-body,
  .preview-grid,
  .content-grid,
  .summary-grid,
  .related-grid,
  .gallery-grid,
  .tutorial-timeline,
  .ready-pattern-grid,
  .use-case-grid,
  .testimonial-grid,
  .filter-top,
  .chart-controls,
  .chart-cta,
  .chart-example-band,
  .info-list {
    grid-template-columns: 1fr;
  }

  .chart-example-band .button {
    width: 100%;
  }

  .size-guide-selector {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .size-guide-selector .select-chip {
    min-width: 0;
    width: 100%;
  }

  .size-guide-selector .select-chip:last-child {
    grid-column: 1 / -1;
  }

  .size-guide-link-row .button {
    flex-basis: 100%;
  }

  .section-heading {
    margin-bottom: 22px;
  }

  .section-cta {
    justify-content: stretch;
  }

  .section-cta .button,
  .split-heading .button {
    width: 100%;
  }

  .tutorial-step-card {
    min-height: 0;
  }

  .ready-pattern-actions {
    grid-template-columns: 1fr;
  }

  .pattern-quick-detail-layout {
    grid-template-columns: 1fr;
  }

  .pattern-quick-detail-shell {
    padding: 22px 16px;
  }

  .pattern-quick-detail-close {
    top: 12px;
    right: 12px;
  }

  .pattern-quick-detail h2 {
    font-size: 1.3rem;
  }

  .collection-guide-links {
    align-items: flex-start;
    flex-direction: column;
  }

  .gallery-result-count {
    text-align: left;
  }

  .before-after-stage {
    min-height: 0;
    aspect-ratio: 1 / 1;
  }

  .before-after-handle {
    width: 50px;
    height: 50px;
  }

  .compare-helper {
    font-size: 0.88rem;
  }

  .compare-pane + .compare-pane,
  .original-pane {
    border-left: 0;
    border-right: 0;
    border-top: 1px solid var(--line);
  }

  .compare-pane img {
    min-height: 240px;
  }

  .output-pattern-panel {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .output-pattern-panel img,
  .output-pattern-panel canvas {
    width: min(100%, 220px);
    height: auto;
  }

  .hero-demo-card .before-after-stage {
    min-height: 0;
    aspect-ratio: 1 / 1;
  }

  .hero-demo-meta {
    gap: 7px;
  }

  .hero-demo-meta > span,
  .hero-demo-meta > button {
    flex: 1 1 calc(50% - 8px);
  }

  .preview-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .preview-panel,
  .preview-grid,
  .original-pane,
  .pattern-pane,
  .original-frame,
  .bead-grid-wrap {
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  .toolbar-controls {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .toolbar-controls .icon-button {
    flex: 0 0 44px;
  }

  .segmented,
  .segmented.four,
  .segmented.five {
    grid-template-columns: 1fr 1fr;
  }

  .bead-grid-wrap {
    min-height: 330px;
    place-items: center;
  }

  .mobile-bottom-cta {
    display: block;
  }

  .not-found-section {
    padding: 48px 0;
  }

  .not-found-layout {
    grid-template-columns: 1fr;
    gap: 32px;
    text-align: center;
  }

  .not-found-mark {
    gap: 12px;
  }

  .not-found-mark img {
    width: 112px;
    height: 112px;
  }

  .not-found-mark strong {
    font-size: 3.5rem;
  }

  .not-found-copy .eyebrow {
    justify-content: center;
  }

  .not-found-copy h1,
  .not-found-copy .lead {
    max-width: none;
  }

  .not-found-copy h1 {
    font-size: 2.2rem;
  }

  .not-found-copy .hero-actions {
    justify-content: center;
  }

  .toast {
    left: 14px;
    right: 14px;
    bottom: 82px;
    max-width: none;
  }
}

@media (max-width: 420px) {
  .container,
  .nav-shell,
  .footer-inner {
    width: min(100% - 20px, var(--max));
  }

  .logo {
    font-size: 0.95rem;
  }

  .logo-mark {
    width: 30px;
    height: 30px;
  }

  .tool-panel,
  .material-panel,
  .info-panel,
  .pattern-detail-panel,
  .filter-panel,
  .content-block,
  .tutorial-step-card,
  .ready-pattern-body,
  .testimonial-card,
  .print-preview {
    padding: 14px;
  }

  .preview-toolbar,
  .comparison-head,
  .card-head {
    padding: 13px 14px;
  }

  .bead-grid-wrap {
    padding: 12px;
  }

  .button {
    padding: 0 13px;
  }

  body[data-page-title-key="gallery.metaTitle"] .collection-guide-links {
    flex-direction: row;
    gap: 6px 10px;
    padding-top: 10px;
    margin-top: 10px;
    font-size: 0.78rem;
  }

  body[data-page-title-key="gallery.metaTitle"] .filter-top {
    margin-bottom: 10px;
  }

  body[data-page-title-key="gallery.metaTitle"] .gallery-result-count {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  .testimonial-card {
    padding: 18px;
  }
}
