/* =====================================================================
   Memoring Co — Luxury Design System v4 "Midnight & Gold"
   Deep. Editorial. Unmistakably premium.
   ===================================================================== */

/* ──────────────────────────────────────────────────────────────────────
   1. DESIGN TOKENS
   ────────────────────────────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,500;0,600;0,700;1,300;1,400;1,500&family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  /* ─ Warm neutrals (light mode) ─ */
  --ink:         #1c1208;
  --ink-soft:    #3d2e1a;
  --muted:       #7a6a52;
  --muted-soft:  #a8937a;
  --cream:       #fffef9;
  --paper:       #faf5eb;
  --paper-2:     #f2e9d8;
  --paper-3:     #e6d9c2;
  --paper-4:     #d6c8ae;

  /* ─ Gold palette ─ */
  --gold:        #b8892c;
  --gold-2:      #d4a84e;
  --gold-3:      #e8c870;
  --gold-light:  #f0d898;
  --gold-pale:   #fdf5e0;
  --gold-deep:   #8a6318;
  --gold-glow:   rgba(184, 137, 44, 0.28);

  /* ─ Brand (very deep warm midnight, used for primary buttons/brand) ─ */
  --brand:       #1c1208;
  --brand-2:     #2e1e0a;
  --brand-3:     #4a3118;
  --brand-inv:   #fffef9;

  /* ─ Status ─ */
  --rose:        #b84040;
  --success-bg:  #f0f8f0;
  --success-ink: #256025;
  --danger-bg:   #fdf0f0;
  --danger-ink:  #8a2020;
  --warn-bg:     #fdf8e8;
  --warn-ink:    #7a5818;

  /* ─ Gradients ─ */
  --grad-brand:  linear-gradient(145deg, #1c1208 0%, #3d2510 100%);
  --grad-gold:   linear-gradient(135deg, #c9a040 0%, #e8c870 50%, #a87828 100%);
  --grad-gold-h: linear-gradient(135deg, #d4a84e 0%, #f0d898 100%);
  --grad-warm:   linear-gradient(160deg, #fffef9 0%, #f5ecda 100%);
  --grad-hero:   linear-gradient(160deg, #0d0a06 0%, #1e1408 55%, #0a0704 100%);
  --grad-aurora: linear-gradient(135deg, #b8892c 0%, #e8c870 50%, #c9a040 100%);
  --grad-cinematic: linear-gradient(160deg, #080603 0%, #1a1208 50%, #060402 100%);

  /* ─ Glass ─ */
  --glass:       rgba(255, 254, 249, 0.88);
  --glass-blur:  saturate(180%) blur(20px);

  /* ─ Shadows (warm-tinted) ─ */
  --shadow-xs:   0 1px 3px rgba(28, 18, 8, 0.06);
  --shadow-sm:   0 2px 12px rgba(28, 18, 8, 0.08), 0 1px 3px rgba(28, 18, 8, 0.05);
  --shadow:      0 8px 32px -4px rgba(28, 18, 8, 0.14), 0 3px 10px -2px rgba(28, 18, 8, 0.08);
  --shadow-lg:   0 24px 64px -8px rgba(28, 18, 8, 0.22), 0 8px 20px -4px rgba(28, 18, 8, 0.12);
  --shadow-gold: 0 8px 28px -4px rgba(184, 137, 44, 0.40);
  --shadow-brand:0 8px 28px -4px rgba(28, 18, 8, 0.45);
  --ring-gold:   0 0 0 3px rgba(184, 137, 44, 0.22);

  /* ─ Geometry ─ */
  --rad-xs:  3px;
  --rad-sm:  8px;
  --rad:     14px;
  --rad-lg:  20px;
  --rad-xl:  28px;
  --rad-pill:9999px;

  /* ─ Typography ─ */
  --serif: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --sans:  'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* ─ Motion ─ */
  --ease:        cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out:    cubic-bezier(0.0, 0.0, 0.2, 1);
  --ease-spring: cubic-bezier(0.34, 1.38, 0.64, 1);

  /* ─ Layout ─ */
  --sidebar-w:  272px;
  --topbar-h:   64px;
  --mab-h:      72px;

  /* ─ Borders ─ */
  --line:        rgba(28, 18, 8, 0.08);
  --line-med:    rgba(28, 18, 8, 0.14);
  --line-strong: rgba(28, 18, 8, 0.22);
  --line-gold:   rgba(184, 137, 44, 0.30);
}

[data-theme="dark"] {
  --ink:         #f5ede0;
  --ink-soft:    #d4bfa0;
  --muted:       #8a7560;
  --muted-soft:  #6a5a48;
  --cream:       #0f0d0a;
  --paper:       #0a0806;
  --paper-2:     #161210;
  --paper-3:     #201c18;
  --paper-4:     #2c2620;

  --gold:        #d4a84e;
  --gold-2:      #e8c870;
  --gold-3:      #f0d898;
  --gold-light:  #f5e4b8;
  --gold-pale:   #1e1a10;
  --gold-deep:   #c9a040;
  --gold-glow:   rgba(212, 168, 78, 0.22);

  --brand:       #e8c870;
  --brand-2:     #d4a84e;
  --brand-3:     #c9a040;
  --brand-inv:   #0f0d0a;

  --line:        rgba(245, 237, 224, 0.08);
  --line-med:    rgba(245, 237, 224, 0.14);
  --line-strong: rgba(245, 237, 224, 0.22);
  --line-gold:   rgba(212, 168, 78, 0.25);

  --glass:       rgba(10, 8, 6, 0.88);
  --shadow-sm:   0 2px 12px rgba(0, 0, 0, 0.40);
  --shadow:      0 8px 32px -4px rgba(0, 0, 0, 0.60), 0 3px 10px -2px rgba(0, 0, 0, 0.40);
  --shadow-lg:   0 24px 64px -8px rgba(0, 0, 0, 0.70);

  --success-bg:  rgba(37, 96, 37, 0.18);
  --success-ink: #7dd87d;
  --danger-bg:   rgba(138, 32, 32, 0.18);
  --danger-ink:  #f5a0a0;
  --warn-bg:     rgba(122, 88, 24, 0.18);
  --warn-ink:    #f0d080;

  --grad-warm:   linear-gradient(160deg, #0f0d0a 0%, #1a1510 100%);
}

/* ──────────────────────────────────────────────────────────────────────
   2. RESET & BASE
   ────────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--sans);
  background: var(--paper);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-size: 15.5px;
  line-height: 1.65;
  min-height: 100vh;
  overflow-x: hidden;
}

img, video { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
a { color: var(--gold-deep); text-decoration: none; transition: color 0.15s var(--ease); }
a:hover { color: var(--gold); }

::selection { background: rgba(184, 137, 44, 0.22); color: var(--ink); }

/* ──────────────────────────────────────────────────────────────────────
   3. TYPOGRAPHY
   ────────────────────────────────────────────────────────────────────── */
h1, h2, h3, h4, h5 {
  font-family: var(--serif);
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--ink);
  line-height: 1.12;
}
h1 { font-size: clamp(2.2rem, 5vw, 3.2rem); font-weight: 400; }
h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); font-weight: 500; }
h3 { font-size: clamp(1.2rem, 2vw, 1.55rem); font-weight: 500; }
h4 { font-size: 1.1rem; font-weight: 600; font-family: var(--sans); letter-spacing: 0; }

p { line-height: 1.7; }

.display-serif {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(3rem, 7vw, 5.5rem);
  line-height: 1.0;
  letter-spacing: -0.02em;
}

/* Utilities */
.muted      { color: var(--muted); }
.text-sm    { font-size: 0.875rem; }
.text-xs    { font-size: 0.78rem; }
.center     { text-align: center; }
.serif      { font-family: var(--serif); }
.gold       { color: var(--gold); }
.mt-1       { margin-top: 0.75rem; }
.mt-2       { margin-top: 1.5rem; }
.mt-3       { margin-top: 2.5rem; }
.mb-1       { margin-bottom: 0.75rem; }
.mb-2       { margin-bottom: 1.5rem; }
.mt-0       { margin-top: 0; }
.mb-0       { margin-bottom: 0; }

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

code {
  font-family: 'SF Mono', 'JetBrains Mono', ui-monospace, monospace;
  background: var(--paper-2);
  padding: 2px 7px;
  border-radius: var(--rad-xs);
  font-size: 0.85em;
  color: var(--gold-deep);
  border: 1px solid var(--line);
}

/* ──────────────────────────────────────────────────────────────────────
   4. ANIMATIONS & KEYFRAMES
   ────────────────────────────────────────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-16px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes goldShimmer {
  0%   { background-position: -300% center; }
  100% { background-position: 300% center; }
}
@keyframes goldPulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 var(--gold-glow); }
  50%       { opacity: 0.8; box-shadow: 0 0 0 10px transparent; }
}
@keyframes scrollCue {
  0%, 100% { transform: translate(-50%, 0); opacity: 0.7; }
  50%       { transform: translate(-50%, 10px); opacity: 0.3; }
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
@keyframes nfcPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50%       { transform: scale(1.18); opacity: 0.6; }
}

/* Page entrance */
.app-body .content-inner > *,
.auth-panel-inner > * {
  animation: fadeUp 0.45s var(--ease) both;
}
.app-body .content-inner > *:nth-child(1) { animation-delay: 0.04s; }
.app-body .content-inner > *:nth-child(2) { animation-delay: 0.09s; }
.app-body .content-inner > *:nth-child(3) { animation-delay: 0.14s; }
.app-body .content-inner > *:nth-child(4) { animation-delay: 0.18s; }
.app-body .content-inner > *:nth-child(5) { animation-delay: 0.22s; }

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}
.reveal.is-visible { opacity: 1; transform: translateY(0); }

/* ──────────────────────────────────────────────────────────────────────
   5. BUTTONS
   ────────────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.4rem;
  min-height: 44px;
  background: var(--cream);
  color: var(--ink);
  border: 1px solid var(--line-med);
  border-radius: var(--rad-sm);
  font: 500 0.88rem/1 var(--sans);
  letter-spacing: 0.02em;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.18s var(--ease), color 0.18s var(--ease),
              transform 0.18s var(--ease-spring), box-shadow 0.18s var(--ease),
              border-color 0.18s var(--ease);
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}
.btn:hover  { transform: translateY(-1px); box-shadow: var(--shadow-sm); text-decoration: none; border-color: var(--line-strong); }
.btn:active { transform: translateY(0); box-shadow: none; }
.btn:focus-visible { outline: none; box-shadow: var(--ring-gold); }

.btn-primary {
  background: var(--grad-brand);
  color: var(--cream);
  border-color: transparent;
  box-shadow: var(--shadow-brand);
  font-weight: 600;
}
.btn-primary:hover {
  background: linear-gradient(145deg, #2e1e0a 0%, #5a3820 100%);
  color: var(--gold-light);
  box-shadow: 0 12px 32px -4px rgba(28, 18, 8, 0.55);
  transform: translateY(-2px);
}

.btn-gold {
  background: var(--grad-gold);
  color: var(--brand);
  border-color: transparent;
  box-shadow: var(--shadow-gold);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.82rem;
}
.btn-gold:hover {
  background: var(--grad-gold-h);
  color: var(--ink);
  box-shadow: 0 14px 38px -4px rgba(184, 137, 44, 0.55);
  transform: translateY(-2px);
}

.btn-ghost {
  background: transparent;
  border: 1px solid var(--line-med);
  color: var(--ink-soft);
}
.btn-ghost:hover { background: var(--paper-2); color: var(--ink); border-color: var(--line-strong); }

.btn-ghost-gold {
  background: transparent;
  border: 1px solid var(--line-gold);
  color: var(--gold-deep);
}
.btn-ghost-gold:hover { background: rgba(184, 137, 44, 0.07); color: var(--gold); border-color: var(--gold); }

.btn-danger {
  background: linear-gradient(135deg, #8a2020, #a82828);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 16px -4px rgba(138, 32, 32, 0.45);
  font-weight: 600;
}
.btn-danger:hover { filter: brightness(1.08); color: #fff; transform: translateY(-1px); }

.btn-lg  { padding: 0.9rem 2rem; min-height: 52px; font-size: 0.95rem; }
.btn-sm  { padding: 0.38rem 0.9rem; min-height: 34px; font-size: 0.8rem; }
.btn-block { display: flex; width: 100%; }
.btn.is-active { background: var(--grad-brand); color: var(--gold-light); border-color: transparent; }

.btn-row    { display: flex; gap: 0.6rem; flex-wrap: wrap; }
.center-row { justify-content: center; }

.link-btn {
  background: none; border: none;
  color: var(--gold-deep);
  cursor: pointer;
  font: 500 0.87rem var(--sans);
  text-decoration: underline;
  text-underline-offset: 3px;
  padding: 0;
  transition: color 0.15s;
}
.link-btn:hover { color: var(--gold); }

/* ──────────────────────────────────────────────────────────────────────
   6. FORMS
   ────────────────────────────────────────────────────────────────────── */
.form-row      { margin-bottom: 1.2rem; }
.form-row label {
  display: block;
  font-weight: 600;
  font-size: 0.72rem;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.45rem;
  font-family: var(--sans);
}
.form-grid          { display: grid; gap: 1rem; }
.form-grid.cols-2   { grid-template-columns: 1fr 1fr; }
@media (max-width: 540px) { .form-grid.cols-2 { grid-template-columns: 1fr; } }

input[type=text],
input[type=email],
input[type=password],
input[type=number],
input[type=tel],
input[type=date],
input[type=file],
textarea,
select {
  width: 100%;
  padding: 0.72rem 1rem;
  min-height: 46px;
  background: var(--cream);
  color: var(--ink);
  border: 1.5px solid var(--paper-3);
  border-radius: var(--rad-sm);
  font: 400 0.93rem/1.4 var(--sans);
  transition: border-color 0.18s var(--ease), box-shadow 0.18s var(--ease), background 0.18s;
  appearance: none;
  -webkit-appearance: none;
}
input:hover:not(:focus), textarea:hover:not(:focus), select:hover:not(:focus) {
  border-color: var(--paper-4);
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: var(--ring-gold);
  background: var(--cream);
}
textarea { min-height: 120px; resize: vertical; font-family: var(--sans); line-height: 1.6; }
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%237a6a52' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
}

.form-hint { font-size: 0.8rem; color: var(--muted); margin-top: 0.3rem; }

.remember-row {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.8rem 1rem;
  border-radius: var(--rad-sm);
  background: var(--paper);
  border: 1.5px solid var(--paper-3);
  margin: 0.6rem 0;
}
.remember-row input { width: auto; min-height: 0; padding: 0; border-radius: 4px; accent-color: var(--gold); }
.remember-row span  { font-size: 0.9rem; color: var(--ink-soft); }

.radio-row  { display: grid; gap: 0.7rem; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.radio-card {
  display: flex; flex-direction: column; gap: 0.2rem;
  padding: 1rem 1.2rem;
  border: 1.5px solid var(--paper-3);
  border-radius: var(--rad);
  background: var(--cream);
  cursor: pointer;
  transition: border-color 0.18s, background 0.18s, box-shadow 0.18s, transform 0.18s;
}
.radio-card input { display: none; }
.radio-card:hover { border-color: var(--gold-2); transform: translateY(-1px); }
.radio-card:has(input:checked) {
  border-color: var(--gold);
  background: var(--gold-pale);
  box-shadow: var(--ring-gold);
}
.radio-card strong { font-family: var(--serif); font-size: 1.2rem; font-weight: 500; color: var(--ink); }
.radio-card span   { font-size: 0.83rem; color: var(--muted); }

/* ──────────────────────────────────────────────────────────────────────
   7. ALERTS & FLASH
   ────────────────────────────────────────────────────────────────────── */
.alert, .flash {
  padding: 0.85rem 1.1rem;
  border-radius: var(--rad-sm);
  margin-bottom: 1.2rem;
  font-size: 0.9rem;
  display: flex; align-items: flex-start; gap: 0.6rem;
  line-height: 1.5;
  border: 1px solid transparent;
}
.alert-err,  .flash-err  { background: var(--danger-bg);  color: var(--danger-ink);  border-color: rgba(138, 32, 32, 0.18); }
.alert-ok,   .flash-ok   { background: var(--success-bg); color: var(--success-ink); border-color: rgba(37, 96, 37, 0.18); }
.alert-info, .flash-info { background: var(--paper-2);    color: var(--ink-soft);    border-color: var(--line-med); }

/* ──────────────────────────────────────────────────────────────────────
   8. APP SHELL
   ────────────────────────────────────────────────────────────────────── */
.app-body { background: var(--paper); }

.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  grid-template-rows: var(--topbar-h) 1fr auto;
  min-height: 100vh;
}

/* ── 8a. Sidebar ── */
.sidebar {
  grid-row: 1 / span 3;
  background: var(--cream);
  border-right: 1px solid var(--line);
  padding: 0 0 1rem;
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; overflow: hidden;
}

.sidebar-brand {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 1.2rem 1.2rem 1.1rem;
  border-bottom: 1px solid var(--line-gold);
  color: var(--ink);
  text-decoration: none;
  background: linear-gradient(180deg, rgba(184,137,44,0.04) 0%, transparent 100%);
  transition: opacity 0.15s;
}
.sidebar-brand:hover { opacity: 0.85; text-decoration: none; }
.sidebar-brand img   { border-radius: var(--rad-sm); }

.sidebar-brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.sidebar-brand .name {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.2rem;
  letter-spacing: 0.05em;
  color: var(--ink);
}
.sidebar-brand .dot  {
  background: var(--grad-gold);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  padding: 0 3px;
}
.sidebar-brand .tag  {
  font-size: 0.63rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-top: 3px;
  font-weight: 500;
}

.sidebar-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 0.75rem;
  scrollbar-width: thin;
  scrollbar-color: var(--paper-3) transparent;
}
.sidebar-scroll::-webkit-scrollbar { width: 4px; }
.sidebar-scroll::-webkit-scrollbar-thumb { background: var(--paper-3); border-radius: 4px; }

.nav-section       { margin-bottom: 1.5rem; }
.nav-section-label {
  padding: 0 0.6rem;
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--gold-deep);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 0.45rem;
}

.nav-link {
  display: flex; align-items: center; gap: 0.7rem;
  padding: 0.58rem 0.75rem;
  border-radius: var(--rad-sm);
  font-size: 0.88rem;
  font-weight: 450;
  color: var(--ink-soft);
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
  margin-bottom: 2px;
  border: 1px solid transparent;
}
.nav-link:hover { background: var(--paper); color: var(--ink); text-decoration: none; }
.nav-link.is-active {
  background: linear-gradient(135deg, rgba(184,137,44,0.10), rgba(200,160,64,0.06));
  color: var(--ink);
  font-weight: 600;
  border-color: var(--line-gold);
}
.nav-link.is-active .nav-ico { color: var(--gold); }

.nav-ico {
  width: 18px; height: 18px; flex-shrink: 0;
  color: var(--muted-soft);
  display: flex; align-items: center; justify-content: center;
  transition: color 0.15s;
}
.nav-link:hover .nav-ico { color: var(--gold); }

.sidebar-foot {
  padding: 0.75rem 0.75rem 0;
  border-top: 1px solid var(--line-gold);
}
.user-card { display: flex; align-items: center; gap: 0.6rem; padding: 0.5rem 0.3rem; }
.user-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--grad-brand);
  color: var(--gold-light);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.78rem;
  flex-shrink: 0; letter-spacing: 0.5px;
  border: 1.5px solid rgba(184, 137, 44, 0.3);
}
.user-info       { flex: 1; min-width: 0; }
.user-info .name { font-weight: 600; font-size: 0.87rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); }
.user-info .email { font-size: 0.7rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.logout {
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  color: var(--muted); text-decoration: none; font-size: 1rem;
  transition: background 0.15s, color 0.15s; flex-shrink: 0;
}
.logout:hover { background: var(--paper-2); color: var(--rose); }

/* ── 8b. Topbar ── */
.topbar {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0 1.4rem;
  height: var(--topbar-h);
  background: var(--glass);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 30;
}

/* Gold accent line below topbar */
.topbar::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, rgba(184,137,44,0.4) 50%, transparent 100%);
  pointer-events: none;
}

.topbar-title-group { flex: 1; min-width: 0; }
.topbar-title {
  font-family: var(--serif);
  font-size: 1.4rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  line-height: 1.1;
  color: var(--ink);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.topbar-sub { font-size: 0.78rem; color: var(--muted); margin-top: 2px; }

.topbar-right { display: flex; align-items: center; gap: 0.4rem; }

.icon-btn {
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 50%;
  width: 38px; height: 38px;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: var(--muted);
  transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.15s;
}
.icon-btn:hover { background: var(--paper-2); color: var(--gold); border-color: var(--line-gold); transform: scale(1.06); }

.sidebar-toggle { display: none; }

.hamburger-icon { width: 18px; height: 14px; display: flex; flex-direction: column; justify-content: space-between; }
.hamburger-icon span { display: block; height: 1.5px; background: currentColor; border-radius: 2px; transition: transform 0.2s, opacity 0.2s; }

.theme-toggle-glyph {
  width: 16px; height: 16px; border-radius: 50%;
  background: conic-gradient(var(--gold) 180deg, var(--brand) 180deg);
}

/* ── 8c. Content ── */
.content { padding: 2rem 1.8rem calc(var(--mab-h) + 2rem); min-width: 0; }
.content-inner { max-width: 1100px; margin: 0 auto; }

.page-actions-bar { display: flex; justify-content: flex-end; margin-bottom: 1.5rem; gap: 0.6rem; flex-wrap: wrap; }

/* ── 8d. Footer ── */
.footer {
  grid-column: 2 / 3;
  padding: 1.5rem 2rem;
  background: var(--cream);
  border-top: 1px solid var(--line);
  font-size: 0.8rem;
  color: var(--muted);
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem;
}
/* Gold top rule on footer */
.footer::before {
  content: '';
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(184,137,44,0.35), transparent);
}
.footer { position: relative; }
.footer-legal a { color: var(--muted); margin: 0 0.3rem; transition: color 0.15s; }
.footer-legal a:hover { color: var(--gold); }

/* ── 8e. Mobile Sidebar ── */
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; left: -300px; top: 0; bottom: 0;
    width: var(--sidebar-w); z-index: 60;
    box-shadow: var(--shadow-lg);
    transition: left 0.28s var(--ease-out);
    height: 100vh;
  }
  .sidebar.is-open { left: 0; }
  .sidebar-backdrop {
    position: fixed; inset: 0;
    background: rgba(10, 7, 4, 0.58);
    backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
    z-index: 50; opacity: 0; pointer-events: none;
    transition: opacity 0.28s var(--ease-out);
  }
  .sidebar-backdrop.is-open { opacity: 1; pointer-events: auto; }
  .sidebar-toggle { display: inline-flex; }
  .topbar-actions-desktop { display: none; }
  .footer { grid-column: 1; padding-bottom: calc(var(--mab-h) + 1.5rem); }
  .content { padding: 1.5rem 1rem calc(var(--mab-h) + 1.5rem); }
}

/* ──────────────────────────────────────────────────────────────────────
   9. CARDS
   ────────────────────────────────────────────────────────────────────── */
.card {
  background: var(--cream);
  border-radius: var(--rad);
  padding: 1.6rem 1.8rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--line);
  margin-bottom: 1.4rem;
  transition: box-shadow 0.22s var(--ease), border-color 0.22s var(--ease), transform 0.22s var(--ease);
  position: relative;
}
.card:hover { box-shadow: var(--shadow); }

.section-title {
  font-family: var(--serif);
  font-size: 1.5rem;
  font-weight: 400;
  margin: 2rem 0 1rem;
  color: var(--ink);
  display: flex; align-items: center; gap: 0.75rem;
  letter-spacing: 0.02em;
}
.section-title::after {
  content: '';
  flex: 1; height: 1px;
  background: linear-gradient(90deg, var(--line-gold), transparent);
}

.empty {
  text-align: center; padding: 4rem 2rem;
  background: var(--cream);
  border-radius: var(--rad);
  border: 1px dashed var(--line-gold);
  box-shadow: var(--shadow-xs);
}
.empty h2, .empty h3 { font-family: var(--serif); font-weight: 400; margin: 0.75rem 0 0.4rem; }
.empty p { color: var(--muted); max-width: 380px; margin: 0 auto 1.5rem; }

.empty-icon {
  display: inline-flex; padding: 1.2rem;
  background: var(--gold-pale);
  border-radius: 50%;
  border: 1px solid var(--line-gold);
  color: var(--gold);
  margin-bottom: 0.5rem;
}
.hero-empty { padding: 5rem 2rem; }

/* ──────────────────────────────────────────────────────────────────────
   10. AUTH LAYOUT
   ────────────────────────────────────────────────────────────────────── */
.auth-body { background: var(--paper); min-height: 100vh; }

.auth-split { display: grid; grid-template-columns: 1.1fr 1fr; min-height: 100vh; }

.auth-hero {
  background: var(--grad-hero);
  color: var(--cream);
  padding: 3rem;
  display: flex; align-items: center;
  position: relative; overflow: hidden;
}

/* Grain */
.auth-hero::before {
  content: ''; position: absolute; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .22 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: 0.3; mix-blend-mode: overlay; pointer-events: none;
}

/* Gold radial glow */
.auth-hero::after {
  content: ''; position: absolute;
  width: 600px; height: 600px; border-radius: 50%;
  background: radial-gradient(circle, rgba(200, 160, 44, 0.18) 0%, transparent 65%);
  top: -100px; right: -100px; pointer-events: none;
}

.auth-hero-inner {
  position: relative; z-index: 2;
  max-width: 460px;
  animation: fadeUp 0.65s var(--ease) both;
}

.auth-brand {
  display: flex; align-items: center; gap: 0.85rem;
  color: var(--cream); text-decoration: none; margin-bottom: 3.5rem;
}
.auth-brand:hover { opacity: 0.9; text-decoration: none; color: var(--cream); }
.auth-brand img   { border-radius: var(--rad-sm); }
.auth-brand .name {
  display: block;
  font-family: var(--serif); font-size: 1.55rem; font-weight: 500; letter-spacing: 0.05em;
}
.auth-brand .dot  { color: var(--gold-3); padding: 0 3px; }
.auth-brand .tag  { display: block; font-size: 0.68rem; opacity: 0.68; text-transform: uppercase; letter-spacing: 2px; margin-top: 3px; }

.auth-hero-copy h1 {
  font-family: var(--serif);
  font-size: clamp(2rem, 4.5vw, 2.8rem);
  color: var(--cream); line-height: 1.12;
  margin: 0 0 1.1rem; font-weight: 300;
  letter-spacing: -0.01em;
}
.auth-hero-copy p { font-size: 1rem; opacity: 0.82; line-height: 1.7; color: var(--cream); }

.auth-features { list-style: none; padding: 0; margin: 1.8rem 0; }
.auth-features li {
  padding: 0.45rem 0; opacity: 0.9; font-size: 0.93rem;
  display: flex; align-items: center; gap: 0.7rem; color: var(--cream);
}
.auth-features .mark {
  width: 20px; height: 20px;
  background: rgba(200, 160, 44, 0.22);
  border: 1px solid rgba(200, 160, 44, 0.45);
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--gold-3); font-size: 0.75rem; flex-shrink: 0;
}

.auth-hero-foot { margin-top: 3.5rem; font-size: 0.78rem; opacity: 0.55; }
.auth-hero-foot a { color: var(--cream); opacity: 0.85; }

.auth-hero-ornament {
  width: 48px; height: 1px;
  background: var(--grad-gold);
  margin: 1.8rem 0; border-radius: 2px;
}

.auth-panel {
  background: var(--cream);
  display: flex; align-items: center; justify-content: center;
  padding: 3rem 2rem;
}
.auth-panel-inner {
  width: 100%; max-width: 420px;
  animation: fadeUp 0.55s 0.1s var(--ease) both;
}
.auth-panel-inner h2 {
  font-family: var(--serif); font-size: 2.2rem; margin: 0 0 0.4rem; font-weight: 400;
}
.auth-sub  { color: var(--muted); margin-bottom: 2rem; font-size: 0.93rem; line-height: 1.6; }
.auth-foot { text-align: center; margin-top: 1.5rem; color: var(--muted); font-size: 0.88rem; }

.auth-divider {
  text-align: center; margin: 1.4rem 0;
  position: relative; color: var(--muted); font-size: 0.78rem;
  text-transform: uppercase; letter-spacing: 1.5px; font-weight: 600;
}
.auth-divider::before,
.auth-divider::after {
  content: ''; display: inline-block; width: 34%; height: 1px;
  background: var(--line-med); vertical-align: middle; margin: 0 0.8rem;
}
.google-btn-wrap { display: flex; justify-content: center; margin: 1rem 0 0.5rem; }

@media (max-width: 860px) {
  .auth-split        { grid-template-columns: 1fr; }
  .auth-hero         { display: none; }
  .auth-panel        { padding: 2.5rem 1.5rem; min-height: 100vh; }
  .auth-panel-inner  { max-width: 100%; }
}

/* ──────────────────────────────────────────────────────────────────────
   11. DASHBOARD / JEWELRY GRID
   ────────────────────────────────────────────────────────────────────── */
.jewelry-grid { display: grid; gap: 1.4rem; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); }

.jewelry-card {
  background: var(--cream);
  border-radius: var(--rad);
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  text-decoration: none; color: var(--ink);
  transition: transform 0.28s var(--ease-spring), box-shadow 0.28s var(--ease), border-color 0.28s;
  display: block;
}
.jewelry-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: var(--line-gold);
  text-decoration: none; color: var(--ink);
}

.jewelry-cover {
  position: relative; aspect-ratio: 4/3;
  background: linear-gradient(145deg, #2a1e10 0%, #1a1208 60%, #3d2a10 100%);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.jewelry-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.45s var(--ease); }
.jewelry-card:hover .jewelry-cover img { transform: scale(1.05); }

.jewelry-cover-placeholder {
  font-family: var(--serif);
  font-size: 5rem;
  color: var(--gold-2);
  font-weight: 300;
  opacity: 0.55;
  user-select: none;
  text-shadow: 0 2px 20px rgba(200, 160, 44, 0.3);
}

.jewelry-cover .badge {
  position: absolute; top: 0.8rem; right: 0.8rem;
  padding: 0.28rem 0.8rem;
  border-radius: var(--rad-pill);
  font-size: 0.64rem; font-weight: 700; letter-spacing: 1px;
  text-transform: uppercase;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.badge-lost     { background: rgba(170, 40, 40, 0.92); color: #fff; }
.badge-memorial { background: rgba(184, 137, 44, 0.92); color: #1c1208; }

.jewelry-body    { padding: 1.15rem 1.4rem 1.4rem; }
.jewelry-type    { font-size: 0.63rem; color: var(--gold); text-transform: uppercase; letter-spacing: 2px; font-weight: 700; margin-bottom: 0.4rem; }
.jewelry-title   { font-family: var(--serif); font-size: 1.4rem; font-weight: 400; margin: 0 0 0.4rem; line-height: 1.15; }
.jewelry-meta    { font-size: 0.82rem; color: var(--muted); }

/* Gold left-edge on pending transfer */
.pending-transfer {
  border-left: 3px solid var(--gold);
  background: linear-gradient(135deg, var(--cream), rgba(184, 137, 44, 0.04));
}

/* ──────────────────────────────────────────────────────────────────────
   12. MEMORY SPACE (owner view)
   ────────────────────────────────────────────────────────────────────── */
.memory-space { display: flex; flex-direction: column; gap: 2rem; }

.memory-hero {
  border-radius: var(--rad-lg); min-height: 320px;
  padding: 2.5rem 2.2rem;
  background: var(--grad-hero);
  background-size: cover; background-position: center;
  color: var(--cream);
  display: flex; align-items: flex-end;
  position: relative; overflow: hidden;
  box-shadow: var(--shadow-lg);
}
.memory-hero::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(10,6,4,0.72) 0%, transparent 60%);
  pointer-events: none;
}

/* Thin gold rule at bottom of hero */
.memory-hero::before {
  content: ''; position: absolute;
  bottom: 0; left: 0; right: 0; height: 2px;
  background: var(--grad-gold);
  z-index: 3; pointer-events: none;
}

.memory-hero-inner { position: relative; z-index: 2; max-width: 720px; }

.memory-eyebrow {
  display: inline-block; font-size: 0.66rem;
  letter-spacing: 2.5px; text-transform: uppercase; font-weight: 700;
  opacity: 0.9; margin-bottom: 0.55rem; color: var(--gold-3);
}
.memory-title {
  font-family: var(--serif);
  font-size: clamp(2rem, 4vw, 2.8rem); color: var(--cream);
  margin: 0 0 0.5rem; line-height: 1.1; font-weight: 300;
  letter-spacing: -0.01em;
}
.memory-desc  { font-size: 1rem; opacity: 0.88; max-width: 580px; line-height: 1.65; color: var(--cream); }

.memory-hero-pills { margin-top: 1.2rem; display: flex; gap: 0.5rem; flex-wrap: wrap; }
.pill {
  display: inline-block; padding: 0.3rem 0.85rem;
  background: rgba(255,255,255,0.12); border: 1px solid rgba(255,255,255,0.20);
  border-radius: var(--rad-pill); font-size: 0.74rem; font-weight: 600;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.pill-memorial { background: rgba(184, 137, 44, 0.88); color: #1c1208; border-color: transparent; }
.pill-lost     { background: rgba(170, 40, 40, 0.88); color: #fff; border-color: transparent; }

.memory-stream { display: flex; flex-direction: column; gap: 1.8rem; }

.memory-item {
  background: var(--cream); border-radius: var(--rad-lg);
  overflow: hidden; border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.22s, transform 0.22s;
}
.memory-item:hover { box-shadow: var(--shadow); transform: translateY(-2px); }

.memory-photo { width: 100%; display: block; max-height: 680px; object-fit: cover; }
.memory-video, .memory-audio { width: 100%; display: block; }

.memory-text { padding: 1.4rem 1.8rem; }
.memory-text h3 { font-family: var(--serif); font-weight: 400; font-size: 1.6rem; margin: 0 0 0.5rem; }
.memory-text p  { color: var(--ink-soft); line-height: 1.75; white-space: pre-wrap; }

.memory-foot {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.85rem 1.6rem;
  border-top: 1px solid var(--line);
  font-size: 0.83rem; color: var(--muted);
}

.inline-form { display: inline; margin: 0; }

.memory-empty {
  text-align: center; padding: 5rem 2rem;
  background: var(--cream); border-radius: var(--rad-lg);
  border: 1px dashed var(--line-gold);
}
.memory-empty-mark { font-size: 3.5rem; color: var(--gold-2); opacity: 0.7; margin-bottom: 0.75rem; display: inline-block; }

.owner-tools h3 { font-family: var(--serif); font-weight: 400; margin: 0 0 0.8rem; font-size: 1.4rem; }

/* ──────────────────────────────────────────────────────────────────────
   13. CINEMATIC FULL-BLEED VIEW (public)
   ────────────────────────────────────────────────────────────────────── */
.cinematic-body { background: #080603; color: #f5ede0; font-family: var(--sans); overflow: hidden; height: 100dvh; }
.cinematic-body .memoring-offline-banner { background: rgba(255,255,255,0.10); color: #f5ede0; }

.cinematic { min-height: 100vh; display: flex; flex-direction: column; }

.cinematic-hero {
  min-height: 100vh; padding: 5rem 2rem;
  background: var(--grad-cinematic);
  background-size: cover; background-position: center;
  display: flex; align-items: center; justify-content: center; flex-direction: column;
  text-align: center; position: relative; isolation: isolate;
}

.cinematic-hero::before {
  content: ''; position: absolute; inset: 0; z-index: -1;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .22 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: 0.38; mix-blend-mode: overlay;
}
.cinematic-hero::after {
  content: ''; position: absolute; inset: 0; z-index: -1;
  background: radial-gradient(ellipse at 50% 40%, rgba(184,137,44,0.12) 0%, transparent 65%);
  pointer-events: none;
}

.cinematic-hero-inner { max-width: 720px; animation: fadeUp 0.75s 0.15s var(--ease) both; }

.cinematic-eyebrow {
  display: inline-block; font-size: 0.72rem; letter-spacing: 3px;
  text-transform: uppercase; font-weight: 700; opacity: 0.85;
  color: var(--gold-3); margin-bottom: 1.2rem;
}

.cinematic-title {
  font-family: var(--serif); font-weight: 300;
  font-size: clamp(2.5rem, 8vw, 5rem); line-height: 1.05;
  color: #fffdf5; margin: 0 0 1.5rem; letter-spacing: -0.015em;
}

.cinematic-desc {
  font-size: clamp(1rem, 2vw, 1.18rem); line-height: 1.78;
  opacity: 0.86; max-width: 580px; margin: 0 auto;
  color: rgba(245, 237, 224, 0.92);
}

.cinematic-tag {
  display: inline-block; margin-top: 1.8rem; padding: 0.48rem 1.3rem;
  background: var(--grad-gold); color: #1c1208;
  border-radius: var(--rad-pill); font-size: 0.82rem; font-weight: 700; letter-spacing: 0.5px;
  box-shadow: var(--shadow-gold);
}

.cinematic-scroll-cue {
  position: absolute; bottom: 2rem; left: 50%; transform: translateX(-50%);
  color: var(--gold-3); font-size: 1.8rem; opacity: 0.7;
  animation: scrollCue 2.4s ease-in-out infinite;
}

.cinematic-stream { display: flex; flex-direction: column; gap: 0; }

.cinematic-item {
  padding: 5rem 2rem; min-height: 65vh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center;
  border-bottom: 1px solid rgba(245, 237, 224, 0.05);
}

.cinematic-item img,
.cinematic-item video { max-width: min(860px, 100%); max-height: 80vh; width: auto; border-radius: var(--rad-lg); box-shadow: 0 30px 80px rgba(0,0,0,0.65); }

.cinematic-item audio { width: min(520px, 100%); }

.cinematic-text { max-width: 660px; margin: 2.2rem auto 0; }
.cinematic-text h2 {
  font-family: var(--serif); color: #fffdf5;
  font-size: clamp(1.6rem, 3.5vw, 2.4rem); margin: 0 0 1rem;
  line-height: 1.15; font-weight: 400; letter-spacing: -0.01em;
}
.cinematic-text p { font-size: 1.1rem; line-height: 1.85; opacity: 0.88; white-space: pre-wrap; color: rgba(245, 237, 224, 0.92); }
.cinematic-date { color: var(--gold-3); font-size: 0.72rem; letter-spacing: 2.5px; text-transform: uppercase; font-weight: 700; margin-top: 1.8rem; opacity: 0.82; }

.cinematic-empty { padding: 7rem 2rem; text-align: center; font-family: var(--serif); font-size: 1.6rem; opacity: 0.7; color: var(--gold-3); }

.cinematic-foot {
  padding: 2.5rem 2rem; text-align: center;
  border-top: 1px solid rgba(245, 237, 224, 0.07);
  display: flex; justify-content: center; gap: 1rem; align-items: center;
  font-size: 0.85rem; color: rgba(245, 237, 224, 0.5);
}
.cinematic-brand { color: var(--gold-3); font-family: var(--serif); font-size: 1.15rem; text-decoration: none; letter-spacing: 0.05em; font-weight: 400; }
.cinematic-brand:hover { color: var(--gold-2); }
.cinematic-foot .muted { color: rgba(245, 237, 224, 0.4); }

.cinematic-hero-gate { background: linear-gradient(160deg, #1c0e04 0%, #060402 100%); }
.cinematic-error { color: #f5a0a0; margin: 1rem 0; font-size: 0.93rem; }

.pin-form { display: flex; flex-direction: column; align-items: center; gap: 1rem; margin-top: 2.5rem; }
.pin-input {
  text-align: center; letter-spacing: 20px; font-size: 2rem; font-weight: 600;
  background: rgba(245, 237, 224, 0.07); color: #fffdf5;
  border: 1.5px solid rgba(184, 137, 44, 0.35);
  border-radius: var(--rad-sm); padding: 1rem 1.8rem;
  max-width: 260px; width: 100%;
  transition: border-color 0.18s, box-shadow 0.18s;
}
.pin-input:focus { border-color: var(--gold-2); box-shadow: 0 0 0 4px rgba(184, 137, 44, 0.18); outline: none; }

.cinematic-hero-lost { background: linear-gradient(160deg, #3a1010 0%, #060402 100%); }
.cinematic-contact   { margin-top: 2rem; font-size: 1.05rem; line-height: 1.85; color: rgba(245, 237, 224, 0.9); }
.cinematic-contact a { color: var(--gold-3); }

/* ──────────────────────────────────────────────────────────────────────
   14. ACTIVATION CARD
   ────────────────────────────────────────────────────────────────────── */
.activation-card {
  max-width: 520px; margin: 5rem auto; text-align: center;
  padding: 3.5rem 2.5rem; background: var(--cream);
  border-radius: var(--rad-xl); border: 1px solid var(--line-gold);
  box-shadow: var(--shadow-lg); animation: fadeUp 0.55s var(--ease) both;
}
.activation-card::before {
  content: ''; display: block; width: 56px; height: 2px;
  background: var(--grad-gold); margin: 0 auto 1.5rem; border-radius: 2px;
}
.activation-mark { font-size: 3.5rem; color: var(--gold-2); margin-bottom: 1rem; display: block; }
.activation-card h1 { margin: 0 0 1rem; }

/* ──────────────────────────────────────────────────────────────────────
   15. TABLES (admin)
   ────────────────────────────────────────────────────────────────────── */
.table-wrap {
  overflow-x: auto; background: var(--cream);
  border-radius: var(--rad); border: 1px solid var(--line);
  box-shadow: var(--shadow-sm); margin-bottom: 1.5rem;
}
.data-table { width: 100%; border-collapse: collapse; min-width: 600px; }
.data-table th,
.data-table td {
  padding: 0.88rem 1.1rem;
  text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; font-size: 0.9rem;
}
.data-table th {
  background: var(--paper);
  font-size: 0.67rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1.5px; color: var(--gold-deep);
}
.data-table tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: var(--paper); }

.batch-output {
  background: #0d0a06; color: var(--gold-3);
  padding: 1.2rem; border-radius: var(--rad-sm);
  border: 1px solid var(--line-gold);
  font-family: 'SF Mono', 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.82rem; white-space: pre; overflow: auto; max-height: 300px;
}

/* ──────────────────────────────────────────────────────────────────────
   16. STATS GRID
   ────────────────────────────────────────────────────────────────────── */
.stats-grid { display: grid; gap: 1.2rem; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); margin-bottom: 2rem; }

.stat {
  background: var(--cream);
  padding: 1.6rem; border-radius: var(--rad);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  text-decoration: none; color: var(--ink);
  transition: transform 0.22s var(--ease-spring), box-shadow 0.22s, border-color 0.22s;
  position: relative; overflow: hidden;
}
/* Animated gold underline */
.stat::before {
  content: ''; position: absolute; bottom: 0; left: 0; right: 0;
  height: 2px; background: var(--grad-gold);
  transform: scaleX(0); transform-origin: left;
  transition: transform 0.35s var(--ease);
}
.stat:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: var(--line-gold); text-decoration: none; }
.stat:hover::before { transform: scaleX(1); }

.stat.brand {
  background: var(--grad-hero);
  color: var(--cream); border-color: transparent;
  box-shadow: var(--shadow-brand);
}
.stat.brand .stat-label { color: rgba(245, 237, 224, 0.7); }
.stat.brand .stat-foot  { color: rgba(245, 237, 224, 0.65); }
.stat.brand .stat-value { color: var(--gold-3); }

.stat-label { font-size: 0.64rem; color: var(--gold-deep); text-transform: uppercase; letter-spacing: 2px; font-weight: 700; }
.stat-value { font-family: var(--serif); font-weight: 400; font-size: 2.8rem; line-height: 1; margin: 0.4rem 0 0.2rem; color: var(--ink); }
.stat-foot  { font-size: 0.8rem; color: var(--muted); }

/* ──────────────────────────────────────────────────────────────────────
   17. SETTINGS
   ────────────────────────────────────────────────────────────────────── */
.settings-grid { display: grid; gap: 1.4rem; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.settings-grid .card h3 { font-family: var(--serif); font-weight: 500; margin: 0 0 1rem; font-size: 1.4rem; }

.plain-list { list-style: none; padding: 0; margin: 0; }
.plain-list li {
  padding: 0.7rem 0; border-bottom: 1px solid var(--line);
  font-size: 0.93rem; color: var(--ink-soft);
  display: flex; align-items: center; justify-content: space-between; gap: 0.5rem;
}
.plain-list li:last-child { border-bottom: 0; }

.device-list { list-style: none; padding: 0; margin: 0; }
.device-list li { padding: 0.85rem 0; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 0.75rem; }
.device-list li:last-child { border-bottom: 0; }

.chip-card   { padding: 1rem 1.4rem; }
.chips-list  { display: flex; flex-direction: column; gap: 0.6rem; }

.transfer-note {
  border-left: 3px solid var(--gold);
  margin: 1rem 0; padding: 0.75rem 1.2rem;
  color: var(--ink-soft); font-style: italic;
  background: rgba(184, 137, 44, 0.06);
  border-radius: 0 var(--rad-sm) var(--rad-sm) 0;
}

/* ──────────────────────────────────────────────────────────────────────
   18. LEGAL
   ────────────────────────────────────────────────────────────────────── */
.legal-doc { line-height: 1.85; max-width: 720px; }
.legal-doc h1 { font-family: var(--serif); font-weight: 400; margin-bottom: 0.5rem; }
.legal-doc h2 { font-family: var(--serif); font-weight: 500; margin: 2.5rem 0 0.75rem; font-size: 1.5rem; }
.legal-doc p  { color: var(--ink-soft); margin-bottom: 1rem; }
.legal-doc ul { padding-left: 1.5rem; margin-bottom: 1rem; }
.legal-doc li { margin: 0.4rem 0; color: var(--ink-soft); }

/* ──────────────────────────────────────────────────────────────────────
   19. MOBILE ACTION BAR
   ────────────────────────────────────────────────────────────────────── */
.mobile-action-bar {
  display: none; position: fixed; bottom: 0; left: 0; right: 0; z-index: 40;
  background: var(--glass);
  backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur);
  border-top: 1px solid var(--line-gold);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  height: var(--mab-h);
}

.mab-inner { display: flex; align-items: stretch; height: 100%; padding: 0 0.25rem; }

.mab-tab {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 3px; padding: 0.4rem 0;
  color: var(--muted-soft); text-decoration: none;
  font-size: 0.65rem; font-weight: 500; letter-spacing: 0.3px;
  transition: color 0.18s var(--ease); position: relative;
}
.mab-tab::before {
  content: ''; position: absolute; top: 0; left: 50%;
  transform: translateX(-50%) scaleX(0); width: 32px; height: 2px;
  background: var(--grad-gold); border-radius: 0 0 4px 4px;
  transition: transform 0.22s var(--ease-spring);
}
.mab-tab.is-active { color: var(--gold-deep); }
.mab-tab.is-active::before { transform: translateX(-50%) scaleX(1); }
.mab-tab.is-active .mab-glyph { color: var(--gold); }

.mab-glyph { width: 24px; height: 24px; color: var(--muted-soft); transition: color 0.18s var(--ease), transform 0.18s var(--ease-spring); }
.mab-tab:hover .mab-glyph { transform: translateY(-1px); color: var(--gold); }

.mab-label { font-size: 0.66rem; line-height: 1; }

.mab-tab-add .mab-glyph {
  width: 36px; height: 36px;
  background: var(--grad-brand);
  border-radius: 50%; color: var(--gold-3);
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-brand);
  transition: transform 0.22s var(--ease-spring), box-shadow 0.2s; padding: 8px;
}
.mab-tab-add:hover .mab-glyph { transform: translateY(-2px) scale(1.08); box-shadow: 0 10px 28px -4px rgba(28, 18, 8, 0.5); color: var(--gold-light); }
.mab-tab-add::before { display: none; }

@media (max-width: 900px) { .mobile-action-bar { display: flex; } }

/* ──────────────────────────────────────────────────────────────────────
   20. OFFLINE BANNER & TOASTS
   ────────────────────────────────────────────────────────────────────── */
.memoring-toast-stack {
  position: fixed; top: 14px; left: 50%; transform: translateX(-50%);
  z-index: 9999; display: flex; flex-direction: column; gap: 0.5rem;
  pointer-events: none; align-items: center;
}

.memoring-offline-banner {
  position: fixed;
  bottom: calc(var(--mab-h) + env(safe-area-inset-bottom, 0px));
  left: 0; right: 0; z-index: 45;
  background: var(--brand);
  color: var(--gold-3);
  display: flex; align-items: center; gap: 0.65rem;
  padding: 0.65rem 1.2rem; font-size: 0.85rem;
  border-top: 1px solid rgba(184, 137, 44, 0.25);
}
@media (min-width: 901px) { .memoring-offline-banner { bottom: 0; } }

.memoring-offline-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--gold-3);
  animation: goldPulse 2s ease-in-out infinite; flex-shrink: 0;
}

/* ──────────────────────────────────────────────────────────────────────
   21. MARKETING WEBSITE
   ────────────────────────────────────────────────────────────────────── */
.mc-body {
  --mc-onyx:        #0d0a06;
  --mc-onyx-2:      #181208;
  --mc-onyx-3:      #2a1e0e;
  --mc-ivory:       #fffef5;
  --mc-ivory-2:     #f5ecda;
  --mc-pearl:       #fffef5;
  --mc-line:        rgba(28,18,8,.07);
  --mc-line-dark:   rgba(245,237,224,.09);
  --mc-ink:         #1c1208;
  --mc-ink-soft:    #4a3828;
  --mc-mute:        #7a6a52;
  --mc-mute-dark:   rgba(245,237,224,.62);

  --mc-gold:        #c9a040;
  --mc-gold-soft:   #e8c870;
  --mc-gold-deep:   #8a6318;
  --mc-gold-pale:   #fdf5e0;

  background: var(--mc-pearl);
  color: var(--mc-ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
.mc-body * { box-sizing: border-box; }
.mc-body a { color: inherit; text-decoration: none; }
.mc-body em { font-style: italic; color: var(--mc-gold); }

/* ─── Section building blocks ─── */
.mc-eyebrow {
  display: inline-flex; align-items: center; gap: 12px;
  font: 700 0.64rem/1 var(--sans);
  letter-spacing: 4px; text-transform: uppercase; color: var(--mc-gold);
  margin-bottom: 1.2rem;
}
.mc-eyebrow::before { content: ''; display: block; width: 32px; height: 1px; background: currentColor; flex-shrink: 0; }
.mc-eyebrow.gold { color: var(--mc-gold-soft); }

.mc-h2 {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(2.2rem, 5vw, 4rem); line-height: 1.06;
  letter-spacing: -0.015em; margin: 0 0 1.2rem;
}
.mc-h2.light { color: var(--mc-pearl); }

.mc-section-head            { max-width: 780px; margin-bottom: 3.5rem; }
.mc-section-head.center     { margin-left: auto; margin-right: auto; text-align: center; }

/* ─── Sticky nav ─── */
.mc-nav {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem clamp(1.25rem, 4vw, 3rem);
  background: rgba(255, 254, 245, 0.88);
  backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--mc-line);
  transition: background 0.3s;
}
/* Thin gold bottom rule on nav */
.mc-nav::after {
  content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(201, 160, 64, 0.5), transparent);
  pointer-events: none;
}

.mc-brand { display: inline-flex; align-items: center; gap: 0.85rem; color: var(--mc-onyx); }

.mc-brand-mark {
  width: 46px; height: 46px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 12px;
  background: linear-gradient(145deg, #1c1208 0%, #3d2510 100%);
  color: var(--mc-gold-soft);
  box-shadow: 0 6px 18px rgba(28, 18, 8, 0.40), inset 0 0 0 1px rgba(200, 160, 44, 0.20);
}

.mc-brand-words   { display: flex; flex-direction: column; line-height: 1.1; }
.mc-brand-name    { font-family: var(--serif); font-weight: 500; font-size: 1.5rem; letter-spacing: 0.05em; color: var(--mc-onyx); }
.mc-brand-dot     { color: var(--mc-gold); padding: 0 3px; }
.mc-brand-tag     { font-size: 0.63rem; letter-spacing: 3px; text-transform: uppercase; color: var(--mc-mute); margin-top: 3px; }

.mc-nav-links { display: flex; align-items: center; gap: 2rem; }
.mc-nav-links a {
  font-size: 0.88rem; font-weight: 500; color: var(--mc-ink-soft);
  position: relative; padding: 0.3rem 0; transition: color 0.18s;
}
.mc-nav-links a:hover { color: var(--mc-onyx); }
.mc-nav-links a:not(.mc-pill)::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -2px; height: 1px;
  background: var(--mc-gold);
  transform: scaleX(0); transform-origin: left;
  transition: transform 0.28s var(--ease);
}
.mc-nav-links a:not(.mc-pill):hover::after { transform: scaleX(1); }

.mc-pill {
  background: var(--mc-onyx); color: var(--mc-ivory) !important;
  padding: 0.65rem 1.5rem; border-radius: 999px;
  font-size: 0.85rem; font-weight: 600; letter-spacing: 0.1em;
  text-transform: uppercase; font-size: 0.78rem;
  transition: background 0.18s, transform 0.18s var(--ease-spring), box-shadow 0.18s;
  box-shadow: 0 6px 20px rgba(28, 18, 8, 0.35);
}
.mc-pill:hover { background: var(--mc-gold); color: var(--mc-onyx) !important; transform: translateY(-1px); box-shadow: 0 10px 28px rgba(28, 18, 8, 0.40); }
.mc-pill::after { display: none !important; }

@media (max-width: 860px) {
  .mc-nav-links a:not(.mc-pill) { display: none; }
  .mc-brand-mark { width: 38px; height: 38px; }
  .mc-brand-name { font-size: 1.3rem; }
  .mc-brand-tag  { display: none; }
}

/* ─── HERO ─── */
.mc-hero {
  position: relative; isolation: isolate;
  min-height: calc(100vh - 72px);
  padding: clamp(3rem, 7vw, 6rem) clamp(1.5rem, 4vw, 4rem) 5rem;
  background:
    radial-gradient(ellipse at 75% 15%, rgba(200, 160, 44, 0.20), transparent 52%),
    radial-gradient(ellipse at 15% 85%, rgba(184, 120, 28, 0.12), transparent 52%),
    linear-gradient(160deg, #0d0a06 0%, #1e1408 50%, #0a0704 100%);
  color: var(--mc-pearl);
  overflow: hidden;
}

.mc-hero-grain {
  position: absolute; inset: 0; z-index: -1; pointer-events: none;
  opacity: 0.28; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.88' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .35 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.mc-hero-inner {
  position: relative; z-index: 1; max-width: 1300px; margin: 0 auto;
  display: grid; gap: clamp(2.5rem, 6vw, 5rem);
  grid-template-columns: 1.1fr 1fr; align-items: center;
}

.mc-hero .mc-eyebrow { color: var(--mc-gold-soft); }

.mc-display {
  font-family: var(--serif); font-weight: 300;
  font-size: clamp(3.4rem, 9vw, 7.2rem);
  line-height: 0.95; letter-spacing: -0.02em; margin: 0 0 1.8rem;
  color: var(--mc-pearl);
}
.mc-display em { font-style: italic; color: var(--mc-gold-soft); }

.mc-lede {
  font-size: clamp(1rem, 1.5vw, 1.16rem); line-height: 1.78;
  max-width: 500px; color: rgba(245, 237, 224, 0.80); margin: 0 0 2.5rem;
}

.mc-cta-row { display: flex; gap: 1rem; flex-wrap: wrap; }

.mc-cta {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0.95rem 2rem; min-height: 54px;
  border-radius: 999px;
  font: 600 0.85rem/1 var(--sans); letter-spacing: 0.08em; text-transform: uppercase;
  transition: transform 0.18s var(--ease-spring), background 0.18s, color 0.18s, box-shadow 0.18s;
}

.mc-cta-primary {
  background: linear-gradient(135deg, #c9a040 0%, #e8c870 50%, #b88020 100%);
  color: #1c1208;
  box-shadow: 0 12px 36px -6px rgba(184, 137, 44, 0.60);
}
.mc-cta-primary:hover { filter: brightness(1.08); transform: translateY(-2px); box-shadow: 0 18px 44px -6px rgba(184, 137, 44, 0.65); color: #1c1208; }

.mc-cta-ghost {
  background: transparent; color: var(--mc-pearl);
  border: 1.5px solid rgba(245, 237, 224, 0.28);
}
.mc-cta-ghost:hover { background: rgba(245, 237, 224, 0.06); border-color: var(--mc-gold-soft); transform: translateY(-1px); color: var(--mc-pearl); }

.mc-cta-gold {
  background: linear-gradient(135deg, #c9a040 0%, #e8c870 50%, #b88020 100%);
  color: #1c1208;
  box-shadow: 0 14px 40px -6px rgba(184, 137, 44, 0.65);
}
.mc-cta-gold:hover { filter: brightness(1.07); transform: translateY(-2px); color: #1c1208; }

.mc-trust {
  margin-top: 2.2rem; display: inline-flex; align-items: center; gap: 0.7rem;
  font-size: 0.78rem; letter-spacing: 0.6px; color: rgba(245, 237, 224, 0.65);
}
.mc-trust-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--mc-gold-soft); box-shadow: 0 0 14px var(--mc-gold);
  animation: goldPulse 2.8s ease-in-out infinite; flex-shrink: 0;
}

.mc-hero-art { display: flex; align-items: center; justify-content: center; }
.mc-ring-art { width: 100%; max-width: 500px; height: auto; filter: drop-shadow(0 32px 64px rgba(184, 137, 44, 0.22)) drop-shadow(0 16px 32px rgba(0,0,0,0.50)); }

.mc-scroll-cue {
  position: absolute; bottom: 1.8rem; left: 50%; transform: translateX(-50%);
  color: var(--mc-gold-soft); font-size: 1.6rem; opacity: 0.72;
  animation: scrollCue 2.6s ease-in-out infinite;
}

@media (max-width: 920px) {
  .mc-hero-inner { grid-template-columns: 1fr; text-align: center; }
  .mc-hero-copy  { order: 2; }
  .mc-hero-art   { order: 1; }
  .mc-ring-art   { max-width: 320px; margin: 0 auto; }
  .mc-lede       { margin-left: auto; margin-right: auto; }
  .mc-cta-row    { justify-content: center; }
  .mc-eyebrow    { margin-left: auto; margin-right: auto; }
  .mc-trust      { justify-content: center; }
}

/* ─── EDITORIAL QUOTE ─── */
.mc-quote {
  background: var(--mc-pearl);
  padding: clamp(5rem, 12vw, 10rem) clamp(1.5rem, 5vw, 4rem);
  text-align: center; border-bottom: 1px solid var(--mc-line);
}
.mc-quote-eyebrow { font: 700 0.64rem/1 var(--sans); letter-spacing: 4px; text-transform: uppercase; color: var(--mc-gold); margin: 0 0 2rem; }
.mc-quote-body {
  font-family: var(--serif); font-weight: 300;
  font-size: clamp(2.2rem, 5.5vw, 4rem); line-height: 1.12;
  color: var(--mc-onyx); margin: 0 auto 2rem; max-width: 880px; letter-spacing: -0.01em;
}
.mc-quote-body em { font-style: italic; color: var(--mc-gold); }
.mc-quote-foot { max-width: 560px; margin: 0 auto; color: var(--mc-ink-soft); line-height: 1.8; font-size: 1.05rem; }

/* ─── HOW IT WORKS ─── */
.mc-how { background: var(--mc-ivory-2); padding: clamp(4rem, 9vw, 8rem) clamp(1.5rem, 5vw, 4rem); }
.mc-how-grid {
  display: grid; gap: clamp(1.2rem, 2.5vw, 1.8rem);
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  max-width: 1200px; margin: 0 auto;
}
.mc-step {
  background: var(--mc-pearl); padding: 2.5rem 2rem;
  border: 1px solid var(--mc-line); border-radius: var(--rad-lg);
  position: relative;
  transition: transform 0.28s var(--ease-spring), box-shadow 0.28s, border-color 0.28s;
}
.mc-step::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--mc-gold), transparent);
  border-radius: var(--rad-lg) var(--rad-lg) 0 0;
  transform: scaleX(0); transform-origin: center;
  transition: transform 0.35s var(--ease);
}
.mc-step:hover { transform: translateY(-7px); box-shadow: 0 28px 56px -8px rgba(28, 18, 8, 0.12); border-color: rgba(201, 160, 64, 0.45); }
.mc-step:hover::before { transform: scaleX(1); }

.mc-step-num { display: block; font-family: var(--serif); font-style: italic; font-size: 2.8rem; color: var(--mc-gold); margin-bottom: 0.75rem; line-height: 1; opacity: 0.65; }
.mc-step h3 { font-family: var(--serif); font-weight: 500; font-size: 1.5rem; margin: 0 0 0.8rem; color: var(--mc-onyx); }
.mc-step p  { color: var(--mc-ink-soft); line-height: 1.75; margin: 0; font-size: 0.94rem; }

/* ─── COLLECTION ─── */
.mc-collection {
  background: var(--mc-onyx); color: var(--mc-pearl);
  padding: clamp(4rem, 9vw, 8rem) clamp(1.5rem, 5vw, 4rem);
  position: relative;
}
/* Subtle gold radial on collection */
.mc-collection::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(ellipse at 80% 15%, rgba(201, 160, 44, 0.10), transparent 55%);
  pointer-events: none;
}
.mc-collection > * { position: relative; z-index: 1; }
.mc-collection .mc-eyebrow { color: var(--mc-gold-soft); }
.mc-collection .mc-h2      { color: var(--mc-pearl); }

.mc-coll-grid {
  display: grid; gap: clamp(1rem, 2vw, 1.4rem);
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  max-width: 1200px; margin: 0 auto;
}
.mc-coll-card {
  padding: 2.2rem 1.8rem 2rem;
  border: 1px solid rgba(201, 160, 44, 0.15); border-radius: var(--rad-lg);
  transition: transform 0.28s var(--ease-spring), border-color 0.28s, background 0.28s;
  background: rgba(255, 254, 245, 0.02);
}
.mc-coll-card:hover { transform: translateY(-5px); border-color: rgba(201, 160, 44, 0.5); background: rgba(201, 160, 44, 0.04); }

.mc-coll-art {
  width: 72px; height: 72px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--mc-gold-soft); margin-bottom: 1.4rem;
  background: rgba(201, 160, 44, 0.10);
  border-radius: var(--rad); border: 1px solid rgba(201, 160, 44, 0.22);
}
.mc-coll-art svg { width: 36px; height: 36px; }
.mc-coll-card h3 { font-family: var(--serif); font-weight: 500; font-size: 1.35rem; margin: 0 0 0.55rem; color: var(--mc-pearl); }
.mc-coll-card p  { color: rgba(245, 237, 224, 0.68); font-size: 0.93rem; line-height: 1.72; margin: 0; }

/* ─── STILLNESS ─── */
.mc-stillness {
  background: var(--mc-pearl);
  padding: clamp(5rem, 12vw, 10rem) clamp(1.5rem, 5vw, 4rem);
  text-align: center;
}
.mc-stillness-line {
  font-family: var(--serif); font-weight: 300;
  font-size: clamp(2.4rem, 7vw, 5rem); line-height: 1.05;
  margin: 0 0 1.6rem; color: var(--mc-onyx); letter-spacing: -0.015em;
}
/* Thin gold rule under stillness headline */
.mc-stillness-line::after {
  content: '';
  display: block; width: 60px; height: 1.5px;
  background: linear-gradient(90deg, transparent, var(--mc-gold), transparent);
  margin: 1.4rem auto 0; border-radius: 2px;
}
.mc-stillness-foot { max-width: 520px; margin: 1.5rem auto 0; color: var(--mc-ink-soft); line-height: 1.82; }

/* ─── CTA BAND ─── */
.mc-cta-band {
  background:
    radial-gradient(ellipse at 30% 10%, rgba(201, 160, 44, 0.22), transparent 55%),
    linear-gradient(160deg, #1a1208 0%, var(--mc-onyx) 100%);
  color: var(--mc-pearl);
  padding: clamp(5rem, 10vw, 9rem) clamp(1.5rem, 5vw, 4rem);
  text-align: center;
}
.mc-cta-band-inner { max-width: 700px; margin: 0 auto; }
.mc-cta-band p { font-size: 1.1rem; line-height: 1.78; color: rgba(245, 237, 224, 0.75); margin: 0 0 2.5rem; }

/* ─── FOOTER ─── */
.mc-footer {
  background: var(--mc-onyx); color: rgba(245, 237, 224, 0.62);
  padding: 3.5rem clamp(1.5rem, 5vw, 4rem) 2.5rem;
  border-top: 1px solid rgba(201, 160, 44, 0.18);
  display: grid; gap: 2rem; grid-template-columns: 1fr auto; align-items: start;
}
.mc-footer-brand { display: flex; flex-direction: column; gap: 0.4rem; }
.mc-footer-brand .mc-brand-name { color: var(--mc-pearl); font-size: 1.4rem; }
.mc-footer-tag { font-size: 0.83rem; color: rgba(245, 237, 224, 0.48); }
.mc-footer-links { display: flex; flex-wrap: wrap; gap: 1.5rem; font-size: 0.88rem; }
.mc-footer-links a { color: rgba(245, 237, 224, 0.72); transition: color 0.15s; }
.mc-footer-links a:hover { color: var(--mc-gold-soft); }
.mc-footer-copy {
  grid-column: 1 / -1; font-size: 0.76rem; letter-spacing: 0.3px;
  color: rgba(245, 237, 224, 0.38);
  border-top: 1px solid rgba(201, 160, 44, 0.12); padding-top: 1.6rem; margin-top: 0.5rem;
}
@media (max-width: 680px) { .mc-footer { grid-template-columns: 1fr; } }

/* ──────────────────────────────────────────────────────────────────────
   22. ONBOARDING / PIN / SPECIAL SCREENS
   ────────────────────────────────────────────────────────────────────── */
.onboarding-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 2rem;
  background: radial-gradient(ellipse at 50% 0%, rgba(184, 137, 44, 0.08), transparent 60%), var(--paper);
}
.onboarding-card {
  width: 100%; max-width: 480px;
  background: var(--cream); border-radius: var(--rad-xl);
  border: 1px solid var(--line-gold); box-shadow: var(--shadow-lg);
  padding: 3rem 2.5rem; text-align: center;
  animation: fadeUp 0.55s var(--ease) both;
}
/* Gold top bar */
.onboarding-card::before {
  content: ''; display: block; width: 56px; height: 2px;
  background: var(--grad-gold); margin: 0 auto 1.5rem; border-radius: 2px;
}
.onboarding-mark { font-size: 3rem; color: var(--gold-2); margin-bottom: 1rem; }

/* ──────────────────────────────────────────────────────────────────────
   23. MISCELLANEOUS UTILITIES
   ────────────────────────────────────────────────────────────────────── */
.gold-line { width: 48px; height: 1.5px; background: var(--grad-gold); margin: 1.2rem 0; border-radius: 2px; }
.gold-line.center { margin-left: auto; margin-right: auto; }

.tag-pill {
  display: inline-block; padding: 0.22rem 0.72rem;
  border-radius: var(--rad-pill); font-size: 0.68rem; font-weight: 700; letter-spacing: 0.8px;
  background: var(--paper-2); color: var(--muted); text-transform: uppercase;
  border: 1px solid var(--line);
}
.tag-pill-gold { background: var(--gold-pale); color: var(--gold-deep); border: 1px solid var(--line-gold); }

.spinner {
  width: 20px; height: 20px;
  border: 2px solid var(--line-med); border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite; display: inline-block;
}

.divider { border: none; border-top: 1px solid var(--line); margin: 1.5rem 0; }

.section { margin-bottom: 2.5rem; }
.section:last-child { margin-bottom: 0; }

.stack { display: flex; flex-direction: column; }

/* ──────────────────────────────────────────────────────────────────────
   24. STORYBOARD — full-screen snap-scroll cinematic viewer
   ────────────────────────────────────────────────────────────────────── */

/* Body: lock native scroll so the sb container handles it */
html:has(body.cinematic-body) { overflow: hidden; height: 100dvh; }
#cinematicWrap {
  height: 100dvh;
  overflow: hidden;
  display: flex; flex-direction: column;
}

/* ── Root container ─────────────────────────────────────────────────── */
.sb {
  height: 100dvh;
  overflow-y: scroll;
  scroll-snap-type: y mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  background: #0c0906;
  color: #f0e6d4;
  position: relative;
  isolation: isolate;
}
.sb::-webkit-scrollbar { display: none; }

/* ── Chapter: each fills exactly the viewport ───────────────────────── */
.sb-chapter {
  scroll-snap-align: start;
  scroll-snap-stop: always;
  height: 100dvh;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}

/* ── Nav dots — fixed right rail ─────────────────────────────────────── */
.sb-nav {
  position: fixed;
  right: 1.4rem; top: 50%;
  transform: translateY(-50%);
  z-index: 60;
  display: flex; flex-direction: column; gap: 9px;
}
.sb-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  border: 1.5px solid rgba(240, 230, 212, 0.30);
  background: transparent;
  cursor: pointer; padding: 0;
  position: relative;
  transition: border-color 0.2s, background 0.2s, transform 0.2s var(--ease-spring);
}
.sb-dot:hover { border-color: var(--gold-2); transform: scale(1.5); }
.sb-dot.is-active { background: var(--gold-2); border-color: var(--gold-2); transform: scale(1.35); }
.sb-dot-label {
  position: absolute; right: calc(100% + 9px); top: 50%; transform: translateY(-50%);
  font-size: 0.6rem; font-weight: 700; letter-spacing: 1px;
  color: rgba(240, 230, 212, 0.45); white-space: nowrap; text-transform: lowercase;
  opacity: 0; transition: opacity 0.15s; pointer-events: none;
}
.sb-dot:hover .sb-dot-label,
.sb-dot.is-active .sb-dot-label { opacity: 1; color: var(--gold-3); }
@media (max-width: 600px) { .sb-nav { display: none; } }

/* ── Autoplay button + progress ─────────────────────────────────────── */
.sb-autoplay {
  position: fixed;
  bottom: 1.6rem; right: 1.6rem;
  z-index: 60;
  display: flex; align-items: center; gap: 0.6rem;
}
.sb-autoplay-btn {
  width: 38px; height: 38px;
  background: rgba(12, 9, 6, 0.75);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(184, 137, 44, 0.30);
  border-radius: 50%;
  color: var(--gold-3);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.15s;
}
.sb-autoplay-btn:hover { background: rgba(20, 15, 8, 0.88); border-color: var(--gold); transform: scale(1.08); }
.sb-progress-bar {
  width: 80px; height: 3px;
  background: rgba(240, 230, 212, 0.12);
  border-radius: 2px; overflow: hidden;
}
.sb-progress-fill {
  height: 100%; width: 0%;
  background: var(--grad-gold);
  border-radius: 2px;
}

/* ── Owner floating bar (top-right) ─────────────────────────────────── */
.sb-owner-float {
  position: fixed; top: 1rem; right: 1rem;
  z-index: 60; display: flex; gap: 0.4rem;
}
.sb-owner-btn {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.4rem 0.85rem;
  background: rgba(12, 9, 6, 0.80);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(184, 137, 44, 0.28);
  border-radius: var(--rad-pill);
  font-size: 0.74rem; font-weight: 600; color: var(--gold-3);
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s;
}
.sb-owner-btn:hover { background: rgba(20, 14, 6, 0.92); border-color: var(--gold); color: var(--gold-3); }

/* ─────────────────────────────────────────────────────────────────────
   COVER
   ───────────────────────────────────────────────────────────────────── */
.sb-cover {
  justify-content: center;
  background:
    radial-gradient(ellipse at 50% 35%, rgba(184, 137, 44, 0.15) 0%, transparent 55%),
    linear-gradient(160deg, #100c06 0%, #1a1208 50%, #080603 100%);
}
.sb-cover-bg {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
  z-index: 0;
}
.sb-cover-veil {
  position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(160deg, rgba(10,7,4,.72) 0%, rgba(10,7,4,.55) 50%, rgba(8,5,3,.80) 100%);
}
/* Film-grain overlay */
.sb-cover::before {
  content: ''; position: absolute; inset: 0; z-index: 2;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.88' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .20 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: 0.28; mix-blend-mode: overlay; pointer-events: none;
}
.sb-cover-body {
  position: relative; z-index: 3;
  text-align: center; max-width: 780px;
  padding: 2rem clamp(1.5rem, 5vw, 4rem);
  animation: fadeUp 0.6s 0.1s var(--ease) both;
}
.sb-cover-eyebrow {
  display: inline-block;
  font-size: 0.62rem; font-weight: 700; letter-spacing: 4px;
  text-transform: uppercase; color: var(--gold-3); margin-bottom: 1.2rem;
}
.sb-cover-tag {
  display: inline-block; padding: 0.3rem 1.1rem;
  background: var(--grad-gold); color: #1c1208;
  border-radius: var(--rad-pill);
  font-size: 0.68rem; font-weight: 700; letter-spacing: 1px;
  text-transform: uppercase; margin-bottom: 1.2rem;
  box-shadow: var(--shadow-gold);
}
.sb-cover-title {
  font-family: var(--serif); font-weight: 300;
  font-size: clamp(3rem, 10vw, 7rem); line-height: 0.98;
  letter-spacing: -0.02em; margin: 0 0 1.4rem;
  color: #fffef8;
}
.sb-cover-desc {
  font-size: clamp(0.95rem, 1.5vw, 1.1rem); line-height: 1.75;
  color: rgba(240, 230, 212, 0.72); max-width: 520px; margin: 0 auto 1.5rem;
}
.sb-cover-rule {
  width: 48px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  margin: 0.4rem auto 1.4rem; border-radius: 1px;
}
.sb-cover-meta {
  display: flex; align-items: center; justify-content: center; gap: 0.7rem;
  font-size: 0.68rem; font-weight: 600; letter-spacing: 2.5px;
  text-transform: uppercase; color: rgba(184, 137, 44, 0.65);
  margin-bottom: 2rem;
}
.sb-cover-meta-dot { opacity: 0.5; }
.sb-cover-empty { color: rgba(240, 230, 212, 0.50); font-style: italic; margin-bottom: 1.5rem; }

.sb-begin {
  display: inline-flex; align-items: center; gap: 0.6rem;
  padding: 0.8rem 2rem;
  background: var(--grad-gold); color: #1c1208;
  border: none; border-radius: var(--rad-pill);
  font: 700 0.8rem/1 var(--sans); letter-spacing: 0.1em; text-transform: uppercase;
  cursor: pointer; text-decoration: none;
  box-shadow: 0 12px 36px -6px rgba(184, 137, 44, 0.55);
  transition: filter 0.18s, transform 0.18s var(--ease-spring);
}
.sb-begin:hover { filter: brightness(1.08); transform: translateY(-2px); color: #1c1208; }

.sb-scroll-hint {
  position: absolute; bottom: 2rem; left: 50%; transform: translateX(-50%);
  font-size: 0.6rem; letter-spacing: 4px; text-transform: uppercase;
  color: rgba(184, 137, 44, 0.45); font-weight: 600;
  animation: scrollCue 2.8s ease-in-out infinite;
}

/* ─────────────────────────────────────────────────────────────────────
   PHOTO chapter — image contained, caption below
   ───────────────────────────────────────────────────────────────────── */
.sb-ch--photo { background: #080503; flex-direction: column; }

.sb-photo-stage {
  flex: 1;
  width: 100%; max-width: 100%;
  display: flex; align-items: center; justify-content: center;
  padding: 3rem 2rem 1rem;
  min-height: 0;
  overflow: hidden;
}
.sb-photo-img {
  display: block;
  max-height: 100%; max-width: 100%;
  width: auto; height: auto;
  object-fit: contain;
  border-radius: 2px;
  box-shadow: 0 40px 90px rgba(0,0,0,0.75), 0 8px 20px rgba(0,0,0,0.55);
}

.sb-photo-foot {
  flex-shrink: 0;
  display: flex; align-items: flex-start; gap: 1rem;
  padding: 1.2rem 2.5rem 2rem;
  border-top: 1px solid rgba(184, 137, 44, 0.10);
  background: linear-gradient(to top, rgba(8,5,3,.92) 0%, rgba(8,5,3,.55) 100%);
  width: 100%;
}
.sb-roman {
  font-family: var(--serif); font-style: italic;
  font-size: 1.3rem; font-weight: 300;
  color: rgba(184, 137, 44, 0.60); line-height: 1;
  flex-shrink: 0; min-width: 1.5rem;
  letter-spacing: 0.05em; text-transform: lowercase;
  margin-top: 0.15rem;
}
.sb-roman--corner {
  position: absolute; top: 1.5rem; left: 2rem; z-index: 5;
  font-family: var(--serif); font-style: italic; font-size: 1.2rem;
  font-weight: 300; letter-spacing: 0.05em; text-transform: lowercase;
  color: rgba(184, 137, 44, 0.55);
}
.sb-photo-text { flex: 1; min-width: 0; }
.sb-photo-title {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(1.2rem, 2.5vw, 1.8rem); color: #fffef8;
  margin: 0 0 0.35rem; line-height: 1.15; letter-spacing: -0.01em;
}
.sb-photo-caption {
  font-size: 0.9rem; line-height: 1.65;
  color: rgba(240, 230, 212, 0.72); margin: 0 0 0.4rem;
}

/* ─────────────────────────────────────────────────────────────────────
   SHARED: center-stage layout for video, voice, text
   ───────────────────────────────────────────────────────────────────── */
.sb-center-stage {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 1.2rem; width: 100%;
  padding: 2.5rem clamp(1.2rem, 4vw, 3rem);
  position: relative; text-align: center;
}

/* ─────────────────────────────────────────────────────────────────────
   VIDEO chapter
   ───────────────────────────────────────────────────────────────────── */
.sb-ch--video {
  background: #060402;
}
.sb-video {
  width: 100%;
  max-width: min(860px, calc(100vw - 3rem));
  max-height: calc(100vh - 14rem);
  height: auto;
  border-radius: 8px;
  box-shadow: 0 40px 90px rgba(0,0,0,0.80), 0 0 0 1px rgba(184,137,44,0.10);
  display: block;
}
.sb-media-caption { max-width: 600px; }
.sb-caption-title {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(1.3rem, 2.5vw, 2rem);
  color: #fffef8; margin: 0 0 0.5rem; line-height: 1.15;
}
.sb-caption-body {
  font-size: 0.95rem; line-height: 1.72;
  color: rgba(240, 230, 212, 0.70); margin: 0;
}

/* ─────────────────────────────────────────────────────────────────────
   VOICE / AUDIO chapter
   ───────────────────────────────────────────────────────────────────── */
.sb-ch--voice {
  background: linear-gradient(160deg, #0d0a05 0%, #060402 100%);
}
.sb-voice-card {
  max-width: 480px; width: 100%;
  padding: 2.5rem 2rem;
  background: rgba(240, 230, 212, 0.035);
  border: 1px solid rgba(184, 137, 44, 0.16);
  border-radius: 20px;
  box-shadow: 0 40px 80px rgba(0,0,0,0.55);
}
.sb-voice-icon {
  width: 64px; height: 64px; margin: 0 auto 1.2rem;
  background: rgba(184, 137, 44, 0.08);
  border: 1px solid rgba(184, 137, 44, 0.22);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--gold-3);
  animation: goldPulse 2.8s ease-in-out infinite;
}
.sb-voice-title {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(1.3rem, 3vw, 1.9rem);
  color: #fffef8; margin: 0 0 1rem; line-height: 1.15;
}
.sb-audio { width: 100%; margin-bottom: 0.5rem; }
.sb-voice-body {
  font-size: 0.92rem; line-height: 1.72;
  color: rgba(240, 230, 212, 0.65); margin: 0.7rem 0 0;
}

/* ─────────────────────────────────────────────────────────────────────
   TEXT chapters: note, letter, memorial, storyboard
   ───────────────────────────────────────────────────────────────────── */
.sb-ch--note,
.sb-ch--letter,
.sb-ch--storyboard {
  background:
    radial-gradient(ellipse at 35% 20%, rgba(184, 137, 44, 0.07) 0%, transparent 55%),
    linear-gradient(160deg, #100d07 0%, #0a0804 100%);
}
.sb-ch--memorial {
  background: linear-gradient(160deg, #0e0908 0%, #060403 100%);
}

.sb-text-card {
  max-width: 640px; width: 100%;
  padding: clamp(2rem, 4vw, 3.5rem) clamp(1.8rem, 4vw, 3rem);
  background: rgba(240, 230, 212, 0.03);
  border: 1px solid rgba(184, 137, 44, 0.13);
  border-radius: 18px;
  text-align: left; position: relative;
  /* Subtle left gold accent */
  border-left: 2px solid rgba(184, 137, 44, 0.35);
}
.sb-text-card.is-letter {
  border-color: rgba(184, 137, 44, 0.22);
  background: rgba(240, 230, 212, 0.04);
}
.sb-text-card.is-memorial {
  border-left-color: rgba(200, 100, 100, 0.25);
  background: rgba(10, 4, 4, 0.40);
}
.sb-letter-header {
  display: flex; align-items: center; gap: 0.55rem;
  font-size: 0.64rem; font-weight: 700; letter-spacing: 2.5px;
  text-transform: uppercase; color: var(--gold-3); opacity: 0.72;
  margin-bottom: 1.4rem;
}
.sb-memorial-header {
  font-size: 1.2rem; color: rgba(240, 230, 212, 0.40);
  margin-bottom: 1rem; letter-spacing: 0.5rem;
}
.sb-text-title {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(1.5rem, 3.5vw, 2.5rem);
  color: #fffef8; margin: 0 0 1rem; line-height: 1.1; letter-spacing: -0.01em;
}
.sb-text-body {
  font-size: clamp(0.95rem, 1.4vw, 1.08rem); line-height: 1.85;
  color: rgba(240, 230, 212, 0.80); white-space: pre-wrap;
  max-height: calc(100vh - 22rem); overflow-y: auto;
  scrollbar-width: thin; scrollbar-color: rgba(184,137,44,.2) transparent;
}
.sb-text-body::-webkit-scrollbar { width: 3px; }
.sb-text-body::-webkit-scrollbar-thumb { background: rgba(184,137,44,.25); border-radius: 2px; }

/* ─────────────────────────────────────────────────────────────────────
   Shared date stamp
   ───────────────────────────────────────────────────────────────────── */
.sb-date {
  display: block; margin-top: 0.9rem;
  font-size: 0.62rem; font-weight: 700; letter-spacing: 3px;
  text-transform: uppercase; color: rgba(184, 137, 44, 0.68);
}
.sb-date--text { margin-top: 1.5rem; }

/* ─────────────────────────────────────────────────────────────────────
   Owner remove form per chapter
   ───────────────────────────────────────────────────────────────────── */
.sb-remove-form { position: absolute; top: 0.9rem; right: 0.9rem; z-index: 10; }
.sb-remove-btn {
  width: 30px; height: 30px; border-radius: 50%; cursor: pointer;
  background: rgba(12, 9, 6, 0.70);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  border: 1px solid rgba(240, 230, 212, 0.15);
  display: flex; align-items: center; justify-content: center;
  color: rgba(240, 230, 212, 0.50);
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.sb-remove-btn:hover { background: rgba(130,28,28,.72); color: #f5a0a0; border-color: rgba(130,28,28,.4); }

/* ─────────────────────────────────────────────────────────────────────
   Footer — own snap-scrolled page
   ───────────────────────────────────────────────────────────────────── */
.sb-foot {
  scroll-snap-align: start;
  height: 100dvh;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  background:
    radial-gradient(ellipse at 50% 40%, rgba(184, 137, 44, 0.08) 0%, transparent 55%),
    linear-gradient(160deg, #0e0b06 0%, #080603 100%);
  border-top: 1px solid rgba(184, 137, 44, 0.10);
  flex-shrink: 0;
}
.sb-foot-inner { text-align: center; }
.sb-foot-brand { text-decoration: none; display: inline-block; margin-bottom: 0.6rem; }
.sb-foot-brand:hover { opacity: 0.82; }
.sb-foot-tag {
  font-size: 0.62rem; letter-spacing: 4px; text-transform: uppercase;
  color: rgba(240, 230, 212, 0.32); margin: 0 0 2rem;
}
.sb-foot-links { display: flex; gap: 1.5rem; justify-content: center; margin-bottom: 2rem; }
.sb-foot-links a { font-size: 0.82rem; color: rgba(184, 137, 44, 0.65); text-decoration: none; transition: color 0.15s; }
.sb-foot-links a:hover { color: var(--gold-3); }
.sb-foot-cta {
  display: inline-block; padding: 0.6rem 1.8rem;
  border: 1px solid rgba(184, 137, 44, 0.28);
  border-radius: var(--rad-pill);
  font-size: 0.8rem; font-weight: 600; letter-spacing: 0.5px;
  color: var(--gold-3); text-decoration: none;
  transition: background 0.18s, border-color 0.18s;
}
.sb-foot-cta:hover { background: rgba(184, 137, 44, 0.08); border-color: var(--gold); }

/* CHIP WRITER PANEL (admin NFC writer)
   ────────────────────────────────────────────────────────────────────── */
.chip-writer {
  border: 1px solid var(--line-gold) !important;
  background: linear-gradient(160deg, var(--cream) 0%, var(--gold-pale) 100%);
}

.chip-writer-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem;
}

.chip-writer-cap {
  display: inline-block; padding: 0.25rem 0.75rem;
  border-radius: var(--rad-pill); font-size: 0.7rem; font-weight: 700;
  letter-spacing: 0.8px; text-transform: uppercase; flex-shrink: 0;
  margin-top: 0.2rem;
}
.chip-writer-cap[data-tone="ok"]   { background: var(--success-bg); color: var(--success-ink); border: 1px solid rgba(37,96,37,0.18); }
.chip-writer-cap[data-tone="err"]  { background: var(--danger-bg); color: var(--danger-ink); border: 1px solid rgba(138,32,32,0.18); }
.chip-writer-cap[data-tone="warn"] { background: var(--warn-bg); color: var(--warn-ink); border: 1px solid rgba(122,88,24,0.18); }

.chip-writer-status {
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
  padding: 1rem 1.2rem;
  border-radius: var(--rad-sm);
  background: var(--paper-2);
  border: 1px solid var(--line-gold);
  margin-bottom: 1rem;
}
.chip-writer-status[data-state="arming"]  { border-color: var(--gold-2); background: var(--gold-pale); }
.chip-writer-status[data-state="success"] { border-color: rgba(37,96,37,0.35); background: var(--success-bg); }
.chip-writer-status[data-state="error"]   { border-color: rgba(138,32,32,0.25); background: var(--danger-bg); }

.chip-writer-status-icon {
  width: 40px; height: 40px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: rgba(184, 137, 44, 0.12); color: var(--gold);
  animation: nfcPulse 1.5s ease-in-out infinite;
}
[data-state="success"] .chip-writer-status-icon { background: rgba(37,96,37,0.14); color: var(--success-ink); animation: none; }
[data-state="error"]   .chip-writer-status-icon { background: rgba(138,32,32,0.12); color: var(--danger-ink); animation: none; }

.chip-writer-status-text { flex: 1; min-width: 0; }
.chip-writer-status-text strong { display: block; font-weight: 600; font-size: 0.93rem; color: var(--ink); margin-bottom: 2px; }

.chip-writer-toolbar {
  display: flex; align-items: center; flex-wrap: wrap; gap: 0.75rem;
  margin-bottom: 0.75rem;
}
.chip-writer-spacer { flex: 1; }

.chip-writer-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0; }

.chip-writer-row {
  display: flex; align-items: center; gap: 0.9rem; flex-wrap: wrap;
  padding: 0.8rem 0.4rem;
  border-bottom: 1px solid var(--line);
  transition: background 0.18s;
}
.chip-writer-row:last-child { border-bottom: 0; }
.chip-writer-row.is-arming { background: var(--gold-pale); }
.chip-writer-row[data-cw-already-encoded] { opacity: 0.72; }

.chip-writer-row-icon {
  width: 32px; height: 32px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  color: var(--gold); opacity: 0.6;
}

.chip-writer-row-main { flex: 1; min-width: 0; }
.chip-writer-row-code { font-weight: 600; font-size: 0.88rem; }
.chip-writer-row-code code { font-size: 0.82rem; }
.chip-writer-row-url { font-size: 0.78rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 320px; }

.chip-writer-row-state { display: flex; align-items: center; }
.chip-writer-row-actions { display: flex; align-items: center; gap: 0.4rem; flex-shrink: 0; }

.chip-writer-pill {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 0.22rem 0.65rem;
  border-radius: var(--rad-pill); font-size: 0.68rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.6px;
}
.chip-writer-pill--done { background: var(--success-bg); color: var(--success-ink); border: 1px solid rgba(37,96,37,0.20); }

.chip-writer-fallback {
  padding: 1.2rem 0 0; border-top: 1px dashed var(--line-med); margin-top: 0.5rem;
}
.chip-writer-fallback h3 { font-family: var(--serif); font-weight: 500; font-size: 1.3rem; margin: 0 0 0.6rem; }

/* ──────────────────────────────────────────────────────────────────────
   25. ADMIN MISC (badge helpers)
   ────────────────────────────────────────────────────────────────────── */
.badge-admin {
  background: var(--grad-gold); color: #1c1208;
  padding: 0.2rem 0.65rem; border-radius: var(--rad-pill);
  font-size: 0.68rem; letter-spacing: 0.8px; text-transform: uppercase; font-weight: 700;
}

.filter-row { display: flex; gap: 0.6rem; flex-wrap: wrap; align-items: center; margin-bottom: 1.2rem; }
.filter-select { width: auto; min-width: 160px; min-height: 40px; font-size: 0.88rem; }
.filter-input  { flex: 1; min-width: 200px; min-height: 40px; font-size: 0.88rem; }

.nfc-enc-done { color: var(--success-ink); font-size: 0.7rem; cursor: help; }
.nfc-enc-pend { color: var(--muted-soft); font-size: 0.7rem; cursor: help; }
