:root {
  color-scheme: light;
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --border: rgba(15, 23, 42, 0.08);
  --muted: #475569;
  --text: #0f172a;
  --accent: #0ea5e9;
  --accent-strong: #0284c7;
  --shadow: 0 24px 44px rgba(15, 23, 42, 0.08);
  --radius-xl: 1.5rem;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b1220;
  --surface: #111827;
  --surface-soft: rgba(30, 41, 59, 0.65);
  --border: rgba(148, 163, 184, 0.22);
  --muted: #94a3b8;
  --text: #e2e8f0;
  --accent: #22d3ee;
  --accent-strong: #0ea5e9;
  --shadow: 0 32px 60px rgba(2, 6, 23, 0.55);
}

* {
  box-sizing: border-box;
}

body {
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial, "Noto Sans";
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  transition: background 0.35s ease, color 0.35s ease;
}

a {
  color: inherit;
}

.glass {
  background: var(--surface);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.tab-btn {
  border-radius: 1rem;
  padding: 0.75rem 1rem;
  font-weight: 600;
  color: var(--muted);
  transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease, border 0.2s ease;
  border: 1px solid transparent;
  width: 100%;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  background: transparent;
}

.tab-btn:hover {
  color: var(--text);
  background: var(--surface-soft);
}

.tab-active {
  background: linear-gradient(135deg, var(--surface-soft), rgba(14, 165, 233, 0.08));
  color: var(--text);
  border-color: var(--border);
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.1);
}

:root[data-theme="dark"] .tab-active {
  box-shadow: 0 18px 30px rgba(2, 6, 23, 0.55);
}

.section-heading {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.text-muted {
  color: var(--muted);
}

.quick-action {
  border: 1px solid var(--border);
  background: var(--surface-soft);
  color: var(--text);
  border-radius: 0.75rem;
  font-weight: 500;
  padding: 0.45rem 0.75rem;
  transition: background 0.2s ease, border 0.2s ease, color 0.2s ease;
  cursor: pointer;
}

.quick-action:hover {
  background: var(--surface);
  border-color: var(--accent);
  color: var(--accent-strong);
}

.form-field {
  width: 100%;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 0.85rem;
  padding: 0.7rem 0.9rem;
  transition: border 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.form-field:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.25);
  background: var(--surface);
}

.form-field[disabled] {
  opacity: 0.65;
  cursor: not-allowed;
}

input[type="color"].form-field {
  padding: 0.2rem;
  height: 44px;
}

input[type="file"].form-field {
  padding: 0.5rem 0.85rem;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}

.btn {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 0.45rem;
  border-radius: 0.85rem;
  font-weight: 600;
  padding: 0.65rem 1.1rem;
  transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease;
  cursor: pointer;
  border: none;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--accent-strong);
  color: #fff;
  box-shadow: 0 12px 24px rgba(14, 165, 233, 0.25);
}

.btn-primary:hover {
  background: var(--accent);
}

.btn-secondary {
  background: var(--surface-soft);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--surface);
}

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}

.btn-ghost:hover {
  background: var(--surface-soft);
}

.brand-icon {
  width: 3rem;
  height: 3rem;
  border-radius: 1.25rem;
  background: var(--surface-soft);
  color: var(--accent-strong);
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.checker {
  background-image:
    linear-gradient(45deg, rgba(148, 163, 184, 0.25) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(148, 163, 184, 0.25) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(148, 163, 184, 0.25) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(148, 163, 184, 0.25) 75%);
  background-size: 20px 20px;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0;
  border-radius: 1rem;
  border: 1px solid var(--border);
}

#qrPreview {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 1.25rem;
  padding: 1.25rem;
  width: 100%;
  display: flex;
  justify-content: center;
}

#qrPreview canvas,
#qrPreview img {
  width: 100%;
  max-width: 360px;
  height: auto;
}

.panel-highlight {
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: 1rem;
}

.panel-highlight a {
  color: var(--accent-strong);
}

.drop-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-xl);
  background: var(--surface-soft);
  padding: 2.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  text-align: center;
  cursor: pointer;
  transition: border 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.drop-zone.dragover {
  border-color: var(--accent-strong);
  background: rgba(14, 165, 233, 0.08);
  transform: translateY(-2px);
}

.drop-zone.disabled {
  opacity: 0.6;
  cursor: progress;
  pointer-events: none;
}

.drop-zone-icon {
  font-size: 2.5rem;
  line-height: 1;
}

.link-button {
  color: var(--accent-strong);
  font-weight: 600;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}

.link-button:hover {
  text-decoration: underline;
}

.progress-track {
  width: 100%;
  height: 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-soft);
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-strong), var(--accent));
  width: 0%;
  transition: width 0.3s ease;
}

.status-line {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: color 0.2s ease;
}

.status-line[data-state="busy"] {
  color: var(--accent-strong);
}

.status-line[data-state="success"] {
  color: #16a34a;
}

.status-line[data-state="error"] {
  color: #ef4444;
}

.preview-img {
  max-height: 18rem;
  width: auto;
  height: auto;
  border-radius: 1rem;
  object-fit: contain;
  box-shadow: var(--shadow);
}

.panel {
  align-content: flex-start;
}

.theme-icon {
  display: inline-flex;
  font-size: 1rem;
  line-height: 1;
}

.theme-label {
  font-size: 0.9rem;
  font-weight: 500;
}

:root[data-theme="light"] .theme-icon-moon {
  display: none;
}

:root[data-theme="dark"] .theme-icon-sun {
  display: none;
}

small,
.hint {
  color: var(--muted);
}

footer,
#privacy {
  color: var(--muted);
}

@media (max-width: 1024px) {
  .panel.grid {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 640px) {
  .tab-btn {
    font-size: 0.9rem;
  }
  #qrPreview {
    padding: 1rem;
  }
}

input,
select {
  font-size: 16px;
}
