/* ═══ ARCANIST’S GUIDEBOOK — SHELL STYLES ═══
   CSS variables, topbar, global nav, shell layout, mobile drawer.
   All modules require this file.
════════════════════════════════════ */

/* Tokens defined in theme.css */

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background-color: var(--nav-bg-deep);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 17px;
  min-height: 100vh;
  /* background-image comes from --bg-pattern token in theme.css */
}

/* HEADER */
/* ═══ TOP BAR — wiki-style, logo + title top-left ═══════════ */
.topbar {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.6rem 1rem;
  border-bottom: 1px solid var(--border);
  background: var(--deep);
  position: sticky;
  top: 0;
  z-index: 100;
}

.hamburger-btn {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 30px;
  height: 30px;
  background: transparent;
  border: none;
  cursor: pointer;
  flex-shrink: 0;
}
.hamburger-btn span {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--gold);
  border-radius: 1px;
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.topbar-logo {
  height: 40px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 0 6px rgba(201,168,76,0.3));
  flex-shrink: 0;
}

.topbar-titles {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.topbar-title {
  font-family: var(--font-decorative);
  font-size: clamp(1rem, 2.4vw, 1.35rem);
  color: var(--nav-accent-bright);
  letter-spacing: 0.04em;
}

.topbar-sub {
  font-family: var(--font-ui);
  font-size: 0.6rem;
  color: var(--text-muted);
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

/* ═══ SHELL — left global nav + main content ═════════════════ */
.shell {
  display: flex;
  align-items: flex-start;
  min-height: calc(100vh - 64px);
}

.global-nav {
  width: 180px;
  flex-shrink: 0;
  position: sticky;
  top: 64px;
  height: calc(100vh - 64px);
  overflow-y: auto;
  border-right: 1px solid var(--border);
  background: var(--deep);
  display: flex;
  flex-direction: column;
  padding: 0.8rem 0;
}

.global-nav-btn {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  background: transparent;
  border: none;
  border-left: 3px solid transparent;
  color: var(--nav-text-muted);
  font-family: var(--font-ui);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.7rem 1rem;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s;
}

.global-nav-btn .tab-glyph {
  font-size: 1.05rem;
  width: 1.4rem;
  text-align: center;
  flex-shrink: 0;
}

.global-nav-btn:hover {
  color: var(--nav-text);
  background: var(--nav-hover);
}

.global-nav-btn.active {
  color: var(--nav-accent-bright);
  border-left-color: var(--nav-accent);
  background: var(--nav-active);
}

.shell-main {
  flex: 1;
  min-width: 0;
  padding: 1.5rem 1rem;
  background-color: var(--content-bg);
  color: var(--content-text);
  /* Pattern visible on shell-main too */
  background-image: var(--bg-pattern), var(--bg-overlay);
  background-attachment: fixed;
}

.nav-overlay {
  display: none;
}

@media (max-width: 720px) {
  .hamburger-btn { display: flex; }

  .shell {
    display: block;
  }

  .global-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 80vw;
    max-width: 300px;
    height: 100vh;
    z-index: 200;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    box-shadow: 4px 0 16px rgba(0,0,0,0.4);
    padding-top: 4.2rem;
  }

  .global-nav.open {
    transform: translateX(0);
  }

  .nav-overlay.open {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 150;
  }

  .shell-main {
    padding: 1rem 0.7rem;
    width: 100%;
  }
}

/* ═══ GLOBAL NAV — COMPLETE SUB-MENU AND CATEGORY STYLES ══════
   Used by all modules. Copied from rituals.css base definitions.
   This ensures consistent nav appearance on every page.
════════════════════════════════════════════════════════════════ */

/* SIDEBAR — desktop */
.rituals-sidebar {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  position: sticky;
  top: 60px;
  max-height: calc(100vh - 90px);
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: var(--gold-dim) transparent;
  padding-right: 4px;
  padding-bottom: 1rem;
}
.rituals-sidebar::-webkit-scrollbar { width: 4px; }
.rituals-sidebar::-webkit-scrollbar-track { background: transparent; }
.rituals-sidebar::-webkit-scrollbar-thumb { background: var(--gold-dim); border-radius: 2px; }

/* ── MOBILE RITUALS LAYOUT ── */
@media(max-width:780px) {
  .rituals-app {
    grid-template-columns: 1fr;
    padding: 0.75rem 0.5rem;
    gap: 0.75rem;
  }

  /* Sidebar becomes horizontal pill scroller */
  .rituals-sidebar {
    position: static;
    flex-direction: row;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: visible;
    max-height: none;
    gap: 6px;
    padding: 0.5rem 0.25rem;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .rituals-sidebar::-webkit-scrollbar { display: none; }

  /* Each category group becomes a compact horizontal chip group */
  .ritual-category-group {
    flex-shrink: 0;
    border-radius: 8px;
    min-width: 0;
  }

  .ritual-category-label {
    padding: 0.4rem 0.7rem 0.3rem;
    font-size: 0.54rem;
    white-space: nowrap;
  }

  .ritual-list-btn {
    padding: 0.4rem 0.65rem;
    font-size: 0.6rem;
    white-space: nowrap;
    flex-direction: row;
    align-items: center;
    gap: 6px;
    border-bottom: none;
    border-right: 1px solid rgba(201,168,76,0.08);
  }
  .ritual-list-btn:last-child { border-right: none; }

  .ritual-list-btn-subtitle { display: none; }

  /* Content area — full width, readable padding */
  .ritual-content {
    border-radius: 8px;
  }

  .ritual-header {
    padding: 1rem 1rem 0.85rem;
  }

  .ritual-title {
    font-size: 0.95rem;
  }

  .ritual-subtitle {
    font-size: 0.6rem;
  }

  .ritual-description {
    font-size: 0.92rem;
  }

  .ritual-steps {
    padding: 0 1rem 1.25rem;
  }

  .ritual-step {
    gap: 0.6rem;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
  }

  .ritual-step-text {
    font-size: 0.92rem;
    line-height: 1.65;
  }

  .ritual-vibrations,
  .ritual-notes {
    margin: 0 1rem 1.25rem;
  }

  .ritual-images-grid {
  display: grid;
  gap: 1rem;
  margin: 1rem 0;
  width: 100%;
  overflow: hidden;
}
.ritual-image-wrap {
  width: 100%;
  overflow: hidden;
}
.ritual-img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
}
.ritual-img-caption {
  text-align: center;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.4rem;
  font-style: italic;
}
.ritual-image-placeholder {
    margin: 0.75rem 1rem 0.75rem;
  }

  .ritual-nav-row {
    padding: 0.75rem 1rem 1rem;
    gap: 6px;
  }

  .ritual-nav-row .btn {
    font-size: 0.58rem;
    padding: 6px 10px;
  }
}

.ritual-category-group {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: visible;
  flex-shrink: 0;
  width: 100%;
}

.ritual-category-label {
  font-family: var(--font-ui);
  font-size: 0.6rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold-dim);
  padding: 0.6rem 0.9rem 0.45rem;
  border-bottom: 1px solid var(--border);
  border-radius: var(--radius) var(--radius) 0 0;
  background: rgba(0,0,0,0.2);
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  box-sizing: border-box;
}

.ritual-category-glyph { font-size: 0.85rem; opacity: 0.7; }

/* ── Collapsible category toggle ── */
.ritual-category-toggle {
  border: none;
  cursor: pointer;
  text-align: left;
  transition: background 0.2s;
}
.ritual-category-toggle:hover {
  background: rgba(201,168,76,0.08);
}

.ritual-category-chevron {
  margin-left: auto;
  font-size: 0.6rem;
  display: inline-block;
  transition: transform 0.2s ease;
  opacity: 0.6;
}
.ritual-category-chevron.open {
  transform: rotate(90deg);
}

.ritual-category-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.25s ease;
}
.ritual-category-body.open {
  max-height: 1000px;
}

.ritual-list-btn {
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(201,168,76,0.08);
  color: var(--text-muted);
  font-family: var(--font-ui);
  font-size: 0.68rem;
  letter-spacing: 0.05em;
  padding: 0.65rem 0.9rem;
  cursor: pointer;
  text-align: left;
  width: 100%;
  transition: all 0.15s;
  line-height: 1.4;
  display: flex;
  flex-direction: column;
  gap: 3px;
  box-sizing: border-box;
  white-space: normal;
  word-break: break-word;
}
.ritual-list-btn:last-child { border-bottom: none; }
.ritual-list-btn:hover { background: rgba(201,168,76,0.06); color: var(--text); }
.ritual-list-btn.active { background: rgba(201,168,76,0.12); color: var(--nav-accent-bright); }

.ritual-list-btn-subtitle {
  font-size: 0.6rem;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  opacity: 0.7;
  white-space: normal;
  line-height: 1.3;
}
.ritual-list-btn.active .ritual-list-btn-subtitle { opacity: 1; }

/* ═══ GLOBAL NAV — nested collapsible groups (Rituals, Shem) ═══ */
.global-nav-group {
  display: flex;
  flex-direction: column;
}

.global-nav-toggle {
  position: relative;
}

.global-nav-toggle .ritual-category-chevron {
  margin-left: auto;
  font-size: 0.65rem;
}

.global-nav-subbody {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.25s ease;
  background: rgba(0,0,0,0.15);
}
.global-nav-subbody.open {
  max-height: 3000px;
}

/* Nested category groups inside the global nav need tighter spacing
   than their old standalone-sidebar styling */
.global-nav-subbody .ritual-category-group {
  border: none;
  margin: 0;
}
.global-nav-subbody .ritual-category-label {
  font-size: 0.62rem;
  padding: 0.5rem 0.8rem 0.4rem 1.6rem;
  background: transparent;
  border-bottom: none;
  border-radius: 0;
}
.global-nav-subbody .ritual-list-btn {
  padding: 0.45rem 0.9rem 0.45rem 2.2rem;
  font-size: 0.72rem;
  border-bottom: none;
  border-radius: 0;
}
.global-nav-subbody .ritual-sidebar-title {
  display: none;
}

/* ═══ MODULE LAYOUT — for content-heavy modules (Rituals, Shem) ═══
   Two-column layout: persistent article list + content display area.
   On mobile, sidebar collapses above the content.
════════════════════════════════════════════════════════════════ */
.module-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 0;
  min-height: calc(100vh - 64px);
  align-items: start;
}

.module-sidebar {
  border-right: 1px solid var(--border);
  position: sticky;
  top: 64px;
  height: calc(100vh - 64px);
  overflow-y: auto;
  background: var(--deep);
}

.module-sidebar-inner {
  padding: 0.6rem 0;
}

.module-sidebar .global-nav-subbody {
  max-height: none !important;
  overflow: visible !important;
  display: block !important;
}

.module-sidebar .ritual-category-chevron {
  display: none;
}

.module-sidebar .ritual-category-body {
  max-height: none !important;
  overflow: visible !important;
}

.module-content {
  min-width: 0;
  padding: 1.5rem 1rem;
}

@media (max-width: 720px) {
  .module-layout {
    grid-template-columns: 1fr;
  }
  .module-sidebar {
    position: relative;
    top: 0;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--border);
    max-height: 240px;
    overflow-y: auto;
  }
  .module-content {
    padding: 1rem 0.7rem;
  }
}

/* ═══ TRADITION BUTTONS — Western Ceremonial / Kabbalistic ══════
   Mid-tier nav items: heavier than category labels, lighter than
   top-level section buttons. Visually distinct from sub-items.
════════════════════════════════════════════════════════════════ */
.tradition-btn {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  background: rgba(201,168,76,0.06);
  border: none;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  color: var(--nav-accent-bright);
  font-family: var(--font-ui);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 0.7rem 1rem;
  cursor: pointer;
  text-align: left;
  transition: background 0.2s;
  margin: 0.25rem 0;
}

.tradition-btn:hover {
  background: rgba(201,168,76,0.12);
  color: var(--nav-accent-bright);
}

.tradition-btn .ritual-category-chevron {
  margin-left: auto;
  display: inline !important;
}

.tradition-glyph {
  font-size: 0.9rem;
  min-width: 1.2rem;
  text-align: center;
  color: var(--gold);
}


/* ═══ SHARED BUTTON STYLES ══════════════════════════════════════
   Used by Tarot actions, Ritual next/prev nav, and other modules.
════════════════════════════════════════════════════════════════ */
.btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-family: var(--font-ui);
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 8px 16px;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.btn:hover { border-color: var(--border-bright); color: var(--text); }

.btn-gold {
  border-color: var(--gold);
  color: var(--nav-accent-bright);
  background: rgba(201,168,76,0.08);
}
.btn-gold:hover { background: rgba(201,168,76,0.16); }

/* ═══ RITUAL NAV ROW (Next/Prev buttons) ════════════════════════ */
.ritual-nav-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 1rem 1rem;
  gap: 1rem;
  border-top: 1px solid var(--border);
  margin-top: 2rem;
}

.ritual-nav-row .btn {
  min-width: 120px;
}

.ritual-nav-row .btn:disabled {
  opacity: 0.3;
  cursor: default;
  pointer-events: none;
}

/* ═══ CUSTOMIZATION PANEL ══════════════════════════════════════ */
.cust-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 300px;
  height: 100vh;
  overflow-y: auto;
  background: var(--nav-bg);
  border-left: 1px solid var(--nav-border);
  z-index: 300;
  box-shadow: -6px 0 32px rgba(0,0,0,0.6);
  display: flex;
  flex-direction: column;
  animation: custSlideIn 0.2s ease;
}
@keyframes custSlideIn {
  from { transform: translateX(100%); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}

.cust-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 1rem 0.75rem;
  border-bottom: 1px solid var(--nav-border);
  background: var(--nav-bg);
  position: sticky;
  top: 0;
  z-index: 1;
  flex-shrink: 0;
}
.cust-header-title {
  font-family: var(--font-ui);
  font-size: 0.68rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--nav-accent);
}
.cust-close {
  background: transparent;
  border: 1px solid var(--nav-border);
  border-radius: 4px;
  color: var(--nav-text-muted);
  cursor: pointer;
  font-size: 0.72rem;
  padding: 2px 7px;
  transition: all 0.15s;
  line-height: 1.4;
}
.cust-close:hover { color: var(--nav-text); border-color: var(--nav-accent); }

.cust-body { flex: 1; overflow-y: auto; }

/* ── Accordion sections ── */
.cust-section {
  border-bottom: 1px solid var(--nav-border);
}
.cust-section-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  background: transparent;
  border: none;
  padding: 0.72rem 1rem;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s;
  color: var(--nav-text);
}
.cust-section-header:hover { background: var(--nav-hover); }
.cust-section-icon {
  font-size: 0.85rem;
  color: var(--nav-accent);
  min-width: 1.1rem;
  text-align: center;
}
.cust-section-label {
  font-family: var(--font-ui);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--nav-text);
  flex: 1;
}
.cust-chevron {
  font-size: 0.55rem;
  color: var(--nav-text-muted);
  transition: transform 0.2s;
  display: inline-block;
}

.cust-section-body {
  padding: 0.6rem 0.8rem 0.75rem;
  background: rgba(0,0,0,0.1);
}

/* ── Row buttons (themes, fonts, weights) ── */
.cust-group { display: flex; flex-direction: column; gap: 0.28rem; }

.cust-btn {
  background: var(--nav-bg-raised) !important;
  border: 1px solid var(--nav-border) !important;
  border-radius: var(--radius-sm, 6px);
  color: var(--nav-text) !important;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s;
  width: 100%;
}
.cust-btn:hover {
  background: var(--nav-hover) !important;
  border-color: var(--nav-text-muted) !important;
}
.cust-btn.active {
  background: var(--nav-active) !important;
  border-color: var(--nav-accent) !important;
}
.cust-btn-row {
  display: flex;
  align-items: baseline;
  gap: 0.55rem;
  padding: 0.4rem 0.65rem;
}
.cust-btn-label {
  font-family: var(--font-ui);
  font-size: 0.72rem;
  color: var(--nav-text) !important;
  letter-spacing: 0.05em;
  flex-shrink: 0;
}
.cust-btn-desc {
  font-family: var(--font-body);
  font-size: 0.67rem;
  color: var(--nav-text-muted) !important;
  font-style: italic;
}

/* ── Swatch grid (accents, text colours) ── */
.cust-swatches {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.35rem;
}
.cust-swatch-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.28rem;
  background: var(--nav-bg-raised) !important;
  border: 1px solid var(--nav-border) !important;
  border-radius: var(--radius-sm, 6px);
  padding: 0.45rem 0.2rem 0.35rem;
  cursor: pointer;
  transition: all 0.15s;
  color: var(--nav-text) !important;
}
.cust-swatch-btn:hover {
  border-color: var(--nav-text-muted) !important;
  background: var(--nav-hover) !important;
}
.cust-swatch-btn.active {
  border-color: var(--nav-accent) !important;
  background: var(--nav-active) !important;
}
.cust-swatch {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.15);
  display: block;
  flex-shrink: 0;
}
.cust-swatch-btn.active .cust-swatch { border-color: rgba(255,255,255,0.55); }
.cust-swatch-btn .cust-btn-label {
  font-size: 0.55rem;
  color: var(--nav-text-muted) !important;
  text-align: center;
}
.cust-swatch-btn.active .cust-btn-label { color: var(--nav-text) !important; }

/* ── Background grid ── */
.cust-bg-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.32rem;
}
.cust-bg-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--nav-bg-raised) !important;
  border: 1px solid var(--nav-border) !important;
  border-radius: var(--radius-sm, 6px);
  padding: 0.42rem 0.6rem;
  cursor: pointer;
  transition: all 0.15s;
  color: var(--nav-text) !important;
}
.cust-bg-btn:hover {
  background: var(--nav-hover) !important;
  border-color: var(--nav-text-muted) !important;
}
.cust-bg-btn.active {
  background: var(--nav-active) !important;
  border-color: var(--nav-accent) !important;
}
.cust-bg-icon {
  font-size: 0.95rem;
  color: var(--nav-accent);
  min-width: 1.1rem;
  text-align: center;
}
.cust-bg-btn .cust-btn-label { font-size: 0.68rem; }

/* ── Footer reset ── */
.cust-footer {
  padding: 0.8rem 1rem;
  border-top: 1px solid var(--nav-border);
  flex-shrink: 0;
  text-align: center;
}
.cust-reset-btn {
  background: transparent !important;
  border: 1px solid var(--nav-border) !important;
  border-radius: var(--radius-sm, 6px);
  color: var(--nav-text-muted) !important;
  font-family: var(--font-ui);
  font-size: 0.6rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.4rem 1.2rem;
  cursor: pointer;
  transition: all 0.15s;
}
.cust-reset-btn:hover {
  color: var(--nav-text) !important;
  border-color: var(--nav-text-muted) !important;
}

/* Settings toggle button in topbar */
.topbar-settings-btn {
  margin-left: auto;
  background: transparent;
  border: 1px solid var(--nav-border);
  border-radius: var(--radius-sm, 6px);
  color: var(--nav-text-muted);
  font-size: 1rem;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
  flex-shrink: 0;
}
.topbar-settings-btn:hover {
  color: var(--nav-accent);
  border-color: var(--nav-accent);
  background: var(--nav-hover);
}

/* ═══ AUTH UI ════════════════════════════════════════════════ */

/* Topbar auth link */
.topbar-auth-btn {
  margin-left: 0.5rem;
  padding: 0.3rem 0.75rem;
  background: transparent;
  border: 1px solid var(--nav-border);
  border-radius: var(--radius-sm, 6px);
  color: var(--nav-text-muted);
  font-family: var(--font-ui, 'Cinzel', serif);
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
  flex-shrink: 0;
}
.topbar-auth-btn:hover {
  color: var(--nav-accent);
  border-color: var(--nav-accent);
  background: var(--nav-hover);
}

/* ── Account / Auth pages ──────────────────────────────────── */
.auth-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--content-bg);
  padding: 2rem 1rem;
}

.auth-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius, 8px);
  padding: 2.5rem 2rem;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 4px 32px rgba(0,0,0,0.4);
}

.auth-logo {
  text-align: center;
  margin-bottom: 1.5rem;
}
.auth-logo img {
  width: 56px;
  height: 56px;
  object-fit: contain;
}
.auth-title {
  font-family: var(--font-display, 'Cinzel', serif);
  color: var(--gold);
  font-size: 1.25rem;
  text-align: center;
  margin: 0 0 0.25rem;
  letter-spacing: 0.1em;
}
.auth-subtitle {
  color: var(--text-muted);
  font-size: 0.8rem;
  text-align: center;
  margin: 0 0 2rem;
}

.auth-field {
  margin-bottom: 1.1rem;
}
.auth-field label {
  display: block;
  font-family: var(--font-ui, 'Cinzel', serif);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
  text-transform: uppercase;
}
.auth-field input[type="email"],
.auth-field input[type="password"] {
  width: 100%;
  padding: 0.6rem 0.75rem;
  background: var(--panel-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm, 6px);
  color: var(--content-text);
  font-size: 0.9rem;
  box-sizing: border-box;
  transition: border-color 0.15s;
  outline: none;
}
.auth-field input:focus {
  border-color: var(--gold);
}

.auth-checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  margin-bottom: 1.5rem;
}
.auth-checkbox-row input[type="checkbox"] {
  margin-top: 2px;
  accent-color: var(--gold);
  flex-shrink: 0;
}
.auth-checkbox-row label {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.auth-btn {
  width: 100%;
  padding: 0.75rem;
  background: var(--gold);
  color: #0f1225;
  border: none;
  border-radius: var(--radius-sm, 6px);
  font-family: var(--font-ui, 'Cinzel', serif);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: opacity 0.15s;
  text-transform: uppercase;
}
.auth-btn:hover { opacity: 0.85; }
.auth-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.auth-btn-secondary {
  width: 100%;
  padding: 0.65rem;
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm, 6px);
  font-family: var(--font-ui, 'Cinzel', serif);
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: all 0.15s;
  margin-top: 0.75rem;
}
.auth-btn-secondary:hover {
  color: var(--gold);
  border-color: var(--gold);
}

.auth-error {
  background: rgba(180,30,30,0.15);
  border: 1px solid rgba(180,30,30,0.4);
  color: #e07070;
  border-radius: var(--radius-sm, 6px);
  padding: 0.6rem 0.75rem;
  font-size: 0.8rem;
  margin-bottom: 1rem;
  display: none;
}
.auth-success {
  background: rgba(30,120,60,0.15);
  border: 1px solid rgba(30,120,60,0.4);
  color: #70c090;
  border-radius: var(--radius-sm, 6px);
  padding: 0.6rem 0.75rem;
  font-size: 0.8rem;
  margin-bottom: 1rem;
  display: none;
}

.auth-divider {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.75rem;
  margin: 1.25rem 0;
  position: relative;
}
.auth-divider::before {
  content: '';
  position: absolute;
  left: 0; right: 0; top: 50%;
  height: 1px;
  background: var(--border);
}
.auth-divider span {
  background: var(--card-bg);
  padding: 0 0.75rem;
  position: relative;
}

.auth-switch {
  text-align: center;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 1.25rem;
}
.auth-switch a {
  color: var(--gold);
  text-decoration: none;
}
.auth-switch a:hover { text-decoration: underline; }

/* ── Premium Gate ──────────────────────────────────────────── */
.premium-gate {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 4rem 2rem;
  min-height: 60vh;
}
.premium-gate-glyph {
  font-size: 3rem;
  margin-bottom: 1.5rem;
  opacity: 0.6;
}
.premium-gate-title {
  font-family: var(--font-display, 'Cinzel', serif);
  color: var(--gold);
  font-size: 1.5rem;
  letter-spacing: 0.12em;
  margin: 0 0 0.75rem;
}
.premium-gate-text {
  color: var(--text-muted);
  font-size: 0.9rem;
  max-width: 420px;
  line-height: 1.7;
  margin: 0 0 2rem;
}
.premium-gate-btn {
  padding: 0.85rem 2.5rem;
  background: var(--gold);
  color: #0f1225;
  border: none;
  border-radius: var(--radius-sm, 6px);
  font-family: var(--font-ui, 'Cinzel', serif);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-decoration: none;
  cursor: pointer;
  transition: opacity 0.15s;
  text-transform: uppercase;
  display: inline-block;
}
.premium-gate-btn:hover { opacity: 0.85; }
.premium-gate-signin {
  margin-top: 1rem;
  font-size: 0.78rem;
  color: var(--text-muted);
}
.premium-gate-signin a {
  color: var(--gold);
  text-decoration: none;
}
.premium-gate-signin a:hover { text-decoration: underline; }

/* ── Account / Manage page ─────────────────────────────────── */
.account-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius, 8px);
  padding: 1.5rem;
  margin-bottom: 1rem;
}
.account-card-title {
  font-family: var(--font-display, 'Cinzel', serif);
  color: var(--gold);
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin: 0 0 1rem;
}
.account-plan-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.7rem;
  font-family: var(--font-ui, 'Cinzel', serif);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 700;
  margin-bottom: 0.75rem;
}
.account-plan-badge.free {
  background: rgba(255,255,255,0.08);
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.account-plan-badge.premium {
  background: rgba(212,175,55,0.15);
  color: var(--gold);
  border: 1px solid var(--gold);
}
.account-email {
  font-size: 0.85rem;
  color: var(--content-text);
  margin-bottom: 0.25rem;
}
.account-plan-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.upgrade-card {
  background: linear-gradient(135deg, rgba(212,175,55,0.08), rgba(212,175,55,0.03));
  border: 1px solid rgba(212,175,55,0.3);
  border-radius: var(--radius, 8px);
  padding: 1.5rem;
  margin-bottom: 1rem;
  text-align: center;
}
.upgrade-card-title {
  font-family: var(--font-display, 'Cinzel', serif);
  color: var(--gold);
  font-size: 1rem;
  letter-spacing: 0.1em;
  margin: 0 0 0.5rem;
}
.upgrade-card-desc {
  color: var(--text-muted);
  font-size: 0.82rem;
  margin: 0 0 1.25rem;
  line-height: 1.6;
}
.upgrade-feature-list {
  list-style: none;
  padding: 0;
  margin: 0 0 1.5rem;
  text-align: left;
}
.upgrade-feature-list li {
  font-size: 0.82rem;
  color: var(--content-text);
  padding: 0.3rem 0;
  padding-left: 1.5rem;
  position: relative;
}
.upgrade-feature-list li::before {
  content: '✦';
  position: absolute;
  left: 0;
  color: var(--gold);
  font-size: 0.65rem;
  top: 0.4rem;
}

/* ── Locked nav state ────────────────────────────────────────── */
.nav-locked-msg {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  padding: 1.25rem 1rem;
  text-align: center;
}
.nav-locked-glyph {
  font-size: 1.1rem;
  opacity: 0.5;
}
.nav-locked-text {
  font-family: var(--font-ui, 'Cinzel', serif);
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.nav-locked-link {
  font-family: var(--font-ui, 'Cinzel', serif);
  font-size: 0.62rem;
  letter-spacing: 0.06em;
  color: var(--gold);
  text-decoration: none;
  border: 1px solid rgba(212,175,55,0.3);
  border-radius: 12px;
  padding: 0.25rem 0.75rem;
  margin-top: 0.2rem;
  transition: all 0.15s;
}
.nav-locked-link:hover {
  background: rgba(212,175,55,0.1);
  border-color: var(--gold);
}

/* ═══ DEPTH SWITCHER ════════════════════════════════════════════
   Controls the Beginner / Practitioner / Adept content tiers.
   Buttons live in the topbar. State is stored on <body data-depth>.
   The controller (depth-mapping-controller.js) drives all switching.
   ════════════════════════════════════════════════════════════ */

/* ── Topbar depth control group ────────────────────────────── */
.depth-controls {
  display: inline-flex;
  gap: 2px;
  padding: 2px;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--nav-border);
  border-radius: 8px;
  margin-left: 0.4rem;
  flex-shrink: 0;
}
.depth-btn {
  border: none;
  background: transparent;
  color: var(--nav-text-muted);
  font-family: var(--font-ui, 'Cinzel', serif);
  font-size: 0.58rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 5px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.18s;
  white-space: nowrap;
}
.depth-btn:hover {
  color: var(--nav-text);
  background: rgba(255,255,255,0.06);
}
.depth-btn.is-active {
  background: var(--nav-accent, var(--gold));
  color: #0f1225;
  font-weight: 600;
}

/* ── Depth-aware content layers ─────────────────────────────
   Elements with class depth-layer-[tier] are shown/hidden
   based on body[data-depth]. Elements visible at a tier are
   also visible at all deeper tiers (cumulative disclosure).
   ─────────────────────────────────────────────────────────── */

/* All depth layers hidden by default; controller shows correct one */
.depth-layer-beginner,
.depth-layer-practitioner,
.depth-layer-adept { display: none; }

/* Beginner: show beginner only */
body[data-depth="beginner"] .depth-layer-beginner { display: block; }

/* Practitioner: show beginner + practitioner */
body[data-depth="practitioner"] .depth-layer-beginner,
body[data-depth="practitioner"] .depth-layer-practitioner { display: block; }

/* Adept: show all layers */
body[data-depth="adept"] .depth-layer-beginner,
body[data-depth="adept"] .depth-layer-practitioner,
body[data-depth="adept"] .depth-layer-adept { display: block; }

/* Inline variant for flex containers */
body[data-depth="practitioner"] .depth-layer-practitioner.depth-inline,
body[data-depth="adept"] .depth-layer-practitioner.depth-inline,
body[data-depth="adept"] .depth-layer-adept.depth-inline { display: inline-block; }

/* Depth indicator badge — appears on cards/panels showing current tier */
.depth-badge {
  display: inline-block;
  font-family: var(--font-ui, 'Cinzel', serif);
  font-size: 0.52rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 10px;
  margin-bottom: 0.6rem;
  border: 1px solid var(--border);
}
body[data-depth="beginner"]     .depth-badge { color: #7ac87a; border-color: rgba(74,154,90,0.4); background: rgba(74,154,90,0.08); }
body[data-depth="practitioner"] .depth-badge { color: var(--gold); border-color: rgba(201,168,76,0.4); background: rgba(201,168,76,0.08); }
body[data-depth="adept"]        .depth-badge { color: #aa7adb; border-color: rgba(138,90,181,0.4); background: rgba(138,90,181,0.08); }

/* Depth section labels inside cards */
.depth-section-label {
  font-family: var(--font-ui, 'Cinzel', serif);
  font-size: 0.56rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold-dim, #7a6128);
  margin: 0.85rem 0 0.35rem;
  padding-top: 0.6rem;
  border-top: 1px solid var(--border);
}
.depth-section-label:first-child { margin-top: 0; border-top: none; padding-top: 0; }
