:root {
  color-scheme: dark;
  --bg: #080b18;
  --panel: #10152a;
  --panel-2: #171d38;
  --line: #2b3563;
  --text: #f5f7ff;
  --muted: #aab4d6;

  --royal: #4169e1;
  --royal-bright: #5d7cff;
  --purple: #8b5cf6;
  --purple-deep: #6d3fdc;

  --accent: #7d74ff;
  --accent-strong: #5f66f3;

  --danger: #ff8fa3;
  --success: #8ee7bd;

  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background:
    radial-gradient(circle at 15% 0%, rgba(65, 105, 225, .22), transparent 34rem),
    radial-gradient(circle at 85% 8%, rgba(139, 92, 246, .20), transparent 32rem),
    linear-gradient(180deg, #090c1d 0%, var(--bg) 45%, #070914 100%);
  color: var(--text);
  min-height: 100vh;
}

a { color: inherit; }

.shell {
  width: min(980px, calc(100% - 32px));
  margin: 0 auto;
  padding: 38px 0 72px;
}

.nav {
  display: flex;
  gap: 10px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.nav a {
  text-decoration: none;
  color: var(--muted);
  padding: 9px 13px;
  border-radius: 10px;
  transition: .2s ease;
}

.nav a:hover,
.nav a.active {
  color: var(--text);
  background:
    linear-gradient(135deg, rgba(65,105,225,.18), rgba(139,92,246,.18)),
    var(--panel);
  box-shadow: inset 0 0 0 1px rgba(125,116,255,.18);
}

.card {
  background:
    linear-gradient(180deg, rgba(255,255,255,.035), transparent 58%),
    linear-gradient(135deg, rgba(65,105,225,.05), rgba(139,92,246,.05)),
    var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: clamp(22px, 4vw, 38px);
  box-shadow:
    0 22px 70px rgba(0,0,0,.34),
    0 0 40px rgba(87,83,235,.06);
  margin-bottom: 20px;
}

.hero { padding-block: 60px; }

.narrow {
  max-width: 560px;
  margin-inline: auto;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: .14em;
  font-size: .74rem;
  font-weight: 800;
  color: #9a8cff;
  margin: 0 0 8px;
}

h1, h2 {
  line-height: 1.1;
  margin: 0 0 14px;
}

h1 {
  font-size: clamp(2rem, 5vw, 3.6rem);
  max-width: 16ch;
}

h2 { font-size: 1.45rem; }

p { line-height: 1.65; }

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

.stack {
  display: grid;
  gap: 16px;
  margin-top: 26px;
}

label {
  display: grid;
  gap: 8px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: #0b1022;
  color: var(--text);
  padding: 12px 13px;
  font: inherit;
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}

textarea {
  resize: vertical;
  word-break: break-all;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: rgba(125,116,255,.8);
  box-shadow:
    0 0 0 3px rgba(65,105,225,.14),
    0 0 18px rgba(139,92,246,.10);
  background: #0d1329;
}

.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.button {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text);
  padding: 11px 15px;
  border-radius: 11px;
  font: inherit;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  transition: transform .18s ease, filter .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.button:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
  border-color: rgba(125,116,255,.55);
}

.button:disabled {
  opacity: .55;
  cursor: not-allowed;
  transform: none;
}

.button.primary {
  background: linear-gradient(135deg, var(--royal) 0%, var(--royal-bright) 48%, var(--purple) 100%);
  border-color: transparent;
  color: #ffffff;
  box-shadow:
    0 10px 28px rgba(65,105,225,.25),
    0 0 22px rgba(139,92,246,.16);
}

.button.primary:hover {
  filter: brightness(1.1);
  box-shadow:
    0 12px 34px rgba(65,105,225,.32),
    0 0 28px rgba(139,92,246,.22);
}

.button.small {
  padding: 8px 11px;
  font-size: .9rem;
}

.notice {
  border: 1px solid var(--line);
  background:
    linear-gradient(135deg, rgba(65,105,225,.055), rgba(139,92,246,.055)),
    #0c1125;
  border-radius: 12px;
  padding: 12px 14px;
  margin-top: 18px;
  line-height: 1.45;
}

.notice.error {
  border-color: rgba(255,143,163,.5);
  color: #ffd4dc;
}

.notice.success {
  border-color: rgba(142,231,189,.45);
  color: var(--success);
}

.hidden { display: none !important; }

.result-card {
  display: grid;
  gap: 18px;
}

.qrbox {
  width: fit-content;
  background: white;
  padding: 14px;
  border-radius: 13px;
  overflow: hidden;
  box-shadow:
    0 0 0 1px rgba(255,255,255,.08),
    0 16px 45px rgba(39,43,110,.32);
}

.qrbox img,
.qrbox canvas {
  display: block;
  max-width: min(320px, 75vw);
  height: auto !important;
}

.split-title {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 20px;
}

.scanner-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(240px, .8fr);
  gap: 18px;
  margin-top: 24px;
}

.reader {
  min-height: 320px;
  border: 1px dashed #46528c;
  border-radius: 14px;
  overflow: hidden;
  background:
    radial-gradient(circle at center, rgba(65,105,225,.08), transparent 65%),
    #070b18;
}

.upload-panel {
  background:
    linear-gradient(145deg, rgba(65,105,225,.07), rgba(139,92,246,.07)),
    var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 20px;
}

.dropzone {
  min-height: 170px;
  border: 1px dashed #5565a1;
  border-radius: 12px;
  padding: 20px;
  display: grid;
  place-items: center;
  text-align: center;
  cursor: pointer;
  color: var(--muted);
  transition: .2s ease;
}

.dropzone:hover {
  border-color: #8578ff;
  background: rgba(100,96,240,.06);
  color: var(--text);
}

.dropzone input { margin-top: 12px; }

.result {
  margin-top: 18px;
  padding: 18px;
  border-radius: 12px;
  background:
    linear-gradient(135deg, rgba(65,105,225,.055), rgba(139,92,246,.055)),
    #0b1022;
  border: 1px solid var(--line);
}

@media (max-width: 760px) {
  .scanner-grid { grid-template-columns: 1fr; }
  .split-title { flex-direction: column; }
}

/* Branded QR invite output */
.brand-preview-wrap {
  display: grid;
  gap: 10px;
}

.brand-preview {
  display: block;
  width: min(100%, 1004px);
  height: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #070a16;
  box-shadow:
    0 18px 55px rgba(0,0,0,.32),
    0 0 34px rgba(96,88,240,.10);
}

.qr-source {
  position: fixed;
  left: -10000px;
  top: -10000px;
  width: 640px;
  height: 640px;
  pointer-events: none;
  opacity: 0;
}

.small-copy { font-size: .9rem; }

/* MVP-ID visual refresh — presentation only; existing behavior is unchanged. */
:root {
  --bg: #0e0d14;
  --panel: #17151f;
  --panel-2: #211e2c;
  --line: #353043;
  --text: #f6f4fa;
  --muted: #b7b1c5;
  --royal: #6941c6;
  --royal-bright: #7951d3;
  --purple: #ad8bff;
  --purple-deep: #7951d3;
  --accent: #b99bff;
  --accent-strong: #9b73f1;
  --danger: #ff9bab;
  --success: #9ce6bc;
}
body {
  background: radial-gradient(ellipse at 50% -18%, #302043 0, transparent 48rem), var(--bg);
  font-size: 15px;
  line-height: 1.55;
}
.shell { width: min(1120px, calc(100% - 48px)); padding: 30px 0 64px; }
.nav {
  align-items: center; gap: 5px; padding: 8px; margin-bottom: 28px;
  background: #17151fee; border: 1px solid var(--line); border-radius: 16px;
}
.nav a { padding: 10px 14px; font-weight: 650; font-size: .88rem; border-radius: 9px; }
.nav a:hover { background: #272133; box-shadow: none; }
.nav a.active { color: #e6d7ff; background: #35274c; box-shadow: inset 0 0 0 1px #654d8c; }
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 22px;
  padding: clamp(22px, 4vw, 40px); box-shadow: 0 12px 40px #0003; margin-bottom: 24px;
  min-width: 0; overflow-wrap: anywhere;
}
.shell > .card { border-top: 2px solid #8162bb; }
.narrow { max-width: 520px; margin-top: clamp(18px, 7vh, 78px); }
.eyebrow { color: #c5aaff; letter-spacing: .11em; font-size: .72rem; font-weight: 750; }
.eyebrow:not(:empty) { display: inline-flex; align-items: center; gap: 8px; }
.eyebrow:not(:empty)::before { content: ''; display: inline-block; width: 7px; height: 7px; flex: 0 0 7px; background: #bd9aff; border-radius: 50%; }
h1, h2, h3 { letter-spacing: -.025em; }
h1 { font-size: clamp(1.8rem, 3.5vw, 2.8rem); max-width: 26ch; line-height: 1.12; }
h2 { font-size: 1.25rem; line-height: 1.3; }
p { line-height: 1.65; }
.split-title > div { min-width: 0; }
.split-title > div > p.muted, .shell > .card > p.muted { max-width: 78ch; }
.stack { gap: 18px; margin-top: 24px; }
.stack > p { margin: 0; }
label { font-size: .88rem; font-weight: 650; gap: 8px; }
input, select, textarea {
  background: #100f17; color: var(--text); border: 1px solid #40394e;
  border-radius: 10px; padding: 12px 14px; min-width: 0;
}
input::placeholder, textarea::placeholder { color: #938ba1; opacity: 1; }
input:focus, select:focus, textarea:focus { border-color: #b38bff; background: #15111f; box-shadow: 0 0 0 3px #a67aff29; }
input[type=file] { max-width: 100%; padding: 8px; font-size: .84rem; }
input::file-selector-button { background: #302740; color: #eee5ff; border: 1px solid #63507d; border-radius: 6px; padding: 7px 9px; margin-inline-end: 8px; cursor: pointer; }
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 42px; max-width: 100%; text-align: center; line-height: 1.4;
  background: #24202f; color: #eeeaf5; border-color: #423a52;
  padding: 11px 16px; border-radius: 10px; font-weight: 650; font-size: .88rem;
  box-shadow: none; transition: background .15s, border-color .15s, transform .15s;
}
.button:hover:not(:disabled) { background: #30273e; border-color: #8e70bb; filter: none; }
.button.primary { background: #7951d3; border-color: #916ce3; box-shadow: 0 4px 14px #7951d329; color: #fff; }
.button.primary:hover:not(:disabled) { background: #8862de; border-color: #b38bff; box-shadow: 0 4px 14px #7951d329; }
.button:focus-visible, .nav a:focus-visible, summary:focus-visible, .dropzone:focus-within { outline: 2px solid #c5aaff; outline-offset: 3px; }
.button.small { min-height: 36px; padding: 8px 13px; white-space: nowrap; }
.notice, .result { background: #1b1725; border-color: #443754; padding: 16px; border-radius: 12px; overflow-wrap: anywhere; }
.notice.success { background: #17291f; color: var(--success); border-color: #42674f; }
.notice.error { background: #2e1922; color: #ffc4cf; border-color: #754250; }
.reader, .scan-layout #reader { background: #100e17; border: 1px dashed #5c4c72; border-radius: 14px; }
.scanner-grid { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 22px; align-items: start; }
.upload-panel, .scan-layout > .card, #confirmationBox { background: #1c1826; border: 1px solid #3f354e; box-shadow: none; padding: 22px; border-radius: 16px; }
.scan-layout > .card { margin-bottom: 0; }
.dropzone { min-height: 180px; padding: 18px; border-color: #705b8e; background: #131019; }
.dropzone:hover { border-color: #c5aaff; background: #21192d; }
.dropzone span { font-weight: 650; color: #e6d8ff; }
.brand-preview { background: #100e17; box-shadow: 0 8px 25px #0004; border-color: #41364f; }
.result-card a, .qr-new a, .details-text a { color: #cdb6ff; overflow-wrap: anywhere; }
/* Higher specificity also styles the management page's existing inline styles. */
.shell .manage-tools { display: grid; grid-template-columns: minmax(0,1.3fr) repeat(2,minmax(0,1fr)) auto auto; gap: 12px; align-items: end; padding: 18px; margin-top: 24px; background: #100f17; border: 1px solid var(--line); border-radius: 14px; }
.shell .manage-tools label { min-width: 0; }
.shell .record { background: #1c1925; border: 1px solid #393247; border-radius: 16px; padding: clamp(16px, 2.5vw, 25px); margin: 18px 0; min-width: 0; }
.record-head h2 { margin-bottom: 10px; font-size: 1.4rem; }
.record-head > div { min-width: 0; }
.record-head img { margin-right: 8px; border: 2px solid #69518a; }
.shell .pill-status { display: inline-block; border-radius: 6px; background: #30263e; border: 1px solid #55436c; color: #e0ceff; font-size: .75rem; padding: 4px 8px; letter-spacing: 0; margin: 3px 0; }
.shell .record-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; margin: 18px 0; }
.record-grid > div { min-width: 0; background: #13111b; border: 1px solid #352d42; padding: 12px; border-radius: 9px; overflow-wrap: anywhere; font-size: .87rem; }
.record-grid small { margin-bottom: 4px; font-size: .73rem; }
.shell .record details { border: 1px solid #393044; border-radius: 9px; background: #17141e; padding: 0 14px; margin-top: 9px; }
.record summary { padding: 12px 0; color: #e4d9f3; font-size: .88rem; font-weight: 650; cursor: pointer; }
.record details[open] { padding-bottom: 14px; }
.record details .stack { margin-top: 10px; }
.shell .record-actions { margin-top: 16px; gap: 9px; }
.shell .button.danger { color: #ffc0cc; background: #301e28; border-color: #70424f !important; }
.shell .button.danger:hover { background: #402333; }
.history { color: var(--muted); overflow-wrap: anywhere; }
.divider, hr { border: 0; border-top: 1px solid var(--line); margin: 18px 0; }
#regeneratedQr, #regeneratedPlayerQr { max-width: 100%; border-radius: 8px; }
#regeneratedQr img, #regeneratedQr canvas, #regeneratedPlayerQr img, #regeneratedPlayerQr canvas { max-width: 100%; height: auto !important; }
@media (max-width: 900px) {
  .shell .manage-tools { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .manage-tools label:first-child { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
  .shell { width: calc(100% - 28px); padding-top: 16px; }
  .nav { margin-bottom: 18px; gap: 4px; }
  .nav a { flex: 1 1 auto; text-align: center; padding: 9px; font-size: .8rem; }
  .scanner-grid, .shell .scan-layout { grid-template-columns: minmax(0,1fr); }
  .split-title { gap: 10px; }
  .card { border-radius: 16px; padding: 20px; }
  .reader { min-height: 260px; }
  .actions > .button { flex: 1 1 auto; }
  .narrow { margin-top: 24px; }
}
@media (max-width: 480px) {
  .shell .record-grid, .shell .manage-tools { grid-template-columns: minmax(0,1fr); }
  .manage-tools label:first-child { grid-column: auto; }
  .shell .record-actions .inline-form, .shell .record-actions .button { width: 100%; }
  .shell .record-actions .inline-form { margin-top: 0; }
  .upload-panel, .scan-layout > .card { padding: 15px; }
  .dropzone { padding: 12px; }
  .actions > .button { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .button, .nav a, .dropzone, input, textarea, select { transition: none; }
  .button:hover { transform: none; }
}
