:root {
  color-scheme: light;
  --primary: #8b4f2f;
  --primary-foreground: #fffaf2;
  --secondary: #e7d3af;
  --background: #fffdf9;
  --surface: #fffaf2;
  --surface-secondary: #f2e6d4;
  --text: #5b3423;
  --text-muted: #7f5b47;
  --border: #d6b889;
  --accent: #8b4f2f;
  --success: #8b4f2f;
  --warning: #b97845;
  --danger: #b44735;
  --surface-elevated: color-mix(in srgb, var(--surface) 90%, transparent);
  --surface-soft: var(--surface-secondary);
  --surface-hover: color-mix(in srgb, var(--primary) 9%, transparent);
  --text-primary: var(--text);
  --text-secondary: var(--text-muted);
  --border-subtle: color-mix(in srgb, var(--border) 55%, transparent);
  --border-soft: color-mix(in srgb, var(--border) 42%, transparent);
  --border-gold: color-mix(in srgb, var(--border) 70%, transparent);
  --accent-hover: color-mix(in srgb, var(--primary) 82%, #000000);
  --accent-gold: var(--border);
  --accent-gold-soft: var(--secondary);
  --bg: var(--background);
  --ink: var(--text);
  --muted: var(--text-muted);
  --line: var(--border-subtle);
  --primary-dark: var(--accent-hover);
  --radius: 18px;
  --radius-sm: 12px;
  --radius-lg: 24px;
  --shadow-soft: 0 8px 24px rgba(91, 52, 35, 0.08);
  --shadow-card: 0 14px 36px rgba(91, 52, 35, 0.1);
  --shadow: var(--shadow-card);
  --shadow-sticky: 0 1px 0 rgba(139, 79, 47, 0.08), 0 10px 22px rgba(91, 52, 35, 0.045);
  --focus-ring: 0 0 0 4px rgba(214, 184, 137, 0.36);
  --brand-emblem: url("assets/el-promillo-header-logo-couple-cutout.png");
  --brand-title-lockup: url("assets/el-promillo-title-lockup-new-cutout.png");
  --brand-mark: var(--brand-emblem);
  --chrome-bg: var(--background);
  --page-max-width: 1180px;
  --page-padding-x: clamp(1rem, 2vw, 1.5rem);
  --chrome-padding-x: max(var(--page-padding-x), calc((100vw - var(--page-max-width)) / 2 + var(--page-padding-x)));
  --page-padding-top: 1.2rem;
  --page-padding-bottom: 4rem;
  --section-gap: 1.35rem;
  --card-padding: clamp(1rem, 1.6vw, 1.35rem);
  --grid-gap: 1rem;
  --topbar-height: 5.1rem;
  --tabbar-height: 3.45rem;
  --sticky-stack-height: calc(var(--topbar-height) + var(--tabbar-height));
  --z-sticky-header: 30;
  --z-sticky-tabbar: 29;
  --z-modal: 80;
  --font-ui: Inter, "SF Pro Text", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-display: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  font-family: var(--font-ui);
}

@view-transition {
  navigation: auto;
}

::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 0.16s;
  animation-timing-function: ease-out;
}

:root[data-app-theme="blue-white"] {
  --primary: #1456a0;
  --primary-foreground: #ffffff;
  --secondary: #d9e9fb;
  --background: #f5f9fe;
  --surface: #ffffff;
  --surface-secondary: #eaf2fb;
  --text: #16283a;
  --text-muted: #516579;
  --border: #9dbbd9;
  --accent: #2d75c7;
}

:root[data-app-theme="green-white"] {
  --primary: #247047;
  --primary-foreground: #ffffff;
  --secondary: #dcefe4;
  --background: #f5fbf7;
  --surface: #ffffff;
  --surface-secondary: #e8f4ec;
  --text: #18372a;
  --text-muted: #526d60;
  --border: #9bc7ad;
  --accent: #34885b;
}

:root[data-app-theme="violet-white"] {
  --primary: #6f42a5;
  --primary-foreground: #ffffff;
  --secondary: #eadff5;
  --background: #faf7fd;
  --surface: #ffffff;
  --surface-secondary: #f0e8f8;
  --text: #30213f;
  --text-muted: #6e5a7f;
  --border: #c4add9;
  --accent: #8558b8;
}

:root[data-app-theme="navy-lightgray"] {
  --primary: #17365f;
  --primary-foreground: #ffffff;
  --secondary: #d7e0e9;
  --background: #eef2f6;
  --surface: #ffffff;
  --surface-secondary: #e1e7ed;
  --text: #182534;
  --text-muted: #586778;
  --border: #9cabb9;
  --accent: #345c8d;
}

:root[data-app-theme="black-white"] {
  --primary: #161616;
  --primary-foreground: #ffffff;
  --secondary: #e7e7e7;
  --background: #f7f7f7;
  --surface: #ffffff;
  --surface-secondary: #eeeeee;
  --text: #151515;
  --text-muted: #5f5f5f;
  --border: #b9b9b9;
  --accent: #303030;
}

:root[data-app-theme="anthracite-gold"] {
  color-scheme: dark;
  --primary: #d2ad5b;
  --primary-foreground: #1d1f21;
  --secondary: #3b3f43;
  --background: #1d2023;
  --surface: #292d31;
  --surface-secondary: #34393e;
  --text: #f7f3e8;
  --text-muted: #c7c0af;
  --border: #756749;
  --accent: #e0bd70;
  --success: #70c992;
  --warning: #efbd65;
  --danger: #f08074;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  overflow-x: hidden;
  scroll-padding-top: calc(var(--sticky-stack-height) + 1rem);
  background: var(--chrome-bg);
  scrollbar-gutter: stable;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: clip;
  background: linear-gradient(180deg, var(--surface) 0%, var(--bg) 52%, var(--surface-secondary) 100%);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overscroll-behavior-y: none;
}

a {
  color: inherit;
}

img,
svg,
video,
canvas {
  max-width: 100%;
  vertical-align: middle;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  font-size: clamp(1.85rem, 3vw, 2.65rem);
  line-height: 1.08;
  margin-bottom: 0.6rem;
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0;
}

h2 {
  font-size: 1.18rem;
  margin-bottom: 1rem;
  font-weight: 650;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 0.2rem;
  font-weight: 650;
}

button,
.button {
  border: 0;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.55rem;
  padding: 0.64rem 0.98rem;
  text-decoration: none;
  font: inherit;
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1.15;
  text-align: center;
  touch-action: manipulation;
  transition: background 0.18s ease, box-shadow 0.18s ease, color 0.18s ease, transform 0.18s ease, border-color 0.18s ease;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.65;
  box-shadow: none;
}

button.is-busy {
  cursor: progress;
}

.primary {
  background: linear-gradient(180deg, color-mix(in srgb, var(--primary) 86%, #ffffff) 0%, var(--primary) 100%);
  color: var(--primary-foreground);
  box-shadow: 0 8px 18px color-mix(in srgb, var(--primary) 24%, transparent);
}

.primary:hover {
  background: var(--primary-dark);
  box-shadow: 0 10px 22px color-mix(in srgb, var(--primary) 30%, transparent);
  transform: translateY(-1px);
}

.secondary {
  background: color-mix(in srgb, var(--secondary) 70%, transparent);
  color: var(--ink);
  border: 1px solid var(--border-gold);
  box-shadow: none;
}

.secondary:hover {
  background: color-mix(in srgb, var(--secondary) 90%, transparent);
}

.danger-soft {
  color: var(--danger);
}

.danger-soft:hover {
  background: rgba(255, 59, 48, 0.1);
}

.text-button {
  background: transparent;
  color: var(--primary);
  padding: 0.35rem 0.5rem;
  min-height: auto;
  font-weight: 600;
}

button:focus-visible,
.button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
summary:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.wide {
  width: 100%;
}

label {
  display: grid;
  gap: 0.45rem;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 500;
  min-width: 0;
}

.check-row {
  display: flex;
  grid-template-columns: none;
  align-items: center;
  gap: 0.6rem;
  color: var(--ink);
}

.check-row input {
  width: auto;
  min-height: auto;
}

.checkbox-line {
  display: inline-flex;
  grid-template-columns: none;
  align-items: center;
  justify-self: start;
  gap: 0.55rem;
  color: var(--ink);
  cursor: pointer;
}

.checkbox-line input[type="checkbox"] {
  flex: 0 0 auto;
  width: 1rem;
  min-width: 1rem;
  height: 1rem;
  min-height: 1rem;
  margin: 0;
  padding: 0;
  accent-color: var(--primary);
}

.checkbox-line span {
  line-height: 1.25;
}

input,
textarea,
select {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  min-height: 2.7rem;
  padding: 0.72rem 0.78rem;
  color: var(--ink);
  background: var(--surface-elevated);
  font: inherit;
  line-height: 1.25;
  transition: background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

input:hover,
textarea:hover,
select:hover {
  background: var(--surface);
  border-color: var(--border);
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  background: var(--surface);
  border-color: var(--primary);
  box-shadow: var(--focus-ring);
}

input[type="color"] {
  padding: 0.2rem;
}

textarea {
  resize: vertical;
}

.auth-layout,
.center-layout,
.claim-layout {
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: var(--page-padding-x);
}

.auth-layout {
  align-content: center;
}

.auth-panel {
  width: min(980px, 100%);
}

.auth-panel .brand-block {
  padding: 0 0.25rem;
}

.auth-brand-mark {
  width: min(100%, 32rem);
  display: flex;
  align-items: center;
  gap: clamp(0.7rem, 2vw, 1rem);
  margin-bottom: clamp(0.95rem, 2vw, 1.35rem);
}

.auth-brand-emblem {
  flex: 0 0 auto;
  width: clamp(2.8rem, 7vw, 4.3rem);
  height: clamp(3.55rem, 8vw, 5.3rem);
  background: var(--brand-emblem) center / contain no-repeat;
}

.auth-brand-lockup {
  flex: 0 1 auto;
  display: block;
  width: min(22rem, 70vw);
  height: clamp(3.2rem, 7vw, 5rem);
  min-width: 0;
  object-fit: contain;
  object-position: left center;
}

.auth-grid,
.dashboard-grid,
.scanner-grid {
  display: grid;
  gap: var(--grid-gap);
}

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

.site-about-section {
  width: min(980px, 100%);
  display: grid;
  justify-items: center;
  gap: clamp(0.75rem, 2vw, 1.1rem);
  padding: clamp(1.25rem, 3vw, 2rem) 1rem 0;
  text-align: center;
}

.site-about-logo {
  width: min(15rem, 52vw);
  max-height: 16rem;
  object-fit: contain;
}

.site-about-lockup {
  width: min(30rem, 84vw);
  max-height: 9rem;
  object-fit: contain;
}

.site-about-email {
  color: var(--text-secondary);
  font-family: var(--font-display);
  font-size: clamp(1.15rem, 2.2vw, 1.65rem);
  font-weight: 700;
  line-height: 1.1;
  text-decoration: none;
}

.site-about-email:hover,
.site-about-email:focus-visible {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 0.28rem;
}

.site-legal-links {
  width: min(980px, 100%);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.55rem 1rem;
  margin: clamp(1.1rem, 3vw, 1.7rem) auto 0;
  padding: 0 1rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.site-legal-links a {
  color: currentColor;
  text-decoration: none;
}

.site-legal-links a:hover,
.site-legal-links a:focus-visible {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 0.24rem;
}

.dashboard-about-section {
  margin: clamp(2rem, 5vw, 3.5rem) auto 0;
  padding-bottom: clamp(0.5rem, 2vw, 1.25rem);
}

.dashboard-grid,
.scanner-grid {
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  align-items: start;
}

.panel,
.template-card {
  background: var(--surface-elevated);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(18px);
  min-width: 0;
}

.panel {
  padding: var(--card-padding);
  display: grid;
  gap: var(--grid-gap);
}

.panel.compact {
  margin-top: 1rem;
  box-shadow: none;
}

.panel.narrow {
  width: min(520px, 100%);
}

.profile-panel {
  width: min(720px, 100%);
}

.account-shell {
  display: grid;
  gap: var(--section-gap);
}

.mobile-account-summary {
  display: none;
}

.scanner-only-mode .mobile-account-summary {
  display: grid;
  gap: 1rem;
  justify-items: start;
}

.scanner-only-mode .account-shell > .page-heading,
.scanner-only-mode .account-grid,
.scanner-only-mode .account-form {
  display: none;
}

.mobile-account-summary h1 {
  margin: 0;
  font-size: clamp(2rem, 9vw, 2.8rem);
}

.account-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.45fr);
  gap: 1rem;
  align-items: stretch;
}

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

.account-detail-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem;
  margin: 0;
}

.account-detail-list div {
  min-width: 0;
  padding: 0.75rem;
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
}

.account-detail-list dt {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
  text-transform: uppercase;
}

.account-detail-list dd {
  margin: 0;
  color: var(--ink);
  font-weight: 650;
  overflow-wrap: anywhere;
}

.account-form,
.account-location-block {
  display: grid;
  gap: 1rem;
}

.account-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
}

.account-logo-block {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 1rem;
  align-items: center;
  padding: 1rem;
  border: 1px solid var(--border-gold);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.account-logo-preview {
  width: 5.5rem;
  height: 5.5rem;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--border-gold);
  border-radius: 22px;
  color: var(--primary);
  background: rgba(214, 184, 137, 0.18);
  font-size: 1.35rem;
  font-weight: 750;
}

.account-logo-preview.has-image {
  width: 5rem;
  height: 5rem;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.account-logo-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.account-logo-preview.has-image {
  border-color: transparent;
  background: transparent;
}

.account-logo-controls {
  display: grid;
  gap: 0.65rem;
  min-width: 0;
}

.account-logo-controls h3 {
  margin: 0;
}

.full-span {
  grid-column: 1 / -1;
}

.account-location-block {
  padding-top: 1rem;
  border-top: 1px solid var(--border-soft);
}

.account-location-actions {
  justify-content: flex-end;
}

.theme-settings {
  gap: 1rem;
}

.theme-option-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.85rem;
}

.theme-option {
  display: grid;
  gap: 0.7rem;
  min-height: 7.5rem;
  padding: 0.85rem;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  background: var(--surface-secondary);
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.theme-option:hover {
  border-color: var(--primary);
  transform: translateY(-1px);
}

.theme-option:has(input:checked) {
  border-color: var(--primary);
  box-shadow: var(--focus-ring);
}

.theme-option input {
  position: absolute;
  width: 1px;
  height: 1px;
  min-height: 0;
  opacity: 0;
  pointer-events: none;
}

.theme-preview {
  display: grid;
  grid-template-columns: 1.35fr 1fr 0.65fr;
  height: 3.4rem;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--text) 16%, transparent);
  border-radius: var(--radius-sm);
  background: var(--theme-background);
}

.theme-preview::before,
.theme-preview::after,
.theme-preview span {
  content: "";
  display: block;
}

.theme-preview::before {
  background: var(--theme-primary);
}

.theme-preview span {
  background: var(--theme-background);
}

.theme-preview::after {
  background: var(--theme-secondary);
}

.theme-option strong {
  color: var(--text);
  font-size: 0.9rem;
}

.theme-save-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.theme-save-status {
  min-height: 1.4rem;
  color: var(--text-muted);
  font-size: 0.88rem;
}
.brand-block {
  margin-bottom: 1rem;
}

.eyebrow {
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 650;
  letter-spacing: 0;
  text-transform: uppercase;
  margin-bottom: 0.35rem;
}

.eyebrow::before {
  content: "";
  display: inline-block;
  width: 1.6rem;
  height: 1px;
  margin-right: 0.48rem;
  vertical-align: middle;
  background: var(--accent-gold);
}

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

.message {
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  border: 1px solid var(--border-soft);
  background: var(--surface-elevated);
  color: var(--ink);
  margin-bottom: 1rem;
  box-shadow: var(--shadow-soft);
  overflow-wrap: anywhere;
}

.message-slot {
  position: fixed;
  z-index: calc(var(--z-modal) - 1);
  right: var(--page-padding-x);
  bottom: calc(env(safe-area-inset-bottom, 0px) + 1rem);
  width: min(26rem, calc(100vw - (var(--page-padding-x) * 2)));
  min-height: 0;
  margin: 0;
  transition: opacity 0.14s ease, background-color 0.14s ease, border-color 0.14s ease;
}

.message-slot.info,
.message-slot.success {
  background: #f7ecdc;
}

.message-slot.warning {
  background: #f7ead7;
}

.message-slot.error {
  background: #fff1ee;
}

.message-slot.is-empty,
.message-slot:empty {
  visibility: hidden;
  opacity: 0;
}

.is-updating {
  pointer-events: none;
  opacity: 0.72;
  transition: opacity 0.14s ease;
}

.message.warning {
  border-color: rgba(185, 120, 69, 0.32);
  background: rgba(231, 211, 175, 0.28);
  color: #7a4c25;
}

.message.success {
  border-color: rgba(139, 79, 47, 0.22);
  background: rgba(214, 184, 137, 0.18);
}

.message.error {
  border-color: rgba(255, 59, 48, 0.22);
  background: rgba(255, 59, 48, 0.09);
  color: var(--danger);
}

.message.scanner-blocked {
  animation: scannerBlockedShake 0.28s ease;
  border-width: 2px;
}

button.danger,
.button.danger {
  border-color: #b42318;
  background: #b42318;
  color: #fff;
}

button.danger:hover,
.button.danger:hover {
  background: #8f1c13;
}

.message.info {
  border-color: rgba(214, 184, 137, 0.32);
  background: rgba(231, 211, 175, 0.24);
}

.topbar {
  width: 100%;
  height: var(--topbar-height);
  min-height: var(--topbar-height);
  margin: 0 auto;
  padding: 0 var(--chrome-padding-x);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 0;
  background: var(--chrome-bg);
  position: sticky;
  top: env(safe-area-inset-top, 0);
  z-index: var(--z-sticky-header);
  box-shadow: none;
}

.topbar nav,
.button-row {
  display: flex;
  gap: 0.7rem;
  align-items: center;
}

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

.brand-link {
  font-weight: 700;
  text-decoration: none;
  letter-spacing: 0;
}

.business-brand-link {
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
  flex: 1 1 auto;
  min-width: 0;
  color: var(--ink);
  text-decoration: none;
}

.business-brand-logo {
  flex: 0 0 auto;
  width: 3.7rem;
  height: 3.7rem;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--border-gold);
  border-radius: 999px;
  color: var(--primary);
  background: color-mix(in srgb, var(--secondary) 72%, transparent);
  font-size: 1.02rem;
  font-weight: 750;
}

.business-brand-logo.has-image {
  width: 3.2rem;
  height: 3.2rem;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.business-brand-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.business-brand-logo.has-image {
  border-color: transparent;
  background: transparent;
}

.business-brand-name {
  min-width: 0;
  max-width: min(38vw, 520px);
  overflow: hidden;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 2.7vw, 2.45rem);
  font-weight: 700;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-brand-mark {
  flex: 0 1 auto;
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.85rem;
  color: var(--ink);
  margin-left: auto;
  min-width: 0;
  text-decoration: none;
}

.app-brand-emblem {
  width: 2.8rem;
  height: 3.7rem;
  display: block;
  flex: 0 0 auto;
  background: var(--brand-emblem) center / contain no-repeat;
}

.app-brand-lockup {
  display: block;
  width: 8.2rem;
  height: 3.7rem;
  flex: 0 1 auto;
  object-fit: contain;
  object-position: right center;
}

.app-tabbar {
  --app-tab-padding-x: 0.78rem;
  position: sticky;
  top: calc(env(safe-area-inset-top, 0) + var(--topbar-height));
  z-index: var(--z-sticky-tabbar);
  display: flex;
  gap: 0.45rem;
  align-items: center;
  width: 100%;
  min-height: var(--tabbar-height);
  margin: 0 auto;
  overflow-x: auto;
  padding: 0.5rem var(--chrome-padding-x);
  padding-left: max(0.5rem, calc(var(--chrome-padding-x) - var(--app-tab-padding-x)));
  border-bottom: 0;
  background: var(--chrome-bg);
  box-shadow: var(--shadow-sticky);
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
}

.app-tabbar::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: var(--border-soft);
  pointer-events: none;
}

.app-tabbar::-webkit-scrollbar {
  display: none;
}

.app-tab {
  flex: 0 0 auto;
  min-height: 2.4rem;
  padding: 0.52rem var(--app-tab-padding-x);
  color: var(--muted);
  font-weight: 500;
  text-decoration: none;
  text-underline-offset: 0.35rem;
  opacity: 0.82;
  border-radius: 0;
  white-space: nowrap;
  transition: background 0.18s ease, color 0.18s ease, opacity 0.18s ease;
}

.app-tabbar button.app-tab {
  border: 0;
  font: inherit;
  cursor: pointer;
}

.scanner-only-logout {
  display: none;
}

.desktop-only-link {
  display: inline-flex;
}

.scanner-only-mode .app-tabbar a[href^="dashboard.html"],
.scanner-only-mode .scanner-only-logout {
  display: none;
}

.scanner-only-mode .app-tab-account {
  display: inline-flex;
}

.app-tab:hover {
  color: var(--ink);
  background: transparent;
  opacity: 1;
}

.app-tab.is-active,
.app-tab[aria-current="page"] {
  color: var(--primary);
  background: transparent;
  font-weight: 650;
  text-decoration: underline;
  text-decoration-color: var(--primary);
  text-decoration-thickness: 2px;
  opacity: 1;
}

.app-tab-account {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.4rem;
  height: 2.4rem;
  padding: 0;
  border: 0;
  background: transparent;
  text-decoration: none;
}

.app-tab-account:hover {
  color: var(--primary);
  background: transparent;
}

.app-tab-account.is-active,
.app-tab-account[aria-current="page"] {
  color: var(--primary);
  text-decoration: none;
  box-shadow: none;
  background: transparent;
}

.account-tab-icon {
  width: 1.35rem;
  height: 1.35rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

.app-tab-account.is-active .account-tab-icon,
.app-tab-account[aria-current="page"] .account-tab-icon {
  stroke-width: 2.35;
}

.page-shell {
  width: min(100%, var(--page-max-width));
  margin: 0 auto;
  padding: var(--page-padding-top) var(--page-padding-x) var(--page-padding-bottom);
}

.page-heading,
.section-title,
.panel-heading {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  min-width: 0;
}

.page-heading > div,
.section-title > div,
.panel-heading > div {
  min-width: 0;
}

.page-heading,
.stats-section > .section-title {
  position: relative;
  align-items: flex-end;
  padding: 0.1rem 0 1rem;
  margin-bottom: 1rem;
}

.page-heading::after,
.stats-section > .section-title::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: min(360px, 62vw);
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent-gold) 0%, rgba(214, 184, 137, 0.72) 48%, rgba(214, 184, 137, 0) 100%);
}

.page-heading h1,
.stats-section > .section-title h2 {
  margin: 0;
  color: var(--text-primary);
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0;
}

.page-heading h1 {
  font-size: clamp(2.05rem, 4vw, 3.15rem);
}

.stats-section > .section-title h2 {
  font-size: clamp(1.75rem, 3vw, 2.45rem);
  line-height: 1.08;
}

.page-heading .eyebrow,
.stats-section > .section-title .eyebrow {
  margin-bottom: 0.28rem;
}

.view-subtitle,
.stats-section > .section-title .muted {
  max-width: 620px;
  margin: 0.45rem 0 0;
  color: var(--text-secondary);
  font-size: 0.98rem;
}

.section-block {
  margin-top: var(--section-gap);
}

.section-block:first-of-type {
  margin-top: 0;
}

#dashboardOverview,
#visitorStatistics {
  scroll-margin-top: calc(var(--sticky-stack-height) + 1rem);
}

.split-row,
.edit-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--grid-gap);
}

.editor-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.86fr);
  gap: var(--grid-gap);
  align-items: start;
}

.editor-fields,
.feature-fields {
  display: grid;
  gap: 1rem;
}

.feature-fields {
  border-top: 1px solid var(--border-soft);
  padding-top: 1rem;
}

.optional-feature-title {
  color: var(--ink);
  font-size: 0.98rem;
  font-weight: 650;
  margin: 0;
}

.optional-feature-toggles {
  display: grid;
  gap: 0.75rem;
  padding-top: 0.9rem;
}

.optional-feature-toggle {
  min-height: 48px;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-sm);
  background: rgba(255, 250, 242, 0.58);
  cursor: pointer;
  user-select: none;
  transition: background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.optional-feature-toggle:hover {
  border-color: rgba(214, 184, 137, 0.72);
  background: rgba(231, 211, 175, 0.26);
}

.optional-feature-toggle input {
  accent-color: var(--primary);
}

.optional-feature-toggle:has(input:checked) {
  border-color: var(--primary);
  background: rgba(214, 184, 137, 0.28);
  box-shadow: 0 8px 20px rgba(91, 52, 35, 0.1);
}

.optional-feature-toggle.is-locked {
  cursor: not-allowed;
  opacity: 0.66;
  background: rgba(142, 142, 147, 0.08);
}

.optional-feature-toggle.is-locked:hover {
  border-color: var(--border-gold);
  background: rgba(142, 142, 147, 0.08);
}

.feature-lock-label {
  margin-left: auto;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
}

.editor-preview-panel {
  position: sticky;
  top: calc(var(--sticky-stack-height) + 1rem);
  display: grid;
  gap: 0.7rem;
  align-self: start;
}

.qr-download-panel {
  display: grid;
  gap: 0.7rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border-soft);
}

.editor-qr {
  width: min(100%, 220px);
  aspect-ratio: 1;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  background: #fff;
  box-shadow: var(--shadow-soft);
}

.copy-input {
  min-width: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 0.82rem;
}

.editor-panel {
  scroll-margin-top: calc(var(--sticky-stack-height) + 1rem);
}

.wallet-notification-panel {
  margin-top: var(--section-gap);
}

.wallet-notification-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.7fr);
  gap: var(--grid-gap);
  align-items: start;
  min-width: 0;
}

.wallet-notification-form,
.wallet-notification-preview,
.history-list {
  display: grid;
  gap: 1rem;
  min-width: 0;
}

.wallet-notification-form.is-disabled label:not(:first-child),
.wallet-notification-form.is-disabled .target-filter-fields,
.wallet-notification-form.is-disabled .form-actions {
  opacity: 0.56;
}

.target-filter-fields {
  display: grid;
  gap: 0.8rem;
  border: 1px solid var(--border-gold);
  border-radius: var(--radius);
  padding: 0.85rem;
  background: rgba(255, 250, 242, 0.54);
}

.target-window-fields {
  display: grid;
  gap: 0.65rem;
  padding: 0.75rem;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
}

.target-window-fields legend {
  padding: 0 0.35rem;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
}

.notification-preview-card {
  display: grid;
  gap: 0.35rem;
  border: 1px solid var(--border-gold);
  border-radius: var(--radius);
  padding: 1rem;
  background: rgba(255, 250, 242, 0.58);
}

.notification-preview-card strong {
  color: var(--ink);
  overflow-wrap: anywhere;
}

.notification-preview-card span {
  color: var(--muted);
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.visible-message {
  display: block;
}

.history-item {
  display: grid;
  gap: 0.35rem;
  border-top: 1px solid var(--border-soft);
  padding-top: 0.85rem;
}

.history-item strong,
.history-item span {
  display: block;
}

.history-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.history-meta span {
  border-radius: 999px;
  padding: 0.22rem 0.5rem;
  background: rgba(214, 184, 137, 0.22);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.history-errors {
  display: grid;
  gap: 0.3rem;
  margin-top: 0.25rem;
}

.history-error {
  color: var(--danger);
  font-size: 0.86rem;
  overflow-wrap: anywhere;
}

.history-error-warning {
  color: #9a5b00;
}

.history-detail {
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.75rem;
  background: rgba(255, 250, 242, 0.52);
}

.history-detail summary,
.history-json summary {
  cursor: pointer;
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 600;
}

.history-detail-list,
.history-audit-list {
  display: grid;
  gap: 0.55rem;
  margin-top: 0.65rem;
  min-width: 0;
}

.history-detail-entry {
  display: grid;
  gap: 0.35rem;
  border-left: 3px solid var(--danger);
  padding: 0.55rem 0.65rem;
  background: var(--surface);
  min-width: 0;
  overflow-wrap: anywhere;
}

.history-detail-warning {
  border-left-color: var(--warning);
}

.history-detail-heading {
  display: grid;
  gap: 0.2rem;
}

.history-detail-heading span,
.history-detail-entry p,
.history-audit-row span {
  color: var(--muted);
  font-size: 0.82rem;
}

.history-json {
  display: grid;
  gap: 0.35rem;
}

.history-json pre {
  max-height: 14rem;
  overflow: auto;
  border: 1px solid rgba(91, 52, 35, 0.2);
  border-radius: var(--radius-sm);
  padding: 0.65rem;
  background: #1d1d1f;
  color: #f8fafc;
  font-size: 0.76rem;
  white-space: pre-wrap;
  word-break: break-word;
}

.history-audit-row {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) 0.7fr 0.7fr minmax(0, 1fr);
  gap: 0.45rem;
  align-items: center;
  border-top: 1px solid var(--border-soft);
  padding-top: 0.45rem;
}

#walletNotificationLimitWarnings {
  display: grid;
  gap: 0.25rem;
  min-width: 0;
}

#walletNotificationLimitWarnings span {
  overflow-wrap: anywhere;
}

.template-list {
  display: grid;
  gap: var(--grid-gap);
}

.table-panel {
  overflow-x: auto;
  background: rgba(255, 250, 242, 0.94);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(18px);
  min-width: 0;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
}

.cards-table {
  width: 100%;
  min-width: 860px;
  border-collapse: collapse;
}

.cards-table th,
.cards-table td {
  padding: 0.8rem 0.85rem;
  border-bottom: 1px solid var(--border-soft);
  text-align: left;
  vertical-align: middle;
}

.cards-table th {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 650;
  text-transform: uppercase;
  background: rgba(242, 230, 212, 0.92);
}

.cards-table tbody tr {
  cursor: pointer;
  transition: background 0.15s ease;
}

.cards-table tbody tr:hover,
.cards-table tbody tr.is-selected {
  background: rgba(214, 184, 137, 0.18);
}

.cards-table tbody tr:last-child td {
  border-bottom: 0;
}

.card-title-cell {
  display: flex;
  gap: 0.7rem;
  align-items: center;
}

.card-title-cell span {
  display: block;
  color: var(--muted);
  font-size: 0.85rem;
  margin-top: 0.15rem;
}

.card-table-icon {
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 0;
  object-fit: contain;
  background: transparent;
  flex: 0 0 auto;
}

.card-table-icon-empty {
  width: 2.35rem;
  height: 2.35rem;
  border: 1px dashed var(--border-subtle);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
}

.table-qr {
  width: 4rem;
  height: 4rem;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  background: #fff;
}

.table-actions {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.table-actions button,
.table-actions .button {
  min-height: 2.25rem;
  padding: 0.45rem 0.65rem;
  font-size: 0.85rem;
}

.actions-cell {
  width: 11rem;
}

.action-select {
  width: 100%;
  min-height: 2.35rem;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: rgba(255, 250, 242, 0.84);
  color: var(--ink);
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  padding: 0.45rem 2rem 0.45rem 0.65rem;
  cursor: pointer;
  text-overflow: ellipsis;
}

.action-select:focus {
  outline: none;
  border-color: rgba(214, 184, 137, 0.72);
  box-shadow: var(--focus-ring);
}

.stats-filter-panel {
  display: grid;
  gap: var(--grid-gap);
  margin-bottom: var(--grid-gap);
}

.stats-filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.9rem;
}

.stats-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.85rem;
  margin-bottom: var(--grid-gap);
}

.kpi-compact-row {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: stretch;
}

.kpi-card {
  display: grid;
  gap: 0.25rem;
  padding: 1rem;
  border: 1px solid var(--border-gold);
  border-radius: var(--radius);
  background: var(--surface-elevated);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(16px);
  min-height: 6rem;
  min-width: 0;
}

.kpi-card-compact {
  flex: 1 1 8.6rem;
  max-width: 12rem;
  min-height: 4.35rem;
  padding: 0.72rem 0.82rem;
}

.kpi-card span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 500;
}

.kpi-card strong {
  font-size: 1.45rem;
  font-weight: 700;
}

.kpi-card-compact span {
  font-size: 0.76rem;
}

.kpi-card-compact strong {
  font-size: 1.08rem;
}

.stats-chart-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-flow: row dense;
  gap: var(--grid-gap);
  margin-bottom: var(--grid-gap);
}

.chart-card {
  display: grid;
  gap: 0.75rem;
  padding: 1rem;
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-lg);
  background: var(--surface-elevated);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(16px);
  min-width: 0;
}

.chart-card-wide {
  grid-column: 1 / -1;
}

.chart-card-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
}

.chart-card-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
}

.chart-card h3 {
  margin: 0;
}

.chart-view-switcher {
  min-width: 11rem;
}

.chart-view-switcher select {
  min-height: 2.35rem;
  padding: 0.5rem 0.65rem;
}

.last-scans-card {
  gap: 0;
}

.last-scans-header {
  align-items: center;
}

.last-scans-title-block {
  display: grid;
  gap: 0.15rem;
  min-width: 0;
}

.last-scans-title-block span {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 650;
}

.last-scans-toggle {
  width: 2.35rem;
  height: 2.35rem;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid var(--border-gold);
  border-radius: 999px;
  background: rgba(255, 250, 242, 0.72);
  color: var(--primary);
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.last-scans-toggle:hover,
.last-scans-toggle:focus-visible {
  border-color: rgba(139, 79, 47, 0.34);
  background: rgba(214, 184, 137, 0.28);
  transform: translateY(-1px);
}

.last-scans-toggle:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.last-scans-toggle span {
  display: block;
  transition: transform 0.18s ease;
}

.last-scans-toggle[aria-expanded="true"] span {
  transform: rotate(180deg);
}

.last-scans-panel {
  display: grid;
  gap: 0.75rem;
  margin-top: 0.9rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--border-soft);
}

.bar-list {
  display: grid;
  gap: 0.5rem;
}

.bar-list-horizontal .bar-row {
  grid-template-columns: minmax(150px, 0.9fr) minmax(0, 1fr) minmax(42px, auto);
}

.bar-row {
  display: grid;
  grid-template-columns: minmax(90px, 0.7fr) minmax(0, 1fr) minmax(42px, auto);
  align-items: center;
  gap: 0.6rem;
  font-size: 0.88rem;
  min-width: 0;
}

.bar-track {
  height: 0.7rem;
  border-radius: 999px;
  background: rgba(139, 79, 47, 0.1);
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: inherit;
  background: var(--primary);
}

.pie-layout {
  display: grid;
  grid-template-columns: minmax(140px, 180px) minmax(0, 1fr);
  gap: 1rem;
  align-items: center;
}

.pie-chart {
  width: min(180px, 100%);
  aspect-ratio: 1;
  border-radius: 50%;
  border: 1px solid var(--border-gold);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.45);
}

.pie-chart.is-donut {
  display: grid;
  place-items: center;
  position: relative;
}

.pie-chart.is-donut::after {
  content: "";
  position: absolute;
  inset: 27%;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border-soft);
}

.pie-chart.is-donut span {
  position: relative;
  z-index: 1;
  color: var(--ink);
  font-weight: 700;
}

.chart-legend {
  display: grid;
  gap: 0.45rem;
}

.legend-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 0.5rem;
  align-items: center;
  color: var(--muted);
  font-size: 0.86rem;
}

.legend-row strong {
  color: var(--ink);
  font-weight: 600;
}

.legend-color {
  width: 0.85rem;
  height: 0.85rem;
  border-radius: 999px;
}

.line-chart-shell {
  display: grid;
  gap: 0.35rem;
}

.line-chart {
  width: 100%;
  min-height: 9.5rem;
  border: 1px solid var(--border-gold);
  border-radius: var(--radius);
  background: rgba(255, 250, 242, 0.58);
}

.chart-axis {
  stroke: var(--border-subtle);
  stroke-width: 2;
}

.line-chart-line {
  fill: none;
  stroke: var(--primary);
  stroke-width: 4;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.line-chart-point {
  fill: var(--surface);
  stroke: var(--primary);
  stroke-width: 3;
}

.line-chart-labels {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  color: var(--muted);
  font-size: 0.82rem;
}

.matrix-chart,
.stacked-chart {
  display: grid;
  gap: 0.75rem;
}

.grouped-chart {
  align-items: stretch;
}

.matrix-row,
.stacked-row {
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr) auto;
  gap: 0.75rem;
  align-items: center;
}

.grouped-bars {
  display: flex;
  gap: 0.7rem;
  align-items: end;
  min-height: 9rem;
  padding: 0.65rem;
  border: 1px solid var(--border-gold);
  border-radius: var(--radius);
  background: rgba(255, 250, 242, 0.58);
}

.grouped-bar {
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 0.3rem;
  width: min(7rem, 45%);
  height: 8rem;
  align-items: end;
}

.grouped-bar small {
  color: var(--muted);
  font-size: 0.72rem;
  overflow-wrap: anywhere;
}

.vertical-bar {
  width: 100%;
  min-height: 0.25rem;
  border-radius: var(--radius) var(--radius) 0 0;
}

.stacked-track {
  display: flex;
  min-width: 3rem;
  height: 1.4rem;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(139, 79, 47, 0.1);
}

.stacked-track span {
  display: grid;
  min-width: 0;
  place-items: center;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
}

.heatmap-scroll,
.stats-table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.heatmap-grid {
  display: grid;
  grid-template-columns: 3.2rem repeat(var(--heatmap-hours), minmax(1.9rem, 1fr));
  gap: 0.18rem;
  min-width: 780px;
  align-items: stretch;
}

.heatmap-corner,
.heatmap-hour,
.heatmap-weekday,
.heatmap-cell {
  min-height: 1.75rem;
  display: grid;
  place-items: center;
  border-radius: 0.35rem;
  font-size: 0.72rem;
}

.heatmap-hour,
.heatmap-weekday {
  color: var(--muted);
  font-weight: 650;
}

.heatmap-cell {
  background: rgba(139, 79, 47, var(--heat));
  color: var(--ink);
  font-weight: 650;
}

.stats-table {
  min-width: 520px;
}

.chart-copy-button {
  justify-self: start;
  color: var(--primary);
}

.template-card {
  display: grid;
  grid-template-columns: minmax(240px, 330px) minmax(0, 1fr);
  padding: var(--card-padding);
  gap: var(--grid-gap);
  align-items: start;
}

.template-details {
  display: grid;
  gap: 1rem;
  align-content: start;
}

.wallet-preview {
  width: min(100%, 19.5rem);
  aspect-ratio: 2 / 3;
  min-height: 0;
  border-radius: 24px;
  padding: 1.1rem;
  color: var(--card-fg);
  background: var(--card-bg);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  align-content: stretch;
  gap: clamp(0.62rem, 2vw, 0.82rem);
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(214, 184, 137, 0.28), 0 18px 38px rgba(91, 52, 35, 0.18);
  contain: layout paint;
}

.wallet-preview::after {
  content: "";
  position: absolute;
  right: -1.2rem;
  bottom: -2.2rem;
  width: 8rem;
  height: 10.2rem;
  background: var(--card-emblem, var(--brand-emblem)) center / contain no-repeat;
  opacity: 0.055;
  pointer-events: none;
}

.wallet-preview > * {
  position: relative;
  z-index: 1;
}

.wallet-top {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  justify-content: space-between;
  min-width: 0;
  font-weight: 650;
}

.wallet-top img,
.wallet-logo-placeholder {
  width: 2rem;
  height: 2rem;
  display: grid;
  place-items: center;
  color: currentColor;
  font-size: 0.72rem;
  font-weight: 750;
  object-fit: contain;
}

.wallet-top img {
  border-radius: 0;
  background: transparent;
}

.wallet-logo-placeholder {
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.22);
}

.wallet-brand-lockup,
.wallet-header-fields {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 0.62rem;
}

.wallet-brand-lockup {
  flex: 1 1 auto;
}

.wallet-brand-lockup-event {
  flex: 0 0 auto;
  align-items: flex-start;
  flex-direction: column;
  gap: 0.22rem;
  max-width: 7.2rem;
}

.wallet-brand-lockup-event span {
  font-size: 0.66rem;
  font-weight: 750;
  line-height: 1.05;
  max-width: 7.2rem;
}

.wallet-brand-lockup span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.wallet-header-fields {
  flex: 0 1 42%;
  justify-content: flex-end;
  text-align: right;
}

.wallet-pass-main {
  min-height: 0;
  display: grid;
  align-content: start;
  gap: clamp(0.52rem, 1.8vw, 0.72rem);
  overflow: hidden;
}

.wallet-pass-field {
  min-width: 0;
  display: grid;
  gap: 0.16rem;
  line-height: 1.08;
}

.wallet-pass-field span {
  min-width: 0;
  opacity: 0.82;
  font-size: 0.64rem;
  font-weight: 850;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}

.wallet-pass-field strong {
  min-width: 0;
  color: currentColor;
  font-size: 0.92rem;
  font-weight: 760;
  overflow-wrap: anywhere;
}

.wallet-pass-header-field strong {
  font-size: 0.78rem;
}

.wallet-pass-primary-fields,
.wallet-pass-secondary-fields,
.wallet-pass-auxiliary-fields {
  min-width: 0;
  display: grid;
}

.wallet-pass-primary-fields {
  gap: 0.28rem;
}

.wallet-pass-primary-fields .wallet-pass-field strong {
  font-family: var(--font-display);
  font-size: clamp(1.72rem, 7vw, 2.36rem);
  font-weight: 720;
  line-height: 0.98;
}

.wallet-pass-secondary-fields {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.54rem;
}

.wallet-pass-auxiliary-fields {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.54rem;
}

.wallet-pass-barcode {
  justify-self: center;
  width: min(62%, 8.6rem);
  display: grid;
  justify-items: center;
  gap: 0.34rem;
  padding: 0.52rem 0.56rem 0.44rem;
  border-radius: 0.72rem;
  color: #111;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 8px 20px rgba(91, 52, 35, 0.12);
}

.wallet-pass-barcode strong {
  max-width: 100%;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 0.68rem;
  line-height: 1.1;
  font-weight: 720;
  overflow-wrap: anywhere;
}

.wallet-pass-qr {
  width: 5.2rem;
  max-width: 100%;
  aspect-ratio: 1;
  background:
    linear-gradient(90deg, #111 50%, transparent 0) 0 0 / 28% 28%,
    linear-gradient(#111 50%, transparent 0) 0 0 / 28% 28%,
    repeating-linear-gradient(90deg, #111 0 8%, transparent 8% 16%),
    repeating-linear-gradient(0deg, transparent 0 10%, #111 10% 18%, transparent 18% 28%);
  border: 0.42rem solid #fff;
  box-shadow: inset 0 0 0 0.26rem #111;
}

.wallet-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  padding-top: 0.6rem;
  border-top: 1px solid rgba(255, 255, 255, 0.24);
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.8rem;
  margin: 0;
}

.detail-grid div {
  background: var(--surface-soft);
  border-radius: var(--radius-sm);
  padding: 0.7rem;
}

.detail-grid dt {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 500;
  margin-bottom: 0.2rem;
}

.detail-grid dd {
  margin: 0;
  word-break: break-word;
}

.pill {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  min-height: 2rem;
  border-radius: 999px;
  padding: 0.35rem 0.7rem;
  background: rgba(0, 0, 0, 0.055);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.82rem;
}

.qr-row {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr);
  gap: 1rem;
  align-items: center;
}

.qr-row img {
  width: 130px;
  height: 130px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  background: #fff;
  box-shadow: var(--shadow-soft);
}

.stack {
  display: grid;
  gap: 0.7rem;
}

.readonly-input {
  font-size: 0.85rem;
}

.empty-state {
  min-height: 5.5rem;
  display: grid;
  align-items: center;
  padding: 1.15rem var(--card-padding);
  border: 1px dashed var(--border-subtle);
  border-radius: var(--radius);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.66);
  box-shadow: var(--shadow-soft);
  overflow-wrap: anywhere;
}

.claim-panel {
  width: min(420px, 100%);
  display: grid;
  gap: 1rem;
  padding: 1.15rem;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  background: var(--surface-elevated);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(18px);
}

.preview-slot {
  width: 100%;
  display: grid;
  justify-items: center;
  margin: 0.6rem auto 1rem;
}

.customer-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 1.25rem;
  font-weight: 700;
}

.topup-form {
  display: grid;
  gap: 0.75rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-soft);
}

.topup-form h3 {
  margin: 0;
}

.scanner-video {
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius-lg);
  background: #1d1d1f;
  object-fit: cover;
  box-shadow: var(--shadow-soft);
}

.scanner-camera-hint {
  margin-top: -0.25rem;
}

.scanner-shell {
  align-items: start;
}

.scanner-operation-picker {
  display: grid;
  gap: 1rem;
  padding: clamp(1rem, 2.5vw, 1.35rem);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-lg);
  background: var(--surface-elevated);
  box-shadow: var(--shadow-soft);
}

.scanner-operation-picker h2,
.scanner-operation-picker p {
  margin-block: 0;
}

.scanner-operation-options {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.65rem;
}

.scanner-operation-option {
  position: relative;
  cursor: pointer;
}

.scanner-operation-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.scanner-operation-option span {
  min-height: 4.35rem;
  display: grid;
  align-content: center;
  gap: 0.2rem;
  padding: 0.75rem;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  background: var(--surface-muted);
  transition: border-color 160ms ease, background 160ms ease;
}

.scanner-operation-option small {
  color: var(--text-secondary);
}

.scanner-operation-option input:checked + span {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, var(--surface-elevated));
  box-shadow: inset 0 0 0 1px var(--accent);
}

.scanner-operation-option input:focus-visible + span {
  outline: 3px solid color-mix(in srgb, var(--accent) 35%, transparent);
  outline-offset: 2px;
}

.scanner-priority-panel {
  display: grid;
  gap: 0.8rem;
  padding: 1rem;
  border: 1px solid color-mix(in srgb, var(--accent) 50%, var(--border-soft));
  border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--accent) 7%, var(--surface-elevated));
}

.scanner-priority-panel h3,
.scanner-priority-panel p {
  margin-block: 0;
}

.scanner-priority-actions .secondary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--primary-foreground);
}

.scanner-collapsible {
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  background: var(--surface-muted);
  overflow: clip;
}

.scanner-collapsible > summary {
  cursor: pointer;
  padding: 0.9rem 1rem;
  font-weight: 700;
}

.scanner-collapsible[open] > summary {
  border-bottom: 1px solid var(--border-soft);
}

.scanner-collapsible > :not(summary) {
  margin: 1rem;
}

@media (max-width: 760px) {
  .scanner-operation-options {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  display: grid;
  place-items: center;
  padding: var(--page-padding-x);
  background: rgba(29, 29, 31, 0.52);
  overscroll-behavior: contain;
}

/* Solid surfaces avoid costly full-panel blur repaints on mobile devices. */
.panel,
.table-panel,
.claim-panel,
.kpi-card,
.chart-card,
.modal-panel {
  backdrop-filter: none;
}

.modal-panel {
  width: min(100%, 560px);
  max-height: calc(100svh - (var(--page-padding-x) * 2));
  overflow: auto;
  background: var(--surface-elevated);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-soft);
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(18px);
  padding: 1.2rem;
  -webkit-overflow-scrolling: touch;
}

body:has(.modal-backdrop:not([hidden])) {
  overflow: hidden;
}

.demographics-panel {
  display: grid;
  gap: 1rem;
}

.access-status-panel {
  display: grid;
  gap: 1rem;
  border-color: rgba(214, 184, 137, 0.78);
  box-shadow: 0 28px 80px rgba(91, 52, 35, 0.28);
}

.access-status-panel h2,
.access-status-panel p { margin: 0; }

.access-status-items { display: grid; gap: 0.75rem; }

.access-status-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.85rem;
  align-items: center;
  padding: 1rem;
  border: 1px solid var(--border-gold);
  border-radius: var(--radius);
  background: rgba(214, 184, 137, 0.16);
}

.access-status-card > div { display: grid; gap: 0.24rem; }

.access-status-card p,
.access-status-card span { color: var(--muted); font-size: 0.88rem; }

.access-status-card strong { color: var(--ink); font-size: 1.28rem; }

.access-status-icon {
  width: 3.2rem;
  height: 3.2rem;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--primary);
  color: #fff !important;
  font-size: 0.8rem !important;
  font-weight: 800;
}

.access-status-card-membership .access-status-icon { background: var(--accent-gold); color: var(--ink) !important; }

.guest-status-section {
  display: grid;
  gap: 0.85rem;
  margin: 1rem 0;
  padding: 1rem;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  background: var(--surface-secondary);
}

.guest-status-section.has-active-restriction {
  border: 2px solid #b42318;
  background: rgba(180, 35, 24, 0.08);
}

.guest-status-heading,
.restriction-history-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.restriction-list,
.restriction-history,
.restriction-warning-items {
  display: grid;
  gap: 0.7rem;
}

.restriction-card,
.restriction-warning-card,
.restriction-history-row {
  padding: 0.85rem;
  border: 1px solid rgba(180, 35, 24, 0.3);
  border-radius: var(--radius-sm);
  background: var(--surface-elevated);
}

.restriction-card p,
.restriction-warning-card p,
.restriction-history-row p {
  margin: 0.25rem 0 0;
}

.restriction-warning-panel {
  display: grid;
  gap: 1rem;
  border: 3px solid #b42318;
  box-shadow: 0 28px 90px rgba(180, 35, 24, 0.38);
}

.restriction-warning-panel h2 {
  margin: 0;
  color: #b42318;
}

.restriction-warning-card strong {
  color: #b42318;
  font-size: 1.15rem;
}

.restriction-editor-panel {
  display: grid;
  gap: 1rem;
}

.demographics-club-info {
  display: grid;
  gap: 0.6rem;
  padding: 0.85rem;
  border: 1px solid var(--border-gold);
  border-radius: var(--radius);
  background: rgba(214, 184, 137, 0.18);
}

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 1.8rem;
  padding: 0.32rem 0.55rem;
  border-radius: 999px;
  background: rgba(214, 184, 137, 0.22);
  color: var(--ink);
  border: 1px solid var(--border-gold);
  font-size: 0.82rem;
  font-weight: 600;
}

.choice-fieldset {
  display: grid;
  gap: 0.7rem;
  border: 0;
  padding: 0;
  margin: 0;
}

.choice-fieldset legend {
  color: var(--muted);
  font-weight: 600;
}

.choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

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

.choice-card {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 3rem;
  padding: 0.8rem;
  border: 1px solid var(--border-gold);
  border-radius: var(--radius);
  background: rgba(255, 250, 242, 0.76);
  color: var(--ink);
  transition: background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.choice-card:hover {
  background: rgba(214, 184, 137, 0.18);
  border-color: rgba(214, 184, 137, 0.56);
}

.choice-card input {
  width: auto;
  min-height: auto;
}

.choice-card:has(input:checked) {
  border-color: var(--primary);
  background: rgba(214, 184, 137, 0.28);
  box-shadow: 0 8px 20px rgba(91, 52, 35, 0.1);
}

.privacy-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

@keyframes scannerBlockedShake {
  0%,
  100% {
    transform: translateX(0);
  }

  25% {
    transform: translateX(-5px);
  }

  75% {
    transform: translateX(5px);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  @view-transition {
    navigation: none;
  }
}

@media (max-width: 860px) {
  :root {
    --page-padding-x: clamp(0.95rem, 3vw, 1.25rem);
    --page-padding-top: 1rem;
    --section-gap: 1.15rem;
    --grid-gap: 0.9rem;
  }

  .auth-grid,
  .account-grid,
  .account-form-grid,
  .dashboard-grid,
  .editor-grid,
  .scanner-grid,
  .wallet-notification-grid,
  .template-card {
    grid-template-columns: 1fr;
  }

  .choice-grid,
  .choice-grid.three {
    grid-template-columns: 1fr;
  }

  .stats-filter-grid,
  .stats-kpi-grid,
  .stats-chart-grid {
    grid-template-columns: 1fr;
  }

  .kpi-card-compact {
    max-width: none;
  }

  .editor-preview-panel {
    position: static;
  }

  .page-heading,
  .section-title,
  .panel-heading,
  .chart-card-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.75rem;
  }

  .page-heading .button,
  .section-title .button,
  .section-title button,
  .panel-heading .button {
    width: fit-content;
  }

  .chart-view-switcher {
    width: 100%;
  }

  .chart-card-controls {
    width: 100%;
    justify-content: flex-start;
  }

  .pie-layout {
    grid-template-columns: 1fr;
    justify-items: start;
  }

  .detail-grid,
  .split-row,
  .edit-grid {
    grid-template-columns: 1fr;
  }

  .qr-row {
    grid-template-columns: 110px minmax(0, 1fr);
  }

  .qr-row img {
    width: 110px;
    height: 110px;
  }
}

@media (max-width: 560px) {
  :root {
    --topbar-height: 4.1rem;
    --tabbar-height: 3.2rem;
    --page-padding-x: 0.9rem;
    --page-padding-top: 0.9rem;
    --page-padding-bottom: 3rem;
    --card-padding: 1rem;
  }

  h1 {
    font-size: 2rem;
  }

  .topbar {
    height: var(--topbar-height);
    min-height: 0;
    align-items: center;
    padding-top: 0.4rem;
    padding-bottom: 0.4rem;
    gap: 0.55rem;
  }

  .business-brand-name {
    max-width: 30vw;
    font-size: 1.25rem;
  }

  .business-brand-link {
    gap: 0.45rem;
  }

  .business-brand-logo {
    width: 2.05rem;
    height: 2.05rem;
    font-size: 0.72rem;
  }

  .business-brand-logo.has-image {
    width: 2rem;
    height: 2rem;
  }

  .app-brand-mark {
    gap: 0.45rem;
  }

  .app-brand-emblem {
    width: 1.55rem;
    height: 2.05rem;
  }

  .app-brand-lockup {
    width: 4.55rem;
    height: 2.05rem;
  }

  .app-tabbar {
    --app-tab-padding-x: 0.62rem;
    gap: 0.28rem;
    padding-top: 0.42rem;
    padding-bottom: 0.42rem;
  }

  .app-tab {
    min-height: 2.2rem;
    padding: 0.45rem var(--app-tab-padding-x);
    font-size: 0.92rem;
  }

  .topbar nav,
  .button-row {
    flex-wrap: wrap;
  }

  .page-heading,
  .stats-section > .section-title {
    padding-bottom: 0.9rem;
    margin-bottom: 0.85rem;
  }

  .panel,
  .template-card,
  .chart-card,
  .table-panel,
  .claim-panel {
    border-radius: var(--radius);
  }

  .account-logo-block {
    grid-template-columns: 1fr;
  }

  .app-tab-account {
    margin-left: 0;
  }

  .qr-row {
    grid-template-columns: 1fr;
  }

  .history-audit-row {
    grid-template-columns: 1fr;
  }

  .bar-row,
  .bar-list-horizontal .bar-row,
  .matrix-row,
  .stacked-row {
    grid-template-columns: 1fr;
  }

  .wallet-notification-panel {
    padding: 1rem;
  }

  .notification-preview-card {
    padding: 0.85rem;
  }
}


.message-layout {
  min-height: 100svh;
  display: grid;
  place-items: start center;
  padding: clamp(1rem, 4vw, 2rem) var(--page-padding-x);
  background:
    radial-gradient(circle at top left, rgba(214, 184, 137, 0.22), transparent 34rem),
    linear-gradient(180deg, #ffffff 0%, var(--bg) 58%, #fbf6ee 100%);
}

.message-panel {
  width: min(760px, 100%);
  display: grid;
  gap: 1.05rem;
  padding: clamp(1rem, 3vw, 1.65rem);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  background: rgba(255, 250, 242, 0.94);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.wallet-message-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(139, 79, 47, 0.1);
}

.wallet-message-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
  color: var(--ink);
  font-weight: 800;
}

.wallet-message-brand-mark {
  width: 2.35rem;
  height: 2.35rem;
  flex: 0 0 auto;
  border-radius: 50%;
  background-image: var(--brand-emblem);
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
}

.wallet-message-badge {
  flex: 0 0 auto;
  padding: 0.45rem 0.7rem;
  border: 1px solid rgba(214, 184, 137, 0.55);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.74);
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 800;
  box-shadow: 0 8px 20px rgba(91, 52, 35, 0.07);
}

.wallet-message-header h1 {
  margin: 0 0 0.25rem;
  font-size: clamp(1.65rem, 7vw, 2.55rem);
  line-height: 1.05;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.wallet-message-card {
  display: grid;
  gap: 1rem;
  padding: clamp(1rem, 3vw, 1.35rem);
  border: 1px solid rgba(139, 79, 47, 0.18);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(255, 250, 242, 0.92));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.wallet-message-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.wallet-message-card-head time {
  text-align: right;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 650;
}

.wallet-message-body {
  margin: 0;
  color: var(--ink);
  font-size: clamp(1.08rem, 3vw, 1.22rem);
  line-height: 1.62;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.wallet-message-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  margin: 0;
  padding-top: 0.95rem;
  border-top: 1px solid var(--border-soft);
}

.wallet-message-facts div {
  display: grid;
  gap: 0.18rem;
}

.wallet-message-facts dt,
.wallet-message-history-item time {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.wallet-message-facts dd {
  margin: 0;
  color: var(--ink);
  font-weight: 700;
  overflow-wrap: anywhere;
}

.wallet-message-history {
  display: grid;
  gap: 0.8rem;
}

.wallet-message-history h2 {
  margin: 0;
  font-size: 1rem;
}

.wallet-message-history-item {
  display: grid;
  gap: 0.35rem;
  padding: 1rem;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.68);
}

.wallet-message-history-item p {
  margin: 0;
  color: var(--ink);
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

@media (max-width: 620px) {
  .message-layout {
    padding: 0.85rem;
  }

  .message-panel {
    border-radius: var(--radius);
  }

  .wallet-message-topline,
  .wallet-message-card-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .wallet-message-facts {
    grid-template-columns: 1fr;
  }
}
.guest-information-section {
  margin: 1.25rem 0;
  padding: 1rem;
  border: 1px solid var(--border-color, #ded7ce);
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.72);
}

.guest-notes-heading {
  margin-top: 1.25rem;
}

.guest-notes-list,
.guest-notification-content {
  display: grid;
  gap: 0.75rem;
}

.guest-note-card {
  padding: 0.85rem;
  border-left: 4px solid #8d857c;
  border-radius: 0.65rem;
  background: rgba(0, 0, 0, 0.035);
}

.guest-note-card p {
  margin: 0.35rem 0;
}

.guest-note-warning {
  border-left-color: #b42318;
  background: #fff1f0;
}

.guest-note-important {
  border-left-color: #b7791f;
  background: #fff8e6;
}

.guest-info-editor-panel,
.guest-note-editor-panel,
.guest-notification-panel {
  max-width: 680px;
}

.guest-scan-settings {
  display: grid;
  gap: 0.75rem;
}
/* Optionales Guest-/Member-CRM */
.crm-filter-panel {
  display: grid;
  grid-template-columns: minmax(240px, 2fr) repeat(4, minmax(150px, 1fr));
  gap: 12px;
  align-items: end;
}

.crm-filter-panel label,
.crm-guest-edit-form label,
.crm-definition-form label {
  display: grid;
  gap: 6px;
}

.crm-guest-list {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.crm-guest-card {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(190px, 1.5fr) repeat(5, minmax(110px, 1fr)) auto;
  gap: 12px;
  align-items: center;
  padding: 16px;
  border: 1px solid var(--border-color, #dac9ba);
  border-radius: 16px;
  background: var(--surface-color, #fff);
  color: inherit;
  text-align: left;
}

.crm-guest-card:hover { border-color: var(--theme-primary, #7d4c2f); }
.crm-guest-card span { display: grid; gap: 3px; min-width: 0; overflow-wrap: anywhere; }
.crm-guest-card small { color: var(--muted-color, #745f52); }
.crm-profile-state { padding: 5px 8px; border-radius: 999px; background: #fff0d7; font-size: .78rem; }
.crm-profile-state.is-complete { background: #dff4e8; }
.crm-pagination { display: flex; justify-content: center; align-items: center; gap: 14px; margin-top: 18px; }
.crm-detail-tabs { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 8px; }
.crm-detail-tabs button { white-space: nowrap; border: 1px solid var(--border-color, #dac9ba); background: var(--surface-color, #fff); color: inherit; }
.crm-detail-tabs button.is-active { background: var(--theme-primary, #7d4c2f); color: #fff; }
.crm-detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; margin-top: 14px; }
.crm-detail-name { font-size: 1.35rem; font-weight: 750; }
.crm-guest-edit-form { margin-top: 14px; }
.crm-form-grid { display: grid; grid-template-columns: repeat(3, minmax(180px, 1fr)); gap: 12px; }
.crm-definition-form { display: grid; grid-template-columns: repeat(3, minmax(170px, 1fr)); gap: 12px; align-items: end; }
.crm-editor-field-options { display: grid; gap: 8px; margin-top: 12px; }
.crm-editor-field-row { display: grid; grid-template-columns: minmax(180px, 1fr) minmax(130px, .5fr); gap: 12px; padding: 10px 12px; border: 1px solid var(--border-color, #dac9ba); border-radius: 12px; }
.claim-crm-form { margin: 16px 0; text-align: left; }
.claim-crm-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.claim-crm-fields label { display: grid; gap: 6px; }
.claim-address-fields { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; border: 1px solid var(--border-color, #dac9ba); border-radius: 12px; }

@media (max-width: 980px) {
  .crm-filter-panel { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .crm-search-field { grid-column: 1 / -1; }
  .crm-guest-card { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .crm-form-grid, .crm-definition-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .crm-filter-panel, .crm-form-grid, .crm-definition-form { grid-template-columns: 1fr; }
  .crm-guest-card { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .crm-guest-card > span:first-child { grid-column: 1 / -1; }
  .crm-pagination { justify-content: space-between; }
  .claim-crm-fields, .claim-address-fields { grid-template-columns: 1fr; }
}
