:root {
  --bg: #08101e;
  --bg-soft: #0e1728;
  --panel: rgba(17, 27, 45, 0.86);
  --panel-strong: #111c2f;
  --border: rgba(255,255,255,.09);
  --text: #f7f9fc;
  --muted: #94a3b8;
  --muted-2: #6f8198;
  --accent: #f36a21;
  --accent-2: #ff8a4c;
  --field: rgba(255,255,255,.055);
  --shadow: 0 24px 70px rgba(0,0,0,.32);
  --good: #36c98f;
  --warn: #f2b84b;
  --danger: #f2706a;
  --chart-grid: rgba(255,255,255,.07);
  --chart-axis: rgba(255,255,255,.22);
}

* { box-sizing: border-box; }

html { color-scheme: dark; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 10% 10%, rgba(243,106,33,.16), transparent 24rem),
    radial-gradient(circle at 90% 20%, rgba(53,90,145,.18), transparent 28rem),
    linear-gradient(180deg, #09111f 0%, #060c16 100%);
  color: var(--text);
}

button, input, select, textarea { font: inherit; }

button { cursor: pointer; }

.shell {
  width: min(1240px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 22px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}

.brand { display: flex; align-items: center; gap: 12px; }

.brand-logo {
  width: 44px;
  height: 44px;
  flex: none;
  display: block;
  filter: drop-shadow(0 8px 18px rgba(243,106,33,.28));
}

.brand-name { font-weight: 800; letter-spacing: -.02em; }
.brand-subtitle { color: var(--muted); font-size: .82rem; margin-top: 2px; }

.privacy-pill, .status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.035);
  color: #c8d3e1;
  padding: 8px 11px;
  border-radius: 999px;
  font-size: .78rem;
  white-space: nowrap;
}

.privacy-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #36c98f;
  box-shadow: 0 0 0 4px rgba(54,201,143,.10);
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(360px, .8fr);
  gap: 22px;
  align-items: start;
}

.panel {
  border: 1px solid var(--border);
  background: var(--panel);
  backdrop-filter: blur(18px);
  border-radius: 22px;
  box-shadow: var(--shadow);
}

.controls { padding: 28px; }

.preview-panel {
  padding: 24px;
  position: sticky;
  top: 18px;
}

.panel-heading, .preview-top, .subheading-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

h1, h2, p { margin-top: 0; }
h1 { font-size: clamp(1.7rem, 3vw, 2.35rem); margin-bottom: 0; letter-spacing: -.04em; }
h2 { font-size: 1.05rem; margin-bottom: 0; letter-spacing: -.02em; }

.eyebrow {
  color: var(--accent-2);
  text-transform: uppercase;
  letter-spacing: .14em;
  font-size: .7rem;
  font-weight: 800;
  margin-bottom: 7px;
}

.type-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 26px 0 22px;
}

.type-tab, .ghost-button {
  border: 1px solid var(--border);
  background: rgba(255,255,255,.035);
  color: #cbd5e1;
  border-radius: 11px;
  transition: .18s ease;
}

.type-tab {
  padding: 9px 13px;
  font-size: .86rem;
  font-weight: 700;
}

.type-tab:hover, .ghost-button:hover {
  border-color: rgba(255,255,255,.17);
  background: rgba(255,255,255,.065);
}

.type-tab.active {
  color: white;
  background: rgba(243,106,33,.14);
  border-color: rgba(243,106,33,.50);
}

.ghost-button { padding: 9px 12px; }
.ghost-button.compact { padding: 8px 11px; }
.ghost-button:disabled { opacity: .38; cursor: not-allowed; }

.form-stack { display: grid; gap: 16px; }
.grid { display: grid; gap: 14px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.field {
  display: grid;
  gap: 8px;
  color: #cbd5e1;
  font-size: .82rem;
  font-weight: 700;
}

.field small { font-weight: 500; color: var(--muted-2); }

.field input[type="text"],
.field input[type="url"],
.field input[type="email"],
.field input[type="tel"],
.field input[type="password"],
.field input[type="date"],
.field textarea,
.field select {
  width: 100%;
  border: 1px solid var(--border);
  background: var(--field);
  color: var(--text);
  border-radius: 12px;
  padding: 12px 13px;
  outline: none;
  transition: .18s ease;
}

.field textarea { min-height: 104px; resize: vertical; }

.field input:focus, .field textarea:focus, .field select:focus {
  border-color: rgba(243,106,33,.72);
  box-shadow: 0 0 0 3px rgba(243,106,33,.09);
}

.field input[type="color"] {
  width: 100%;
  height: 43px;
  padding: 4px;
  border: 1px solid var(--border);
  background: var(--field);
  border-radius: 12px;
}

.field input[type="file"] {
  min-width: 0;
  color: var(--muted);
}

.file-row { display: flex; gap: 10px; align-items: center; }
.file-row input { flex: 1; }

.helper { color: var(--muted-2) !important; }

.section-divider {
  height: 1px;
  background: var(--border);
  margin: 28px 0;
}

.subheading-row { margin-bottom: 18px; }

.qr-stage {
  margin-top: 22px;
  min-height: 390px;
  border: 1px solid var(--border);
  background:
    linear-gradient(45deg, #eef2f7 25%, transparent 25%) -8px 0/16px 16px,
    linear-gradient(-45deg, #eef2f7 25%, transparent 25%) -8px 0/16px 16px,
    linear-gradient(45deg, transparent 75%, #eef2f7 75%) -8px 0/16px 16px,
    linear-gradient(-45deg, transparent 75%, #eef2f7 75%) -8px 0/16px 16px,
    #fff;
  border-radius: 18px;
  display: grid;
  place-items: center;
  padding: 34px;
  overflow: hidden;
}

#qrCode canvas, #qrCode svg, #qrCode img, #detailQr canvas, #detailQr svg, #detailQr img {
  display: block;
  max-width: 100%;
  height: auto !important;
}

.payload-preview {
  margin-top: 16px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.035);
  border-radius: 12px;
  padding: 11px 12px;
  display: grid;
  gap: 5px;
}

.payload-preview span {
  color: var(--muted);
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  font-weight: 800;
}

.payload-preview code {
  color: #d9e2ef;
  display: block;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .78rem;
  line-height: 1.45;
  max-height: 68px;
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.download-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 14px;
}

.primary-button, .secondary-button {
  border-radius: 12px;
  padding: 12px 14px;
  font-weight: 800;
  border: 1px solid transparent;
}

.primary-button {
  background: linear-gradient(135deg, var(--accent), #da5513);
  color: white;
  box-shadow: 0 10px 24px rgba(243,106,33,.20);
}

.secondary-button {
  background: rgba(255,255,255,.05);
  color: #eef3f9;
  border-color: var(--border);
}

.primary-button:hover { filter: brightness(1.06); }
.secondary-button:hover { background: rgba(255,255,255,.08); }

.fine-print {
  color: var(--muted-2);
  font-size: .75rem;
  line-height: 1.55;
  margin: 14px 2px 0;
}

footer {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  color: var(--muted-2);
  font-size: .75rem;
  padding-top: 18px;
}

.footer-separator { opacity: .55; }


/* ---------- Shared layout: nav, user menu, pages ---------- */

a { color: var(--accent-2); }
.brand { color: inherit; text-decoration: none; }

.topbar { flex-wrap: wrap; }

.nav { display: flex; gap: 4px; margin-right: auto; margin-left: 18px; }
.nav a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 700;
  font-size: .88rem;
  padding: 8px 12px;
  border-radius: 10px;
}
.nav a:hover { color: var(--text); background: rgba(255,255,255,.05); }
.nav a.active { color: var(--text); background: rgba(243,106,33,.14); }

.user-menu { display: flex; align-items: center; gap: 10px; }
.org-switch {
  color: var(--text); font-size: .82rem; font-weight: 700;
  padding: 7px 11px; border-radius: 10px; border: 1px solid var(--border); background: rgba(255,255,255,.035);
  max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
select.org-switch { cursor: pointer; }
.user-email { color: var(--muted); font-size: .8rem; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
a.ghost-button { text-decoration: none; display: inline-flex; align-items: center; font-size: .85rem; }

.primary-button, .secondary-button { text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px; cursor: pointer; }
.primary-button:disabled, .secondary-button:disabled { opacity: .4; cursor: not-allowed; filter: none; box-shadow: none; }
.full { width: 100%; }
.muted { color: var(--muted); line-height: 1.55; }
.meta { color: var(--muted-2); font-size: .78rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

[hidden] { display: none !important; }

.auth-loader { display: none; }
body.auth-pending .shell { visibility: hidden; }
body.auth-pending .auth-loader {
  display: grid; place-items: center; position: fixed; inset: 0;
  color: var(--muted); font-size: .9rem;
}

.page { display: grid; gap: 20px; }
.page-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.heading-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.back-link { color: var(--muted); text-decoration: none; font-size: .85rem; font-weight: 700; }
.back-link:hover { color: var(--text); }

.blocked { padding: 32px; max-width: 520px; margin: 40px auto; display: grid; gap: 14px; justify-items: start; }
.blocked h1 { font-size: 1.6rem; }

/* ---------- Generator: mode toggle & tracked fields ---------- */

.mode-row { display: flex; align-items: center; gap: 14px; margin-bottom: 8px; }
.mode-row.disabled { opacity: .45; }
.mode-label { color: #cbd5e1; font-size: .82rem; font-weight: 700; }

.segmented {
  display: inline-flex; padding: 3px; gap: 3px;
  border: 1px solid var(--border); border-radius: 12px; background: rgba(255,255,255,.035);
}
.segmented label { position: relative; }
.segmented input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.segmented span { display: block; padding: 7px 13px; border-radius: 9px; font-size: .84rem; font-weight: 700; color: #cbd5e1; }
.segmented input:checked + span { background: rgba(243,106,33,.18); color: #fff; box-shadow: inset 0 0 0 1px rgba(243,106,33,.5); }
.segmented input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 1px; }
.segmented input:disabled { cursor: not-allowed; }

.mode-hint { color: var(--muted-2); font-size: .8rem; margin: 0 0 18px; line-height: 1.5; }

.tracked-fields {
  margin-top: 16px; padding: 18px; border-radius: 16px;
  border: 1px solid rgba(243,106,33,.22); background: rgba(243,106,33,.04);
}

.checkbox-field { display: flex; align-items: center; gap: 10px; }

.prefixed-input {
  display: flex; align-items: stretch; border: 1px solid var(--border);
  background: var(--field); border-radius: 12px; overflow: hidden;
}
.prefixed-input:focus-within { border-color: rgba(243,106,33,.72); box-shadow: 0 0 0 3px rgba(243,106,33,.09); }
.prefixed-input .prefix {
  display: flex; align-items: center; padding: 0 4px 0 13px;
  color: var(--muted-2); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .8rem; font-weight: 500;
  white-space: nowrap;
}
.field .prefixed-input input[type="text"] { border: 0; background: transparent; box-shadow: none; padding-left: 2px; min-width: 0; }
.helper.error { color: var(--danger) !important; }

.field input.locked, .field textarea.locked { opacity: .65; }
.type-tab:disabled { opacity: .4; cursor: not-allowed; }

.tracked-actions { margin-top: 14px; display: grid; gap: 10px; }
.saved-box {
  border: 1px solid rgba(54,201,143,.3); background: rgba(54,201,143,.07);
  border-radius: 12px; padding: 12px; font-size: .85rem;
}
.saved-box p { margin: 0 0 10px; }
.saved-links { display: flex; flex-wrap: wrap; gap: 8px; }

.download-grid button:disabled { opacity: .4; cursor: not-allowed; }
.download-grid.three { grid-template-columns: 1.1fr 1fr 1fr; }
.download-grid select {
  border: 1px solid var(--border); background: var(--field); color: var(--text);
  border-radius: 12px; padding: 0 10px;
}

/* ---------- Design controls ---------- */

.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.presets {
  display: grid; grid-auto-flow: column; grid-auto-columns: 92px; gap: 10px;
  overflow-x: auto; padding: 2px 2px 10px; margin-bottom: 18px; scrollbar-width: thin;
}
.preset {
  display: grid; justify-items: center; gap: 7px; padding: 9px 6px 8px;
  border: 1px solid var(--border); border-radius: 14px; background: rgba(255,255,255,.035); color: #cbd5e1;
  transition: .15s ease;
}
.preset:hover { border-color: rgba(255,255,255,.18); background: rgba(255,255,255,.06); }
.preset[aria-pressed="true"] { border-color: rgba(243,106,33,.6); background: rgba(243,106,33,.1); color: #fff; }
.preset-thumb {
  width: 72px; height: 72px; border-radius: 10px; overflow: hidden; display: grid; place-items: center;
  background: repeating-conic-gradient(#e8edf3 0% 25%, #fff 0% 50%) 50% / 12px 12px;
}
.preset-thumb canvas, .preset-thumb svg, .preset-thumb img { display: block; width: 72px; height: 72px; }
.preset-name { font-size: .74rem; font-weight: 700; }

.design-group {
  border: 1px solid var(--border); border-radius: 16px; padding: 14px 16px 16px; margin: 0 0 14px;
  display: grid; gap: 14px; min-width: 0;
}
.design-group legend {
  padding: 0 6px; margin-left: -6px; color: var(--accent-2); font-size: .7rem; font-weight: 800;
  text-transform: uppercase; letter-spacing: .12em;
}
.design-group .helper { margin-top: -4px; font-size: .74rem; }

.field input[type="range"] { width: 100%; accent-color: var(--accent); height: 43px; margin: 0; }
.field input[type="range"]:disabled { opacity: .35; }
.field span small { font-variant-numeric: tabular-nums; margin-left: 4px; }

.color-toggle { display: flex; gap: 8px; }
.color-toggle select { flex: 1; min-width: 0; }
.color-toggle input[type="color"] { width: 52px !important; flex: none; }

.file-row { flex-wrap: wrap; }

/* ---------- Scan check ---------- */

.scan-check {
  display: flex; align-items: center; gap: 9px; margin-top: 12px; padding: 10px 12px;
  border-radius: 12px; border: 1px solid var(--border); background: rgba(255,255,255,.035);
  font-size: .82rem; font-weight: 700; color: #d9e2ef;
}
.scan-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; background: var(--muted-2); }
.scan-check.pending .scan-dot { animation: pulse 1s ease-in-out infinite; }
.scan-check.ok { border-color: rgba(54,201,143,.35); }
.scan-check.ok .scan-dot { background: var(--good); }
.scan-check.warn { border-color: rgba(242,184,75,.4); }
.scan-check.warn .scan-dot { background: var(--warn); }
.scan-check.fail { border-color: rgba(242,112,106,.55); color: #fde2e1; }
.scan-check.fail .scan-dot { background: var(--danger); }
@keyframes pulse { 50% { opacity: .3; } }
@media (prefers-reduced-motion: reduce) { .scan-check.pending .scan-dot { animation: none; } }

.design-warnings {
  margin: 8px 0 0; padding: 10px 12px 10px 28px; border-radius: 12px;
  background: rgba(242,184,75,.07); border: 1px solid rgba(242,184,75,.25);
  color: #f5dfb1; font-size: .78rem; line-height: 1.5; display: grid; gap: 4px;
}

.more-formats { display: flex; justify-content: center; align-items: center; gap: 6px; margin-top: 6px; color: var(--muted-2); font-size: .8rem; }
.more-formats .link-button { font-weight: 700; }
.more-formats .link-button:disabled { opacity: .4; cursor: not-allowed; }

/* ---------- Login ---------- */

.centered-page { display: grid; place-items: center; padding: 24px 16px; }
.login-wrap { width: min(420px, 100%); display: grid; gap: 18px; }
.login-brand { justify-self: center; }
.login-brand .brand-logo { width: 56px; height: 56px; }
.login-card { padding: 28px; display: grid; gap: 16px; }
.login-card h1 { font-size: 1.7rem; }
.login-card .muted { margin: -6px 0 4px; font-size: .9rem; }
.form-error { color: var(--danger); font-size: .85rem; margin: 0; }
.form-note { color: var(--muted); font-size: .85rem; margin: 0; padding: 10px 12px; border-radius: 10px; background: rgba(255,255,255,.04); border: 1px solid var(--border); }
.checkbox-field span { font-weight: 600; }
.link-button { background: none; border: 0; color: var(--muted); font-size: .82rem; justify-self: center; padding: 4px; }
.link-button:hover { color: var(--text); }
.fine-print.center { text-align: center; }

/* ---------- Tiles ---------- */

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.tile {
  border: 1px solid var(--border); background: var(--panel); border-radius: 16px;
  padding: 16px 18px; display: grid; gap: 6px;
}
.tile-label { color: var(--muted); font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .1em; }
.tile-value { font-size: 1.7rem; font-weight: 800; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.tile-value.small { font-size: 1.05rem; padding-top: 8px; }

/* ---------- Tables ---------- */

.table-panel { padding: 18px; }
.toolbar { display: flex; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.field.inline { gap: 0; }
.field.grow { flex: 1; min-width: 220px; }

.table-scroll { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: .86rem; }
.data-table th {
  text-align: left; color: var(--muted); font-size: .7rem; text-transform: uppercase;
  letter-spacing: .1em; font-weight: 800; padding: 10px 12px; border-bottom: 1px solid var(--border);
}
.data-table td { padding: 12px; border-bottom: 1px solid rgba(255,255,255,.05); vertical-align: middle; }
.data-table tbody tr:hover { background: rgba(255,255,255,.02); }
.data-table.compact td { padding: 9px 12px; }
.data-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.data-table .truncate { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.data-table td a { color: #d9e2ef; text-decoration: none; }
.data-table td a:hover { color: var(--accent-2); text-decoration: underline; }
.bot-row td { color: var(--muted-2); }

.row-title { font-weight: 800; color: var(--text) !important; }
.row-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 4px; }
.row-sub code { color: var(--muted-2); font-size: .74rem; }
.tag {
  display: inline-block; padding: 2px 7px; border-radius: 6px; font-size: .7rem; font-weight: 700;
  background: rgba(255,255,255,.06); color: #cbd5e1;
}
.empty-note { color: var(--muted); text-align: center; padding: 28px 12px !important; }
p.empty-note { margin: 0; }

.row-actions { white-space: nowrap; text-align: right; }
.row-actions > * { vertical-align: middle; }
.menu { position: relative; display: inline-block; margin-left: 4px; }
.menu summary { list-style: none; cursor: pointer; }
.menu summary::-webkit-details-marker { display: none; }
.menu-list {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; min-width: 190px;
  display: grid; padding: 6px; border-radius: 12px;
  background: var(--panel-strong); border: 1px solid var(--border); box-shadow: var(--shadow);
}
.menu-list a, .menu-list button {
  text-align: left; background: none; border: 0; color: #d9e2ef !important; text-decoration: none !important;
  padding: 8px 10px; border-radius: 8px; font-size: .84rem;
}
.menu-list a:hover, .menu-list button:hover { background: rgba(255,255,255,.06); }

/* ---------- Status badges (always label + dot, never color alone) ---------- */

.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 9px; border-radius: 999px;
  font-size: .74rem; font-weight: 800; border: 1px solid var(--border); background: rgba(255,255,255,.035); color: #d9e2ef;
}
.badge-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--muted-2); }
.badge-active .badge-dot { background: var(--good); }
.badge-paused .badge-dot { background: var(--warn); }
.badge-expired .badge-dot { background: var(--danger); }
.badge-archived { color: var(--muted); }

/* ---------- Detail page ---------- */

.detail-grid { display: grid; grid-template-columns: minmax(300px, 380px) minmax(0, 1fr); gap: 20px; align-items: start; }
.detail-qr, .detail-form { padding: 22px; }
.detail-qr { display: grid; gap: 12px; }
.detail-qr .qr-stage, .qr-stage.compact { margin-top: 0; min-height: 0; padding: 22px; }
.detail-qr .payload-preview, .detail-qr .download-grid { margin-top: 0; }
.detail-form h2 { margin-bottom: 18px; }
.form-actions { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; }

/* ---------- Charts ---------- */

.chart-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.chart-panel { padding: 20px; }
.chart-panel.wide { grid-column: 1 / -1; }
.chart-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }

.chart-root { position: relative; }
.chart-svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart-svg .chart-gridline { stroke: var(--chart-grid); stroke-width: 1; }
.chart-svg .chart-baseline { stroke: var(--chart-axis); stroke-width: 1; }
.chart-svg .chart-axis { fill: var(--muted-2); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart-svg .chart-bar { fill: var(--accent); }
.chart-svg .chart-hit { fill: transparent; outline: none; }
.chart-svg .chart-hit.hover { fill: rgba(255,255,255,.04); }

.chart-tooltip {
  position: absolute; pointer-events: none; transform: translate(-50%, calc(-100% - 10px));
  background: var(--panel-strong); border: 1px solid var(--border); border-radius: 10px;
  padding: 7px 10px; font-size: .78rem; color: var(--muted); white-space: nowrap;
  box-shadow: 0 10px 24px rgba(0,0,0,.35); opacity: 0; transition: opacity .12s;
}
.chart-tooltip strong { color: var(--text); font-size: .9rem; }
.chart-tooltip span { display: block; color: var(--muted-2); font-size: .72rem; margin-top: 2px; }
.chart-tooltip.show { opacity: 1; }

.chart-table { margin-top: 10px; font-size: .8rem; }
.chart-table summary { color: var(--muted-2); cursor: pointer; font-size: .76rem; }
.chart-table table { margin-top: 8px; }

.bar-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.bar-list-row { display: flex; justify-content: space-between; gap: 10px; font-size: .84rem; margin-bottom: 6px; }
.bar-list-label { color: #d9e2ef; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-list-label a { color: inherit; text-decoration: none; }
.bar-list-label a:hover { color: var(--accent-2); }
.bar-list-value { color: var(--text); font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.bar-list-value small { color: var(--muted-2); font-weight: 600; margin-left: 4px; }
.bar-list-track { height: 8px; border-radius: 4px; background: rgba(255,255,255,.05); overflow: hidden; }
.bar-list-fill { height: 100%; border-radius: 4px; background: var(--accent); min-width: 4px; }

/* ---------- Toast ---------- */

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); z-index: 100;
  background: var(--panel-strong); border: 1px solid var(--border); color: var(--text);
  padding: 11px 16px; border-radius: 12px; font-size: .86rem; box-shadow: var(--shadow);
  opacity: 0; pointer-events: none; transition: .2s ease; max-width: calc(100% - 32px);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { border-color: rgba(242,112,106,.5); }

@media (max-width: 900px) {
  .workspace, .detail-grid, .chart-grid { grid-template-columns: 1fr; }
  .preview-panel { position: static; }
  .nav { order: 3; width: 100%; margin: 0; }
}

@media (max-width: 620px) {
  .shell { width: min(100% - 20px, 1240px); padding-top: 14px; }
  .topbar { align-items: flex-start; }
  .privacy-pill { display: none; }
  .controls, .preview-panel { padding: 18px; border-radius: 18px; }
  .grid.two, .grid.three, .download-grid { grid-template-columns: 1fr; }
  .qr-stage { min-height: 310px; padding: 22px; }
  .file-row { align-items: stretch; flex-direction: column; }
  .user-email { display: none; }
  .org-switch { max-width: 140px; }
  .tile-value { font-size: 1.4rem; }
  .download-grid.three { grid-template-columns: 1fr 1fr 1fr; }

  /* Codes table collapses into cards */
  .qr-table thead { display: none; }
  .qr-table, .qr-table tbody, .qr-table tr, .qr-table td { display: block; width: 100%; }
  .qr-table tr { border-bottom: 1px solid var(--border); padding: 10px 0; }
  .qr-table td { border: 0; padding: 4px 4px; text-align: left !important; max-width: none !important; }
  .qr-table td[data-label]:not([data-label="Name"])::before {
    content: attr(data-label); display: inline-block; width: 92px;
    color: var(--muted-2); font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em;
  }
  .qr-table .row-actions { padding-top: 8px; }
  .menu-list { right: auto; left: 0; }
}
