:root {
  --accent: #0d9488;
  --accent-hover: #0f766e;
  --border: #e2e8f0;
  --muted: #64748b;
  --text: #0f172a;
  color: var(--text);
  background: #f8fafc;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  font-synthesis: none;
  line-height: 1.5;
  text-rendering: optimizeLegibility;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background: #f8fafc;
}

button,
select,
textarea {
  font: inherit;
}

.shell {
  width: min(100% - 32px, 1060px);
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid var(--border);
  background: #ffffff;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 69px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 700;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 7px;
  color: #ffffff;
  background: var(--accent);
  font-size: 0.68rem;
  font-weight: 700;
}

.nav {
  display: flex;
  gap: 15px;
  margin-left: auto;
}

.nav a {
  color: #334155;
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
}

.nav a:hover {
  color: var(--accent);
}

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

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

.page {
  display: grid;
  gap: 24px;
  padding: 26px 0 48px;
}

.content-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  align-items: start;
  gap: 30px;
}

.main-column {
  display: grid;
  gap: 36px;
}

.content-card {
  padding-top: 8px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 18px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.eyebrow::before {
  width: 10px;
  height: 10px;
  border-radius: 4px;
  background: var(--accent);
  content: "";
}

.language-field {
  position: relative;
  display: inline-grid;
  min-width: 128px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
}

.language-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  min-height: 30px;
  cursor: pointer;
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 5px 9px;
  color: #334155;
  background: #ffffff;
  box-shadow: none;
  font-weight: 600;
  outline: none;
  text-align: left;
}

.language-button::after {
  color: #94a3b8;
  font-size: 0.62rem;
  content: "▼";
}

.language-button:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgb(13 148 136 / 0.1);
}

.language-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 100;
  display: none;
  width: max(100%, 190px);
  max-height: 280px;
  overflow-y: auto;
  border: 1px solid #d7e1ec;
  border-radius: 10px;
  padding: 5px;
  background: #ffffff;
  box-shadow: 0 14px 34px rgb(15 23 42 / 0.14);
}

.language-menu.is-open {
  display: grid;
  gap: 2px;
}

.language-option {
  width: 100%;
  border: 0;
  cursor: pointer;
  border-radius: 8px;
  padding: 8px 9px;
  color: #334155;
  background: transparent;
  font-size: 0.84rem;
  font-weight: 700;
  text-align: left;
  white-space: nowrap;
}

.language-option:hover,
.language-option.is-selected {
  color: var(--accent-hover);
  background: rgb(13 148 136 / 0.08);
}

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

h1 {
  max-width: 620px;
  margin-bottom: 10px;
  font-size: clamp(2.1rem, 5vw, 3rem);
  line-height: 1.06;
  letter-spacing: -0.04em;
}

h2 {
  margin-bottom: 14px;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
}

.description,
.content-card p {
  color: var(--muted);
}

.description {
  max-width: 640px;
  margin-bottom: 18px;
}

.tool-panel {
  display: grid;
  gap: 16px;
  margin-top: 24px;
  border: 2px dashed #cbd5e1;
  border-radius: 18px;
  padding: 26px;
  background: rgb(255 255 255 / 0.72);
}

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

.field {
  display: grid;
  gap: 8px;
  color: #334155;
  font-weight: 700;
}

textarea {
  width: 100%;
  min-height: 108px;
  resize: vertical;
  border: 1px solid #cbd5e1;
  border-radius: 16px;
  padding: 14px 16px;
  color: var(--text);
  background: #ffffff;
  outline: none;
}

textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgb(13 148 136 / 0.12);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 0;
}

.actions button {
  cursor: pointer;
  border: 0;
  border-radius: 999px;
  padding: 12px 20px;
  color: #ffffff;
  background: var(--accent);
  font-weight: 800;
}

.actions button:hover:not(:disabled) {
  background: var(--accent-hover);
}

.actions button:disabled {
  cursor: not-allowed;
  background: #9ca3af;
}

.message {
  min-height: 24px;
  margin: 0;
  color: var(--muted);
}

.preview {
  display: grid;
  position: relative;
  min-height: 220px;
  place-items: center;
  overflow: hidden;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  background: #f8fafc;
}

.preview > * {
  grid-area: 1 / 1;
}

.preview-hint {
  margin: 0;
  color: #94a3b8;
  font-weight: 700;
  text-align: center;
}

canvas {
  width: 256px;
  height: 256px;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.preview.has-qr .preview-hint {
  display: none;
}

.preview.has-qr canvas {
  opacity: 1;
}

.ad-banner {
  overflow: hidden;
}

.ad-banner-top {
  width: 100%;
}

.ad-banner-below-header {
  width: 100%;
  text-align: center;
}

.ad-banner-sidebar {
  position: sticky;
  top: 92px;
}

.site-footer {
  border-top: 1px solid var(--border);
  background: rgb(255 255 255 / 0.72);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.footer-inner p {
  margin: 0;
}



.footer-links a,
.legal-card a {
  color: var(--accent-hover);
  font-weight: 700;
  text-decoration: none;
}

.footer-links a:hover,
.legal-card a:hover {
  text-decoration: underline;
}

.legal-page {
  min-height: calc(100vh - 142px);
}

.legal-card {
  max-width: 760px;
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 32px;
  background: #ffffff;
}

.legal-card h1 {
  font-size: clamp(2rem, 5vw, 2.6rem);
}

.legal-card h2 {
  margin-top: 28px;
}

.logo-field {
  display: grid;
  gap: 8px;
  color: #334155;
  font-size: 0.88rem;
  font-weight: 700;
}

.logo-field-label {
  display: block;
}

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

#logo-input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.logo-upload-btn {
  cursor: pointer;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 7px 16px;
  color: #334155;
  background: #ffffff;
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
  user-select: none;
  transition: border-color 0.15s, color 0.15s;
}

.logo-upload-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.logo-name {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 200px;
}

.logo-clear-btn {
  cursor: pointer;
  border: 0;
  border-radius: 999px;
  padding: 4px 9px;
  color: var(--muted);
  background: #e2e8f0;
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1;
  flex-shrink: 0;
}

.logo-clear-btn:hover {
  background: #cbd5e1;
  color: var(--text);
}

@media (max-width: 860px) {
  .header-inner {
    flex-wrap: wrap;
    gap: 12px;
    padding: 12px 0;
  }

  .nav {
    order: 3;
    width: 100%;
    margin-left: 0;
  }

  .header-actions {
    margin-left: auto;
  }

  .content-layout {
    grid-template-columns: 1fr;
  }

  .ad-banner-sidebar {
    position: static;
    min-height: 96px;
    order: -1;
  }
}

@media (max-width: 640px) {
  .shell {
    width: min(100% - 24px, 1040px);
  }

  .page {
    padding-top: 16px;
  }

  .content-card {
    padding-top: 0;
  }

  .brand {
    font-size: 0.95rem;
  }

  .language-field {
    min-width: 142px;
  }

  .language-button {
    min-height: 32px;
    padding: 6px 9px;
    font-size: 0.78rem;
  }

  .language-menu {
    width: min(220px, calc(100vw - 24px));
    max-height: 240px;
  }

  .language-option {
    padding: 7px 9px;
    font-size: 0.78rem;
  }

  h1 {
    font-size: 2.15rem;
  }

  .tool-panel {
    padding: 18px;
  }

  .actions {
    display: grid;
  }

  .actions button {
    width: 100%;
  }

  .preview {
    min-height: 220px;
  }

  canvas {
    width: min(100%, 220px);
    height: auto;
  }
}
