:root {
  color-scheme: light;
  --background: #fffdf9;
  --surface: #fffaf2;
  --surface-elevated: rgba(255, 250, 242, 0.9);
  --surface-soft: #f2e6d4;
  --surface-hover: rgba(139, 79, 47, 0.08);
  --text-primary: #5b3423;
  --text-secondary: #8a6148;
  --text-muted: #ab8f78;
  --border-subtle: rgba(139, 79, 47, 0.16);
  --border-soft: rgba(139, 79, 47, 0.12);
  --border-gold: rgba(214, 184, 137, 0.42);
  --accent: #8b4f2f;
  --accent-hover: #6f3c23;
  --accent-gold: #d6b889;
  --accent-gold-soft: #e7d3af;
  --success: #8b4f2f;
  --warning: #b97845;
  --danger: #b44735;
  --bg: var(--background);
  --ink: var(--text-primary);
  --muted: var(--text-secondary);
  --line: var(--border-subtle);
  --primary: var(--accent);
  --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: #fffdf9;
  --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);
}

* {
  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, #ffffff 0%, var(--bg) 52%, #fbf6ee 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;
}

.primary {
  background: linear-gradient(180deg, #9c5a36 0%, var(--primary) 100%);
  color: #fffaf2;
  box-shadow: 0 8px 18px rgba(91, 52, 35, 0.2);
}

.primary:hover {
  background: var(--primary-dark);
  box-shadow: 0 10px 22px rgba(91, 52, 35, 0.26);
  transform: translateY(-1px);
}

.secondary {
  background: rgba(231, 211, 175, 0.42);
  color: var(--ink);
  border: 1px solid var(--border-gold);
  box-shadow: none;
}

.secondary:hover {
  background: rgba(214, 184, 137, 0.36);
}

.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;
}

input,
textarea,
select {
  width: 100%;
  min-width: 0;
  border: 1px solid rgba(139, 79, 47, 0.34);
  border-radius: var(--radius-sm);
  min-height: 2.7rem;
  padding: 0.72rem 0.78rem;
  color: var(--ink);
  background: rgba(255, 250, 242, 0.86);
  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: rgba(255, 250, 242, 1);
  border-color: rgba(139, 79, 47, 0.52);
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  background: #fffaf2;
  border-color: rgba(139, 79, 47, 0.58);
  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-panel {
  width: min(980px, 100%);
}

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

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

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

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

.panel,
.template-card {
  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;
}

.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);
}

.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 img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.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);
}

.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.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;
}

.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: rgba(231, 211, 175, 0.42);
  font-size: 1.02rem;
  font-weight: 750;
}

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

.business-brand-name {
  min-width: 0;
  max-width: min(38vw, 520px);
  overflow: hidden;
  color: var(--ink);
  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 {
  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);
  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: rgba(139, 79, 47, 0.08);
  pointer-events: none;
}

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

.app-tab {
  flex: 0 0 auto;
  min-height: 2.4rem;
  padding: 0.52rem 0.78rem;
  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-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);
}

.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.35rem;
  height: 2.35rem;
  border-radius: var(--radius-sm);
  object-fit: cover;
  background: var(--surface-soft);
  flex: 0 0 auto;
}

.card-table-icon-empty {
  border: 1px dashed var(--border-subtle);
}

.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-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 span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 500;
}

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

.stats-chart-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  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 h3 {
  margin: 0;
}

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

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

.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: 12rem;
  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: 2.2rem;
  height: 2.2rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.22);
  color: currentColor;
  font-size: 0.72rem;
  font-weight: 750;
  object-fit: cover;
}

.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 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-shell {
  align-items: start;
}

.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.42);
  backdrop-filter: blur(12px);
  overscroll-behavior: contain;
}

.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;
}

.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 (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;
  }

  .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%;
  }

  .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: 767px) {
  .desktop-only-link {
    display: none;
  }
}

@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;
  }

  .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 {
    gap: 0.28rem;
    padding-top: 0.42rem;
    padding-bottom: 0.42rem;
  }

  .app-tab {
    min-height: 2.2rem;
    padding: 0.45rem 0.62rem;
    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: center;
  padding: var(--page-padding-x);
}

.message-panel {
  width: min(620px, 100%);
  display: grid;
  gap: 1rem;
  padding: clamp(1.1rem, 3vw, 1.7rem);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  background: var(--surface-elevated);
  box-shadow: var(--shadow-soft);
}

.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);
  background: rgba(255, 250, 242, 0.9);
}

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

.wallet-message-facts {
  display: grid;
  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: 0.95rem;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.58);
}

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