:root {
  --bg: #0b1120;
  --surface: #111827;
  --surface-2: #1e293b;
  --border: rgba(255, 255, 255, 0.1);
  --text: #f1f5f9;
  --muted: #94a3b8;
  --accent: #38bdf8;
  --accent-2: #22c55e;
  --danger: #f87171;
}

body.light {
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-2: #f1f5f9;
  --border: rgba(15, 23, 42, 0.12);
  --text: #0f172a;
  --muted: #64748b;
  --accent: #0284c7;
  --accent-2: #16a34a;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  line-height: 1.5;
}

.container {
  width: min(1100px, 100% - 28px);
  margin: 0 auto;
}

.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 12px 0;
}
.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--text);
  font-size: 20px;
}
.brand strong { color: var(--accent); }
.privacy-pill {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-2);
  background: rgba(34, 197, 94, 0.12);
  padding: 4px 10px;
  border-radius: 999px;
}
.icon-btn {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  width: 36px;
  height: 34px;
  cursor: pointer;
  font-size: 16px;
}

.tool-nav {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.nav-scroll {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 8px 0;
}
.nav-tab {
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 600;
  font-size: 14px;
  padding: 8px 14px;
  border-radius: 10px;
  cursor: pointer;
  white-space: nowrap;
}
.nav-tab:hover { color: var(--text); background: var(--surface-2); }
.nav-tab.active {
  background: var(--accent);
  color: #08121e;
  font-weight: 700;
}

.main-content {
  flex: 1;
  padding: 22px 0 40px;
}

.tool-panel { display: flex; flex-direction: column; gap: 16px; }
.panel-head h1 { margin: 0; font-size: clamp(22px, 3vw, 28px); }
.subtitle { margin: 4px 0 0; color: var(--muted); font-size: 14px; }

.controls-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 12px 14px;
  border-radius: 12px;
}

.field {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
}
.field-col {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
}

input[type="text"], input[type="number"], select, textarea {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: 8px 10px;
  font: inherit;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.dropzone {
  border: 2px dashed var(--border);
  background: var(--surface);
  border-radius: 14px;
  padding: 34px 16px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.dropzone:hover, .dropzone.drag {
  border-color: var(--accent);
  background: rgba(56, 189, 248, 0.06);
}
.drop-icon { font-size: 36px; margin-bottom: 6px; }
.link-like { color: var(--accent); text-decoration: underline; }
.muted { color: var(--muted); }
.small { font-size: 12px; }

.summary-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.3);
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}
.img-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.img-card img {
  width: 100%;
  height: 150px;
  object-fit: contain;
  background: var(--surface-2);
  border-radius: 8px;
}
.img-meta {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted);
}
.badge-save {
  color: var(--accent-2);
  font-weight: 700;
}

.split-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 720px) {
  .split-2 { grid-template-columns: 1fr; }
}

.card-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
}
.stack { display: flex; flex-direction: column; gap: 12px; }
.center-col { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; }

.seg {
  display: inline-flex;
  gap: 4px;
  background: var(--surface-2);
  padding: 4px;
  border-radius: 10px;
  align-self: flex-start;
}
.seg button {
  border: none;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 7px;
  cursor: pointer;
}
.seg button.active {
  background: var(--accent);
  color: #08121e;
}

.qr-preview {
  background: #ffffff;
  padding: 14px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  min-height: 220px;
  min-width: 220px;
}
.qr-preview img, .qr-preview canvas { max-width: 240px; height: auto; }

.pdf-list { display: flex; flex-direction: column; gap: 8px; }
.pdf-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 14px;
}
.inline-group { display: flex; gap: 8px; flex-wrap: wrap; }

.code-area {
  width: 100%;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  line-height: 1.5;
  resize: vertical;
}
.status-msg { margin: 0; font-size: 13px; font-weight: 600; min-height: 1.2em; }
.status-msg.ok { color: var(--accent-2); }
.status-msg.err { color: var(--danger); }

.copy-box { display: flex; gap: 8px; }
.copy-box input { flex: 1; font-family: ui-monospace, monospace; font-size: 14px; }
.strength-bar { height: 6px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.strength-bar span { display: block; height: 100%; transition: width 0.2s, background 0.2s; }
.check-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; font-size: 13px; }

.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }
.btn {
  font: inherit;
  font-weight: 700;
  font-size: 14px;
  border: none;
  border-radius: 9px;
  padding: 9px 16px;
  cursor: pointer;
}
.btn.primary { background: var(--accent); color: #08121e; }
.btn.secondary { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); }
.btn.ghost { background: transparent; color: var(--muted); border: 1px solid var(--border); }
.btn.small { padding: 6px 11px; font-size: 12px; }
.btn:hover { filter: brightness(1.08); }

.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 14px 0;
  font-size: 13px;
  color: var(--muted);
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}
.footer-inner a { color: var(--accent); text-decoration: none; }

.hide { display: none !important; }
