/* =========================================================
   ChrysoKit - QR Code Generator
   Tool stylesheet - matches the main site design system exactly.
   Imports: Inter (rsms.me), Lucide icons (unpkg).
   ========================================================= */

/* ── CSS Variables (mirrors main site exactly) ────────────── */
:root {
  --primary:        #D4A373;
  --primary-dark:   #B8895E;
  --primary-darker: #8F6A44;
  --secondary-bg:   #FAEDCD;
  --page-bg:        #FEFAE0;
  --text:           #2C2C2C;
  --text-muted:     #6B6B6B;
  --text-subtle:    #9A9A9A;
  --success:        #CCD5AE;
  --success-dark:   #A8B288;
  --border:         #E9E9E9;
  --border-warm:    #E8DFCA;
  --white:          #FFFFFF;
  --danger:         #C97B63;
  --warning:        #E0A458;

  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius:    10px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --radius-xl: 24px;

  --shadow-xs:    0 1px 2px rgba(60,42,24,.04);
  --shadow-sm:    0 1px 3px rgba(60,42,24,.06), 0 1px 2px rgba(60,42,24,.04);
  --shadow:       0 4px 10px rgba(60,42,24,.06), 0 2px 4px rgba(60,42,24,.04);
  --shadow-md:    0 8px 20px rgba(60,42,24,.08), 0 4px 8px rgba(60,42,24,.04);
  --shadow-lg:    0 16px 36px rgba(60,42,24,.10), 0 6px 12px rgba(60,42,24,.05);
  --shadow-focus: 0 0 0 3px rgba(212,163,115,.28);

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Monaco, Consolas, monospace;

  --ease:    cubic-bezier(0.2,0.8,0.2,1);
  --t-fast:  140ms var(--ease);
  --t:       220ms var(--ease);
  --t-slow:  380ms var(--ease);

  --container: 1200px;
  --header-h:  68px;
}

/* ── Dark theme (mirrors dark-theme.css) ──────────────────── */
html[data-theme="dark"] {
  --primary:        #E0B88A;
  --primary-dark:   #D4A373;
  --primary-darker: #F0CFA3;
  --secondary-bg:   #2B2520;
  --page-bg:        #1A1714;
  --text:           #F2EAD8;
  --text-muted:     #B5AC9A;
  --text-subtle:    #7E7668;
  --success:        #A8B288;
  --success-dark:   #B9C49A;
  --border:         #35302A;
  --border-warm:    #3A342D;
  --white:          #24201C;
  --danger:         #D98E75;
  --warning:        #E8B36A;
  --shadow-xs:      0 1px 2px rgba(0,0,0,.35);
  --shadow-sm:      0 1px 3px rgba(0,0,0,.4),  0 1px 2px rgba(0,0,0,.3);
  --shadow:         0 4px 10px rgba(0,0,0,.45), 0 2px 4px rgba(0,0,0,.3);
  --shadow-md:      0 8px 20px rgba(0,0,0,.5),  0 4px 8px rgba(0,0,0,.35);
  --shadow-lg:      0 16px 36px rgba(0,0,0,.55),0 6px 12px rgba(0,0,0,.4);
  --shadow-focus:   0 0 0 3px rgba(224,184,138,.35);
}

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

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

body {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background-color: var(--page-bg);
  background-image:
    radial-gradient(1200px 600px at 90% -10%, rgba(212,163,115,.10), transparent 60%),
    radial-gradient(900px 500px at -10% 10%,  rgba(204,213,174,.14), transparent 60%);
  background-attachment: fixed;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "cv11","ss01","ss03";
}

html[data-theme="dark"] body {
  background-image:
    radial-gradient(1200px 600px at 90% -10%, rgba(212,163,115,.10), transparent 60%),
    radial-gradient(900px 500px at -10% 10%,  rgba(168,178,136,.08), transparent 60%);
}

img, svg { display: block; max-width: 100%; }
a { color: var(--primary-darker); text-decoration: none; transition: color var(--t-fast); }
a:hover { color: var(--text); }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea, select { font-family: inherit; font-size: inherit; color: inherit; }

::selection { background: var(--primary); color: var(--white); }

h1,h2,h3,h4 { font-weight: 700; line-height: 1.2; color: var(--text); letter-spacing: -.015em; }
h1 { font-size: clamp(1.75rem,3.5vw,2.5rem); letter-spacing: -.025em; }
h2 { font-size: clamp(1.25rem,2.5vw,1.75rem); letter-spacing: -.02em; }
h3 { font-size: 1.1rem; }

:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: var(--radius-xs); }
button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible { outline: none; box-shadow: var(--shadow-focus); }

/* ── Layout ───────────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 28px;
}
main { flex: 1; }

/* ── Header ───────────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background-color: rgba(254,250,224,.82);
  backdrop-filter: saturate(160%) blur(12px);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--border-warm);
}
html[data-theme="dark"] .site-header {
  background-color: rgba(26,23,20,.82);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-h);
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -.02em;
}
.logo:hover { color: var(--primary-darker); }
.logo-mark {
  width: 32px; height: 32px;
  background: var(--primary);
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--page-bg);
  font-weight: 800;
  font-size: 1rem;
  box-shadow: inset 0 -2px 0 rgba(0,0,0,.08), var(--shadow-xs);
}
html[data-theme="dark"] .logo-mark { color: var(--page-bg); }
.logo-text span { color: var(--primary-darker); }

.main-nav {
  display: flex;
  align-items: center;
  gap: 28px;
}
.main-nav a {
  color: var(--text);
  font-weight: 500;
  font-size: .95rem;
  position: relative;
  padding: 4px 0;
}
.main-nav a::after {
  content: "";
  position: absolute;
  left: 0; right: 100%;
  bottom: -2px;
  height: 2px;
  background: var(--primary);
  border-radius: 2px;
  transition: right var(--t);
}
.main-nav a:hover { color: var(--primary-darker); }
.main-nav a:hover::after { right: 0; }

.header-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 6px;
}

.icon-btn {
  width: 40px; height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: var(--text);
  border: 1px solid transparent;
  border-radius: var(--radius);
  transition: background var(--t), border-color var(--t), color var(--t);
}
.icon-btn:hover { background: var(--secondary-bg); border-color: var(--border-warm); color: var(--primary-darker); }
.icon-btn svg { width: 18px; height: 18px; }

/* Theme toggle moon/sun */
.theme-toggle .sun { display: none; }
.theme-toggle .moon { display: block; }
html[data-theme="dark"] .theme-toggle .sun  { display: block; }
html[data-theme="dark"] .theme-toggle .moon { display: none;  }

/* Hamburger */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 10px;
  border-radius: var(--radius-sm);
}
.nav-toggle span {
  display: block;
  width: 22px; height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform var(--t), opacity var(--t);
}
.nav-toggle.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.active span:nth-child(2) { opacity: 0; }
.nav-toggle.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── Skip link ────────────────────────────────────────────── */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 12px;
  background: var(--primary);
  color: var(--white);
  padding: 10px 18px;
  border-radius: var(--radius);
  font-weight: 600;
  z-index: 200;
  box-shadow: var(--shadow-md);
}
.skip-link:focus { left: 16px; color: var(--white); }

/* ── Breadcrumb ───────────────────────────────────────────── */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  font-size: .88rem;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--primary-darker); }
.breadcrumb svg { width: 14px; height: 14px; }

/* ── Tool page wrapper ────────────────────────────────────── */
.tool-page { padding: 40px 0 72px; }

/* ── Tool header ──────────────────────────────────────────── */
.tool-header {
  display: flex;
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 36px;
}
.tool-icon {
  width: 60px; height: 60px;
  background: var(--secondary-bg);
  border: 1px solid var(--border-warm);
  border-radius: var(--radius-md);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-darker);
  flex-shrink: 0;
}
.tool-icon svg { width: 28px; height: 28px; }
.tool-header-text h1 { margin-bottom: 8px; }
.tool-header-text p {
  color: var(--text-muted);
  font-size: .97rem;
  max-width: 580px;
}

/* ── Buttons ──────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: .95rem;
  line-height: 1;
  transition: background-color var(--t), color var(--t), transform var(--t-fast), box-shadow var(--t);
  border: 1px solid transparent;
  white-space: nowrap;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: translateY(1px); }
.btn svg { width: 16px; height: 16px; }

.btn-primary {
  background: var(--primary);
  color: var(--white);
  box-shadow: var(--shadow-xs), inset 0 -1px 0 rgba(0,0,0,.08);
}
.btn-primary:hover {
  background: var(--primary-dark);
  color: var(--white);
  box-shadow: var(--shadow), inset 0 -1px 0 rgba(0,0,0,.08);
  transform: translateY(-1px);
}
.btn-primary:active { transform: translateY(0); }
html[data-theme="dark"] .btn-primary         { color: #1A1714; }
html[data-theme="dark"] .btn-primary:hover   { color: #1A1714; }

.btn-secondary {
  background: var(--white);
  color: var(--text);
  border-color: var(--border-warm);
}
.btn-secondary:hover { background: var(--secondary-bg); border-color: var(--primary); color: var(--text); }

.btn:disabled { opacity: .45; cursor: not-allowed; transform: none !important; box-shadow: none; }
.btn-block { width: 100%; }

/* ── Form fields ──────────────────────────────────────────── */
.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.field label {
  font-weight: 600;
  font-size: .85rem;
  color: var(--text);
  letter-spacing: -.005em;
}

.field input[type="text"],
.field input[type="number"],
.field input[type="email"],
.field input[type="url"],
.field input[type="tel"],
.field input[type="password"],
.field textarea,
.field select {
  width: 100%;
  padding: 10px 13px;
  border: 1px solid var(--border-warm);
  border-radius: var(--radius);
  background: var(--white);
  color: var(--text);
  transition: border-color var(--t), box-shadow var(--t);
  outline: none;
  font-size: .95rem;
}
.field textarea { min-height: 100px; resize: vertical; line-height: 1.6; }
.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: var(--primary);
  box-shadow: var(--shadow-focus);
}

.char-count {
  font-size: .78rem;
  color: var(--text-subtle);
  text-align: right;
  margin-top: -3px;
}

/* ── Tabs ─────────────────────────────────────────────────── */
.tab-bar {
  display: flex;
  gap: 4px;
  background: var(--page-bg);
  border: 1px solid var(--border-warm);
  padding: 4px;
  border-radius: var(--radius);
  overflow-x: auto;
}
.tab {
  flex: 1;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  font-weight: 500;
  font-size: .875rem;
  color: var(--text-muted);
  transition: background var(--t), color var(--t);
  white-space: nowrap;
  border: none;
  background: none;
  cursor: pointer;
}
.tab:hover { color: var(--text); }
.tab.active {
  background: var(--white);
  color: var(--text);
  box-shadow: var(--shadow-xs);
}

/* ── QR Tool Card (two-pane layout) ───────────────────────── */
.qr-tool-card {
  background: var(--white);
  border: 1px solid var(--border-warm);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  display: grid;
  grid-template-columns: 1fr 320px;
  overflow: hidden;
  margin-bottom: 48px;
}

.controls-pane {
  padding: 32px;
  border-right: 1px solid var(--border-warm);
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.preview-pane {
  padding: 32px 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  background: var(--page-bg);
}

/* ── Tab panels ───────────────────────────────────────────── */
.tab-panels { flex: 1; }
.tab-panel { display: none; animation: fadeIn var(--t-slow); }
.tab-panel.active { display: block; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Field grid (contact / wifi forms) ────────────────────── */
.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.field--full { grid-column: 1 / -1; }
.field--center { align-self: end; }

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: .88rem;
  font-weight: 500;
  cursor: pointer;
  padding: 10px 0;
  color: var(--text);
}
.checkbox-label input[type="checkbox"] {
  width: 17px; height: 17px;
  accent-color: var(--primary);
  cursor: pointer;
  flex-shrink: 0;
}

/* ── Options row ──────────────────────────────────────────── */
.options-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

/* ── Color pickers ────────────────────────────────────────── */
.color-wrap {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 12px;
  border: 1px solid var(--border-warm);
  border-radius: var(--radius);
  background: var(--white);
  transition: border-color var(--t), box-shadow var(--t);
}
.color-wrap:focus-within {
  border-color: var(--primary);
  box-shadow: var(--shadow-focus);
}
.color-wrap input[type="color"] {
  width: 28px; height: 28px;
  border: none;
  padding: 0;
  border-radius: var(--radius-sm);
  cursor: pointer;
  background: none;
  flex-shrink: 0;
}
.hex-input {
  border: none !important;
  background: none !important;
  padding: 0 !important;
  box-shadow: none !important;
  font-size: .85rem !important;
  font-family: var(--font-mono) !important;
  color: var(--text);
  width: 76px;
  letter-spacing: .03em;
}
.hex-input:focus { outline: none; }

/* ── Format toggle ────────────────────────────────────────── */
.format-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.format-label {
  font-size: .85rem;
  font-weight: 600;
  color: var(--text);
}
.toggle-group {
  display: flex;
  gap: 3px;
  background: var(--page-bg);
  border: 1px solid var(--border-warm);
  padding: 3px;
  border-radius: var(--radius-sm);
}
.fmt-btn {
  padding: 6px 18px;
  border-radius: var(--radius-xs);
  border: none;
  background: none;
  color: var(--text-muted);
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--t), color var(--t), box-shadow var(--t);
}
.fmt-btn:hover { color: var(--text); }
.fmt-btn.active {
  background: var(--white);
  color: var(--text);
  box-shadow: var(--shadow-xs);
}

/* ── QR Preview frame ─────────────────────────────────────── */
.qr-frame {
  width: 100%;
  max-width: 256px;
  aspect-ratio: 1;
  background: var(--white);
  border: 1px solid var(--border-warm);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: box-shadow var(--t), border-color var(--t);
}
.qr-frame.has-qr {
  box-shadow: var(--shadow-md);
  border-color: var(--primary);
}

.qr-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  color: var(--text-subtle);
  font-size: .88rem;
  text-align: center;
  padding: 24px;
  line-height: 1.5;
}
.qr-empty svg { opacity: .35; }

#qrCanvas {
  display: none;        /* hidden by default; JS sets display:block to reveal */
  width: 100% !important;
  height: auto !important;
}
.qr-svg-wrap {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.qr-svg-wrap svg { width: 100%; height: auto; display: block; }

/* ── Action buttons ───────────────────────────────────────── */
.action-row {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  max-width: 256px;
}

/* ── Privacy note ─────────────────────────────────────────── */
.privacy-note {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .78rem;
  color: var(--text-subtle);
  text-align: center;
}
.privacy-note svg { flex-shrink: 0; color: var(--success-dark); }

/* ── Tips section ─────────────────────────────────────────── */
.tips { margin-top: 0; margin-bottom: 12px; }
.tips h2 { margin-bottom: 20px; }

.tips-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}
.tip {
  background: var(--white);
  border: 1px solid var(--border-warm);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  display: flex;
  gap: 14px;
  align-items: flex-start;
  font-size: .9rem;
  color: var(--text-muted);
  line-height: 1.55;
  transition: transform var(--t-fast), box-shadow var(--t-fast);
}
.tip:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.tip strong { color: var(--text); }
.tip em { color: var(--primary-darker); font-style: normal; font-weight: 600; }
.tip-icon { font-size: 22px; flex-shrink: 0; margin-top: 1px; }

/* ── Footer ───────────────────────────────────────────────── */
.site-footer {
  background: var(--secondary-bg);
  border-top: 1px solid var(--border-warm);
  padding: 32px 0;
  margin-top: auto;
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  font-size: .9rem;
  color: var(--text-muted);
}
.footer-nav { display: flex; gap: 22px; flex-wrap: wrap; }
.footer-nav a { color: var(--text-muted); }
.footer-nav a:hover { color: var(--primary-darker); }

.social-links {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.social-links a {
  width: 36px; height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  transition: background var(--t), color var(--t);
}
.social-links a:hover { color: var(--primary-darker); background: rgba(212,163,115,.1); }
.social-links a svg { width: 18px; height: 18px; }

/* ── Toast ────────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(24px);
  background: var(--text);
  color: var(--page-bg);
  padding: 11px 20px;
  border-radius: var(--radius);
  font-size: .9rem;
  font-weight: 500;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--t), transform var(--t);
  z-index: 100;
  box-shadow: var(--shadow-lg);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
html[data-theme="dark"] .toast { background: var(--secondary-bg); color: var(--text); border: 1px solid var(--border-warm); }

/* ── Back to top ──────────────────────────────────────────── */
.back-to-top {
  position: fixed;
  right: 22px; bottom: 22px;
  width: 44px; height: 44px;
  background: var(--primary);
  color: var(--white);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity var(--t), transform var(--t), background var(--t);
  z-index: 60;
}
.back-to-top.show { opacity: 1; transform: translateY(0); pointer-events: auto; }
.back-to-top:hover { background: var(--primary-dark); }
.back-to-top svg { width: 20px; height: 20px; }
html[data-theme="dark"] .back-to-top { color: var(--page-bg); }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 900px) {
  .qr-tool-card {
    grid-template-columns: 1fr;
  }
  .controls-pane {
    border-right: none;
    border-bottom: 1px solid var(--border-warm);
  }
  .preview-pane {
    padding: 28px;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 24px;
  }
  .action-row { max-width: 260px; }
}

@media (max-width: 768px) {
  .container { padding: 0 20px; }
  .nav-toggle { display: flex; }
  .header-actions { margin-left: auto; margin-right: 8px; }
  .main-nav {
    position: absolute;
    top: var(--header-h);
    left: 0; right: 0;
    background: var(--page-bg);
    border-bottom: 1px solid var(--border-warm);
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 8px 0;
    display: none;
    box-shadow: var(--shadow);
    z-index: 50;
  }
  .main-nav.open { display: flex; }
  .main-nav a { padding: 14px 24px; border-radius: 0; }
  .main-nav a::after { display: none; }

  .tool-header { flex-direction: column; gap: 12px; }
  .field-grid { grid-template-columns: 1fr; }
  .field--full { grid-column: auto; }
  .options-row { grid-template-columns: 1fr; }
  .footer-inner { justify-content: center; text-align: center; }
}

@media (max-width: 480px) {
  .qr-tool-card { border-radius: var(--radius-lg); }
  .controls-pane { padding: 22px 18px; }
  .preview-pane { padding: 22px 18px; }
  .tab { font-size: .78rem; padding: 8px 6px; }
}

/* ── Reduced motion ───────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}


/* =================================================================
   MOBILE FIXES (additive only, desktop untouched)
   v=20260509f
   ================================================================= */

/* Prevent iOS zoom on focus */
@media (max-width: 768px) {
  input, textarea, select { font-size: 16px !important; }
  html, body { overflow-x: hidden; }
}

/* Header */
@media (max-width: 768px) {
  :root { --header-h: 60px; }
  .logo { font-size: 1.1rem; gap: 8px; }
  .logo-mark { width: 28px; height: 28px; font-size: 0.9rem; border-radius: 7px; }
  .header-actions { gap: 4px; margin-left: auto; margin-right: 8px; }
  .header-actions .icon-btn { width: 40px; height: 40px; }
  .nav-toggle { padding: 10px; min-width: 44px; min-height: 44px; }
}

/* Tool page: tighter padding */
@media (max-width: 768px) {
  .tool-page { padding: 22px 0 48px; }
  .breadcrumb { font-size: 0.82rem; margin-bottom: 12px; }
  .tool-header { margin-bottom: 22px; padding: 0 4px; }
  .tool-header h1 { font-size: 1.55rem; }
  .tool-header p { font-size: 0.92rem; line-height: 1.5; }
  .qr-tool-card { border-radius: 14px; }
  .controls-pane { padding: 22px 18px; }
  .preview-pane { padding: 22px 18px; }
  .how-to { padding: 20px 18px; border-radius: 14px; }
}
@media (max-width: 480px) {
  .tool-page { padding: 18px 0 36px; }
  .controls-pane { padding: 18px 14px; }
  .preview-pane { padding: 18px 14px; }
}

/* Forms */
@media (max-width: 768px) {
  .field { margin-bottom: 16px; gap: 6px; }
  .field input, .field textarea, .field select {
    padding: 13px 14px;
    border-radius: 10px;
  }
  .field textarea { min-height: 140px; }
  .field-grid { gap: 12px; }
  .options-row { gap: 12px; }
}

/* Tabs */
@media (max-width: 768px) {
  .tabs { padding: 3px; gap: 2px; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .tabs::-webkit-scrollbar { display: none; }
  .tab { padding: 11px 12px; min-height: 40px; font-size: 0.85rem; }
}
@media (max-width: 480px) {
  .tab { font-size: 0.8rem; padding: 10px 8px; }
}

/* Buttons */
@media (max-width: 768px) {
  .btn { min-height: 44px; padding: 12px 18px; font-size: 0.95rem; }
  .btn-icon { min-width: 44px; min-height: 44px; padding: 10px; }
  .button-row { gap: 8px; }
  .action-row .btn { width: 100%; min-height: 46px; }
}

/* Range slider */
@media (max-width: 768px) {
  input[type="range"] { height: 8px; }
  input[type="range"]::-webkit-slider-thumb { width: 26px; height: 26px; }
  input[type="range"]::-moz-range-thumb { width: 26px; height: 26px; }
}

/* QR preview: keep canvas/img responsive */
@media (max-width: 540px) {
  #qrcode img, #qrcode canvas, .qr-preview img, .qr-preview canvas {
    max-width: 100%;
    height: auto !important;
    padding: 10px;
  }
  .preview-pane { flex-direction: column; gap: 18px; }
}

/* Footer */
@media (max-width: 480px) {
  .site-footer { padding: 22px 0; }
  .footer-inner { gap: 10px; font-size: 0.82rem; flex-direction: column; }
  .footer-nav { gap: 14px 18px; justify-content: center; }
}

/* Toast & back-to-top */
@media (max-width: 768px) {
  .toast {
    bottom: max(80px, calc(env(safe-area-inset-bottom, 0px) + 70px));
    left: 16px; right: 16px;
    transform: translate(0, 24px);
    text-align: center; justify-content: center;
    border-radius: 12px;
  }
  .toast.show { transform: translate(0, 0); }
  .back-to-top {
    right: 14px;
    bottom: max(14px, calc(env(safe-area-inset-bottom, 0px) + 14px));
    width: 44px; height: 44px;
  }
}

/* Cookie banner */
@media (max-width: 480px) {
  #ck-consent { left: 10px; right: 10px; bottom: 10px; }
  .ck-consent__panel { padding: 14px; gap: 12px; flex-direction: column; align-items: stretch; }
  .ck-consent__body { font-size: 0.88rem; }
  .ck-consent__actions { width: 100%; gap: 8px; }
  .ck-consent__btn { flex: 1 1 0; min-height: 44px; font-size: 0.88rem; }
}

/* Hover lift off on touch */
@media (hover: none) {
  .btn:hover { transform: none; }
}

/* Smallest phones */
@media (max-width: 380px) {
  .container { padding: 0 14px; }
  .tool-header h1 { font-size: 1.4rem; }
}
