:root {
  --border: #e2e2e2;
  --text: #1a1a1a;
  --muted: #6b6b6b;
  --danger: #dc2626;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--text);
  background: #fafafa;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.5rem;
  background: #fff;
  border-bottom: 1px solid var(--border);
}

.topbar .brand { font-weight: 700; text-decoration: none; color: var(--text); font-size: 1.1rem; }

.topbar nav { display: flex; align-items: center; gap: 1rem; }
.topbar nav a { color: var(--text); text-decoration: none; }
.topbar nav a:hover { text-decoration: underline; }
.user-email { color: var(--muted); font-size: 0.9rem; }

.container { max-width: 900px; margin: 0 auto; padding: 2rem 1.5rem; }

.page-header { display: flex; align-items: center; justify-content: space-between; }

.form-card {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 420px;
  background: #fff;
  padding: 1.5rem;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.form-card label { display: flex; flex-direction: column; gap: 0.25rem; font-size: 0.9rem; }
.form-card input, .form-card select { padding: 0.5rem; border: 1px solid var(--border); border-radius: 4px; font-size: 1rem; }
.form-card fieldset { border: 1px solid var(--border); border-radius: 4px; }

.form-card .row { flex-direction: row !important; align-items: center; justify-content: space-between; gap: 0.75rem !important; }
.form-card .row input[type="color"] { width: 44px; padding: 0.15rem; flex-shrink: 0; }
.color-pair { display: flex; align-items: center; gap: 0.5rem; }
.hex-input { width: 100px; font-family: monospace; }
.form-card .row.checkbox { justify-content: flex-start; }
.form-card .row.checkbox input { width: auto; }

.corner-options { display: flex; flex-direction: column; gap: 0.5rem; }
.corner-option { flex-direction: row !important; align-items: center; gap: 0.5rem !important; font-size: 0.9rem; }

.qr-preview { background: #fff; padding: 1rem; border: 1px solid var(--border); border-radius: 8px; display: inline-block; }
.qr-preview svg { display: block; width: 240px; height: 240px; }

.download-table { margin-top: 1rem; border-collapse: collapse; }
.download-table th, .download-table td { padding: 0.4rem 0.75rem 0.4rem 0; text-align: left; font-size: 0.9rem; }

button, .button {
  display: inline-block;
  padding: 0.55rem 1rem;
  background: var(--text);
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  text-decoration: none;
  font-size: 0.95rem;
}

.button.danger, button.danger { background: var(--danger); }

.link-button {
  background: none;
  border: none;
  color: var(--danger);
  cursor: pointer;
  padding: 0;
  font-size: 0.9rem;
  text-decoration: underline;
}

.inline-form { display: inline; }

.table { width: 100%; border-collapse: collapse; background: #fff; }
.table th, .table td { text-align: left; padding: 0.6rem; border-bottom: 1px solid var(--border); font-size: 0.9rem; }
.truncate { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.muted { color: var(--muted); }
.muted.small { font-size: 0.8rem; margin: 0; }
.error { color: var(--danger); }

.qr-layout { display: flex; gap: 2rem; flex-wrap: wrap; margin-bottom: 2rem; }
