:root {
  color-scheme: light;
  --bg: #fafafa;
  --surface: #ffffff;
  --surface-soft: #fafafa;
  --surface-strong: #f5f5f5;
  --ink: #171717;
  --body: #4d4d4d;
  --muted: #8f8f8f;
  --muted-soft: #8f8f8f;
  --line: #dcdcdc;
  --line-strong: #b8b8b8;
  --primary: #171717;
  --primary-active: #000000;
  --focus: #0070f3;
  --success: #1f8a65;
  --error: #ee0000;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: Geist, "Geist Sans", Inter, Aptos, "Segoe UI Variable", "Segoe UI", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: 400;
}

button,
textarea,
select {
  font: inherit;
}

.tabler-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 56px 0;
}

.hero {
  margin-bottom: 26px;
  text-align: center;
}

.brand-domain {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  margin: 0 0 14px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 600;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--primary);
  font-size: 0.72rem;
  font-family: "Geist Mono", "SFMono-Regular", Consolas, ui-monospace, monospace;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  max-width: 1120px;
  margin: 0 auto;
  font-size: 3.35rem;
  line-height: 1;
  font-weight: 600;
  letter-spacing: 0;
  white-space: nowrap;
}

h2 {
  font-size: 1.2rem;
  line-height: 1.2;
  font-weight: 600;
  letter-spacing: 0;
}

.seo-intro {
  width: min(760px, 100%);
  margin: 18px auto 0;
  color: var(--body);
  font-size: 1rem;
  line-height: 1.65;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(330px, 0.65fr);
  gap: 20px;
  align-items: start;
}

.panel {
  border: 1px solid #d1d1d1;
  border-radius: 12px;
  background: var(--surface);
  box-shadow: none;
}

.editor-panel {
  display: grid;
  gap: 8px;
  padding: 12px;
  overflow: hidden;
}

.field-group {
  display: grid;
  gap: 8px;
}

.field-description {
  max-width: 680px;
  margin: -2px 0 4px;
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.55;
}

label {
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 600;
}

textarea,
select {
  width: 100%;
  border: 1px solid #d2d2d2;
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  outline: none;
  transition: border-color 0.18s ease, background 0.18s ease;
}

textarea {
  min-height: 86px;
  resize: vertical;
  padding: 16px;
  line-height: 1.55;
}

textarea::placeholder {
  color: var(--muted-soft);
  opacity: 1;
}

select {
  min-height: 48px;
  margin-top: 8px;
  padding: 0 14px;
}

textarea:focus,
select:focus {
  border-color: var(--focus);
  box-shadow: 0 0 0 3px rgba(0, 112, 243, 0.12);
}

.toolbar {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding: 16px 22px 22px;
}

.settings-section {
  overflow: hidden;
  border: 1px solid #d0d0d0;
  border-radius: 10px;
  background: var(--surface);
}

.settings-header {
  display: grid;
  grid-template-columns: 40px 1fr auto;
  align-items: center;
  width: 100%;
  min-height: 58px;
  padding: 0 16px 0 12px;
  border: 0;
  background: var(--surface);
  color: var(--ink);
  text-align: left;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.16s ease;
}

.settings-header:hover {
  background: #fbfbfb;
}

.settings-icon {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border: 1px solid #b7b7b7;
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
}

.settings-icon .tabler-icon {
  width: 15px;
  height: 15px;
}

.settings-toggle {
  color: var(--muted);
  font-size: 1.15rem;
  font-weight: 500;
}

.settings-body {
  display: none;
  padding: 0 18px 20px;
  border-top: 1px solid var(--line);
}

.settings-section.is-open .settings-body {
  display: block;
}

.color-mode-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin: 18px 0 14px;
  color: var(--body);
  font-size: 0.86rem;
}

.color-mode-row label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: inherit;
  font-weight: 400;
}

.color-fields {
  display: grid;
  gap: 16px;
  max-width: 340px;
}

.color-input-wrap {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  width: min(100%, 210px);
  margin-top: 8px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.color-input-wrap input[type="color"] {
  width: 48px;
  height: 38px;
  padding: 0;
  border: 0;
  background: transparent;
}

.color-input-wrap input[type="text"] {
  min-width: 0;
  border: 0;
  padding: 0 12px;
  background: #ffffff;
  color: var(--body);
  font: inherit;
  outline: none;
  text-transform: uppercase;
}

.design-body {
  display: none;
  gap: 26px;
}

.settings-section.is-open .design-body {
  display: grid;
}

.design-group h3 {
  margin: 18px 0 10px;
  color: var(--body);
  font-size: 0.86rem;
  font-weight: 700;
}

.design-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(58px, 58px));
  gap: 10px;
}

.design-button {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: #000000;
  cursor: pointer;
  transition: border-color 0.16s ease, transform 0.16s ease, box-shadow 0.16s ease;
}

.design-button span {
  font-size: 1.95rem;
  line-height: 1;
}

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

.design-button.is-active {
  border-color: var(--primary);
  box-shadow: inset 0 0 0 1px var(--primary);
}

.color-control,
.shape-control {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
}

.color-row,
.shape-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

#qr-color {
  width: 48px;
  height: 48px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  cursor: pointer;
}

.color-swatch {
  width: 36px;
  height: 36px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--swatch);
  cursor: pointer;
  box-shadow: inset 0 0 0 3px var(--surface);
  transition: transform 0.18s ease, border-color 0.18s ease;
}

.color-swatch:hover {
  transform: translateY(-1px);
}

.color-swatch.is-active {
  border-color: var(--primary);
  box-shadow: inset 0 0 0 3px var(--surface), 0 0 0 2px rgba(23, 23, 23, 0.08);
}

.shape-button {
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.shape-button:hover {
  border-color: var(--line-strong);
}

.shape-button.is-active {
  border-color: var(--primary);
  background: var(--ink);
  color: var(--surface);
}

.section-head,
.preview-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.section-head {
  margin-bottom: 14px;
}

.style-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.style-card {
  position: relative;
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 128px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink);
  text-align: center;
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.style-card:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong);
}

.style-card.is-active {
  border-color: var(--primary);
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--primary);
}

.style-card.is-active::after {
  content: "";
  position: absolute;
  top: 10px;
  right: 10px;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--primary);
}

.style-thumb-wrap {
  display: grid;
  place-items: center;
  width: 100%;
  height: 104px;
  border-radius: 10px;
  background: transparent;
  overflow: hidden;
}

.style-thumb-wrap img {
  width: 88px;
  height: 88px;
  object-fit: contain;
}

.preview-panel {
  position: sticky;
  top: 22px;
  padding: 22px;
}

.status-pill {
  min-width: 72px;
  padding: 7px 10px;
  border-radius: 999px;
  background: var(--surface-strong);
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 600;
  text-align: center;
}

.qr-stage {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  margin: 20px 0;
  border: 0;
  border-radius: 8px;
  background: var(--surface);
}

.qr-stage img {
  width: min(98%, 460px);
  height: min(98%, 460px);
  object-fit: contain;
  transition: opacity 0.18s ease;
}

.qr-stage.is-empty img {
  opacity: 1;
}

.preview-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.download-button,
.copy-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: 100%;
  min-height: 54px;
  border: 0;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.download-button {
  background: var(--ink);
  color: var(--bg);
  box-shadow: none;
}

.download-button .tabler-icon,
.copy-button .tabler-icon {
  width: 19px;
  height: 19px;
  stroke-width: 1.9;
}

.copy-button {
  border: 1px solid #d0d0d0;
  background: var(--surface);
  color: var(--ink);
}

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

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

.copy-button:hover {
  border-color: var(--line-strong);
  box-shadow: none;
}

.download-button:disabled,
.copy-button:disabled {
  cursor: not-allowed;
  opacity: 1;
  transform: none;
}

.download-button:disabled {
  background: var(--surface-strong);
  color: var(--muted);
}

.copy-button:disabled {
  background: var(--surface-soft);
  color: var(--muted);
}

.seo-section {
  display: grid;
  grid-template-columns: 0.65fr 1.35fr;
  gap: 24px;
  margin-top: 28px;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}

.seo-copy {
  margin: 14px 0 0;
  color: var(--body);
  font-size: 0.94rem;
  line-height: 1.65;
}

.faq-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.faq-grid article {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}

.faq-grid h3 {
  margin: 0 0 9px;
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.3;
  font-weight: 600;
}

.faq-grid p {
  margin: 0;
  color: var(--muted);
  font-size: 0.93rem;
  line-height: 1.55;
}

@media (max-width: 940px) {
  .workspace,
  .seo-section {
    grid-template-columns: 1fr;
  }

  .preview-panel {
    position: static;
  }

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

  .faq-grid {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 2.85rem;
    white-space: normal;
  }
}

@media (max-width: 620px) {
  body {
    background: #f4f4f2;
  }

  body::before {
    content: "";
    display: block;
    height: 4px;
    background: var(--ink);
  }

  .shell {
    width: 100%;
    padding: 14px 10px 22px;
  }

  .hero {
    margin: 0 0 14px;
    text-align: left;
  }

  .brand-domain {
    margin-bottom: 10px;
  }

  h1 {
    font-size: 1.75rem;
    line-height: 1.05;
    white-space: normal;
  }

  .seo-intro {
    display: none;
  }

  .workspace {
    display: flex;
    flex-direction: column;
    gap: 0;
  }

  .panel {
    border-radius: 0;
  }

  .editor-panel,
  .preview-panel {
    padding: 0;
    border: 0;
    background: transparent;
  }

  .editor-panel {
    gap: 5px;
  }

  .settings-section {
    border-radius: 0;
    background: var(--surface);
  }

  .settings-header {
    grid-template-columns: 38px 1fr auto;
    min-height: 52px;
    padding: 0 14px 0 10px;
    font-size: 0.88rem;
  }

  .settings-icon {
    width: 28px;
    height: 28px;
    border-radius: 7px;
  }

  .settings-body {
    padding: 12px 12px 16px;
  }

  textarea {
    min-height: 58px;
    padding: 14px;
    resize: none;
  }

  .color-mode-row {
    gap: 12px;
    margin: 4px 0 14px;
  }

  .color-fields {
    max-width: none;
  }

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

  .design-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
  }

  .design-button {
    width: 100%;
    height: 52px;
  }

  .design-button span {
    font-size: 1.65rem;
  }

  .toolbar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding: 12px 0 18px;
  }

  .style-grid {
    grid-template-columns: 1fr;
  }

  .toolbar label {
    font-size: 0.82rem;
  }

  select {
    min-height: 44px;
    margin-top: 6px;
    padding: 0 10px;
  }

  .preview-panel {
    margin-top: 10px;
  }

  .preview-topline {
    display: none;
  }

  .qr-stage {
    width: 100%;
    max-width: 390px;
    margin: 10px auto 18px;
    background: transparent;
  }

  .qr-stage img {
    width: min(94vw, 380px);
    height: min(94vw, 380px);
  }

  .preview-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding: 0 0 6px;
  }

  .download-button,
  .copy-button {
    min-height: 50px;
    padding: 0 12px;
    font-size: 0.86rem;
  }

  .seo-section {
    margin-top: 22px;
    padding: 16px;
    border-radius: 0;
  }

  .style-card {
    min-height: 112px;
    text-align: center;
  }

  .style-thumb-wrap {
    height: 82px;
  }

  .style-thumb-wrap img {
    width: 62px;
    height: 62px;
  }
}
