/* ---- Base tokens ---- */
:root {
  --bg: #ffffff;
  --card: #ffffff;
  --text: #111111;
  --muted: #666666;
  --border: #e6e6e6;
  --primary: #111111;
  --accent: #0b72ff;
  --shadow: 0 10px 30px rgba(0,0,0,.06);
}

/* Dark theme overrides */
:root[data-theme="dark"] {
  --bg: #0f1117;
  --card: #141822;
  --text: #f3f5f8;
  --muted: #a7adbb;
  --border: #242b3a;
  --primary: #f3f5f8;
  --accent: #5aa7ff;
  --shadow: 0 10px 30px rgba(0,0,0,.35);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { color-scheme: dark; }
}

/* ---- Global ---- */
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
}
.wrap { max-width: 1100px; margin: 0 auto; padding: 0 16px; }

/* ---- Header ---- */
.site-header { position: sticky; top:0; z-index: 100; background: var(--bg); border-bottom: 1px solid var(--border); }
.header-row { display:flex; align-items:center; justify-content:space-between; gap:12px; padding: 14px 0; }
.brand { font-weight: 900; font-size: 1.25rem; color: var(--text); text-decoration: none; }
.theme-toggle { border:1px solid var(--border); background: var(--card); color: var(--text); padding:8px 10px; border-radius:10px; cursor:pointer; }

.nav { display:flex; gap:14px; margin-left:auto; }
.nav a { color: var(--text); text-decoration: none; opacity:.85; font-weight:600; }
.nav a.active, .nav a:hover { opacity:1; text-decoration: underline; }

.menu-toggle { display:none; background:transparent; border:none; font-size:1.7rem; color:var(--text); cursor:pointer; }

/* Mobile header */
@media (max-width: 768px){
  .header-row { flex-wrap: wrap; padding:12px 8px; }
  .menu-toggle { display:block; }
  .nav { display:none; flex-direction:column; width:100%; background:var(--card); border-radius:10px; margin-top:10px; box-shadow: var(--shadow); }
  .nav.show { display:flex; }
  .nav a { display:block; padding:12px 0; text-align:center; border-top:1px solid var(--border); }
  .nav a:first-child { border-top:none; }
  .theme-toggle { order:3; margin-left:auto; }
}

/* ---- Hero ---- */
.hero { padding: 18px 0 8px; }
.hero h1 { font-size: clamp(1.6rem, 4.5vw, 2.2rem); margin:6px 0; }
.hero p { color: var(--muted); margin: 0; }

/* ---- Grid ---- */
.grid { display:grid; gap:16px; grid-template-columns: 1fr 1fr; align-items:start; }
@media (max-width: 900px){ .grid { grid-template-columns:1fr; } }

/* ---- Cards & form ---- */
.card { background:var(--card); border:1px solid var(--border); border-radius:12px; padding:14px; box-shadow: var(--shadow); }
.muted { color:var(--muted); }
label { font-weight:700; display:block; margin:12px 0 6px; font-size:.95rem; }

input[type="text"], input[type="number"], textarea, select {
  width:100%; padding:10px 12px; border:1px solid var(--border); border-radius:10px; background:transparent; color:var(--text); font-size:15px;
}
textarea { resize:vertical; }
.row { display:flex; gap:10px; align-items:center; }
.row > * { flex:1; }
.sep { border:0; border-top:1px solid var(--border); margin:16px 0; }

.tabbar { display:flex; gap:8px; flex-wrap:wrap; margin-bottom:6px; }
.tab { padding:8px 12px; border:1px solid var(--border); background:transparent; color:var(--text); border-radius:999px; cursor:pointer; font-weight:700; font-size:.9rem; }
.tab.active { background:var(--text); color:var(--bg); border-color:var(--text); }
.pane.hidden { display:none; }
.help { color:var(--muted); font-size:.9rem; margin-top:4px; }

/* ---- Preview ---- */
.qrbox {
  min-height: 280px;
  display:flex; align-items:center; justify-content:center;
  border:1px dashed var(--border); border-radius:12px;
  background: repeating-conic-gradient(from 45deg, rgba(0,0,0,.04) 0 25%, transparent 0 50%) 50% / 24px 24px;
}

/* ---- Buttons ---- */
.actions { display:flex; gap:10px; flex-wrap:wrap; margin-top:12px; }
button { border:0; background:var(--text); color:var(--bg); padding:10px 14px; border-radius:10px; cursor:pointer; font-weight:800; }
button.secondary { background:transparent; color:var(--text); border:1px solid var(--border); }
button:disabled { opacity:.6; cursor:not-allowed; }

/* ---- Footer ---- */
.site-footer { border-top:1px solid var(--border); margin-top:20px; }
.footer-row { display:flex; align-items:center; justify-content:space-between; padding:12px 0 18px; }
.footnav { display:flex; gap:14px; }
.footnav a { color: var(--muted); text-decoration:none; }

/* Utility */
.ad { border:1px dashed var(--border); border-radius:10px; padding:12px; text-align:center; color:var(--muted); font-size:13px; }
