/* Blobly Light Design System */
:root {
  /* Colors */
  --colors-primary: #171717;
  --colors-secondary: #525252;
  --colors-tertiary: #007a7a;
  --colors-neutral: #fafaf8;
  --colors-surface: #ffffff;
  --colors-on-surface: #171717;
  --colors-border: #e5e7eb;
  --colors-muted-border: #e5e5e5;
  --colors-accent: #00d3d3;
  --colors-error: #dc2626;

  /* Aliases */
  --color-primary: var(--colors-primary);
  --color-secondary: var(--colors-secondary);
  --color-tertiary: var(--colors-tertiary);
  --color-neutral: var(--colors-neutral);
  --color-surface: var(--colors-surface);
  --color-border: var(--colors-border);
  --color-muted-border: var(--colors-muted-border);
  --color-accent: var(--colors-accent);
  --color-error: var(--colors-error);

  /* Typography */
  --font-family: 'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-mono: 'Geist Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  /* Rounded */
  --rounded-none: 0px;
  --rounded-sm: 4px;
  --rounded-md: 8px;
  --rounded-lg: 12px;
  --rounded-xl: 16px;
  --rounded-full: 9999px;

  /* Spacing */
  --spacing-xs: 10px;
  --spacing-sm: 16px;
  --spacing-md: 24px;
  --spacing-lg: 32px;
  --spacing-xl: 96px;

  /* Legacy Bindings Mapped to Blobly Light */
  --paper: var(--colors-neutral);
  --white: var(--colors-surface);
  --ink: var(--colors-primary);
  --muted: var(--colors-secondary);
  --line: var(--colors-border);
  --accent: var(--colors-accent);
  --accent-soft: rgba(0, 211, 211, 0.1);
  --radius: var(--rounded-md);

  /* Safe Area Insets */
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);

  /* Global baseline */
  font-family: var(--font-family);
  color: var(--colors-primary);
  background: var(--colors-neutral);
  font-synthesis: none;
  font-size: 15px;
  line-height: 24.375px;
  scroll-behavior: smooth;
  scroll-padding-top: 32px;
}

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

body {
  margin: 0;
  background-color: var(--colors-neutral);
  color: var(--colors-primary);
  font-family: var(--font-family);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

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

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

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

button {
  cursor: pointer;
  background: none;
  border: none;
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

a, button {
  touch-action: manipulation;
}

button, select, input, textarea {
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
}

button:active,
.button:active,
.icon-button:active,
.shape-option:active,
.color-preset:active,
.template-card:active {
  transform: scale(0.97);
}

button:focus-visible, a:focus-visible, summary:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--colors-tertiary);
  outline-offset: 2px;
}

input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--colors-tertiary);
  outline-offset: 1px;
  border-color: var(--colors-tertiary);
}

[hidden] {
  display: none !important;
}

h1, h2, h3, h4, p {
  margin: 0;
}

svg.icon {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
  vertical-align: middle;
}

.shell {
  max-width: 1240px;
  margin: 0 auto;
  width: calc(100% - 64px);
}

/* =========================================================
   Site Header
   ========================================================= */
.site-header {
  height: 72px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--colors-border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  max-width: 1240px;
  width: calc(100% - 64px);
  height: 100%;
  margin: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: var(--rounded-sm);
  text-decoration: none;
}

.brand-logo {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  object-fit: contain;
  display: block;
}

.brand-text {
  font-family: var(--font-family);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--colors-primary);
  line-height: 1;
}

.about-brand-logo {
  width: 48px;
  height: 48px;
  object-fit: contain;
  display: block;
  margin-bottom: 24px;
}

.site-header nav {
  display: flex;
  gap: 28px;
  height: 100%;
  align-items: center;
}

.site-header nav a {
  font-size: 15px;
  font-weight: 400;
  line-height: 22px;
  position: relative;
  color: var(--colors-secondary);
  height: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
}

.site-header nav a:hover {
  color: var(--colors-primary);
}

.site-header nav a.active {
  color: var(--colors-primary);
  font-weight: 500;
}

.site-header nav a.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  height: 2px;
  background: var(--colors-accent);
  width: 100%;
  left: 0;
}

.count {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  background: var(--colors-neutral);
  color: var(--colors-secondary);
  border: 1px solid var(--colors-border);
  min-width: 18px;
  text-align: center;
  padding: 1px 6px;
  border-radius: var(--rounded-full);
}

.blobly-link {
  font-size: 14px;
  font-weight: 400;
  color: var(--colors-tertiary);
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1px solid var(--colors-border);
  border-radius: var(--rounded-sm);
  background: var(--colors-surface);
}

.blobly-link:hover {
  border-color: var(--colors-tertiary);
  color: #005757;
}

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

.install-btn {
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.install-btn svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

.header-install-btn {
  background: var(--colors-neutral);
  border-color: var(--colors-border);
  color: var(--colors-primary);
}

.header-install-btn:hover {
  background: var(--colors-surface);
  border-color: var(--colors-tertiary);
  color: var(--colors-tertiary);
}

/* =========================================================
   Buttons & Common Controls
   ========================================================= */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--colors-border);
  border-radius: var(--rounded-sm);
  padding: 8px 16px;
  background: var(--colors-surface);
  color: var(--colors-primary);
  font-size: 15px;
  font-weight: 400;
  line-height: 22px;
  height: 40px;
  min-height: 40px;
  box-sizing: border-box;
  text-align: center;
  white-space: nowrap;
}

.button:hover {
  background: var(--colors-neutral);
  border-color: #d1d5db;
}

/* Primary Button: #171717 fill, #fafaf8 text, 40px height, 4px rounded */
.button.dark,
.button.primary {
  background: var(--colors-primary);
  color: var(--colors-neutral);
  border-color: var(--colors-primary);
  font-weight: 400;
}

.button.dark:hover,
.button.primary:hover {
  background: #2a2a2a;
  border-color: #2a2a2a;
  color: #ffffff;
}

.button.small {
  font-size: 13px;
  height: 32px;
  min-height: 32px;
  padding: 4px 10px;
}

.button.full {
  width: 100%;
}

.button .file-tag {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 11px;
  opacity: 0.75;
}

/* Button Link: tertiary teal text, transparent background, no container chrome */
.text-button {
  font-size: 15px;
  font-weight: 400;
  line-height: 24.375px;
  display: inline-flex;
  gap: 6px;
  align-items: center;
  padding: 0;
  color: var(--colors-tertiary);
  background: transparent;
  border: none;
  cursor: pointer;
}

.text-button:hover {
  color: #005757;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.icon-button {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--rounded-sm);
  color: var(--colors-secondary);
  border: 1px solid var(--colors-border);
  background: var(--colors-surface);
}

.icon-button:hover {
  color: var(--colors-primary);
  border-color: #d1d5db;
  background: var(--colors-neutral);
}

.subtle-pill {
  background: var(--colors-surface);
  border: 1px solid var(--colors-border);
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--colors-secondary);
  border-radius: var(--rounded-full);
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
}

/* =========================================================
   Hero Section
   ========================================================= */
.hero {
  padding-top: 64px;
  padding-bottom: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
}

.hero-copy {
  max-width: 640px;
}

.eyebrow {
  font-size: 12px;
  font-weight: 500;
  line-height: 16px;
  letter-spacing: 0.02em;
  color: var(--colors-secondary);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.small-cross {
  font-size: 14px;
  color: var(--colors-tertiary);
}

.hero h1 {
  font-size: 48px;
  font-weight: 500;
  line-height: 49.92px;
  letter-spacing: -1.44px;
  color: var(--colors-primary);
  margin: 16px 0 16px;
}

.hero h1 span {
  color: var(--colors-secondary);
  font-weight: 500;
}

.hero p {
  color: var(--colors-secondary);
  font-size: 16px;
  line-height: 24px;
  font-weight: 400;
  margin-bottom: 24px;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.hero-aside {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
}

.free-note {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 12px;
}

.scribble {
  font-family: var(--font-family);
  font-size: 16px;
  line-height: 22px;
  color: var(--colors-secondary);
  font-weight: 400;
  text-align: right;
}

.free-note svg {
  width: 48px;
  height: 40px;
  stroke: var(--colors-tertiary);
  stroke-width: 1.4;
  fill: none;
}

.promise {
  font-size: 13px;
  font-weight: 400;
  color: var(--colors-secondary);
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--colors-surface);
  border: 1px solid var(--colors-border);
  border-radius: var(--rounded-full);
  padding: 6px 14px;
}

.promise .icon {
  width: 15px;
  height: 15px;
  color: var(--colors-tertiary);
}

.local-note {
  font-size: 12px;
  color: var(--colors-secondary);
  display: flex;
  gap: 6px;
  align-items: center;
  background: var(--colors-surface);
  border: 1px solid var(--colors-border);
  border-radius: var(--rounded-full);
  padding: 4px 12px;
}

.local-note .icon {
  width: 14px;
  height: 14px;
  color: var(--colors-accent);
}

/* =========================================================
   Studio Section & Workspace
   ========================================================= */
.studio-section {
  scroll-margin-top: 32px;
  margin-bottom: 64px;
}

.studio-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  gap: 16px;
}

.studio-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.studio-title h2 {
  font-size: 20px;
  font-weight: 500;
  line-height: 24px;
  letter-spacing: 0;
  color: var(--colors-primary);
}

.status-light {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--colors-accent);
  box-shadow: 0 0 0 3px rgba(0, 211, 211, 0.2);
}

.project-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

#project-name {
  border: 1px solid var(--colors-border);
  background: var(--colors-surface);
  border-radius: var(--rounded-sm);
  color: var(--colors-primary);
  font-size: 13px;
  padding: 6px 10px;
  max-width: 150px;
  width: 150px;
}

/* Workspace: Card styling (3 columns) */
.workspace {
  display: grid;
  grid-template-columns: 340px minmax(320px, 1fr) 280px;
  background: var(--colors-surface);
  border: 1px solid var(--colors-border);
  border-radius: var(--rounded-md);
  overflow: hidden;
  min-height: 580px;
}

.settings-area {
  border-right: 1px solid var(--colors-border);
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--colors-surface);
}

.content-input {
  padding: 20px;
  border-bottom: 1px solid var(--colors-border);
}

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

.label-row label,
.label-row h3 {
  font-size: 14px;
  font-weight: 500;
  color: var(--colors-primary);
  letter-spacing: 0;
}

.label-row select {
  font-size: 12px;
  color: var(--colors-secondary);
  border: 1px solid var(--colors-border);
  background: var(--colors-neutral);
  padding: 4px 8px;
  border-radius: var(--rounded-sm);
  max-width: 130px;
}

.textarea-wrap {
  position: relative;
  margin-top: 8px;
}

.textarea-wrap > .icon {
  position: absolute;
  left: 10px;
  top: 12px;
  width: 15px;
  color: var(--colors-secondary);
}

.textarea-wrap textarea {
  resize: vertical;
  width: 100%;
  min-height: 64px;
  max-height: 140px;
  padding: 10px 12px 10px 34px;
  border: 1px solid var(--colors-border);
  border-radius: var(--rounded-sm);
  background: var(--colors-surface);
  font-family: var(--font-family);
  font-size: 14px;
  line-height: 20px;
  color: var(--colors-primary);
}

.input-caption {
  font-size: 12px;
  color: var(--colors-secondary);
  display: flex;
  gap: 6px;
  align-items: center;
  margin-top: 8px;
}

.input-caption .icon {
  width: 13px;
  height: 13px;
  color: var(--colors-tertiary);
}

.customization {
  display: flex;
  flex: 1;
  min-height: 360px;
}

.tool-tabs {
  width: 76px;
  flex-shrink: 0;
  background: var(--colors-neutral);
  border-right: 1px solid var(--colors-border);
  padding: 8px 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.tool-tab {
  display: flex;
  align-items: center;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  border-radius: var(--rounded-sm);
  color: var(--colors-secondary);
  padding: 8px 2px;
  font-size: 11px;
  font-weight: 500;
  min-height: 48px;
  background: transparent;
}

.tool-tab .icon {
  width: 16px;
  height: 16px;
}

.tool-tab:hover {
  color: var(--colors-primary);
  background: rgba(0, 0, 0, 0.04);
}

.tool-tab[aria-selected="true"] {
  background: var(--colors-surface);
  color: var(--colors-primary);
  border: 1px solid var(--colors-border);
  box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}

.tool-tab[aria-selected="true"] .icon {
  color: var(--colors-tertiary);
}

.tool-panel {
  padding: 20px;
  flex: 1;
  min-width: 0;
  overflow-y: auto;
}

.panel-title {
  font-size: 16px;
  font-weight: 500;
  line-height: 22px;
  color: var(--colors-primary);
}

.panel-description {
  font-size: 13px;
  color: var(--colors-secondary);
  line-height: 18px;
  margin: 4px 0 16px;
}

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

.shape-option {
  border: 1px solid var(--colors-border);
  border-radius: var(--rounded-sm);
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
  justify-content: center;
  height: 68px;
  color: var(--colors-secondary);
  background: var(--colors-surface);
  position: relative;
  font-size: 11px;
  font-weight: 400;
  padding: 6px 4px;
}

.shape-option:hover {
  background: var(--colors-neutral);
  border-color: #d1d5db;
  color: var(--colors-primary);
}

.shape-option.selected {
  background: var(--colors-neutral);
  border-color: var(--colors-tertiary);
  color: var(--colors-primary);
  font-weight: 500;
}

.shape-option.selected::after {
  content: '✓';
  font-size: 8px;
  position: absolute;
  right: 4px;
  top: 4px;
  background: var(--colors-tertiary);
  color: #ffffff;
  border-radius: 50%;
  width: 12px;
  height: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 12px;
}

.shape-sample {
  display: grid;
  grid-template-columns: repeat(3, 5px);
  grid-template-rows: repeat(3, 5px);
  gap: 2px;
  color: var(--colors-primary);
  height: 19px;
}

.shape-sample i {
  display: block;
  background: currentColor;
}

.shape-sample.round i {
  border-radius: 50%;
}

.shape-sample.rounded i {
  border-radius: 1.5px;
}

.shape-sample.extra-rounded i {
  border-radius: 2.5px;
}

.shape-sample.dots i {
  border-radius: 50%;
  transform: scale(0.85);
}

.shape-sample.diamond i {
  transform: rotate(45deg) scale(0.8);
}

.shape-sample.triangle i {
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
}

.panel-separator {
  border-top: 1px solid var(--colors-border);
  margin: 20px 0;
}

.panel-subtitle {
  font-size: 13px;
  font-weight: 500;
  color: var(--colors-primary);
  margin-bottom: 12px;
}

.field-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--colors-primary);
  margin: 14px 0 6px;
}

.field-hint {
  font-size: 12px;
  color: var(--colors-secondary);
  line-height: 18px;
  margin-top: 8px;
}

.tip {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 12px;
  color: var(--colors-secondary);
  background: var(--colors-neutral);
  border: 1px solid var(--colors-border);
  border-radius: var(--rounded-sm);
  padding: 10px 12px;
  margin-top: 16px;
  line-height: 18px;
}

.tip .icon {
  width: 14px;
  height: 14px;
  margin-top: 2px;
  color: var(--colors-tertiary);
}

.color-presets {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.color-preset {
  width: 26px;
  height: 26px;
  border: 2px solid var(--colors-surface);
  border-radius: 50%;
  box-shadow: 0 0 0 1px var(--colors-border);
}

.color-preset.selected {
  box-shadow: 0 0 0 2px var(--colors-primary);
}

.color-field {
  border: 1px solid var(--colors-border);
  padding: 6px 10px;
  border-radius: var(--rounded-sm);
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--colors-surface);
}

.color-field input[type="color"] {
  width: 24px;
  height: 24px;
  cursor: pointer;
  padding: 0;
  border: 0;
  background: none;
}

.color-field input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 0;
}

.color-field input[type="color"]::-webkit-color-swatch {
  border: 1px solid var(--colors-border);
  border-radius: 2px;
}

.color-field input[type="text"] {
  min-width: 0;
  width: 100%;
  border: 0;
  background: none;
  outline: none;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--colors-primary);
}

.range-label {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 500;
  color: var(--colors-primary);
  margin: 16px 0 6px;
}

.range-label output {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 400;
  color: var(--colors-secondary);
}

input[type="range"] {
  width: 100%;
  accent-color: var(--colors-tertiary);
  height: 6px;
  margin: 10px 0 12px;
  cursor: pointer;
  border-radius: 3px;
}

input[type="range"]::-webkit-slider-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--colors-tertiary);
  cursor: pointer;
  -webkit-appearance: none;
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

input[type="range"]::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--colors-tertiary);
  cursor: pointer;
  border: none;
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

.select-field,
select#export-size,
.tool-panel select {
  width: 100%;
  border: 1px solid var(--colors-border);
  background: var(--colors-surface);
  padding: 8px 12px;
  border-radius: var(--rounded-sm);
  font-size: 14px;
  color: var(--colors-primary);
  cursor: pointer;
}

.switch-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 16px 0;
  font-size: 13px;
  color: var(--colors-primary);
  cursor: pointer;
}

.switch-row input {
  accent-color: var(--colors-tertiary);
  width: 16px;
  height: 16px;
}

.local-indicator {
  display: flex;
  gap: 6px;
  align-items: center;
  border-top: 1px solid var(--colors-border);
  padding: 12px 16px;
  font-size: 12px;
  color: var(--colors-secondary);
  background: var(--colors-neutral);
  cursor: help;
}

.local-indicator .icon {
  width: 14px;
  height: 14px;
  color: var(--colors-tertiary);
}

.local-indicator .icon:last-child {
  margin-left: auto;
  color: var(--colors-secondary);
}

/* =========================================================
   Live Preview Stage
   ========================================================= */
.preview-area {
  background: var(--colors-neutral);
  position: relative;
  min-width: 0;
  display: flex;
  align-items: center;
  flex-direction: column;
  border-right: 1px solid var(--colors-border);
}

.preview-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 20px 24px;
}

.preview-heading .eyebrow {
  margin-bottom: 0;
}

.live-badge {
  font-size: 11px;
  font-weight: 500;
  color: var(--colors-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--colors-surface);
  border: 1px solid var(--colors-border);
  border-radius: var(--rounded-full);
  padding: 3px 10px;
}

.live-badge i {
  width: 6px;
  height: 6px;
  background: var(--colors-accent);
  border-radius: 50%;
  display: inline-block;
}

.preview-stage {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  min-height: 330px;
  padding: 28px 36px;
  position: relative;
  background-image: radial-gradient(var(--colors-border) 1px, transparent 1px);
  background-size: 16px 16px;
  background-position: center;
  overflow: hidden;
}

.qr-mount {
  width: 100%;
  max-width: 300px;
  aspect-ratio: 1;
  background: var(--colors-surface);
  border: 1px solid var(--colors-border);
  border-radius: var(--rounded-md);
  position: relative;
  transition: transform 0.2s ease;
}

.qr-mount svg {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
}

.qr-mount.checkerboard,
.checkerboard {
  background-color: var(--colors-surface);
  background-image: conic-gradient(#f0f0f0 25%, transparent 0 50%, #f0f0f0 0 75%, transparent 0);
  background-size: 16px 16px;
}

.preview-caption {
  display: flex;
  align-items: center;
  flex-direction: column;
  gap: 4px;
  margin-top: 16px;
  margin-bottom: 24px;
  text-align: center;
}

.preview-caption strong {
  font-size: 14px;
  font-weight: 500;
  color: var(--colors-primary);
}

.preview-caption span {
  font-size: 12px;
  color: var(--colors-secondary);
}

.preview-controls {
  border-top: 1px solid var(--colors-border);
  background: var(--colors-surface);
  width: 100%;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  gap: 8px;
}

.size-hint {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--colors-secondary);
}

.zoom-control {
  display: flex;
  align-items: center;
  background: var(--colors-surface);
  border: 1px solid var(--colors-border);
  border-radius: var(--rounded-sm);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--colors-secondary);
  height: 28px;
}

.zoom-control button {
  width: 26px;
  font-size: 15px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--colors-primary);
}

.zoom-control span {
  padding: 0 6px;
}

.preview-controls .icon-button {
  height: 28px;
  width: 28px;
}

/* =========================================================
   Results Area (Scan Quality & Export)
   ========================================================= */
.results-area {
  padding: 20px 18px 0;
  background: var(--colors-surface);
  display: flex;
  flex-direction: column;
}

.results-area h3 {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--colors-secondary);
}

.scan-card > .label-row > .icon {
  width: 14px;
  height: 14px;
  color: var(--colors-secondary);
}

.quality-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 12px 0 6px;
}

.quality-title strong {
  font-size: 24px;
  font-weight: 500;
  line-height: 29px;
  color: var(--colors-primary);
}

.quality-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--colors-tertiary);
  box-shadow: 0 0 0 3px rgba(0, 122, 122, 0.15);
}

.quality-title.risky .quality-dot {
  background: #d97706;
  box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.15);
}

.quality-title.failed .quality-dot {
  background: var(--colors-error);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.15);
}

.scan-description {
  font-size: 12px;
  color: var(--colors-secondary);
  line-height: 18px;
  min-height: 18px;
}

.quality-meter {
  display: flex;
  gap: 4px;
  margin: 12px 0;
}

.quality-meter i {
  height: 4px;
  flex: 1;
  border-radius: 2px;
  background: var(--colors-tertiary);
}

.quality-meter i.off {
  background: var(--colors-border);
}

.quality-meter.risky i:not(.off) {
  background: #d97706;
}

.quality-meter.failed i:not(.off) {
  background: var(--colors-error);
}

.scan-checks {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

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

.check-row > span:first-child {
  color: var(--colors-secondary);
}

.check-value {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--colors-tertiary);
  font-weight: 500;
}

.check-value .icon {
  height: 12px;
  width: 12px;
}

.check-value.warning {
  color: #d97706;
}

.decode-line {
  font-size: 12px;
  color: var(--colors-secondary);
  border-radius: var(--rounded-sm);
  background: var(--colors-neutral);
  border: 1px solid var(--colors-border);
  padding: 8px 10px;
  margin: 12px 0 0;
  line-height: 18px;
  display: flex;
  align-items: center;
}

.decode-line .icon {
  width: 13px;
  height: 13px;
  margin-right: 6px;
  color: var(--colors-tertiary);
}

.decode-line.warning {
  color: #92400e;
  background: #fef3c7;
  border-color: #fde68a;
}

.export-card {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--colors-border);
}

.export-card > .label-row > .icon {
  width: 14px;
  color: var(--colors-secondary);
}

.export-card .field-label {
  margin-top: 10px;
  font-size: 12px;
  color: var(--colors-secondary);
  font-weight: 500;
}

.export-card select {
  height: 38px;
  font-size: 13px;
}

.export-card .button.full {
  margin-top: 8px;
  justify-content: flex-start;
}

.export-card .button.primary {
  margin-top: 12px;
}

.mobile-share-btn {
  border-color: var(--colors-tertiary);
  color: var(--colors-tertiary);
  font-weight: 500;
}

.mobile-share-btn:hover {
  background: var(--colors-neutral);
  border-color: #005757;
  color: #005757;
}

.export-card .icon {
  width: 15px;
  height: 15px;
}

.transparent-export .icon {
  margin-left: auto;
}

.checker-icon {
  height: 14px;
  width: 14px;
  border: 1px solid var(--colors-border);
  border-radius: 2px;
  background: conic-gradient(#e5e7eb 25%, #ffffff 0 50%, #e5e7eb 0 75%, #ffffff 0);
  background-size: 6px 6px;
}

.advanced-export {
  font-size: 12px;
  margin-top: 12px;
  color: var(--colors-secondary);
}

.advanced-export summary {
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
}

.advanced-export summary span {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--colors-secondary);
}

.advanced-export > div {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.advanced-export p {
  margin: 6px 0;
  font-size: 11px;
  color: var(--colors-secondary);
}

.export-note {
  font-size: 12px;
  color: var(--colors-secondary);
  margin: 14px 0;
  text-align: center;
}

.qr-info {
  font-size: 12px;
  border-top: 1px solid var(--colors-border);
  padding: 12px 0;
  color: var(--colors-secondary);
}

.qr-info summary {
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.qr-info .icon {
  width: 12px;
  height: 12px;
}

.qr-info dl {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px;
  line-height: 18px;
  margin-top: 8px;
}

.qr-info dd {
  margin: 0;
  font-family: var(--font-mono);
  color: var(--colors-primary);
}

.studio-bottom {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--colors-secondary);
  margin: 14px 0 0;
}

.studio-bottom > span {
  display: flex;
  align-items: center;
  gap: 6px;
}

.studio-bottom .icon {
  height: 13px;
  width: 13px;
}

/* =========================================================
   Sections: Templates, Recent, About
   ========================================================= */
.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.section-heading h2 {
  font-size: 36px;
  font-weight: 500;
  line-height: 40px;
  letter-spacing: -0.72px;
  color: var(--colors-primary);
  margin-top: 8px;
}

.section-heading p {
  font-size: 15px;
  line-height: 24.375px;
  color: var(--colors-secondary);
  margin-top: 6px;
}

.section-note {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--colors-secondary);
  display: flex;
  gap: 6px;
  align-items: center;
}

.section-note .icon {
  width: 14px;
  height: 14px;
}

.templates-section {
  padding-top: 64px;
  padding-bottom: 64px;
  border-top: 1px solid var(--colors-border);
}

.templates-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 16px;
}

.template-card {
  padding: 0;
  text-align: left;
  min-width: 0;
  border-radius: var(--rounded-md);
  overflow: hidden;
  border: 1px solid var(--colors-border);
  background: var(--colors-surface);
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.template-card:hover {
  transform: translateY(-2px);
  border-color: var(--colors-primary);
}

.template-image {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 150px;
  background: var(--tile-bg, var(--colors-neutral));
  padding: 20px;
}

.template-image svg {
  width: 100px;
  height: 100px;
}

.template-caption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-top: 1px solid var(--colors-border);
  font-size: 13px;
  font-weight: 500;
  color: var(--colors-primary);
}

.template-caption .icon {
  width: 13px;
  color: var(--colors-secondary);
}

.template-caption small {
  display: block;
  font-size: 11px;
  font-weight: 400;
  color: var(--colors-secondary);
  margin-top: 2px;
}

/* Recent Section */
.recent-section {
  padding-top: 48px;
  padding-bottom: 64px;
  border-top: 1px solid var(--colors-border);
}

.recent-section .section-heading h2 {
  display: flex;
  align-items: center;
  gap: 12px;
}

.empty-state {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 36px 20px;
  border: 1px dashed var(--colors-border);
  border-radius: var(--rounded-md);
  background: var(--colors-surface);
}

.empty-state > .icon {
  width: 28px;
  height: 28px;
  stroke: var(--colors-secondary);
  stroke-width: 1.2;
}

.empty-state strong {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--colors-primary);
  margin-bottom: 4px;
}

.empty-state p {
  font-size: 13px;
  color: var(--colors-secondary);
}

.recent-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.project-card {
  border: 1px solid var(--colors-border);
  padding: 16px;
  background: var(--colors-surface);
  border-radius: var(--rounded-md);
  display: grid;
  grid-template-columns: 58px 1fr;
  column-gap: 12px;
  row-gap: 12px;
  min-width: 0;
}

.project-thumb {
  width: 58px;
  height: 58px;
  background: var(--colors-neutral);
  border: 1px solid var(--colors-border);
  border-radius: var(--rounded-sm);
  overflow: hidden;
}

.project-thumb svg {
  width: 100%;
  height: 100%;
}

.project-card h3 {
  font-size: 14px;
  font-weight: 500;
  margin: 4px 0 2px;
  word-break: break-word;
  color: var(--colors-primary);
}

.project-card p {
  font-size: 12px;
  color: var(--colors-secondary);
}

.project-card-actions {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 6px;
}

.project-card-actions .button {
  margin-right: auto;
}

/* About Section */
.about-section {
  padding: 64px 0 64px;
  border-top: 1px solid var(--colors-border);
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 64px;
}

.about-section h2 {
  font-size: 36px;
  font-weight: 500;
  line-height: 40px;
  letter-spacing: -0.72px;
  color: var(--colors-primary);
  margin: 8px 0 16px;
}

.about-section p {
  font-size: 15px;
  line-height: 24.375px;
  color: var(--colors-secondary);
  max-width: 640px;
  margin-bottom: 12px;
}

.about-label {
  padding-top: 8px;
}

.about-links {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  margin-top: 24px;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--colors-border);
  padding-top: 32px;
  padding-bottom: 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.site-footer > p {
  font-size: 13px;
  color: var(--colors-secondary);
}

.site-footer > a:last-child {
  font-size: 13px;
  color: var(--colors-tertiary);
  display: flex;
  align-items: center;
  gap: 4px;
}

.site-footer > a:last-child:hover {
  text-decoration: underline;
}

/* =========================================================
   Toast & Dialog
   ========================================================= */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--colors-primary);
  color: var(--colors-neutral);
  border-radius: var(--rounded-sm);
  padding: 10px 18px;
  z-index: 200;
  font-size: 14px;
  line-height: 20px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  max-width: min(90vw, 540px);
}

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

.skip-link {
  position: fixed;
  top: -100px;
  left: 20px;
  padding: 10px 16px;
  background: var(--colors-surface);
  border: 1px solid var(--colors-border);
  border-radius: var(--rounded-sm);
  z-index: 1000;
}

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

dialog {
  border: 1px solid var(--colors-border);
  border-radius: var(--rounded-md);
  padding: 28px;
  width: min(92vw, 480px);
  color: var(--colors-primary);
  background: var(--colors-surface);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.08);
}

dialog::backdrop {
  background: rgba(23, 23, 23, 0.45);
  backdrop-filter: blur(2px);
}

.dialog-close {
  position: absolute;
  right: 12px;
  top: 12px;
}

dialog h2 {
  font-size: 20px;
  font-weight: 500;
  line-height: 24px;
  letter-spacing: 0;
  margin: 0 0 12px;
}

dialog p {
  font-size: 14px;
  line-height: 22px;
  color: var(--colors-secondary);
  margin: 10px 0;
}

dialog ol {
  margin: 14px 0;
  padding-left: 20px;
  line-height: 1.7;
  font-size: 13.5px;
  color: var(--colors-secondary);
}

dialog ol li {
  margin-bottom: 6px;
}

dialog ol li strong {
  color: var(--colors-primary);
  font-weight: 600;
}

dialog .dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

dialog input[type="text"] {
  width: 100%;
  border: 1px solid var(--colors-border);
  border-radius: var(--rounded-sm);
  padding: 8px 12px;
  font-size: 14px;
  background: var(--colors-surface);
  color: var(--colors-primary);
}

dialog .expanded-qr {
  max-width: 380px;
  width: 100%;
  margin: 16px auto;
  border: 1px solid var(--colors-border);
  border-radius: var(--rounded-md);
  overflow: hidden;
  background: var(--colors-surface);
}

dialog .expanded-qr svg {
  width: 100%;
  height: auto;
  display: block;
}

.radio-option {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--colors-border);
  border-radius: var(--rounded-sm);
  padding: 10px 12px;
  margin: 8px 0;
  font-size: 13px;
  cursor: pointer;
  background: var(--colors-surface);
}

.radio-option:has(input:checked) {
  border-color: var(--colors-tertiary);
  background: var(--colors-neutral);
}

.radio-option input {
  accent-color: var(--colors-tertiary);
}

.radio-option .checker-icon {
  margin-left: auto;
}

.upload-label {
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  border: 1px dashed var(--colors-border);
  border-radius: var(--rounded-sm);
  padding: 24px 12px;
  gap: 8px;
  color: var(--colors-secondary);
  text-align: center;
  background: var(--colors-neutral);
  font-size: 13px;
}

.upload-label:hover {
  border-color: var(--colors-tertiary);
  color: var(--colors-primary);
}

.upload-label .icon {
  width: 24px;
  height: 24px;
  color: var(--colors-tertiary);
}

.upload-label small {
  font-size: 11px;
  color: var(--colors-secondary);
  line-height: 16px;
}

.logo-summary {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--colors-border);
  border-radius: var(--rounded-sm);
  padding: 8px 12px;
  background: var(--colors-surface);
}

.logo-summary img {
  width: 36px;
  height: 36px;
  object-fit: contain;
}

.logo-summary span {
  font-size: 12px;
  color: var(--colors-secondary);
}

.logo-summary button {
  margin-left: auto;
}

.tool-panel > .button {
  margin-top: 12px;
}

.mini-corner {
  width: 22px;
  height: 22px;
  border: 3px solid var(--colors-primary);
  padding: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mini-corner::after {
  content: '';
  height: 8px;
  width: 8px;
  flex-shrink: 0;
  background: var(--colors-primary);
}

.mini-corner.rounded {
  border-radius: 6px;
}

.mini-corner.rounded::after {
  border-radius: 2px;
}

.mini-corner.round {
  border-radius: 50%;
}

.mini-corner.round::after {
  border-radius: 50%;
}

.mini-corner.diamond {
  transform: rotate(45deg);
  width: 19px;
  height: 19px;
}

.corner-grid {
  grid-template-columns: repeat(2, 1fr);
}

.text-content-count {
  font-size: 12px;
  color: var(--colors-secondary);
  line-height: 20px;
}

.text-content-count strong {
  color: var(--colors-primary);
}

#preview-error {
  max-width: 280px;
  text-align: center;
  line-height: 20px;
  font-size: 13px;
  padding: 20px;
  color: var(--colors-error);
}

#custom-size {
  width: 100%;
  border: 1px solid var(--colors-border);
  border-radius: var(--rounded-sm);
  padding: 8px 12px;
  margin-bottom: 6px;
}

#fix-scan {
  margin-top: 10px;
}

#tool-panel input[type="number"] {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--colors-border);
  border-radius: var(--rounded-sm);
}

details summary::-webkit-details-marker {
  display: none;
}

.noscript {
  position: fixed;
  bottom: 20px;
  left: 20px;
  background: var(--colors-surface);
  padding: 16px 20px;
  border: 1px solid var(--colors-border);
  border-radius: var(--rounded-sm);
}

.privacy-text {
  font-size: 12px;
  color: var(--colors-secondary);
  line-height: 18px;
}

/* =========================================================
   Responsive Breakpoints & Mobile Optimization
   ========================================================= */
@media (min-width: 1400px) {
  .hero {
    padding-top: 72px;
    padding-bottom: 56px;
  }
  .workspace {
    grid-template-columns: 360px minmax(320px, 1fr) 290px;
  }
}

@media (max-width: 1100px) {
  .shell, .header-inner {
    width: calc(100% - 40px);
  }
  .workspace {
    grid-template-columns: 300px minmax(260px, 1fr) 250px;
  }
  .templates-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .hero h1 {
    font-size: 40px;
    line-height: 44px;
  }
}

@media (max-width: 860px) and (min-width: 681px) {
  .workspace {
    grid-template-columns: 300px 1fr;
  }
  .results-area {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    border-top: 1px solid var(--colors-border);
    padding: 20px;
  }
  .export-card {
    margin: 0;
    padding: 0;
    border: 0;
  }
  .qr-info {
    grid-column: 1 / -1;
  }
  .preview-area {
    border-right: 0;
  }
  .recent-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 680px) {
  :root {
    scroll-padding-top: 76px;
  }
  .shell, .header-inner {
    width: calc(100% - max(28px, calc(var(--safe-left) + var(--safe-right) + 16px)));
  }
  .site-header {
    height: 60px;
  }
  .site-header nav {
    gap: 12px;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .site-header nav::-webkit-scrollbar {
    display: none;
  }
  .site-header nav a {
    font-size: 14px;
    white-space: nowrap;
    padding: 0 4px;
  }
  .header-actions {
    gap: 6px;
  }
  .header-install-btn {
    padding: 0 8px;
    font-size: 13px;
    height: 34px;
    min-height: 34px;
  }
  .blobly-link {
    display: none;
  }

  /* Hero Section */
  .hero {
    padding: 32px 0 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
  }
  .hero-copy {
    max-width: 100%;
  }
  .hero h1 {
    font-size: clamp(30px, 8.5vw, 42px);
    line-height: 1.15;
    letter-spacing: -0.03em;
    margin: 12px 0;
  }
  .hero p {
    font-size: 15px;
    line-height: 22px;
    margin-bottom: 20px;
  }
  .hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
  }
  .hero-actions .button {
    flex: 1 1 auto;
    min-width: 140px;
    height: 42px;
  }
  .hero-actions .text-button {
    width: 100%;
    justify-content: center;
    padding: 6px 0;
  }
  .hero-aside {
    margin-top: 8px;
    align-items: flex-start;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
  }
  .free-note {
    display: none;
  }
  .promise, .local-note {
    font-size: 12px;
    padding: 5px 12px;
  }

  /* Studio Section & Heading */
  .studio-section {
    margin-bottom: 48px;
  }
  .studio-heading {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    margin-bottom: 14px;
  }
  .studio-title {
    justify-content: space-between;
  }
  .studio-title h2 {
    font-size: 18px;
  }
  .project-actions {
    display: flex;
    gap: 8px;
    width: 100%;
  }
  #project-name {
    flex: 1;
    min-width: 0;
    max-width: none;
    width: 100%;
    height: 38px;
    font-size: 14px;
  }
  #reset {
    width: 38px;
    height: 38px;
    flex-shrink: 0;
  }
  #save-project {
    height: 38px;
    min-height: 38px;
    white-space: nowrap;
  }

  /* Workspace on mobile */
  .workspace {
    display: flex;
    flex-direction: column;
    min-height: 0;
    border-radius: var(--rounded-md);
  }

  /* Live Preview on mobile */
  .preview-area {
    order: 0;
    border-right: none;
    border-bottom: 1px solid var(--colors-border);
  }
  .preview-heading {
    padding: 14px 16px;
  }
  .preview-stage {
    padding: 16px 12px;
    min-height: 270px;
  }
  .qr-mount {
    max-width: min(250px, 72vw);
  }
  .preview-caption {
    margin: 10px 0 16px;
  }
  .preview-controls {
    height: 44px;
    padding: 0 12px;
  }
  .zoom-control button {
    width: 30px;
    height: 28px;
    font-size: 16px;
  }

  /* Settings Area on mobile */
  .settings-area {
    order: 1;
    border-right: none;
    border-bottom: 1px solid var(--colors-border);
  }
  .content-input {
    padding: 16px;
  }
  .content-input textarea {
    font-size: 16px;
  }

  /* Tab Navigation bar on mobile */
  .customization {
    flex-direction: column;
    min-height: 0;
  }
  .tool-tabs {
    width: 100%;
    flex-direction: row;
    justify-content: flex-start;
    border-right: none;
    border-bottom: 1px solid var(--colors-border);
    padding: 8px 12px;
    gap: 6px;
    position: sticky;
    top: 60px;
    z-index: 20;
    background: var(--colors-surface);
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .tool-tabs::-webkit-scrollbar {
    display: none;
  }
  .tool-tab {
    flex: 0 0 auto;
    flex-direction: row;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 500;
    border-radius: var(--rounded-full);
    background: var(--colors-neutral);
    border: 1px solid var(--colors-border);
    height: 38px;
    min-height: 38px;
    white-space: nowrap;
    color: var(--colors-secondary);
  }
  .tool-tab .icon {
    width: 15px;
    height: 15px;
  }
  .tool-tab[aria-selected="true"] {
    background: var(--colors-surface);
    color: var(--colors-primary);
    border-color: var(--colors-tertiary);
    font-weight: 600;
    box-shadow: 0 1px 4px rgba(0, 122, 122, 0.12);
  }
  .tool-tab[aria-selected="true"] .icon {
    color: var(--colors-tertiary);
  }

  /* Tool Panel on mobile */
  .tool-panel {
    padding: 16px 14px;
  }
  .shape-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }
  .shape-option {
    height: 72px;
    font-size: 11px;
    touch-action: manipulation;
  }
  .color-presets {
    gap: 10px;
  }
  .color-preset {
    width: 32px;
    height: 32px;
  }
  .color-field input[type="text"] {
    font-size: 15px;
  }
  .switch-row {
    min-height: 40px;
    padding: 4px 0;
  }

  /* Results Area & Export on mobile */
  .results-area {
    order: 2;
    padding: 18px 14px;
  }
  .export-card {
    margin-top: 14px;
    padding-top: 14px;
  }
  .export-card .button {
    height: 44px;
    min-height: 44px;
    font-size: 15px;
  }
  .export-card select {
    height: 42px;
    font-size: 14px;
  }

  /* Studio Bottom Note */
  .studio-bottom {
    flex-direction: column;
    gap: 6px;
    text-align: center;
    align-items: center;
  }

  /* Templates & Recent on mobile */
  .templates-section,
  .recent-section,
  .about-section {
    padding-top: 48px;
    padding-bottom: 48px;
  }
  .section-heading {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 20px;
  }
  .section-heading h2 {
    font-size: 28px;
    line-height: 32px;
  }
  .templates-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
  .template-image {
    height: 120px;
    padding: 12px;
  }
  .template-image svg {
    width: 80px;
    height: 80px;
  }
  .recent-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .project-card {
    padding: 14px;
  }
  .project-card-actions {
    flex-wrap: wrap;
    gap: 8px;
  }
  .project-card-actions .button {
    flex: 1;
  }

  /* About section */
  .about-section {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .about-section h2 {
    font-size: 28px;
    line-height: 32px;
  }
  .about-brand-logo {
    display: none;
  }
  .about-links {
    flex-direction: column;
    gap: 12px;
  }
  .about-links .button,
  .about-links .text-button {
    width: 100%;
    justify-content: center;
  }

  /* Footer */
  .site-footer {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 12px;
    padding-bottom: calc(24px + var(--safe-bottom));
  }
}

@media (max-width: 420px) {
  .hero h1 {
    font-size: 28px;
    line-height: 32px;
  }
  .templates-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
  .template-caption {
    padding: 8px 10px;
    font-size: 12px;
  }
  .shape-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
  }
  .shape-option {
    height: 66px;
  }
  .header-install-btn .install-btn-text {
    display: none;
  }
  .header-install-btn {
    padding: 0 8px;
    min-width: 34px;
  }
}

/* =========================================================
   Loading Skeletons (Blobly Light)
   ========================================================= */
@keyframes skeleton-shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

.skeleton,
.skeleton-box,
.skeleton-line {
  background: linear-gradient(
    90deg,
    #f0f2ee 25%,
    #fafaf8 45%,
    #f0f2ee 65%
  );
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.8s cubic-bezier(0.4, 0, 0.2, 1) infinite;
  border-radius: var(--rounded-sm);
}

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

.skeleton-card .skeleton-image {
  height: 150px;
  width: 100%;
  border-radius: 0;
}

.skeleton-caption {
  padding: 12px 14px;
  border-top: 1px solid var(--colors-border);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.skeleton-line {
  height: 12px;
  width: 100%;
}

.skeleton-line.short {
  height: 10px;
  width: 55%;
}

.skeleton-thumb {
  width: 58px;
  height: 58px;
  border-radius: var(--rounded-sm);
  flex-shrink: 0;
}

.skeleton-project {
  display: grid;
  grid-template-columns: 58px 1fr;
  column-gap: 12px;
  row-gap: 12px;
  padding: 16px;
  align-items: center;
}

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

.qr-skeleton {
  width: calc(100% - 40px);
  height: calc(100% - 40px);
  position: absolute;
  inset: 20px;
  border-radius: var(--rounded-sm);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    transition: none !important;
    animation: none !important;
  }
}
