/* =========================================================
   quixqr.com — foundational stylesheet
   Mobile-first, vanilla CSS, Tailwind-like utility spacing
   ========================================================= */

:root {
  /* Brand — exact colors from the quixqr logo mark, constant across themes */
  --color-brand-blue: #1552ff;
  --color-brand-blue-dark: #0f3fd1;
  --color-brand-teal: #00c4cc;
  --color-brand-teal-dark: #00a3aa;

  --color-primary: var(--color-brand-blue);
  --color-primary-dark: var(--color-brand-blue-dark);
  --color-primary-light: #eef1ff;
  --color-accent: var(--color-brand-teal);

  /* Neutrals — light theme (default) */
  --color-bg: #f7f7fb;
  --color-surface: #ffffff;
  --color-border: #e5e7eb;
  --color-text: #111827;
  --color-text-muted: #6b7280;
  --color-text-subtle: #9ca3af;

  /* Feedback */
  --color-success: #16a34a;
  --color-warning-bg: #fef3c7;
  --color-warning-border: #f59e0b;
  --color-warning-text: #92400e;

  /* Radii */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 999px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(17, 24, 39, 0.06);
  --shadow-md: 0 4px 16px rgba(17, 24, 39, 0.08);
  --shadow-lg: 0 12px 32px rgba(17, 24, 39, 0.12);

  /* Layout */
  --header-height: 80px;
  --max-width: 1200px;

  /* Type */
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
}

/* Dark theme — system preference, unless explicitly overridden */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --color-primary-light: #1b2140;
    --color-bg: #0a0a0f;
    --color-surface: #15151d;
    --color-border: #2a2a36;
    --color-text: #f4f4f6;
    --color-text-muted: #a4a4b0;
    --color-text-subtle: #6f6f7c;
    --color-warning-bg: rgba(245, 158, 11, 0.15);
    --color-warning-text: #fbbf24;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.6);
  }
}

/* Dark theme — explicit toggle override, wins regardless of system setting */
:root[data-theme="dark"] {
  --color-primary-light: #1b2140;
  --color-bg: #0a0a0f;
  --color-surface: #15151d;
  --color-border: #2a2a36;
  --color-text: #f4f4f6;
  --color-text-muted: #a4a4b0;
  --color-text-subtle: #6f6f7c;
  --color-warning-bg: rgba(245, 158, 11, 0.15);
  --color-warning-text: #fbbf24;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.6);
}

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

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

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.2s ease, color 0.2s ease;
}

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

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

a {
  color: var(--color-primary);
}

h1, h2, h3, h4 {
  line-height: 1.25;
  margin: 0 0 0.5em;
}

p {
  margin: 0 0 1em;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--color-primary);
  color: #fff;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  z-index: 1000;
}

.skip-link:focus {
  left: 1rem;
  top: 1rem;
}

/* ---------------------------------------------------------
   Header
   --------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
}

.site-header__inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1.5rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.brand__logo-img {
  height: 38px; /* Adjust between 32px - 40px depending on preference */
  width: auto;  /* Maintains exact aspect ratio without stretching */
  display: block;
}

.header-right-actions {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(0, 230, 118, 0.12);
  color: #00e676;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-full);
  white-space: nowrap;
}

.badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #00e676;
  flex-shrink: 0;
}

/* ---------------------------------------------------------
   Header nav — About link + language switcher
   --------------------------------------------------------- */
.header-nav__link {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-text);
  text-decoration: none;
  white-space: nowrap;
}

.header-nav__link:hover {
  color: var(--color-primary);
}

.lang-switcher {
  position: relative;
}

.lang-switcher__trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: none;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  padding: 0.4rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--color-text);
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.lang-switcher__trigger:hover {
  border-color: var(--color-brand-blue);
  color: var(--color-primary);
}

.lang-switcher__chevron {
  flex-shrink: 0;
  transition: transform 0.15s ease;
}

.lang-switcher.open .lang-switcher__chevron {
  transform: rotate(180deg);
}

.lang-switcher__menu {
  display: none;
  position: absolute;
  top: calc(100% + 0.4rem);
  right: 0;
  min-width: 160px;
  max-height: 320px;
  overflow-y: auto;
  margin: 0;
  padding: 0.4rem;
  list-style: none;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  z-index: 60;
}

.lang-switcher:hover .lang-switcher__menu,
.lang-switcher.open .lang-switcher__menu {
  display: block;
}

.lang-switcher__option {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.5rem 0.6rem;
  border: none;
  background: none;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  color: var(--color-text);
  cursor: pointer;
}

.lang-switcher__option:hover {
  background: var(--color-primary-light);
  color: var(--color-primary-dark);
}

.lang-switcher__option.active {
  background: var(--color-primary-light);
  color: var(--color-primary-dark);
  font-weight: 700;
}

/* ---------------------------------------------------------
   Theme toggle
   --------------------------------------------------------- */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  background: var(--color-surface);
  color: var(--color-text-muted);
  cursor: pointer;
  flex-shrink: 0;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.theme-toggle:hover {
  background: var(--color-primary-light);
  color: var(--color-primary-dark);
  border-color: var(--color-primary-light);
}

.theme-toggle svg {
  width: 18px;
  height: 18px;
}

.theme-toggle__icon--moon {
  display: none;
}

:root[data-theme="dark"] .theme-toggle__icon--sun {
  display: none;
}

:root[data-theme="dark"] .theme-toggle__icon--moon {
  display: block;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle__icon--sun {
    display: none;
  }

  :root:not([data-theme="light"]) .theme-toggle__icon--moon {
    display: block;
  }
}

/* ---------------------------------------------------------
   AdSense placeholder slots
   --------------------------------------------------------- */
.adsense-slot {
  max-width: var(--max-width);
  margin: 1rem auto;
  padding: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 90px;
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  color: var(--color-text-subtle);
}

.adsense-slot__label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.adsense-slot--header,
.adsense-slot--footer {
  margin-left: 1.25rem;
  margin-right: 1.25rem;
}

.adsense-slot--sidebar {
  min-height: 250px;
}

@media (min-width: 640px) {
  .adsense-slot--header,
  .adsense-slot--footer {
    margin-left: auto;
    margin-right: auto;
    padding-left: 1.25rem;
    padding-right: 1.25rem;
  }
}

/* ---------------------------------------------------------
   Main / tabs wrapper
   --------------------------------------------------------- */
main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
}

.tab-radio {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

/* ---------------------------------------------------------
   Tab bar
   --------------------------------------------------------- */
.tab-bar {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 0.4rem;
  padding: 0.35rem;
  margin-bottom: 1.5rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-sm);
}

.tab-label {
  padding: 0.55rem 0.5rem;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-align: center;
  color: var(--color-text-muted);
  border-radius: var(--radius-full);
  cursor: pointer;
  user-select: none;
  transition: background-color 0.15s ease, color 0.15s ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tab-label:hover {
  background: var(--color-primary-light);
  color: var(--color-primary-dark);
}

@media (max-width: 480px) {
  .tab-label {
    padding: 0.5rem 0.2rem;
    font-size: 0.68rem;
  }
}

.tab-radio:checked + .tab-bar,
.tab-radio:focus-visible + .tab-bar {
  outline: none;
}

/* Active tab highlighting, and panel visibility, driven purely by :checked */
#tab-url:checked ~ .tab-bar label[for="tab-url"],
#tab-text:checked ~ .tab-bar label[for="tab-text"],
#tab-email:checked ~ .tab-bar label[for="tab-email"],
#tab-phone:checked ~ .tab-bar label[for="tab-phone"],
#tab-sms:checked ~ .tab-bar label[for="tab-sms"],
#tab-vcard:checked ~ .tab-bar label[for="tab-vcard"],
#tab-wifi:checked ~ .tab-bar label[for="tab-wifi"],
#tab-location:checked ~ .tab-bar label[for="tab-location"] {
  background: var(--color-primary);
  color: #fff;
}

.panels .panel {
  display: none;
}

#tab-url:checked ~ .workspace .panels #panel-url,
#tab-text:checked ~ .workspace .panels #panel-text,
#tab-email:checked ~ .workspace .panels #panel-email,
#tab-phone:checked ~ .workspace .panels #panel-phone,
#tab-sms:checked ~ .workspace .panels #panel-sms,
#tab-vcard:checked ~ .workspace .panels #panel-vcard,
#tab-wifi:checked ~ .workspace .panels #panel-wifi,
#tab-location:checked ~ .workspace .panels #panel-location {
  display: block;
  animation: fade-in 0.15s ease;
}

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

/* ---------------------------------------------------------
   Workspace grid
   --------------------------------------------------------- */
.workspace {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  align-items: start;
}

@media (min-width: 900px) {
  .workspace {
    grid-template-columns: minmax(0, 1fr) 360px;
  }
}

.workspace__left {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 1.5rem;
}

.panel__title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

/* ---------------------------------------------------------
   Form fields
   --------------------------------------------------------- */
.field {
  display: block;
  margin-bottom: 1rem;
}

.field:last-child {
  margin-bottom: 0;
}

.field__label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-text-muted);
  margin-bottom: 0.4rem;
}

.field__input {
  width: 100%;
  padding: 0.65rem 0.85rem;
  font-size: 0.9rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field__input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-light);
}

textarea.field__input {
  resize: vertical;
}

.field__input--file {
  padding: 0.5rem;
  cursor: pointer;
}

.logo-file-status {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: -0.5rem;
  margin-bottom: 1rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

.logo-file-status__name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.logo-file-status__remove {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border: 1px solid #ef4444;
  border-radius: 50%;
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.logo-file-status__remove:hover {
  background: #dc2626;
  color: #fff;
}

.field-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem 1rem;
}

@media (min-width: 480px) {
  .field-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.location-map {
  height: 320px;
  width: 100%;
  margin-top: 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  overflow: hidden;
  background: var(--color-surface);
}

.location-map__hint {
  margin-top: 0.5rem;
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

.field--checkbox {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.field--checkbox .field__label {
  margin-bottom: 0;
}

.field--checkbox-aligned {
  margin-top: 1.4rem;
}

.field--color {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.field--color .field__label {
  margin-bottom: 0;
}

.field__color {
  width: 44px;
  height: 36px;
  padding: 2px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  cursor: pointer;
}

.field__range {
  width: 100%;
  accent-color: var(--color-primary);
}

.color-mode-toggle {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.radio-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.85rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, background-color 0.15s ease;
}

.radio-pill input {
  accent-color: var(--color-primary);
}

.radio-pill:has(input:checked) {
  border-color: var(--color-primary);
  color: var(--color-primary-dark);
  background: var(--color-primary-light);
}

.color-fields {
  margin-bottom: 1rem;
}

.color-fields:last-child {
  margin-bottom: 0;
}

.color-input-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.color-input-row .field__color {
  flex-shrink: 0;
}

.field__hex {
  flex: 1;
  min-width: 0;
  padding: 0.65rem 0.75rem;
  font-size: 0.85rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  text-transform: uppercase;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  color: var(--color-text);
}

.field__hex:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-light);
}

.field--button {
  display: flex;
  flex-direction: column;
}

.field--button .field__label {
  visibility: hidden;
}

.btn--swap {
  white-space: nowrap;
}

.eye-color-actions {
  display: flex;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.eye-color-actions .btn {
  flex: 1;
}

/* ---------------------------------------------------------
   Shape tile grids — Body Shape / Eye Frame Shape / Eye Ball Shape
   --------------------------------------------------------- */

.shape-group {
  margin-bottom: 1.5rem;
}

.shape-group:last-child {
  margin-bottom: 0;
}

.shape-group__label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-text-muted);
  margin-bottom: 0.6rem;
}

.shape-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.shape-tile {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  color: var(--color-text);
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.shape-tile:hover {
  border-color: var(--color-brand-blue);
}

.shape-tile.active {
  border-color: var(--color-brand-blue);
  box-shadow: 0 0 0 3px rgba(21, 82, 255, 0.18), 0 0 10px rgba(21, 82, 255, 0.35);
}

/* Body Shape — a shared 3x3 "on/off" glyph (corners + center lit);
   only the shape modifier below changes per tile, so all six tiles
   in the row stay visually comparable at a glance. */
.shape-icon {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: 2px;
  width: 26px;
  height: 26px;
}

.shape-icon span:nth-child(odd) {
  background: currentColor;
}

.shape-icon--square span:nth-child(odd) {
  border-radius: 1px;
}

.shape-icon--dots span:nth-child(odd) {
  border-radius: 50%;
}

.shape-icon--rounded span:nth-child(odd) {
  border-radius: 35%;
}

.shape-icon--extra-rounded span:nth-child(odd) {
  border-radius: 46%;
}

.shape-icon--classy span:nth-child(odd) {
  border-radius: 1px;
  clip-path: polygon(30% 0, 100% 0, 100% 70%, 70% 100%, 0 100%, 0 30%);
}

.shape-icon--classy-rounded span:nth-child(odd) {
  border-radius: 30%;
  clip-path: polygon(20% 0, 100% 0, 100% 80%, 80% 100%, 0 100%, 0 20%);
}

.shape-icon--diamond span:nth-child(odd) {
  border-radius: 2px;
  transform: rotate(45deg) scale(0.72);
}

.shape-icon--star span:nth-child(odd) {
  background: currentColor;
  border-radius: 0;
  clip-path: polygon(50% 0%, 63% 35%, 100% 35%, 70% 57%, 82% 91%, 50% 70%, 18% 91%, 30% 57%, 0% 35%, 37% 35%);
}

.shape-icon--horizontal-lines span:nth-child(odd) {
  height: 34%;
  align-self: center;
  border-radius: 1px;
}

.shape-icon--vertical-lines span:nth-child(odd) {
  width: 34%;
  justify-self: center;
  border-radius: 1px;
}

.shape-icon--mosaic span:nth-child(odd) {
  border-radius: 1px;
  transform: rotate(10deg) scale(0.82);
}

.shape-icon--mosaic span:nth-child(4n) {
  transform: rotate(-8deg) scale(0.82);
}

/* Eye Frame Shape — a single hollow square/circle outline */
.eye-frame-icon {
  box-sizing: border-box;
  width: 26px;
  height: 26px;
  border: 4px solid currentColor;
}

.eye-frame-icon--square {
  border-radius: 3px;
}

.eye-frame-icon--dot {
  border-radius: 50%;
}

.eye-frame-icon--extra-rounded {
  border-radius: 40%;
}

.eye-frame-icon--leaf-right {
  border-radius: 0 60% 0 60%;
}

.eye-frame-icon--leaf-left {
  border-radius: 60% 0 60% 0;
}

.eye-frame-icon--dotted-frame {
  border-style: dotted;
  border-width: 5px;
  border-radius: 3px;
}

/* Eye Ball Shape — a single filled square/circle */
.eye-ball-icon {
  width: 22px;
  height: 22px;
  background: currentColor;
}

.eye-ball-icon--square {
  border-radius: 3px;
}

.eye-ball-icon--dot {
  border-radius: 50%;
}

.eye-ball-icon--rounded-square {
  border-radius: 30%;
}

.eye-ball-icon--leaf-right {
  border-radius: 0 60% 0 60%;
}

.eye-ball-icon--leaf-left {
  border-radius: 60% 0 60% 0;
}

.eye-ball-icon--diamond {
  border-radius: 2px;
  transform: rotate(45deg) scale(0.75);
}

.eye-ball-icon--bars-horizontal {
  background: repeating-linear-gradient(
    to bottom,
    currentColor 0,
    currentColor 4px,
    transparent 4px,
    transparent 7px
  );
}

.eye-ball-icon--bars-vertical {
  background: repeating-linear-gradient(
    to right,
    currentColor 0,
    currentColor 4px,
    transparent 4px,
    transparent 7px
  );
}

.contrast-warning {
  display: none;
  align-items: flex-start;
  gap: 0.5rem;
  margin-top: 1rem;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-md);
  background: var(--color-warning-bg);
  border: 1px solid var(--color-warning-border);
  color: var(--color-warning-text);
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.4;
}

.contrast-warning__icon {
  flex-shrink: 0;
}

/* ---------------------------------------------------------
   Accordions
   --------------------------------------------------------- */
.accordion-group {
  margin-top: 1.75rem;
  border-top: 1px solid var(--color-border);
  padding-top: 1.25rem;
}

.accordion {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  margin-bottom: 0.75rem;
  overflow: hidden;
}

.accordion:last-child {
  margin-bottom: 0;
}

.accordion[open] > .accordion__summary {
  border-bottom: 1px solid var(--color-border);
  color: var(--color-primary-dark);
}

.accordion__summary {
  list-style: none;
  cursor: pointer;
  padding: 0.85rem 1rem;
  font-weight: 700;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--color-surface);
  user-select: none;
}

.accordion__summary::-webkit-details-marker {
  display: none;
}

.accordion__chevron {
  width: 9px;
  height: 9px;
  border-right: 2px solid var(--color-text-muted);
  border-bottom: 2px solid var(--color-text-muted);
  transform: rotate(45deg);
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.accordion[open] .accordion__chevron {
  transform: rotate(-135deg);
}

.accordion__body {
  padding: 1rem;
  background: var(--color-surface);
}

.accordion__body p:last-child {
  margin-bottom: 0;
}

/* ---------------------------------------------------------
   Preview panel (sticky right column)
   --------------------------------------------------------- */
.workspace__right {
  position: relative;
}

@media (min-width: 900px) {
  .workspace__right {
    position: sticky;
    top: calc(var(--header-height) + 1rem);
  }
}

.preview-panel {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 1.5rem;
}

.preview-panel__title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.preview-panel__canvas-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin: 0;
  border-radius: 0;
  border: 1px solid var(--color-border);
  overflow: hidden;
}

#canvas-container {
  width: 100%;
  max-width: 100%;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0;
  /* Safety-net fill, not a visual frame — the canvas below always
     covers this completely at 100%/100%, so it's invisible in the
     settled state. It only matters for the instant of a re-render,
     where it keeps that gap white instead of flashing through to
     whatever's behind the card. */
  background-color: #fff;
}

#canvas-container canvas,
#canvas-container svg {
  width: 100%;
  height: 100%;
  border-radius: 0;
}

.preview-panel__canvas-wrap + .field {
  margin-top: 1.25rem;
}

.resolution-labels {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: 0.6rem;
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

.resolution-labels__value {
  font-weight: 700;
}

.preview-panel__actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
  margin-top: 1.25rem;
}

/* ---------------------------------------------------------
   Buttons
   --------------------------------------------------------- */
.btn {
  appearance: none;
  border: none;
  border-radius: var(--radius-md);
  padding: 0.7rem 1rem;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.05s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

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

.btn--primary {
  background: var(--color-primary);
  color: #fff;
  box-shadow: var(--shadow-sm);
}

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

.btn--secondary {
  background: var(--color-primary-light);
  color: var(--color-primary-dark);
}

.btn--secondary:hover {
  background: #e0e3fc;
}

/* ---------------------------------------------------------
   SEO content section
   --------------------------------------------------------- */
.seo {
  margin-top: 3rem;
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

@media (min-width: 900px) {
  .seo {
    grid-template-columns: minmax(0, 1fr) 300px;
  }

  .seo__faq {
    grid-column: 1 / 2;
  }

  .adsense-slot--sidebar {
    grid-column: 2 / 3;
    grid-row: 1 / 3;
    position: sticky;
    top: calc(var(--header-height) + 1rem);
    margin: 0;
  }

  .adsense-slot--footer {
    grid-column: 1 / -1;
  }
}

.seo__prose h2,
.seo__faq h2 {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.seo__prose h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-top: 1.5rem;
}

.seo__prose p,
.seo__faq p {
  color: var(--color-text-muted);
}

.seo__faq .accordion {
  background: var(--color-surface);
}

/* ---------------------------------------------------------
   Footer
   --------------------------------------------------------- */
.site-footer {
  border-top: 1px solid var(--color-border);
  padding: 1.5rem 1.25rem;
  text-align: center;
  color: var(--color-text-subtle);
  font-size: 0.8rem;
}

/* ---------------------------------------------------------
   Utility: larger screens polish
   --------------------------------------------------------- */
@media (min-width: 1024px) {
  .site-header__inner,
  main {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }
}
