/* KoloQR — three-column layout (Data · Design · Preview) */

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

/* ── Tooltips ───────────────────────────────────────────────
   Use data-tooltip="…" on any element. A singleton floating element is
   appended to <body> by JS so the tooltip is never clipped by overflow. */
.qr-tooltip {
  position: fixed;
  z-index: 2000;
  background: #1A1A1A;
  color: #fff;
  font-family: 'DM Sans', system-ui, sans-serif;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.35;
  padding: 8px 12px;
  border-radius: 8px;
  max-width: 260px;
  white-space: normal;
  text-align: center;
  box-shadow: 0 4px 12px rgba(0,0,0,0.18);
  pointer-events: none;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 120ms ease, transform 120ms ease;
}
.qr-tooltip.show {
  opacity: 1;
  transform: translateY(0);
}
.qr-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: #1A1A1A;
  width: 0;
  height: 0;
}
.qr-tooltip.below::after {
  top: auto;
  bottom: 100%;
  border-top-color: transparent;
  border-bottom-color: #1A1A1A;
}

:root {
  --bg:       #78D650;
  --panel:    #ffffff;
  --surface:  #f4f4f4;
  --border:   #e5e5e1;
  --border2:  #c8c8c2;
  --text:     #111110;
  --text2:    #6b6b65;
  --text3:    #a8a8a2;
  --radius:   14px;
  --radius-s: 9px;
  --shadow:   0 1px 2px rgba(0,0,0,.04), 0 8px 32px rgba(0,0,0,.08);
  --ease:     160ms cubic-bezier(.4,0,.2,1);
  --font:     'DM Sans', system-ui, sans-serif;
  --mono:     'DM Mono', 'SF Mono', monospace;
  --col-editor:  800px;
  --col-preview: 400px;
  --col-data:    320px;
  --col-design:  440px;
}

html { font-size: 15px; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ── Page wrapper: centers the two columns ── */
.app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px 24px 60px;
}

/* ── Header ── */
.app-header {
  width: 100%;
  max-width: calc(var(--col-editor) + var(--col-preview) + 24px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 15px;
}
.logo-mark { font-size: 18px; }

.app-tag {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--text3);
  letter-spacing: .05em;
  text-transform: uppercase;
}

/* ── Two columns ── */
.columns {
  width: 100%;
  max-width: 1280px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  align-items: stretch;   /* preview matches editor height */
}

/* ── Editor cards (Data, Design) ── */
.editor {
  /* card chrome (border / radius / shadow / bg) is shared with .preview-box */
  overflow: hidden;
}

.editor-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* Step headings inside the editor — "1 Data" and "2 Design" */
.step-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font);
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 20px;
}
.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #1A1A1A;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  flex-shrink: 0;
}
/* Add a divider above the second step heading */
.editor-body .step-title + * { margin-top: 0; }
.editor-body > .step-title:not(:first-child) {
  border-top: 1px solid #EEE;
  padding-top: 18px;
  margin-top: 16px;
}

/* ── Data column card — wraps the tag strip + active content section. */
.data-card {
  background: #F4F4F4;
  border-radius: 24px;
  padding: 8px;
}

.tag-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  margin-bottom: 16px;
}
.tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 8px;
  background: transparent;
  border: none;
  border-radius: 15px;
  cursor: pointer;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 500;
  color: var(--text2);
  transition: background 140ms cubic-bezier(.4,0,.2,1), color 140ms, box-shadow 140ms, transform 100ms;
}
.tag:hover { color: var(--text); }
.tag.is-active {
  background: #fff;
  color: var(--text);
  box-shadow: 0 2px 6px 0 rgba(0,0,0,0.08);
}
.tag:active { transform: scale(.96); }
.tag svg { flex-shrink: 0; }

/* Data form section with the input fields for the active tag. */
.data-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.content-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  background: #fff;
  border-radius: 15px;
  animation: section-in 220ms cubic-bezier(.4,0,.2,1);
}
.content-section[hidden] { display: none; }
@keyframes section-in {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.field-group {
  display: flex;
  flex-direction: column;
}
/* Side-by-side groups within one row (e.g. Platform + Handle for Social). */
.field-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}
.field-row > .field-group { min-width: 0; }
.field-row .field-platform { flex: 0 0 auto; min-width: 0; }
.field-row .field-handle   { flex: 1 1 auto; min-width: 0; }
.field-row .field-platform .platform-picker { padding: 0 14px; }
.field-label {
  font-family: var(--font);
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  margin: 0 0 8px;
  display: block;
}

/* ── Design column cards (Shape · Tabs · Colors) ───────────
   Figma spec: outer cards radius 24, gray #F4F4F4. Sub-cards radius 15,
   white with subtle drop shadow. */
.design-card {
  background: #F4F4F4;
  border-radius: 24px;
  padding: 8px;
  margin: 0 0 12px;
}
.design-card:last-child { margin-bottom: 0; }

/* Shape card — single row of shape toggles, gap 4 */
.design-shape-card .toggle-group {
  display: flex;
  align-items: center;
  gap: 4px;
}
.design-shape-card .toggle {
  font-size: 0;          /* hide text — icon only */
  gap: 0;
  flex: 1 0 0;
  height: 44px;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 15px;
  color: var(--text3);   /* gray icons for inactive */
}
.design-shape-card .toggle svg { width: 22px; height: 22px; }
.design-shape-card .toggle.active {
  background: transparent;     /* sliding indicator paints the white pill */
  border: none;
  color: var(--text);
}
.design-shape-card .toggle-group { position: relative; }
.design-shape-card .toggle { position: relative; z-index: 1; }

/* Sliding white background that animates between active items.
   Positioned + sized by JS via translate3d + width. */
.slide-indicator {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: #fff;
  border-radius: 15px;
  box-shadow: 0 2px 6px 0 rgba(0,0,0,0.08);
  transition: transform 260ms cubic-bezier(.4,0,.2,1),
              width     260ms cubic-bezier(.4,0,.2,1);
  pointer-events: none;
  z-index: 0;
}
.slide-indicator.is-hidden { opacity: 0; }

/* Stack labelled ring-text inputs with a small gap (matches Email/WiFi panels) */
.circ-options { display: flex; flex-direction: column; gap: 12px; }

/* Tabs strip — each tab is its own card-like button (Figma Frame 17) */
.design-tabs-card { padding: 12px; }
.design-tabs {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  margin-bottom: 16px;
}
.design-tab {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px 12px 12px;
  background: transparent;
  border: none;
  border-radius: 15px;
  cursor: pointer;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 500;
  color: var(--text2);
  transition: color 200ms cubic-bezier(.4,0,.2,1);
}
.design-tab:hover { color: var(--text); }
.design-tab.is-active {
  background: transparent;     /* sliding indicator paints the white pill */
  color: var(--text);
  box-shadow: none;
}
.design-tab svg { color: currentColor; }
.design-tab .tab-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
}
.design-tab .tab-icon svg { width: 22px; height: 22px; }
.design-tab-panel[hidden] { display: none; }
.design-tab-panel {
  display: flex;
  flex-direction: column;
  gap: 8px;
  animation: panel-in 220ms cubic-bezier(.4,0,.2,1);
}
@keyframes panel-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* White sub-card inside a tab panel — Figma radius 15. No shadow because
   the card itself isn't clickable; only the buttons inside are. */
.panel-subcard {
  background: #fff;
  border-radius: 15px;
  padding: 16px;
}
.panel-subcard .eyes-grid,
.panel-subcard .border-grid,
.panel-subcard .logo-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
/* Pattern grid — exactly 6 buttons per row */
.panel-subcard .pattern-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: space-between;
}
.panel-subcard.panel-colors {
  display: flex;
  gap: 8px;
  padding: 12px;
}
.color-tile {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: #fff;
  border: 1.5px solid #E3E3E3;
  border-radius: 15px;
  cursor: pointer;
  transition: border-color 140ms;
  position: relative;
  min-width: 0;
}
.color-tile:hover { border-color: #C8C8C2; }
.color-tile:hover { border-color: #C8C8C2; }
.color-tile-name {
  font-family: var(--font);
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.color-tile input.color-pick {
  position: absolute;
  width: 1px; height: 1px;
  opacity: 0;
  pointer-events: none;
}
.color-tile .clr-field {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}
.color-tile .clr-field > button {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
  pointer-events: none !important;
  border: none !important;
  padding: 0 !important;
}
.color-tile .clr-field::before {
  content: '';
  display: block;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: currentColor;
  border: 1.5px solid rgba(0,0,0,0.15);
  box-sizing: border-box;
}

/* Two design sections side-by-side as columns within one row */
.editor-design .row-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.editor-design .row-pair .section.row { min-width: 0; }

/* ── Design column — vertical sections ───────────────────── */
.editor-design .section.row {
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  padding: 6px 0;
  min-height: 0;
}
.editor-design .section.row .sec-label {
  width: auto;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
}
.editor-design .section.row .sec-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #EEE;
}
.editor-design .section.row .toggle-group,
.editor-design .section.row .pattern-grid,
.editor-design .section.row .eyes-grid,
.editor-design .section.row .border-grid,
.editor-design .section.row .logo-grid {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  flex: 0 0 auto;
  width: 100%;
  overflow: visible;
  padding: 0;
  margin: 0;
  gap: 6px;
}

/* Logo color swatch — pushed to its own corner inside the wrapped row */
.editor-design .section.row .logo-color-swatch {
  margin-left: 0;
}

/* ── Right: preview card ── */
.preview-col {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.preview-box {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  overflow: hidden;
  position: relative;
}
.preview-head {
  padding: 24px 24px 0;
}
.preview-head .step-title { margin: 0; }

.qr-out {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  width: 100%;
  padding: 24px 24px 180px 24px;  /* extra bottom room for the format tags + download CTA */
}
.qr-out svg {
  display: block;
  width: 320px;
  height: 320px;
  max-width: 100%;
  max-height: 100%;
}

@keyframes pop {
  from { opacity: 0; transform: scale(.97); }
  to   { opacity: 1; transform: scale(1); }
}

/* ── Download CTA (pinned inside preview at the bottom) ── */
.preview-actions {
  position: absolute;
  left: 50%;
  bottom: 32px;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  z-index: 2;
  width: max-content;
}
.format-tags {
  display: flex;
  gap: 8px;
}
.format-tags .tag {
  height: 36px;
  padding: 0 18px;
  font-size: 13px;
}
.preview-actions .download-cta {
  padding: 15px 30px;
  font-size: 15px;
  gap: 8px;
  border-radius: 999px;
}

/* ── Sections ── */
.section { display: flex; flex-direction: column; gap: 9px; }

/* Horizontal-row variant: label on the left, segmented controls on the right,
   wrapped in a soft surface-colored pill.  Used for Shape / Border / Pattern /
   Eyes — compact rows that all share the same shape language. */
.section.row {
  flex-direction: row;
  align-items: center;
  gap: 16px;
  padding: 8px 0;
  background: transparent;
  border-radius: 0;
  min-height: 64px;
}
.section.row .sec-label {
  font-family: var(--font);
  font-size: 14px;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  color: var(--text);
  margin: 0;
  flex-shrink: 0;
  width: 80px;
}

/* Buttons inside a row: white card with gray outline (matches .tag style). */
.design-tab-panel .toggle,
.section.row .toggle,
.design-tab-panel .pattern-btn,
.section.row .pattern-btn,
.design-tab-panel .eye-btn,
.section.row .eye-btn,
.design-tab-panel .border-btn,
.section.row .border-btn,
.design-tab-panel .logo-btn {
  width: 46px;
  height: 46px;
  background: #fff;
  border: 1.5px solid #E3E3E3;
  border-radius: 12px;
  box-shadow: none;
  flex-shrink: 0;
  padding: 8px;
  color: var(--text);
  transition: border-color 140ms cubic-bezier(.4,0,.2,1), transform 100ms;
}
.design-tab-panel .toggle:active,
.section.row .toggle:active,
.design-tab-panel .pattern-btn:active,
.section.row .pattern-btn:active,
.design-tab-panel .eye-btn:active,
.section.row .eye-btn:active,
.design-tab-panel .border-btn:active,
.section.row .border-btn:active,
.design-tab-panel .logo-btn:active {
  transform: scale(.93);
}
.design-tab-panel .toggle.active,
.design-tab-panel .pattern-btn.active,
.design-tab-panel .eye-btn.active,
.design-tab-panel .border-btn.active,
.design-tab-panel .logo-btn.active,
.section.row .toggle.active,
.section.row .pattern-btn.active,
.section.row .eye-btn.active,
.section.row .border-btn.active,
.section.row .logo-btn.active {
  border-color: #1A1A1A;
  border-width: 2px;
}
.design-tab-panel .toggle:hover:not(.active),
.design-tab-panel .pattern-btn:hover:not(.active),
.design-tab-panel .eye-btn:hover:not(.active),
.design-tab-panel .border-btn:hover:not(.active),
.design-tab-panel .logo-btn:hover:not(.active),
.section.row .toggle:hover:not(.active),
.section.row .pattern-btn:hover:not(.active),
.section.row .eye-btn:hover:not(.active),
.section.row .border-btn:hover:not(.active),
.section.row .logo-btn:hover:not(.active) {
  border-color: #C8C8C2;
}

/* Logo panel: "or" divider between the brand strip and the upload button. */
.logo-or {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 14px 0 10px;
  color: #9A9A95;
  font-size: 13px;
  font-weight: 400;
}

/* Full-width "Upload logo" button — same border treatment as a logo-btn,
   but spans the panel width with a centered text label. */
.logo-upload-btn[hidden] { display: none; }
.logo-upload-btn {
  display: block;
  width: 100%;
  padding: 10px 16px;
  min-height: 50px;
  box-sizing: border-box;
  background: #fff;
  border: 1.5px solid #E3E3E3;
  border-radius: 12px;
  color: var(--text);
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 140ms cubic-bezier(.4,0,.2,1), transform 100ms;
}
.logo-upload-btn:hover { border-color: #C8C8C2; }
.logo-upload-btn:active { transform: scale(.98); }
.logo-upload-btn.active { border-color: #1A1A1A; border-width: 2px; }

.logo-upload-hint {
  margin: 8px 0 0;
  text-align: center;
  color: #9A9A95;
  font-size: 12px;
}

/* Active-upload card — replaces .logo-upload-btn once a file is loaded.
   The whole card is the delete affordance (click anywhere to remove). */
.logo-upload-card[hidden] { display: none; }
.logo-upload-card {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  /* Match .logo-upload-btn height so swapping them doesn't jump the layout. */
  padding: 10px 12px;
  min-height: 50px;
  box-sizing: border-box;
  background: #fff;
  border: 2px solid #1A1A1A;
  border-radius: 12px;
  color: var(--text);
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: border-color 140ms cubic-bezier(.4,0,.2,1), transform 100ms;
}
.logo-upload-card:hover { border-color: #d33; }
.logo-upload-card:hover .logo-upload-card-trash { color: #d33; }
.logo-upload-card:active { transform: scale(.98); }

.logo-upload-card-thumb {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: transparent center / contain no-repeat;
}

.logo-upload-card-name {
  flex: 1 1 auto;
  font-size: 14px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.logo-upload-card-trash {
  flex: 0 0 auto;
  color: #9A9A95;
  transition: color 140ms;
}

/* Double-ring sub-card: outer + inner color tiles side by side. */
#double-ring-options {
  display: flex;
  gap: 8px;
}
#double-ring-options .color-tile { flex: 1 1 0; }

/* "Flip bottom text" toggle row inside the single-ring options. */
.flip-bottom-row {
  display: flex;
  align-items: center;
  gap: 8px;
  /* Sit close to the bottom-text input — the row above already supplies a
     field-group margin, so we only need a hair of breathing room here. */
  margin-top: -4px;
  font-size: 14px;
  color: var(--text);
  cursor: pointer;
  user-select: none;
}
.flip-bottom-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #1A1A1A;
  cursor: pointer;
}

/* Custom-uploaded logo preview replaces the SVG icon */
.design-tab-panel .logo-btn.has-upload .logo-custom-icon,
.section.row .logo-btn.has-upload .logo-custom-icon { display: none; }
.design-tab-panel .logo-btn.has-upload,
.section.row .logo-btn.has-upload {
  background-size: 22px 22px;
  background-position: center;
  background-repeat: no-repeat;
}

/* "More" button — three-dot dropdown trigger */
.design-tab-panel .logo-more-btn,
.section.row .logo-more-btn { color: var(--text); }

/* Color swatch — same button component as eye-btn / logo-btn, but with a
   color circle in place of an icon. Uses grid+place-items so the inner
   Coloris button is locked dead-center regardless of sibling input. */
.design-tab-panel .logo-color-swatch,
.section.row .logo-color-swatch,
.section.row .eye-color-swatch,
.section.row .color-row-swatch {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  margin-left: auto;        /* push swatch to the right edge of the Logo row */
  align-self: center;       /* vertically centered in the flex row */
  display: grid;
  place-items: center;
  padding: 0;
  background: #fff;
  border: 1.5px solid #E3E3E3;
  border-radius: 12px;
  cursor: pointer;
  transition: border-color 140ms cubic-bezier(.4,0,.2,1);
  position: relative;
}
.design-tab-panel .logo-color-swatch[hidden],
.section.row .logo-color-swatch[hidden] { display: none; }
.design-tab-panel .logo-color-swatch input.color-pick,
.section.row .logo-color-swatch input.color-pick,
.section.row .eye-color-swatch input.color-pick,
.section.row .color-row-swatch input.color-pick {
  position: absolute;
  width: 1px; height: 1px;
  opacity: 0;
  pointer-events: none;
}
/* Coloris wraps the input in .clr-field and sets `color: <hex>` on it.
   We use it as a flex centering host and render our own circle via ::before. */
.design-tab-panel .logo-color-swatch .clr-field,,
.section.row .logo-color-swatch .clr-field,
.section.row .eye-color-swatch .clr-field,
.section.row .color-row-swatch .clr-field {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}
/* Hide the Coloris-generated swatch button — we only need it as a click target. */
.design-tab-panel .logo-color-swatch .clr-field >,
.section.row .logo-color-swatch .clr-field > button,
.section.row .eye-color-swatch .clr-field > button,
.section.row .color-row-swatch .clr-field > button {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
  pointer-events: none !important;
  border: none !important;
  padding: 0 !important;
}
/* Our visible 22×22 color circle — sized to match SVG icons. */
.design-tab-panel .logo-color-swatch .clr-field::before,
.section.row .logo-color-swatch .clr-field::before,
.section.row .eye-color-swatch .clr-field::before,
.section.row .color-row-swatch .clr-field::before {
  content: '';
  display: block;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: currentColor;
  border: 1.5px solid rgba(0,0,0,0.15);
  box-sizing: border-box;
}
.section.row .color-row-swatch {
  margin-left: 0;           /* standalone color row → align to the left */
  align-self: flex-start;   /* override center alignment from shared rule */
}
.section.row .logo-color-swatch:hover,
.section.row .eye-color-swatch:hover,
.section.row .color-row-swatch:hover {
  border-color: #C8C8C2;
}

/* ── Logo picker dropdown ─────────────────────────────────── */
.logo-dropdown {
  position: fixed;
  z-index: 1000;
  width: 320px;
  max-height: 60vh;
  background: #fff;
  border: 1px solid #E3E3E3;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  overflow-y: auto;
  animation: pop 140ms cubic-bezier(.4,0,.2,1);
}
.logo-dropdown[hidden] { display: none; }
.logo-dropdown-body { padding: 10px 12px 12px; }
.logo-cat { margin-top: 12px; }
.logo-cat:first-child { margin-top: 2px; }
.logo-cat-title {
  font-family: var(--font);
  font-size: 11px;
  font-weight: 600;
  color: #8A8A85;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0 0 6px 4px;
}
.logo-cat-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
}
.logo-card {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1 / 1;
  background: #fff;
  color: var(--text);
  border: 1px solid #E3E3E3;
  border-radius: 8px;
  cursor: pointer;
  transition: background 100ms, border-color 100ms;
}
.logo-card:hover { background: #F4F4F4; }
.logo-card.active { border-color: #1A1A1A; }
.logo-card svg {
  width: 20px;
  height: 20px;
  color: var(--brand);
}
.logo-card span { display: none; }

/* Hide Shape toggle text labels in row layout — only icons remain. */
.section.row .toggle {
  font-size: 0;
  gap: 0;
  justify-content: center;
}
.section.row .toggle svg { width: 22px; height: 22px; }
.section.row .pattern-btn svg,
.section.row .eye-btn svg,
.section.row .border-btn svg { width: 100%; height: 100%; }
.design-tab-panel .logo-btn svg { width: 22px; height: 22px; }

.sec-label {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--text3);
}

/* ── URL Input ── */
.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  background: #fff;
  border: 1.5px solid #E3E3E3;
  border-radius: 8px;
  transition: border-color var(--ease), box-shadow var(--ease);
}
.input-wrap:focus-within {
  background: #fff;
  border-color: var(--text);
  box-shadow: 0 0 0 3px rgba(0,0,0,.06);
}
.url-prefix {
  padding-left: 13px;
  font-family: var(--font);
  font-size: 13px;
  color: var(--text3);
  user-select: none;
}
.url-input {
  flex: 1; min-width: 0;
  padding: 11px 36px 11px 0;
  font-family: var(--font);
  font-size: 13px;
  color: var(--text);
  background: transparent;
  border: none;
  outline: none;
}
.url-input::placeholder { color: var(--text3); }
.clear-btn {
  position: absolute; right: 9px; top: 50%;
  transform: translateY(-50%);
  background: none; border: none; cursor: pointer;
  color: var(--text3); font-size: 11px;
  width: 22px; height: 22px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--ease);
}
.clear-btn:hover { background: var(--border); color: var(--text); }

/* ── Flash-empty-input feedback ───────────
   Triggered when the user clicks Download with no payload entered.
   Applied to either an .input-wrap (URL) or directly to a .field. */
@keyframes flash-error {
  0%   { border-color: var(--border); box-shadow: 0 0 0 0 rgba(239,68,68,0); }
  20%  { border-color: #ef4444;        box-shadow: 0 0 0 4px rgba(239,68,68,.22); }
  60%  { border-color: #ef4444;        box-shadow: 0 0 0 4px rgba(239,68,68,.22); }
  100% { border-color: var(--border); box-shadow: 0 0 0 0 rgba(239,68,68,0); }
}
.flash-error { animation: flash-error 700ms ease-in-out; }

/* ── Card chrome — shared by top-bar, editor and preview-box.
   Matches the Figma spec: 1px #E3E3E3 border, white bg, soft shadow.
   Each card has its own radius profile so the big 24px corners point
   outward to form a cohesive tray-shaped composition:
     top-bar         → big TL + TR  (rounded along the top edge)
     editor (left)   → big BL       (rounded along the bottom-left)
     preview (right) → big BR       (rounded along the bottom-right) */
.editor,
.preview-box {
  background: #ffffff;
  border: none;
  box-shadow: none;
}
.editor            { border-radius: 8px; }
.editor-data       { border-radius: 24px 8px 8px 24px; }
.editor-design     { border-radius: 8px; }
.preview-box       { border-radius: 8px 24px 24px 8px; }

/* ── Generic field input / textarea ── */
.field {
  width: 100%;
  padding: 11px 13px;
  font-family: var(--font); font-size: 13px; color: var(--text);
  background: #fff;
  border: 1.5px solid #E3E3E3;
  border-radius: 8px;
  outline: none;
  transition: border-color var(--ease), box-shadow var(--ease);
}
.field::placeholder { color: var(--text3); }
.field:focus {
  background: #fff;
  border-color: var(--text);
  box-shadow: 0 0 0 3px rgba(0,0,0,.06);
}
textarea.field {
  resize: vertical;
  min-height: 60px;
  line-height: 1.4;
}

.wifi-enc-group { grid-template-columns: 1fr 1fr 1fr; }

/* ── Social platform dropdown ── */
select.social-select {
  appearance: none; -webkit-appearance: none;
  cursor: pointer;
  padding-right: 36px;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8' fill='none' stroke='%236b6b65' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
  background-size: 11px;
}

/* ── Shape toggle ── */
.toggle-group { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.toggle {
  display: flex; align-items: center; justify-content: center;
  gap: 7px; height: 44px; padding: 0 14px;
  background: #fff;
  border: 1.5px solid #E3E3E3;
  border-radius: 10px;
  cursor: pointer;
  font-family: var(--font); font-size: 14px; font-weight: 500;
  color: var(--text);
  transition: border-color 160ms cubic-bezier(.4,0,.2,1);
}
.toggle:hover { border-color: #C8C8C2; }
.toggle.active {
  border-color: #1A1A1A;
  border-width: 2px;
}

/* SVG icons inside pattern / eye / border buttons fill their padded box */
.pattern-btn svg,
.eye-btn svg,
.border-btn svg { width: 100%; height: 100%; }

/* ── Circ inputs ── */
.field-stack { display: flex; flex-direction: column; gap: 7px; }
.circ-input {
  width: 100%; padding: 11px 13px;
  font-family: var(--font); font-size: 13px; color: var(--text);
  background: #fff;
  border: 1.5px solid #E3E3E3;
  border-radius: 8px;
  outline: none;
  transition: border-color var(--ease), box-shadow var(--ease);
}
.circ-input::placeholder { color: var(--text3); }
.circ-input:focus {
  border-color: var(--text); background: #fff;
  box-shadow: 0 0 0 3px rgba(0,0,0,.06);
}

/* ── Buttons ── */
.btn {
  display: flex; align-items: center; justify-content: center;
  gap: 8px; padding: 13px 20px;
  border-radius: var(--radius-s);
  font-family: var(--font); font-size: 13px; font-weight: 500;
  cursor: pointer;
  border: 1.5px solid var(--border);
  background: var(--panel); color: var(--text);
  transition: all var(--ease);
}
.btn:hover:not(:disabled) { background: var(--surface); border-color: var(--border2); }
.btn:active:not(:disabled) { transform: scale(.98); }
.btn.primary { background: var(--text); color: #fff; border-color: var(--text); }
.btn.primary:hover:not(:disabled) { background: #2a2a28; }
.btn:disabled { opacity: .35; cursor: not-allowed; }

/* ── Phone country picker ──────────────────────────────── */
.phone-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}
.country-picker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  height: 44px;
  background: #fff;
  border: 1.5px solid #E3E3E3;
  border-radius: 8px;
  cursor: pointer;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  flex-shrink: 0;
  transition: border-color 140ms cubic-bezier(.4,0,.2,1);
}
.country-picker:hover { border-color: #C8C8C2; }
.country-picker.is-open {
  border-color: #1A1A1A;
  border-width: 2px;
}
.country-picker.is-empty .country-dial { color: var(--text3); font-weight: 400; }
.country-picker .country-globe { color: var(--text3); flex-shrink: 0; display: none; }
.country-picker.is-empty .country-globe { display: inline-block; }
.country-picker.is-empty .country-flag  { display: none; }
.country-picker svg { color: var(--text3); flex-shrink: 0; }

/* Platform picker — same trigger style but full-width so it matches .field */
.platform-picker {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  height: 44px;
  padding: 0 12px;
  background: #fff;
  border: 1.5px solid #E3E3E3;
  border-radius: 8px;
  cursor: pointer;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 400;
  color: var(--text);
  text-align: left;
  transition: border-color 140ms cubic-bezier(.4,0,.2,1);
}
.platform-picker:hover { border-color: #C8C8C2; }
.platform-picker.is-open {
  border-color: #1A1A1A;
  border-width: 2px;
}
.platform-picker .platform-name { display: none; }
.platform-picker > svg { color: var(--text3); flex-shrink: 0; }
.platform-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  color: var(--text);
}
.platform-icon svg { width: 22px; height: 22px; }
.country-flag {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  flex-shrink: 0;
  object-fit: cover;
  display: block;
}

/* Floating popover with country search list — anchored under the picker */
.country-popover {
  position: fixed;
  z-index: 1100;
  width: 320px;
  max-height: 380px;
  background: #fff;
  border: 1px solid #E3E3E3;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.14);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.country-popover[hidden] { display: none; }
.country-search {
  margin: 8px 8px 6px;
  padding: 8px 10px;
  font-family: var(--font);
  font-size: 13px;
  color: var(--text);
  background: transparent;
  border: none;
  border-bottom: 1px solid #EEE;
  outline: none;
  border-radius: 0;
}
.country-search::placeholder { color: var(--text3); }
.country-list {
  flex: 1;
  overflow-y: auto;
  padding: 4px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.country-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  background: transparent;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  text-align: left;
  font-family: var(--font);
  font-size: 13px;
  color: var(--text);
}
.country-item:hover { background: #F4F4F4; }
.country-item .country-flag { width: 18px; height: 18px; }
.country-item .country-name { flex: 1; }
.country-item .country-dial {
  color: var(--text3);
  font-variant-numeric: tabular-nums;
}
.country-item .country-check {
  width: 14px;
  height: 14px;
  color: var(--text);
  opacity: 0;
  flex-shrink: 0;
}
.country-item.is-selected .country-check { opacity: 1; }
.country-empty {
  padding: 24px 12px;
  text-align: center;
  color: var(--text3);
  font-size: 13px;
}

/* ── Responsive ── */
/* Keep all three columns in one row down to laptop widths; only collapse to
   two columns on tablets and below. */
@media (max-width: 1024px) {
  .columns {
    grid-template-columns: 1fr 1fr;
    max-width: 880px;
  }
  /* Preview spans the full width below Data + Design */
  .preview-col { grid-column: 1 / -1; }
  .preview-box { aspect-ratio: 1; max-height: 520px; }
}
@media (max-width: 760px) {
  .columns {
    grid-template-columns: 1fr;
    max-width: 600px;
  }
  .preview-col { grid-column: auto; }
  .app { padding: 24px 16px 48px; }
  .editor-body { max-height: none; }
}
