/* MyTarotWorld unified local theme */
:root {
  --radius: 0.65rem;
  --background: #fff;
  --foreground: #09090b;
  --card: #fff;
  --card-foreground: #09090b;
  --primary: #7f22fe;
  --primary-hover: #7008e7;
  --primary-foreground: #f5f3ff;
  --secondary: #f4f4f5;
  --muted: #f4f4f5;
  --muted-foreground: #71717b;
  --border: #e4e4e7;
  --ring: #a685ff;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 8px 28px rgba(0, 0, 0, 0.06);
  --shadow-primary: 0 8px 24px rgba(127, 34, 254, 0.22);
  --content-width: 1120px;
  --header-height: 64px;
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { color-scheme: light; }

html.dark {
  color-scheme: dark;
  --background: #110c19;
  --foreground: #f7f2fb;
  --card: #1a1323;
  --card-foreground: #f7f2fb;
  --primary: #9a5cff;
  --primary-hover: #b887ff;
  --primary-foreground: #170d26;
  --secondary: #251c31;
  --muted: #251c31;
  --muted-foreground: #c9bfd4;
  --border: #43364f;
  --ring: #c0a0ff;
  --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 12px 32px rgba(0, 0, 0, 0.32);
  --shadow-primary: 0 8px 24px rgba(154, 92, 255, 0.32);
}

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--foreground);
  background: var(--background);
  line-height: 1.6;
  overflow-x: clip;
}

a { color: inherit; }

.starcoreastro-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-height);
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
}

html.dark .starcoreastro-header { background: rgba(17, 12, 25, 0.92); }
html.dark .starcoreastro-brand,
html.dark .starcoreastro-cloned-brand { color: #f7e6bd !important; }
html.dark .starcoreastro-header button { color: var(--muted-foreground); }

.starcoreastro-header-inner {
  max-width: var(--content-width);
  margin: 0 auto;
  height: 100%;
  padding: 0 max(16px, calc((100% - var(--content-width)) / 2));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.starcoreastro-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: "Cinzel", Georgia, "Times New Roman", serif;
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
  padding: 8px 0;
  border-radius: 0;
  color: #29263a;
  background: transparent;
  text-decoration: none;
  white-space: nowrap;
}

.starcoreastro-brand > span { background: none; -webkit-text-fill-color: currentColor; }

.starcore-brand-mark {
  display: block;
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  fill: #b48c39;
}

.starcoreastro-cloned-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: "Cinzel", Georgia, "Times New Roman", serif;
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
  padding: 8px 0;
  border-radius: 0;
  color: #29263a !important;
  background: transparent;
  text-decoration: none;
  white-space: nowrap;
}

.starcoreastro-cloned-brand > span { background: none; -webkit-text-fill-color: currentColor; }
.starcoreastro-cloned-brand .starcore-brand-mark { fill: #b48c39; }

footer .starcoreastro-cloned-brand,
footer .starcoreastro-brand { color: #f7e6bd !important; }
footer .starcoreastro-cloned-brand .starcore-brand-mark,
footer .starcoreastro-brand .starcore-brand-mark { fill: #b48c39; }

.starcoreastro-nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 2px;
  justify-content: flex-end;
}

.starcoreastro-nav a {
  padding: 8px 12px;
  border-radius: calc(var(--radius) - 2px);
  font-size: 14px;
  font-weight: 500;
  color: var(--muted-foreground);
  text-decoration: none;
  transition: color 0.15s, background 0.15s;
}

.starcoreastro-nav a:hover {
  color: var(--foreground);
  background: var(--secondary);
}

.starcoreastro-nav a.is-active {
  color: var(--primary);
  background: var(--primary-foreground);
}

.starcoreastro-nav-divider {
  width: 1px;
  height: 20px;
  background: var(--border);
  margin: 0 4px;
}

/* The direct navigation is injected only for phones; desktop keeps the
   captured header untouched. */
.local-mobile-direct-navigation { display: none !important; }

@media (max-width: 768px) {
  .starcoreastro-nav a { padding: 6px 8px; font-size: 13px; }
  .starcoreastro-nav-divider { display: none; }
}

/* Captured production pages use a utility-class header rather than the local
   StarCore classes. On phones, present the core destinations as a direct 4 × 2
   grid: no horizontal scrolling, text wrapping, or hidden primary actions. */
@media (max-width: 767px) {
  header.sticky.top-0 {
    height: auto !important;
    min-height: var(--header-height);
  }
  header.sticky.top-0 > div {
    height: auto !important;
    min-height: var(--header-height);
    flex-wrap: wrap;
    gap: 6px !important;
    padding-inline: max(14px, env(safe-area-inset-left)) max(14px, env(safe-area-inset-right)) !important;
  }
  header.sticky.top-0 > div > nav:not(.local-mobile-direct-navigation) { display: none !important; }
  header.sticky.top-0 > div > .local-mobile-direct-navigation {
    position: relative;
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    order: 3;
    width: 100%;
    flex: 0 0 100%;
    min-width: 0;
    gap: 6px !important;
    margin: 0 !important;
    padding: 0 0 10px;
    overflow: visible;
  }
  header.sticky.top-0 > div > .local-mobile-direct-navigation > :is(a, button) {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    min-width: 0 !important;
    min-height: 44px !important;
    height: 44px !important;
    width: 100%;
    margin: 0 !important;
    padding: 0 4px !important;
    border-radius: 9px;
    color: var(--foreground);
    background: transparent;
    font-size: 13px;
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
    white-space: nowrap;
    touch-action: manipulation;
  }
  header.sticky.top-0 > div > .local-mobile-direct-navigation > :is(a, button):active { background: var(--secondary); }
  .local-mobile-nav-menu {
    position: absolute;
    z-index: 2147483000;
    top: calc(50% + 24px);
    right: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
    width: min(320px, calc(100vw - 28px));
    max-height: min(60dvh, 420px);
    overflow-y: auto;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--card);
    box-shadow: 0 16px 36px rgba(0, 0, 0, .16);
  }
  .local-mobile-nav-menu[hidden] { display: none !important; }
  .local-mobile-nav-menu a {
    min-height: 40px;
    display: flex;
    align-items: center;
    padding: 8px;
    border-radius: 8px;
    color: var(--foreground);
    font-size: 13px;
    line-height: 1.35;
    text-decoration: none;
  }
  .local-mobile-nav-menu a:active { background: var(--secondary); }
  .local-mobile-nav-menu[data-mobile-nav-menu="fortune"] { top: 50px; right: 0; }
  .local-mobile-nav-menu[data-mobile-nav-menu="more"] { top: 100px; right: 0; }
  header.sticky.top-0 > div > .local-mobile-direct-navigation button[aria-expanded="true"] {
    color: var(--primary);
    background: var(--secondary);
  }

  :is(.starcoreastro-main, .starcore-main, .archive-mount, body > main) {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    min-width: 0;
    padding-inline: max(14px, env(safe-area-inset-left)) max(14px, env(safe-area-inset-right));
    padding-bottom: calc(40px + env(safe-area-inset-bottom));
  }
  :is(.starcoreastro-main, .starcore-main, .archive-mount, body > main) > * {
    min-width: 0;
    max-width: 100%;
  }
  :is(.starcoreastro-main, .starcore-main, .archive-mount, body > main) [class*="min-w-"] { min-width: 0 !important; }
  :is(.starcoreastro-main, .starcore-main, .archive-mount, body > main) [class~="w-screen"] { width: 100% !important; }
  :is(.starcoreastro-main, .starcore-main, .archive-mount, body > main) .inline-block.max-w-lg { display: block; width: 100%; max-width: 100%; }
  :is(.starcoreastro-main, .starcore-main, .archive-mount, body > main) .inline-block.max-w-lg :is(h1, h2, h3, p) { white-space: normal !important; }
  :is(.starcoreastro-main, .starcore-main, .archive-mount, body > main) :where(img, video, canvas, svg) { max-width: 100%; }
  :is(.starcoreastro-main, .starcore-main, .archive-mount, body > main) :where(p, li, dd, blockquote, figcaption, code) { overflow-wrap: anywhere; word-break: break-word; }
  :is(.starcoreastro-main, .starcore-main, .archive-mount, body > main) :where(h1, h2, h3) { max-width: 100%; overflow-wrap: anywhere; }
  :is(.starcoreastro-main, .starcore-main, .archive-mount, body > main) :where(input:not([type="checkbox"]):not([type="radio"]), select, textarea) {
    min-height: 44px;
    font-size: 16px;
  }
  :is(.starcoreastro-main, .starcore-main, .archive-mount, body > main) button:not(.spread-slot):not(.rt-card-tap) {
    min-width: 44px;
    min-height: 44px;
    touch-action: manipulation;
  }
  body button:not(.spread-slot):not(.rt-card-tap) {
    min-width: 44px !important;
    min-height: 44px !important;
    touch-action: manipulation;
  }
  :is(.starcoreastro-main, .starcore-main, .archive-mount, body > main) :is(table, pre) {
    display: block;
    max-width: 100%;
    overflow-x: auto;
  }
  :is(.starcoreastro-main, .starcore-main, .archive-mount, body > main) [class~="grid-cols-3"],
  :is(.starcoreastro-main, .starcore-main, .archive-mount, body > main) [class~="grid-cols-4"],
  :is(.starcoreastro-main, .starcore-main, .archive-mount, body > main) [class~="grid-cols-5"],
  :is(.starcoreastro-main, .starcore-main, .archive-mount, body > main) [class~="grid-cols-6"] {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
  :is(.starcoreastro-panel, .starcore-panel) { padding: 20px 16px; border-radius: 14px; }
  .shop-collection, .shop-detail[data-shop-product], .starcore-manifestation-grid { grid-template-columns: 1fr !important; }
  /* The desktop reader sidebar is mirrored into this phone-only host. Keep the
     picker and the question composer as two explicit vertical groups: archive
     grid utilities otherwise place a composer child between reader cards. */
  .local-mobile-reader-list { display: block !important; width: 100%; min-width: 0; }
  .local-mobile-reader-grid { display: grid !important; grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 10px; width: 100%; }
  .local-mobile-reader-grid > .local-mobile-reader { display: flex !important; align-items: center; min-width: 0; min-height: 76px !important; padding: 10px !important; }
  .local-mobile-reader-grid > .local-mobile-reader :is(img, svg) { flex: 0 0 auto; }
  .local-mobile-reader-composer { display: grid !important; grid-column: 1 / -1; gap: 12px; width: 100%; margin-top: 18px; }
  .local-mobile-reader-context { padding: 14px; border: 1px solid var(--border); border-radius: 14px; background: var(--card); }
  .local-mobile-reader-context :is(span, strong, p) { margin: 0; }
  .local-mobile-reader-context span { display: block; margin-bottom: 3px; color: var(--muted-foreground); font-size: 13px; }
  .local-mobile-reader-context strong { color: var(--primary); font-size: 16px; }
  .local-mobile-reader-context p { margin-top: 5px; line-height: 1.55; }
  .local-mobile-reader-question { display: grid; gap: 7px; color: var(--foreground); font-weight: 600; }
  .local-mobile-reader-question > span { font-size: 14px; }
  .local-mobile-reader-composer textarea { width: 100%; min-height: 112px; padding: 12px; border: 1px solid var(--border); border-radius: 12px; resize: vertical; font-weight: 400; }
  .local-mobile-reader-composer button { width: 100%; min-height: 44px; padding: 10px 14px; border-radius: 12px; }
  .local-mobile-reader-composer [data-local-mobile-reader-suggestion] { border: 1px solid var(--border); color: var(--muted-foreground); background: var(--card); text-align: left; }
  .local-mobile-reader-composer [data-local-mobile-reader-send] { border: 0; color: var(--primary-foreground); background: var(--primary); font-weight: 700; }
  #celtic-board { grid-template-columns: repeat(5, minmax(0, 1fr)) !important; gap: 5px !important; margin-inline: -4px; }
  .celtic-slot-label { font-size: 9px !important; }
}

@media (max-width: 767px) and (max-height: 540px) {
  header.sticky.top-0 > div > .local-mobile-direct-navigation { max-height: none; padding-bottom: 10px; }
  :is(.starcoreastro-main, .starcore-main, .archive-mount, body > main) { padding-top: 16px; }
}

/* ── Layout ── */
.starcoreastro-main {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 24px 16px 64px;
  min-width: 0;
}

/* ── Tarot manifestation ── */
.starcore-manifestation {
  width: min(100% - 32px, 980px);
  margin: 0 auto;
  padding: clamp(56px, 10vw, 104px) 0 88px;
}
.starcore-manifestation-heading { max-width: 650px; margin: 0 auto 40px; text-align: center; }
.starcore-manifestation-eyebrow { margin: 0 0 8px; color: #b48c39; font: 700 13px/1 "Cinzel", Georgia, serif; letter-spacing: .11em; text-transform: uppercase; }
.starcore-manifestation-heading h1 { margin: 0; color: var(--foreground); font-size: clamp(32px, 5vw, 52px); line-height: 1.12; }
.starcore-manifestation-heading > p:last-child { margin: 16px 0 0; color: var(--muted-foreground); font-size: 17px; }
.starcore-manifestation-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(280px, .9fr); gap: 20px; align-items: stretch; }
.starcore-manifestation-card { padding: 28px; border: 1px solid var(--border); border-radius: 20px; color: var(--card-foreground); background: var(--card); box-shadow: var(--shadow-sm); }
.starcore-manifestation-card label, .starcore-manifestation-progress > p { display: block; margin: 0 0 12px; color: var(--muted-foreground); font-size: 14px; font-weight: 650; }
.starcore-manifestation-card textarea { display: block; width: 100%; min-height: 128px; resize: vertical; padding: 14px 15px; border: 1px solid var(--border); border-radius: 12px; color: var(--foreground); background: var(--background); font: inherit; line-height: 1.6; outline: none; }
.starcore-manifestation-card textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 20%, transparent); }
.starcore-manifestation-actions { display: flex; align-items: center; gap: 12px; margin-top: 16px; }
.starcore-manifestation-save, .starcore-manifestation-checkin { border: 0; border-radius: 10px; padding: 11px 16px; color: #fff; background: var(--primary); box-shadow: var(--shadow-primary); font: inherit; font-weight: 650; cursor: pointer; }
.starcore-manifestation-save:hover, .starcore-manifestation-checkin:hover { background: var(--primary-hover); }
.starcore-manifestation-status { color: var(--muted-foreground); font-size: 13px; }
.starcore-manifestation-progress { display: flex; flex-direction: column; }
.starcore-manifestation-progress strong { margin-bottom: 18px; color: var(--foreground); font-size: 30px; line-height: 1.1; }
.starcore-manifestation-meter { height: 8px; overflow: hidden; margin-bottom: 28px; border-radius: 999px; background: var(--secondary); }
.starcore-manifestation-meter span { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #7f22fe, #b48c39); transition: width .25s ease; }
.starcore-manifestation-checkin { width: 100%; }
.starcore-manifestation-checkin.is-complete, .starcore-manifestation-checkin:disabled { color: var(--foreground); background: var(--secondary); box-shadow: none; cursor: default; }
.starcore-manifestation-card-link { display: flex; justify-content: space-between; margin-top: auto; padding-top: 24px; color: var(--primary); font-weight: 650; text-decoration: none; }
.starcore-manifestation-card-link:hover { text-decoration: underline; }
html.dark .starcore-manifestation-card textarea { background: #110c19; }
@media (max-width: 720px) { .starcore-manifestation { width: min(100% - 24px, 980px); padding-top: 48px; } .starcore-manifestation-grid { grid-template-columns: 1fr; } .starcore-manifestation-card { padding: 22px; } }

.starcoreastro-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 0 0 20px;
  font-size: 13px;
  color: var(--muted-foreground);
}

.starcoreastro-breadcrumb a {
  color: var(--muted-foreground);
  text-decoration: none;
}

.starcoreastro-breadcrumb a:hover { color: var(--primary); }

.starcoreastro-breadcrumb-sep { opacity: 0.45; }

.starcoreastro-page-head {
  text-align: center;
  margin-bottom: 28px;
}

.starcoreastro-page-head h1 {
  margin: 0 0 10px;
  font-size: clamp(26px, 4vw, 36px);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--foreground);
}

.starcoreastro-page-head .muted,
.muted {
  color: var(--muted-foreground);
  line-height: 1.75;
  margin: 0;
}

.starcoreastro-panel {
  max-width: 760px;
  margin: 0 auto;
  padding: 28px 24px;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 6px);
  background: var(--card);
  box-shadow: var(--shadow-md);
}

.starcoreastro-panel-wide { max-width: 960px; }

/* ── Forms & buttons ── */
.spread-form,
#elara-form,
#reader-chat-form,
#demo-auth-form {
  display: grid;
  gap: 12px;
}

.demo-auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0;
  color: var(--muted-foreground);
  font-size: 13px;
}

.demo-auth-divider::before,
.demo-auth-divider::after {
  content: "";
  height: 1px;
  flex: 1;
  background: var(--border);
}

.demo-google-login {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 46px;
  padding: 10px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  color: var(--foreground);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition: border-color .15s, box-shadow .15s, transform .15s;
}

.demo-google-login:hover {
  border-color: #b8b8c1;
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.demo-google-login svg { width: 20px; height: 20px; flex: 0 0 auto; }

.demo-auth-notice {
  margin: 16px 0 0;
  padding: 10px 12px;
  border: 1px solid #f5b8c2;
  border-radius: var(--radius);
  background: #fff5f6;
  color: #a32035;
  font-size: 14px;
  line-height: 1.55;
}

/* StarCore account access */
.starcore-auth {
  width: min(100%, 448px);
  margin: clamp(24px, 7vh, 72px) auto;
}

.starcore-auth-card {
  padding: clamp(20px, 5vw, 32px);
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--card);
  box-shadow: 0 20px 55px rgba(32, 22, 65, .08);
}

.starcore-auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  border-radius: 12px;
  background: #f3f1f6;
}

.starcore-auth-tabs button {
  min-height: 42px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #625e70;
  font: inherit;
  font-weight: 650;
  cursor: pointer;
  transition: background .18s ease, color .18s ease, box-shadow .18s ease;
}

.starcore-auth-tabs button.is-active {
  background: #fff;
  color: #17121f;
  box-shadow: 0 1px 3px rgba(20, 13, 35, .14);
}

.starcore-auth-tabs button:focus-visible,
.starcore-auth-card input:focus-visible,
.starcore-auth-card a:focus-visible,
.starcore-auth-card button:focus-visible {
  outline: 3px solid rgba(127, 34, 254, .26);
  outline-offset: 2px;
}

.starcore-auth-heading { margin: 28px 0 20px; }
.starcore-auth-kicker { margin: 0 0 6px; color: var(--primary); font-size: 11px; font-weight: 750; letter-spacing: .14em; }
.starcore-auth-heading h1 { margin: 0; color: #16111d; font-size: 28px; line-height: 1.2; letter-spacing: -.03em; }
.starcore-auth-heading p { margin: 8px 0 0; color: #706b79; font-size: 14px; line-height: 1.6; }

.starcore-auth .starcore-google-login { min-height: 46px; border-radius: 10px; font-weight: 600; }
.starcore-auth .demo-auth-divider { margin: 20px 0 16px; font-size: 11px; letter-spacing: .08em; }

.starcore-auth #demo-auth-form { gap: 8px; }
.starcore-auth #demo-auth-form > label:not(.starcore-auth-remember),
.starcore-auth-password-label label,
.starcore-auth-confirm label {
  color: #292432;
  font-size: 14px;
  font-weight: 650;
}

.starcore-auth #demo-auth-form input:not([type="checkbox"]) {
  min-height: 46px;
  border-radius: 10px;
  color: #201a29;
}

.starcore-auth-password-label { display: flex; align-items: baseline; justify-content: space-between; margin-top: 10px; }
.starcore-auth-password-label a { color: var(--primary); font-size: 13px; font-weight: 600; text-decoration: none; }
.starcore-auth-password-label a:hover, .starcore-auth-switch button:hover { text-decoration: underline; }

.starcore-password-field { position: relative; }
.starcore-password-field input { padding-right: 50px !important; }
.starcore-password-toggle {
  position: absolute;
  top: 1px;
  right: 1px;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #7b7583;
  cursor: pointer;
}
.starcore-password-toggle:hover { color: var(--primary); background: rgba(127, 34, 254, .07); }
.starcore-password-toggle svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; }

.starcore-auth-confirm { display: grid; gap: 8px; margin-top: 10px; }
.starcore-auth-remember { display: inline-flex; align-items: center; gap: 10px; min-height: 36px; margin: 4px 0 8px; color: #37313f; font-size: 14px; cursor: pointer; }
.starcore-auth-remember input { width: 17px; height: 17px; accent-color: var(--primary); }
.starcore-auth-submit { width: 100%; min-height: 46px; border-radius: 10px; }
.starcore-auth-submit[aria-busy="true"] { opacity: .7; cursor: wait; }
.starcore-auth-status { min-height: 20px; margin: 14px 0 0; color: #a32035; font-size: 13px; line-height: 1.5; }
.starcore-auth-status.is-success { color: #177245; }
.starcore-auth-switch { margin: 16px 0 0; color: #716b78; text-align: center; font-size: 14px; }
.starcore-auth-switch button { border: 0; padding: 0; color: var(--primary); background: transparent; font: inherit; font-weight: 650; cursor: pointer; }
.starcore-auth + .demo-auth-notice { width: min(100%, 448px); margin: -52px auto 40px; }

html.dark .starcore-auth-card { background: #16121f; border-color: #302a3b; box-shadow: 0 20px 55px rgba(0, 0, 0, .28); }
html.dark .starcore-auth-tabs { background: #24202c; }
html.dark .starcore-auth-tabs button { color: #c9c3d0; }
html.dark .starcore-auth-tabs button.is-active { background: #312a3d; color: #fff; box-shadow: none; }
html.dark .starcore-auth-heading h1, html.dark .starcore-auth #demo-auth-form > label:not(.starcore-auth-remember), html.dark .starcore-auth-password-label label, html.dark .starcore-auth-confirm label, html.dark .starcore-auth-remember { color: #f5eff9; }
html.dark .starcore-auth-heading p, html.dark .starcore-auth-switch { color: #bbb4c5; }
html.dark .starcore-auth #demo-auth-form input:not([type="checkbox"]) { color: #f7f1fb; background: #211b29; border-color: #42384e; }
html.dark .starcore-auth .demo-google-login { background: #211b29; border-color: #42384e; color: #f7f1fb; }

@media (max-width: 520px) {
  .starcore-auth { width: 100%; margin: 20px auto 32px; }
  .starcore-auth-card { padding: 20px 16px; border-radius: 14px; box-shadow: none; }
  .starcore-auth-heading { margin-top: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  .starcore-auth * { transition-duration: .01ms !important; }
}

.spread-form textarea,
#spread-question,
#elara-input,
#reader-chat-input,
#demo-auth-form input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font: inherit;
  color: var(--foreground);
  background: var(--background);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.spread-form textarea:focus,
#spread-question:focus,
#elara-input:focus,
#reader-chat-input:focus,
#demo-auth-form input:focus {
  outline: none;
  border-color: var(--ring);
  box-shadow: 0 0 0 3px rgba(166, 133, 255, 0.25);
}

.spread-btn,
.button,
.primary,
.local-oracle-primary,
button.spread-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  border: 0;
  border-radius: 999px;
  background: var(--primary);
  color: var(--primary-foreground);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  box-shadow: var(--shadow-primary);
  transition: background 0.15s, transform 0.15s, box-shadow 0.15s;
}

.spread-btn:hover,
.button:hover,
.primary:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

.spread-btn:disabled,
.spread-btn[disabled] {
  opacity: 0.45;
  cursor: default;
  transform: none;
  box-shadow: none;
}

.spread-btn-secondary {
  background: var(--secondary);
  color: var(--foreground);
  box-shadow: var(--shadow-sm);
}

/* ── Random tarot hero (randomtarot.org style) ── */
.rt-hero {
  position: relative;
  overflow: hidden;
  margin: 0 calc(-1 * max(16px, calc((100% - var(--content-width)) / 2))) 40px;
  padding: 40px 16px 52px;
  background:
    radial-gradient(ellipse 80% 60% at 50% 40%, rgba(88, 28, 135, 0.35), transparent 70%),
    radial-gradient(ellipse 120% 80% at 50% 100%, rgba(30, 10, 60, 0.8), transparent 60%),
    linear-gradient(180deg, #07050f 0%, #0b0818 45%, #050508 100%);
  text-align: center;
}

.rt-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(1px 1px at 10% 20%, rgba(255, 255, 255, 0.55), transparent),
    radial-gradient(1px 1px at 30% 65%, rgba(255, 255, 255, 0.35), transparent),
    radial-gradient(1.5px 1.5px at 55% 15%, rgba(255, 215, 120, 0.45), transparent),
    radial-gradient(1px 1px at 72% 42%, rgba(255, 255, 255, 0.4), transparent),
    radial-gradient(1px 1px at 88% 78%, rgba(255, 255, 255, 0.3), transparent),
    radial-gradient(1px 1px at 45% 88%, rgba(255, 255, 255, 0.25), transparent);
  opacity: 0.75;
  pointer-events: none;
}

.rt-hero-head {
  position: relative;
  z-index: 1;
  margin-bottom: 28px;
}

.rt-hero-head h1 {
  margin: 0 0 10px;
  font-size: clamp(26px, 4vw, 36px);
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #f5e6c8;
  text-shadow: 0 0 24px rgba(167, 139, 250, 0.35);
}

.rt-hero-lead {
  margin: 0 auto;
  max-width: 520px;
  color: rgba(245, 230, 200, 0.72);
  line-height: 1.75;
  font-size: 15px;
}

#rt-stage {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  margin: 8px 0 24px;
}

.rt-card-tap {
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
  width: min(280px, 72vw);
  max-width: 280px;
  transition: transform 0.25s ease, filter 0.25s ease;
  filter:
    drop-shadow(0 0 22px rgba(124, 58, 237, 0.55))
    drop-shadow(0 0 48px rgba(139, 92, 246, 0.28));
}

.rt-card-tap:hover {
  transform: translateY(-4px) scale(1.02);
  filter:
    drop-shadow(0 0 28px rgba(124, 58, 237, 0.7))
    drop-shadow(0 0 56px rgba(167, 139, 250, 0.35));
}

.rt-card-back {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 350 / 600;
  border-radius: 14px;
  object-fit: cover;
}

#rt-stage .spread-slot {
  max-width: min(280px, 72vw);
}

.rt-hero .rt-card-slot {
  width: min(280px, 72vw);
  max-width: 280px;
  pointer-events: auto;
  filter:
    drop-shadow(0 0 22px rgba(124, 58, 237, 0.55))
    drop-shadow(0 0 48px rgba(139, 92, 246, 0.28));
}

.rt-reveal-btn {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 8px;
  padding: 14px 32px;
  border: 1px solid rgba(251, 191, 36, 0.35);
  border-radius: 999px;
  background: linear-gradient(135deg, #5b21b6 0%, #7c3aed 48%, #6d28d9 100%);
  color: #fde68a;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
  box-shadow:
    0 0 24px rgba(124, 58, 237, 0.45),
    0 8px 24px rgba(0, 0, 0, 0.35);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.rt-reveal-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow:
    0 0 32px rgba(124, 58, 237, 0.6),
    0 12px 28px rgba(0, 0, 0, 0.4);
}

.rt-reveal-btn:disabled {
  opacity: 0.55;
  cursor: default;
}

.rt-hero #rt-result,
.rt-hero #rt-ai {
  position: relative;
  z-index: 1;
  max-width: 640px;
  margin: 20px auto 0;
  padding: 20px;
  border: 1px solid rgba(167, 139, 250, 0.25);
  border-radius: 16px;
  background: rgba(15, 10, 30, 0.72);
  color: rgba(245, 230, 200, 0.9);
  line-height: 1.75;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
}

.rt-hero #rt-result h2 {
  color: #fde68a;
}

.rt-hero #rt-result .spread-pos,
.rt-hero #rt-result a {
  color: #c4b5fd;
}

.rt-hero #rt-result a:hover {
  color: #fde68a;
}

.rt-hero .card-detail-img {
  box-shadow: 0 0 24px rgba(124, 58, 237, 0.35);
}

/* ── Spread board & cards ── */

#rt-stage .spread-slot {
  max-width: 220px;
  border: 0;
  background: transparent;
  padding: 0;
}

.spread-board {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: center;
  margin: 24px 0;
}

.spread-slot {
  position: relative;
  border: 0;
  background: transparent;
  padding: 0;
  width: 120px;
  max-width: 34vw;
  transition: transform 0.2s ease, filter 0.2s ease, opacity 0.2s;
  pointer-events: none;
  opacity: 0.45;
  perspective: 900px;
}

.spread-slot-active,
.spread-slot.spread-active {
  pointer-events: auto;
  cursor: pointer;
  opacity: 1;
  transform: translateY(-4px);
  filter: drop-shadow(0 8px 16px rgba(127, 34, 254, 0.28));
}

.spread-slot.spread-revealed {
  opacity: 1;
  pointer-events: auto;
  cursor: pointer;
}

.spread-slot.spread-revealed:hover,
.spread-slot.spread-revealed:focus-visible,
.spread-slot.spread-selected {
  transform: translateY(-4px);
  filter: drop-shadow(0 8px 16px rgba(127, 34, 254, 0.28));
  outline: 3px solid rgba(127, 34, 254, 0.55);
  outline-offset: 4px;
}

.spread-flip-inner {
  position: relative;
  width: 100%;
  aspect-ratio: 350 / 600;
  transform-style: preserve-3d;
  transition: transform 0.65s cubic-bezier(0.4, 0.2, 0.2, 1);
}

.spread-revealed .spread-flip-inner {
  transform: rotateY(180deg);
}

.spread-num {
  position: absolute;
  top: -8px;
  left: -8px;
  z-index: 3;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: grid;
  place-items: center;
}

.spread-card-back,
.spread-card-face {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: 10px;
  border: 2px solid var(--border);
  background: #fff;
  box-shadow: var(--shadow-md);
  object-fit: cover;
  backface-visibility: hidden;
}

.spread-card-face {
  transform: rotateY(180deg);
}

.spread-card-face.reversed {
  transform: rotateY(180deg) rotateZ(180deg);
}

.spread-label {
  display: block;
  margin-top: 6px;
  font-size: 11px;
  color: var(--muted-foreground);
  line-height: 1.3;
  text-align: center;
}

#spread-detail,
#rt-result,
#spread-ai,
#rt-ai,
#quiz-app,
#elara-chat,
.local-draw-results,
.local-draw-summary {
  max-width: 680px;
  width: min(680px, 100%);
  margin: 20px auto 0;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 4px);
  background: var(--card);
  line-height: 1.75;
  box-shadow: var(--shadow-sm);
  overflow-wrap: anywhere;
  word-break: break-word;
  box-sizing: border-box;
}

#spread-ai,
#rt-ai {
  white-space: pre-wrap;
  min-height: 80px;
}

/* Cap long AI replies/readings: scroll inside a fixed box instead of growing forever */
.bubble-tail,
#reader-chat-bubble,
#elara-bubble,
.demo-summary,
.local-draw-summary-text,
.local-draw-summary pre,
#spread-ai,
#rt-ai,
#celtic-ai-output {
  max-height: min(42vh, 22rem);
  overflow-y: auto;
  overscroll-behavior: contain;
}

#spread-detail h3,
#rt-result h2 {
  margin: 0 0 8px;
  color: var(--primary);
}

/* ── Gallery & quiz ── */
.cards-group { margin: 28px 0; }

.cards-group h2 {
  font-size: 22px;
  color: var(--foreground);
  margin: 0 0 12px;
}

.cards-group h2 span {
  font-size: 14px;
  color: var(--muted-foreground);
  font-weight: 400;
  margin-left: 8px;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 12px;
}

.cards-item {
  display: block;
  text-decoration: none;
  color: inherit;
  text-align: center;
}

.cards-item img {
  width: 100%;
  aspect-ratio: 350 / 600;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #fff;
  transition: transform 0.15s, box-shadow 0.15s;
}

.cards-item:hover img {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.cards-item span {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted-foreground);
}

.quiz-options {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.quiz-options button {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--secondary);
  cursor: pointer;
  font-size: 15px;
  transition: border-color 0.15s, background 0.15s;
}

.quiz-options button:hover {
  border-color: var(--ring);
  background: var(--primary-foreground);
}

.quiz-progress {
  color: var(--primary);
  font-size: 14px;
}

.card-detail-img {
  display: block;
  max-width: 260px;
  margin: 0 auto 16px;
  border-radius: 12px;
  box-shadow: var(--shadow-md);
}

/* ── Hub cards (feature grid) ── */
.spread-hub {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin: 28px 0;
}

.spread-card-link {
  display: block;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 4px);
  background: var(--card);
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}

.spread-card-link:hover {
  transform: translateY(-2px);
  border-color: rgba(127, 34, 254, 0.25);
  box-shadow: 0 12px 28px rgba(127, 34, 254, 0.1);
}

.spread-card-link h2 {
  margin: 0 0 8px;
  font-size: 18px;
  color: var(--primary);
}

.spread-card-link p {
  margin: 0;
  color: var(--muted-foreground);
  font-size: 14px;
  line-height: 1.6;
}

.spread-hub-card {
  display: block;
  width: 88px;
  margin: 0 auto 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.starcoreastro-section {
  margin: 48px auto 0;
  max-width: var(--content-width);
}

.starcoreastro-section-title {
  text-align: center;
  margin: 0 0 24px;
  font-size: clamp(22px, 3vw, 28px);
  font-weight: 700;
  color: var(--foreground);
}

#rt-result:empty,
#rt-ai:empty {
  display: none;
  margin: 0;
  padding: 0;
  border: 0;
  box-shadow: none;
}

/* ── Injected buttons on cloned static pages ── */
button.spread-btn,
#love-spread-start {
  display: block;
  margin: 24px auto;
}

/* ── Demo / utility pages ── */
.demo-cards { display: grid; gap: 16px; margin: 20px 0; }

.demo-card {
  display: block;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--secondary);
  color: inherit;
  text-decoration: none;
  transition: border-color .2s ease, transform .2s ease;
}

.demo-card:hover,
.demo-card:focus-visible { border-color: var(--primary); transform: translateY(-2px); outline: none; }

.demo-pos { color: var(--primary); font-size: 13px; margin: 0 0 8px; }

.demo-summary {
  white-space: pre-wrap;
  background: var(--secondary);
  padding: 16px;
  border-radius: var(--radius);
  line-height: 1.7;
}

#spread-next-btn,
#rt-flip-btn,
#celtic-next-btn {
  display: block;
  margin: 0 auto 16px;
}

.celtic-link-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 22px;
  border-radius: 999px;
  background: var(--primary);
  color: var(--primary-foreground);
  text-decoration: none;
  font-weight: 600;
  box-shadow: var(--shadow-primary);
}

.celtic-link-btn.secondary {
  background: var(--secondary);
  color: var(--foreground);
  box-shadow: var(--shadow-sm);
}

.celtic-detail-card strong {
  display: block;
  font-size: 18px;
  margin-bottom: 4px;
}

.celtic-detail-card span {
  color: var(--primary);
  font-size: 13px;
}

.celtic-detail-card p {
  margin: 10px 0 0;
  line-height: 1.7;
  color: var(--foreground);
}

#celtic-ai-section h2 {
  text-align: center;
  color: var(--primary);
  margin: 0 0 12px;
}

/* ── Signed-in member space ── */
.starcore-member {
  width: min(100% - 32px, 1040px);
  margin: 42px auto 72px;
  color: var(--foreground);
}

.starcore-member-head {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr) auto;
  gap: 24px;
  align-items: end;
  padding: 0 0 24px;
  border-bottom: 1px solid var(--border);
}

.starcore-member-kicker,
.starcore-card-heading > p {
  margin: 0;
  color: var(--primary);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: .13em;
}

.starcore-member-head h1,
.starcore-member-head p { margin: 0; }
.starcore-member-head h1 { font-size: clamp(30px, 4vw, 42px); line-height: 1.1; letter-spacing: -.04em; }
.starcore-member-head div > p { max-width: 560px; margin-top: 10px; color: var(--muted-foreground); line-height: 1.65; }

.starcore-member-nav { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.starcore-member-nav a,
.starcore-filter-group button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 15px;
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--muted-foreground);
  background: var(--secondary);
  font: inherit;
  font-size: 14px;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .2s ease, color .2s ease, border-color .2s ease, transform .2s ease;
}

.starcore-member-nav a:hover,
.starcore-filter-group button:hover { transform: translateY(-1px); border-color: color-mix(in srgb, var(--primary) 30%, var(--border)); }
.starcore-member-nav a.is-active,
.starcore-filter-group button.is-active { color: var(--primary-foreground); background: var(--primary); border-color: var(--primary); box-shadow: var(--shadow-primary); }

.starcore-profile-grid { display: grid; grid-template-columns: minmax(0, 1.18fr) minmax(300px, .82fr); gap: 20px; margin-top: 28px; align-items: start; }
.starcore-profile-side { display: grid; gap: 20px; }
.starcore-member-card { padding: 28px; border: 1px solid var(--border); border-radius: 18px; background: var(--card); box-shadow: var(--shadow-sm); }
.starcore-card-heading { margin-bottom: 24px; }
.starcore-card-heading h2 { margin: 8px 0 0; font-size: 21px; line-height: 1.32; letter-spacing: -.02em; }
.starcore-member-card > label,
.starcore-profile-two label { display: grid; gap: 8px; color: var(--foreground); font-size: 14px; font-weight: 650; }
.starcore-member-card input:not([type="checkbox"]),
.starcore-member-card select {
  width: 100%; min-height: 46px; box-sizing: border-box; padding: 0 13px; border: 1px solid var(--border); border-radius: 10px; color: var(--foreground); background: var(--background); font: inherit; font-size: 16px;
}
.starcore-profile-two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 18px; }
.starcore-member-save { width: 100%; min-height: 46px; margin-top: 24px; border-radius: 10px; }
.starcore-member-status { min-height: 20px; margin: 10px 0 0; color: #177245; font-size: 13px; }

.starcore-switch-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 18px 0; border-top: 1px solid var(--border); cursor: pointer; }
.starcore-switch-row:first-of-type { border-top: 0; }
.starcore-switch-row strong { display: block; font-size: 15px; }
.starcore-switch-row small { display: block; max-width: 310px; margin-top: 5px; color: var(--muted-foreground); font-size: 13px; font-weight: 400; line-height: 1.55; }
.starcore-switch-row input { appearance: none; position: relative; flex: 0 0 auto; width: 46px; height: 26px; margin: 0; border-radius: 999px; background: #bbb4c5; cursor: pointer; transition: background-color .2s ease; }
.starcore-switch-row input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform .2s ease; }
.starcore-switch-row input:checked { background: var(--primary); }
.starcore-switch-row input:checked::after { transform: translateX(20px); }
.starcore-account-card dl { display: grid; gap: 13px; margin: 0; }
.starcore-account-card dl div { display: flex; justify-content: space-between; gap: 20px; padding-top: 13px; border-top: 1px solid var(--border); }
.starcore-account-card dt { color: var(--muted-foreground); font-size: 13px; }
.starcore-account-card dd { margin: 0; font-size: 14px; text-align: right; overflow-wrap: anywhere; }
.starcore-logout { min-height: 42px; margin-top: 24px; padding: 0 14px; border: 1px solid #e8b7bf; border-radius: 9px; color: #a32035; background: transparent; font: inherit; cursor: pointer; }

.starcore-history-filters { display: flex; justify-content: space-between; gap: 16px; padding: 24px 0; border-bottom: 1px solid var(--border); }
.starcore-filter-group { display: flex; gap: 8px; flex-wrap: wrap; }
.starcore-history-status { margin: 20px 0 4px; color: var(--muted-foreground); font-size: 14px; }
.starcore-history-list { display: grid; gap: 10px; padding: 0; margin: 0; list-style: none; }
.starcore-history-list li { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 20px 0; border-bottom: 1px solid var(--border); }
.starcore-history-list h2 { margin: 0; font-size: 17px; line-height: 1.4; }
.starcore-history-list p { margin: 6px 0 0; color: var(--muted-foreground); font-size: 13px; }
.starcore-history-actions { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.starcore-history-actions a { min-height: 40px; display: inline-flex; align-items: center; padding: 0 14px; border-radius: 9px; color: var(--primary); background: var(--secondary); font-size: 14px; font-weight: 650; text-decoration: none; }
.starcore-history-actions button { min-height: 40px; padding: 0 10px; border: 0; color: #a32035; background: transparent; font: inherit; cursor: pointer; }
.starcore-history-empty { padding: 48px 0; color: var(--muted-foreground); text-align: center; }
.starcore-history-cta { display: flex; width: fit-content; min-height: 46px; align-items: center; margin: 28px 0 0; border-radius: 10px; }

.starcore-member :is(a, button, input, select):focus-visible { outline: 3px solid color-mix(in srgb, var(--primary) 42%, transparent); outline-offset: 3px; }
html.dark .starcore-member-card { background: #17141d; border-color: #342f3d; }
html.dark .starcore-member-card input:not([type="checkbox"]), html.dark .starcore-member-card select { background: #211b29; border-color: #42384e; }
html.dark .starcore-filter-group button, html.dark .starcore-member-nav a { background: #211b29; color: #d9d2e1; }
html.dark .starcore-filter-group button.is-active, html.dark .starcore-member-nav a.is-active { color: #fff; background: var(--primary); }

@media (max-width: 760px) {
  .starcore-member { width: min(100% - 28px, 600px); margin: 24px auto 48px; }
  .starcore-member-head { grid-template-columns: 1fr; gap: 14px; padding-bottom: 20px; }
  .starcore-member-nav { justify-content: flex-start; }
  .starcore-profile-grid { grid-template-columns: 1fr; margin-top: 20px; }
  .starcore-member-card { padding: 20px 16px; border-radius: 14px; }
  .starcore-profile-two { grid-template-columns: 1fr; }
  .starcore-history-filters { display: grid; gap: 12px; padding: 18px 0; }
  .starcore-history-list li { align-items: flex-start; flex-direction: column; gap: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .starcore-member * { transition-duration: .01ms !important; }
}

/* ── Reading archive: quiet, two-column workspace ── */
.starcore-history-workspace {
  width: min(100% - 32px, 730px);
  min-height: 540px;
  margin: 64px auto 88px;
}
.starcore-history-workspace > h1 { margin: 0; color: var(--foreground); font-size: 29px; letter-spacing: -.035em; line-height: 1.2; }
.starcore-history-frame { display: grid; grid-template-columns: 236px minmax(0, 1fr); gap: 56px; margin-top: 28px; }
.starcore-history-sidebar { min-width: 0; }
.starcore-history-type-list { display: grid; gap: 4px; }
.starcore-history-type-list button { width: 100%; min-height: 42px; display: flex; align-items: center; gap: 12px; padding: 0 12px; border: 1px solid transparent; border-radius: 10px; color: var(--muted-foreground); background: transparent; font: inherit; font-size: 15px; text-align: left; cursor: pointer; transition: color .18s ease, background-color .18s ease, border-color .18s ease; }
.starcore-history-type-list button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto; }
.starcore-history-type-list button:hover { color: var(--foreground); background: var(--secondary); }
.starcore-history-type-list button.is-active { color: var(--foreground); background: var(--secondary); font-weight: 650; }
.starcore-history-type-list button.is-active svg { color: var(--primary); }
.starcore-history-period { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--border); }
.starcore-history-period button { min-width: 43px; min-height: 34px; padding: 0 10px; border: 1px solid var(--border); border-radius: 999px; color: var(--muted-foreground); background: var(--card); font: inherit; font-size: 13px; cursor: pointer; transition: color .18s ease, border-color .18s ease, background-color .18s ease; }
.starcore-history-period button:hover { color: var(--primary); border-color: color-mix(in srgb, var(--primary) 42%, var(--border)); }
.starcore-history-period button.is-active { color: var(--primary); border-color: color-mix(in srgb, var(--primary) 45%, var(--border)); background: color-mix(in srgb, var(--primary) 8%, var(--card)); font-weight: 650; }
.starcore-history-saved { display: inline-grid; width: 36px; height: 36px; margin-top: 10px; place-items: center; border: 1px solid var(--border); border-radius: 50%; color: var(--muted-foreground); background: var(--card); cursor: pointer; }
.starcore-history-saved:hover { color: var(--primary); border-color: var(--primary); }
.starcore-history-saved svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linejoin: round; }
.starcore-history-results { position: relative; display: flex; min-height: 320px; align-items: center; justify-content: center; text-align: center; }
.starcore-history-results:not(.is-empty) .starcore-history-empty-icon { display: none; }
.starcore-history-results:not(.is-empty) { display: block; text-align: left; }
.starcore-history-empty-icon { display: grid; width: 60px; height: 60px; margin: 0 auto 14px; place-items: center; border-radius: 50%; color: var(--muted-foreground); background: var(--secondary); }
.starcore-history-empty-icon svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.starcore-history-status { margin: 0; color: var(--foreground); font-size: 14px; font-weight: 650; }
.starcore-history-list:not(:empty) + .starcore-history-cta { display: none; }
.starcore-history-list { width: 100%; max-height: 470px; overflow: auto; padding: 0; margin: 0; list-style: none; }
.starcore-history-list:empty { display: none; }
.starcore-history-list:not(:empty) ~ .starcore-history-empty-icon { display: none; }
.starcore-history-list li { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 15px 0; border-bottom: 1px solid var(--border); text-align: left; }
.starcore-history-list li.starcore-history-empty { display: block; padding: 0; border: 0; color: transparent; font-size: 0; }
.starcore-history-list li.starcore-history-empty::after { content: ""; display: none; }
.starcore-history-list h2 { margin: 0; font-size: 15px; }
.starcore-history-list p { margin: 5px 0 0; color: var(--muted-foreground); font-size: 12px; }
.starcore-history-actions { display: flex; gap: 6px; flex: 0 0 auto; }
.starcore-history-actions a, .starcore-history-actions button { min-height: 36px; display: inline-flex; align-items: center; padding: 0 10px; border: 0; border-radius: 8px; color: var(--primary); background: var(--secondary); font: inherit; font-size: 13px; text-decoration: none; cursor: pointer; }
.starcore-history-actions button { color: #a32035; background: transparent; }
.starcore-history-cta { display: inline-flex; min-height: 38px; align-items: center; margin: 16px auto 0; padding: 0 18px; border-radius: 999px; font-size: 14px; }
.starcore-history-workspace :is(button, a):focus-visible { outline: 3px solid color-mix(in srgb, var(--primary) 42%, transparent); outline-offset: 3px; }
html.dark .starcore-history-period button, html.dark .starcore-history-saved { background: #211b29; border-color: #42384e; }
html.dark .starcore-history-type-list button.is-active { background: #211b29; }
html.dark .starcore-history-empty-icon { background: #211b29; }

/* Account popover placed into the existing global header once signed in. */
.starcore-account-host {
  position: relative;
  display: inline-flex;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  vertical-align: middle;
  align-items: center;
  justify-content: center;
}
.starcore-account-trigger {
  position: relative;
  display: grid;
  width: 38px;
  height: 38px;
  padding: 0 !important;
  place-items: center;
  border: 2px solid color-mix(in srgb, var(--primary) 36%, #fff);
  border-radius: 50%;
  color: var(--primary-foreground) !important;
  background: var(--primary) !important;
  font-size: 11px !important;
  font-weight: 750;
  letter-spacing: .02em;
  cursor: pointer;
  overflow: visible;
}
.starcore-account-status {
  position: absolute;
  right: -1px;
  bottom: -1px;
  z-index: 2;
  width: 10px;
  height: 10px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #22c55e;
  pointer-events: none;
}
.starcore-account-popover {
  position: absolute;
  z-index: 120;
  top: calc(100% + 12px);
  right: 0;
  width: min(280px, calc(100vw - 24px));
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, .08);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 14px 40px rgba(23, 15, 33, .16);
}
.starcore-account-popover[hidden] { display: none; }
.starcore-account-head {
  padding: 14px 16px 12px;
  border-bottom: 1px solid rgba(0, 0, 0, .06);
}
.starcore-account-label {
  margin: 0 0 4px;
  color: #71717a;
  font-size: 12px;
  line-height: 1.3;
}
.starcore-account-id {
  margin: 0;
  color: #18181b;
  font-size: 13px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}
.starcore-account-links {
  display: grid;
  gap: 2px;
  padding: 8px;
}
.starcore-account-popover a,
.starcore-account-popover button {
  display: flex;
  width: 100%;
  min-height: 42px;
  align-items: center;
  gap: 12px;
  padding: 0 10px;
  border: 0;
  border-radius: 9px;
  color: #18181b;
  background: transparent;
  font: inherit;
  font-size: 14px;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.starcore-account-popover a:hover,
.starcore-account-popover button:hover { background: #f4f4f5; }
.starcore-account-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  color: #52525b;
}
.starcore-account-badge {
  margin-left: auto;
  padding: 2px 8px;
  border-radius: 999px;
  color: #fff;
  background: #7f22fe;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .04em;
  line-height: 1.4;
}
.starcore-account-foot {
  padding: 8px;
  border-top: 1px solid rgba(0, 0, 0, .06);
}
.starcore-account-logout,
.starcore-account-logout .starcore-account-icon { color: #ef4444 !important; }
.starcore-account-logout:hover { background: #fef2f2 !important; }
html.dark .starcore-account-popover { border-color: #42384e; background: #17141d; }
html.dark .starcore-account-head,
html.dark .starcore-account-foot { border-color: #42384e; }
html.dark .starcore-account-label { color: #a1a1aa; }
html.dark .starcore-account-id,
html.dark .starcore-account-popover a,
html.dark .starcore-account-popover button { color: #f4f4f5; }
html.dark .starcore-account-popover a:hover,
html.dark .starcore-account-popover button:hover { background: #27212f; }
html.dark .starcore-account-icon { color: #d4d4d8; }
html.dark .starcore-account-status { border-color: #17141d; }
html.dark .starcore-account-logout:hover { background: rgba(239, 68, 68, .12) !important; }

@media (max-width: 700px) {
  .starcore-history-workspace { width: min(100% - 28px, 520px); margin-top: 30px; }
  .starcore-history-frame { grid-template-columns: 1fr; gap: 20px; }
  .starcore-history-type-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .starcore-history-period { margin-top: 14px; padding-top: 14px; }
  .starcore-history-results { min-height: 240px; }
}

/* The cloned page has a broad input rule. Keep the auth remember control a
   compact, labeled checkbox in both sign-in and registration modes. */
.starcore-auth #demo-auth-form .starcore-auth-remember {
  display: inline-flex !important;
  width: fit-content !important;
  min-height: 32px;
  align-items: center;
  gap: 10px;
  margin: 8px 0 10px;
  padding: 0;
  color: var(--foreground);
  line-height: 1;
}
.starcore-auth #demo-auth-form .starcore-auth-remember input[type="checkbox"] {
  appearance: auto;
  box-sizing: border-box;
  flex: 0 0 18px;
  width: 18px !important;
  min-width: 18px;
  height: 18px !important;
  min-height: 18px;
  margin: 0;
  padding: 0;
  accent-color: var(--primary);
}
.starcore-auth #demo-auth-form .starcore-auth-remember span { display: inline-block; white-space: nowrap; }
html.dark .starcore-auth #demo-auth-form .starcore-auth-remember { color: #f5eff9; }
