/* Veezol Digital — theme drawn from the logo: violet → indigo → sky gradient */
:root {
  --violet: #8b3dff;
  --indigo: #5b6cf6;
  --sky: #2bb8f5;
  --grad: linear-gradient(100deg, #8b3dff 0%, #5b6cf6 55%, #2bb8f5 100%);
  --grad-soft: linear-gradient(135deg, #f1e9ff 0%, #e6ecff 55%, #def4fe 100%);
  --brand: #6c4cf7;
  --brand-dark: #4b2fd1;

  --bg: #f8f7fe;
  --surface: #ffffff;
  --soft: #f1eefc;
  --ink: #1b1834;
  --text: #3b3858;
  --muted: #6c6987;
  --line: #e5e1f6;
  --line-strong: #cfc8ee;

  --ok: #12805c;
  --ok-bg: #e2f6ee;
  --warn: #9a6700;
  --warn-bg: #fff4d6;
  --danger: #c2334d;
  --danger-bg: #fde8ec;

  --radius: 14px;
  --radius-lg: 22px;
  --shadow: 0 1px 2px #1b18340d, 0 8px 24px -12px #3b2a9433;
  --shadow-lg: 0 20px 50px -20px #4b2fd155;

  --display: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.6 var(--sans); font-optical-sizing: auto; -webkit-font-smoothing: antialiased; }
button, input, textarea, select { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
h1, h2, h3, blockquote { font-family: var(--display); font-weight: 700; color: var(--ink); letter-spacing: -.015em; }
h1 em, h2 em, h3 em, blockquote em {
  font-style: normal;
  padding-right: .06em;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
:focus-visible { outline: 3px solid #8b3dff66; outline-offset: 2px; border-radius: 6px; }

/* ---------- Announcement + header ---------- */

.site-header { height: 78px; padding: 0 6%; display: flex; align-items: center; justify-content: space-between; gap: 24px; background: var(--glass); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.brand { width: 132px; flex: 0 0 auto; }
.brand img, .footer-brand img { display: block; width: 100%; height: auto; }
.main-nav { display: flex; align-items: center; gap: 10px; }
.header-link { white-space: nowrap; font-size: 14px; font-weight: 500; color: var(--muted); transition: color .15s; }
.header-link:hover { color: var(--brand); }
/* Nav items are separate pill buttons that float up on hover / click */
.main-nav a { white-space: nowrap; padding: 9px 18px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--text); font-size: 14px; font-weight: 500; box-shadow: 0 1px 2px #1b18340d; transition: transform .2s cubic-bezier(.2,.8,.3,1.4), box-shadow .2s, border-color .2s, color .2s, background .2s; }
.main-nav a:hover, .main-nav a:focus-visible { transform: translateY(-4px); border-color: var(--line-strong); color: var(--brand-dark); box-shadow: 0 12px 22px -10px #4b2fd166, 0 2px 4px #1b18340f; }
.main-nav a:active { transform: translateY(-2px); box-shadow: 0 6px 14px -8px #4b2fd166; }
.main-nav a[aria-current="page"] { border-color: transparent; background: var(--grad); color: #fff; box-shadow: 0 8px 18px -10px #6c4cf7; }
.main-nav a[aria-current="page"]:hover { color: #fff; }
.nav-icon, .nav-chevron, .nav-title, .nav-auth { display: none; }
.header-actions { display: flex; align-items: center; gap: 18px; }
.header-join, .header-studio { padding: 9px 16px; border-radius: 999px; background: var(--grad); color: #fff; font-size: 13px; font-weight: 600; box-shadow: 0 6px 16px -8px #6c4cf7; transition: transform .15s, box-shadow .15s; }
.header-join:hover, .header-studio:hover { transform: translateY(-1px); box-shadow: 0 10px 20px -8px #6c4cf7; }
.header-join span { margin-left: 6px; }
/* Profile menu + sign-out confirmation */
.profile-menu { position: relative; }
.avatar-button { display: inline-flex; align-items: center; gap: 4px; padding: 3px 6px 3px 3px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--muted); cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.avatar-button:hover, .avatar-button[aria-expanded="true"] { border-color: var(--line-strong); box-shadow: var(--shadow); }
.avatar { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: var(--grad); color: #fff; font-size: 15px; font-weight: 600; line-height: 1; overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar-form { margin: 0; display: grid; gap: 2px; }
.avatar-form.is-uploading { opacity: .6; pointer-events: none; }
.avatar-lg { width: 42px; height: 42px; font-size: 18px; flex: 0 0 auto; }
.avatar-caret { width: 16px; height: 16px; transition: transform .15s; }
.avatar-button[aria-expanded="true"] .avatar-caret { transform: rotate(180deg); }
.profile-dropdown { position: absolute; right: 0; top: calc(100% + 10px); z-index: 30; width: 260px; padding: 8px; display: grid; gap: 2px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-lg); }
.profile-dropdown[hidden] { display: none; }
.profile-head { padding: 8px 10px 12px; margin-bottom: 4px; display: flex; align-items: center; gap: 12px; border-bottom: 1px solid var(--line); }
.profile-head div { display: grid; min-width: 0; }
.profile-head strong { color: var(--muted); font-size: 12px; font-weight: 500; }
.profile-head small { overflow: hidden; color: var(--ink); font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.profile-dropdown a, .profile-signout, .avatar-form button { width: 100%; padding: 10px; display: flex; align-items: center; gap: 10px; border: 0; border-radius: 10px; background: none; color: var(--text); font-size: 14px; text-align: left; cursor: pointer; }
.profile-dropdown a:hover, .profile-dropdown a:focus-visible, .profile-signout:hover, .profile-signout:focus-visible, .avatar-form button:hover, .avatar-form button:focus-visible { background: var(--soft); color: var(--brand-dark); }
.profile-dropdown .icon { width: 18px; height: 18px; }
.profile-signout { margin-top: 4px; border-top: 1px solid var(--line); border-radius: 0 0 10px 10px; color: var(--danger); }
.profile-signout:hover, .profile-signout:focus-visible { background: var(--danger-bg); color: var(--danger); }
.confirm-dialog { width: min(420px, calc(100vw - 32px)); padding: 28px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); color: var(--ink); box-shadow: var(--shadow-lg); }
.confirm-dialog::backdrop { background: #1b183466; backdrop-filter: blur(3px); }
.confirm-dialog form { margin: 0; }
.confirm-dialog h2 { margin: 0 0 6px; font-size: 24px; }
.confirm-dialog p { margin: 0; color: var(--muted); line-height: 1.6; }
.confirm-actions { margin-top: 22px; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; }
.confirm-actions .button { flex: 1 1 auto; }
/* Delete account */
.profile-delete { width: 100%; padding: 8px 10px; display: flex; align-items: center; gap: 10px; border: 0; border-radius: 10px; background: none; color: var(--muted); font-size: 13px; text-align: left; cursor: pointer; }
.profile-delete .icon { width: 16px; height: 16px; }
.profile-delete:hover, .profile-delete:focus-visible { background: var(--danger-bg); color: var(--danger); }
.danger-icon { background: var(--danger-bg) !important; color: var(--danger) !important; box-shadow: inset 0 0 0 1px #f4c3cd !important; display: grid !important; }
.danger-text { color: var(--muted); font-size: 14.5px; line-height: 1.6; }
.danger-text p { margin: 0 0 6px; }
.danger-text ul { margin: 0 0 4px; padding-left: 18px; }
.danger-text strong { color: var(--danger); }
.danger-label { margin-top: 14px; display: block; color: var(--text); font-size: 13px; font-weight: 600; }
.danger-input { width: 100%; margin-top: 6px; padding: 11px 14px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--field); color: var(--ink); font: 600 15px var(--sans); letter-spacing: .08em; }
.danger-input:focus { outline: 0; border-color: var(--danger); box-shadow: 0 0 0 4px #c2334d1f; }
.button-danger { background: var(--danger); color: #fff; }
.button-danger:hover:not(:disabled) { background: #a92a42; }
.button-danger:disabled { opacity: .45; cursor: not-allowed; }
.menu-toggle { display: none; }

/* ---------- Buttons ---------- */
.button { min-height: 46px; padding: 0 22px; display: inline-flex; align-items: center; justify-content: center; gap: 12px; border: 1px solid transparent; border-radius: 12px; font-size: 14px; font-weight: 600; cursor: pointer; transition: transform .15s, box-shadow .15s, background .15s, border-color .15s; }
.button-dark { background: var(--grad); background-size: 130% 100%; color: #fff; box-shadow: 0 10px 22px -12px #5b3df0; }
.button-dark:hover { transform: translateY(-1px); background-position: 100% 0; box-shadow: 0 14px 26px -12px #5b3df0; }
.button-outline { background: var(--surface); border-color: var(--line-strong); color: var(--brand-dark); }
.button-outline:hover { border-color: var(--brand); color: var(--brand); }
.button-danger { background: var(--danger); color: #fff; }
.button-danger:hover { background: #a3263d; }
.button-small { min-height: 36px; padding: 0 14px; font-size: 13px; border-radius: 10px; }
.button[disabled] { opacity: .5; cursor: not-allowed; transform: none; }

.eyebrow { margin: 0; color: var(--brand); font-size: 12px; font-weight: 700; letter-spacing: .14em; }
.eyebrow > span { margin-right: 6px; }
.text-link { padding-bottom: 2px; color: var(--brand); font-size: 14px; font-weight: 600; border-bottom: 2px solid #6c4cf733; transition: border-color .15s; }
.text-link:hover { border-color: var(--brand); }
.text-link span { margin-left: 6px; }

/* ---------- Hero ---------- */
.hero { position: relative; min-height: 560px; padding: 72px 8% 80px; display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: center; overflow: hidden; }
.hero::before { content: ""; position: absolute; inset: -40% -10% auto auto; width: 70%; height: 140%; background: radial-gradient(closest-side, #8b3dff1f, transparent 70%); pointer-events: none; }
.hero-copy { position: relative; z-index: 2; }
.hero h1 { margin: 18px 0 18px; font-size: clamp(46px, 5.4vw, 74px); line-height: 1.05; letter-spacing: -.02em; }
.hero-description { max-width: 440px; margin: 0; color: var(--muted); font-size: 17px; line-height: 1.7; }
.hero-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 22px; margin-top: 30px; }
.reader-note { display: flex; align-items: center; color: var(--muted); font-size: 13px; }
.reader-note i { width: 28px; height: 28px; margin-left: -6px; border: 2px solid var(--bg); border-radius: 50%; display: grid; place-items: center; background: var(--violet); color: #fff; font-size: 11px; font-style: normal; font-weight: 700; }
.reader-note i:first-child { margin-left: 0; }
.reader-note i:nth-child(2) { background: var(--indigo); }
.reader-note i:nth-child(3) { margin-right: 10px; background: var(--sky); }
.hero-note { margin-top: 34px; display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; }
.hero-note span, .scroll-cue span { width: 28px; height: 2px; border-radius: 2px; background: var(--grad); }

.hero-art { position: relative; width: 100%; max-width: 520px; height: 420px; justify-self: end; overflow: hidden; border-radius: 28px; background: var(--grad); box-shadow: var(--shadow-lg); }
.hero-art-caption { position: absolute; right: 24px; bottom: 22px; z-index: 2; margin: 0; color: #ffffffd0; font-size: 10px; font-weight: 600; letter-spacing: .18em; }
.scroll-cue { position: absolute; left: 8%; bottom: 26px; display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; }

.trust-strip { min-height: 72px; padding: 14px 8%; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 14px; border-block: 1px solid var(--line); background: var(--surface); color: var(--text); font-size: 13px; font-weight: 500; }
.trust-strip span { display: inline-flex; align-items: center; gap: 10px; }
.trust-strip .icon { width: 20px; height: 20px; flex: 0 0 auto; color: var(--brand); }

/* ---------- Line icons (inline SVG) ---------- */
.icon { width: 1em; height: 1em; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.icon-inline { display: inline-block; width: 1.05em; height: 1.05em; vertical-align: -.17em; stroke-width: 2.2; flex: 0 0 auto; }
.icon-inline.icon-fill { fill: currentColor; stroke-width: 1.4; width: .9em; height: .9em; vertical-align: -.1em; margin-right: 3px; }
.button .icon-inline, .text-link .icon-inline, .back-link .icon-inline, .add-button .icon-inline { transition: transform .18s ease; }
.button:hover .icon-inline, .text-link:hover .icon-inline, .add-button:hover .icon-inline { transform: translateX(2px); }
.back-link:hover .icon-inline { transform: translateX(-2px); }
.check-list li > span .icon-inline { width: 15px; height: 15px; vertical-align: 0; stroke-width: 2.6; }
.section-icon { width: 44px; height: 44px; margin-bottom: 14px; display: inline-grid; place-items: center; border-radius: 12px; background: var(--grad-soft); color: var(--brand-dark); box-shadow: inset 0 0 0 1px var(--line); }
.section-icon .icon { width: 22px; height: 22px; }
.section-heading .section-icon, .newsletter .section-icon { display: grid; }

/* ---------- Book grid ---------- */
.book-section { padding: 84px 8% 56px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 16px; }
.section-heading h2, .newsletter h2 { margin: 10px 0 0; font-size: clamp(30px, 3.4vw, 42px); letter-spacing: -.025em; line-height: 1.15; }
.shop-controls { margin-top: 28px; padding-bottom: 16px; display: flex; justify-content: space-between; align-items: center; gap: 16px; border-bottom: 1px solid var(--line); }
.category-list { display: flex; flex-wrap: wrap; gap: 8px; }
.category-chip { min-height: 36px; padding: 0 14px; display: inline-flex; align-items: center; border: 1px solid var(--line); background: var(--surface); border-radius: 999px; color: var(--text); font-size: 13px; font-weight: 500; transition: border-color .15s, color .15s; }
.category-chip:hover { border-color: var(--brand); color: var(--brand); }
.category-chip.selected { background: var(--grad); border-color: transparent; color: #fff; }
.category-chip span { margin-left: 8px; opacity: .75; font-size: 11px; }
.search-box { display: flex; align-items: center; gap: 10px; min-width: 260px; padding: 0 6px 0 14px; height: 44px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.search-box:focus-within { border-color: var(--brand); box-shadow: 0 0 0 4px #6c4cf71a; }
.search-box svg { width: 18px; height: 18px; flex: 0 0 auto; fill: none; stroke: var(--muted); stroke-width: 1.8; }
.search-box input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font-size: 14px; }
.search-box button { height: 32px; padding: 0 12px; border: 0; border-radius: 8px; background: var(--soft); color: var(--brand-dark); font-size: 13px; font-weight: 600; cursor: pointer; }
.book-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 32px 22px; padding-top: 28px; }
.book-card { min-width: 0; }
.book-art { position: relative; height: 260px; margin-bottom: 14px; display: grid; place-items: center; border-radius: var(--radius-lg); background: var(--grad-soft); overflow: hidden; transition: box-shadow .25s; }
.book-card:hover .book-art { box-shadow: var(--shadow); }
.book-art img { width: 140px; height: 204px; object-fit: cover; border-radius: 4px 8px 8px 4px; box-shadow: 10px 14px 24px -8px #2a1f6b55; transition: transform .3s; }
.book-card:hover .book-art img { transform: translateY(-6px) rotate(1deg); }
.book-tag { position: absolute; z-index: 1; top: 12px; left: 12px; padding: 5px 10px; border-radius: 999px; background: var(--surface); color: var(--brand); font-size: 11px; font-weight: 700; letter-spacing: .04em; }
.book-info { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.book-info h3 { margin: 0; font: 600 16px/1.3 var(--display); }
.book-info h3 a:hover { color: var(--brand); }
.book-info p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.book-price { flex: 0 0 auto; color: var(--brand-dark); font-size: 14px; font-weight: 700; }
.book-meta { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; }
.book-category { color: var(--muted); font-size: 12px; }
.add-button { color: var(--brand); font-size: 13px; font-weight: 600; }
.add-button:hover { text-decoration: underline; text-underline-offset: 3px; }
.section-bottom { display: flex; justify-content: space-between; margin-top: 52px; padding-top: 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.section-bottom span:last-child { color: var(--brand); }

/* ---------- Quote + newsletter ---------- */
.quote-banner { position: relative; min-height: 240px; padding: 44px 8%; display: grid; grid-template-columns: .45fr 2fr .8fr; align-items: center; gap: 20px; background: var(--ink-solid); color: #fff; overflow: hidden; }
.quote-banner::after { content: ""; position: absolute; inset: auto -10% -60% auto; width: 50%; height: 140%; background: radial-gradient(closest-side, #5b6cf655, transparent); }
.quote-banner .eyebrow { color: #b9a6ff; }
.quote-mark { align-self: start; font: 700 120px/.8 var(--display); background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.quote-banner blockquote { max-width: 580px; margin: 14px 0 12px; color: #fff; font-size: clamp(24px, 3vw, 36px); line-height: 1.25; letter-spacing: -.02em; }
.quote-banner small { color: #c9c6e3; font-size: 13px; }
.quote-side { position: relative; z-index: 1; justify-self: end; color: #c9c6e3; font-size: 11px; font-weight: 600; letter-spacing: .14em; line-height: 1.9; }
.newsletter { position: relative; margin: 72px 8%; padding: 56px 6%; display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: 44px; overflow: hidden; border-radius: 28px; background: var(--grad-soft); }
.newsletter > div:first-child > p:last-child, .newsletter-aside p { max-width: 400px; margin: 14px 0 0; color: var(--muted); font-size: 15px; line-height: 1.7; }
.newsletter-aside { position: relative; z-index: 1; display: grid; gap: 18px; justify-items: start; }
.newsletter-art { position: absolute; right: 3%; bottom: -46px; color: var(--brand); opacity: .1; pointer-events: none; }
.newsletter-art .icon { width: 230px; height: 230px; stroke-width: 1.2; }

/* ---------- Footer ---------- */
.site-footer { min-height: 100px; padding: 26px 6%; display: flex; flex-wrap: wrap; align-items: center; gap: 24px; border-top: 1px solid var(--line); background: var(--surface); }
.footer-brand { width: 104px; }
.site-footer > p { margin: 0; color: var(--muted); font-size: 13px; }
.footer-nav { display: flex; gap: 22px; margin-left: auto; color: var(--text); font-size: 13px; }
.footer-nav a:hover { color: var(--brand); }
.copyright { color: var(--muted); font-size: 12px; }

/* ---------- Flash messages ---------- */
.flash-stack { max-width: 1100px; margin: 18px auto; padding: 0 20px; }
.studio-main .flash-stack { padding: 0; margin-top: 0; }
.flash { padding: 13px 16px; margin-bottom: 8px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); font-size: 14px; }
.flash-error { border-color: #f4b7c3; background: var(--danger-bg); color: #8c1f35; }
.flash-success { border-color: #a6e3cb; background: var(--ok-bg); color: #0c5e43; }

/* ---------- Book detail / reading ---------- */
.breadcrumbs { max-width: 1050px; margin: 34px auto 0; padding: 0 24px; color: var(--muted); font-size: 13px; }
.breadcrumbs a:hover { color: var(--brand); }
.breadcrumbs span { margin: 0 8px; }
.book-detail { max-width: 1050px; margin: 26px auto 80px; padding: 0 24px; display: grid; grid-template-columns: .85fr 1.15fr; gap: 64px; align-items: center; }
.detail-cover { min-height: 460px; display: grid; place-items: center; border-radius: 28px; background: var(--grad-soft); }
.detail-cover img { width: min(66%, 280px); max-height: 400px; object-fit: cover; border-radius: 4px 10px 10px 4px; box-shadow: 16px 22px 40px -14px #2a1f6b66; }
.detail-copy h1, .content-page h1, .auth-aside h1, .reading-page h1, .status-page h1 { margin: 12px 0 8px; font-size: clamp(36px, 4.6vw, 56px); line-height: 1.08; letter-spacing: -.03em; }
.detail-author { margin: 6px 0 22px; color: var(--muted); font-size: 16px; }
.detail-description { color: var(--text); font-size: 16px; line-height: 1.75; white-space: pre-line; }
.detail-price { margin: 26px 0 18px; font: 700 30px var(--display); }
.detail-price span { display: block; margin-top: 4px; color: var(--muted); font: 500 13px var(--sans); }
.detail-copy > .button-outline { margin-right: 8px; }
.detail-buy { margin-top: 12px; }
.detail-buy button { width: 100%; }
.payment-note { max-width: 460px; color: var(--muted); font-size: 12.5px; line-height: 1.7; }
.sample-teaser { margin: 0 8% 72px; padding: 48px 6%; display: grid; grid-template-columns: 1fr 1fr; gap: 48px; border-radius: 28px; background: var(--grad-soft); }
.sample-teaser h2 { font-size: 34px; }
.sample-teaser p { color: var(--text); font-size: 16px; line-height: 1.8; }
.reading-page { max-width: 720px; margin: 56px auto 90px; padding: 0 24px; }
.back-link { display: inline-block; margin-bottom: 28px; color: var(--brand); font-size: 14px; font-weight: 600; }
.reading-byline { color: var(--muted); font-size: 16px; }
.reading-copy { margin: 40px 0; color: var(--text); font-size: 18px; line-height: 1.9; }
.reading-copy p { margin: 0 0 22px; }

.format-chip, .meta-chip { display: inline-flex; align-items: center; padding: 3px 9px; border-radius: 999px; font-size: 11px; font-weight: 700; letter-spacing: .06em; vertical-align: middle; }
.format-chip { margin-left: 6px; background: var(--grad); color: #fff; }
.admin-book-tags .format-chip { margin-left: 0; }
.meta-chip { background: var(--soft); color: var(--text); letter-spacing: 0; font-weight: 600; }

/* ---------- Content pages ---------- */
.content-page { max-width: 1080px; margin: 72px auto 96px; padding: 0 24px; }
.page-intro { max-width: 600px; color: var(--muted); font-size: 16px; line-height: 1.7; }

/* ---------- Auth ---------- */
.auth-page { min-height: 600px; padding: 64px 8%; display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: 64px; }
.auth-aside { position: relative; }
.auth-aside > p:last-of-type { max-width: 400px; color: var(--muted); font-size: 16px; line-height: 1.7; }
.form-card { width: 100%; max-width: 440px; padding: 36px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-lg); }
.form-card h2 { margin: 8px 0 22px; font-size: 28px; }
/* Continue with Google */
.google-button { width: 100%; min-height: 48px; padding: 0 18px; display: flex; align-items: center; justify-content: center; gap: 12px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface); color: var(--ink); font-size: 15px; font-weight: 600; box-shadow: 0 1px 2px #1b18340d; transition: transform .15s, box-shadow .15s, border-color .15s, background .15s; }
.google-button:hover { transform: translateY(-1px); border-color: #b9b2e3; box-shadow: var(--shadow); }
.google-button:active { transform: none; background: var(--soft); }
.google-logo { width: 20px; height: 20px; flex: 0 0 auto; }
.auth-divider { margin: 20px 0 6px; display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 12.5px; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.stack-form { display: grid; gap: 8px; }
.stack-form label, .publish-form label { margin-top: 8px; color: var(--text); font-size: 13px; font-weight: 600; }
.stack-form input, .publish-form input:not([type=checkbox]):not([type=file]), .publish-form textarea, .studio-search input {
  width: 100%; padding: 12px 14px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--field); color: var(--ink); font-size: 15px; transition: border-color .15s, box-shadow .15s;
}
.stack-form input:focus, .publish-form input:focus, .publish-form textarea:focus, .studio-search input:focus { outline: 0; border-color: var(--brand); box-shadow: 0 0 0 4px #6c4cf71f; }
.password-field { position: relative; }
.password-field input { padding-right: 52px; }
.password-toggle { position: absolute; top: 50%; right: 6px; transform: translateY(-50%); width: 40px; height: 40px; display: grid; place-items: center; border: 0; border-radius: 10px; background: transparent; color: var(--muted); cursor: pointer; transition: background .15s, color .15s; }
.password-toggle:hover { background: var(--soft); color: var(--brand); }
.password-toggle svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.password-toggle .icon-eye-off, .password-toggle.is-visible .icon-eye { display: none; }
.password-toggle.is-visible .icon-eye-off { display: block; }
.password-toggle.is-visible { color: var(--brand); }
.stack-form small, .form-hint { color: var(--muted); font-size: 12.5px; line-height: 1.6; }
.form-submit { margin-top: 14px; }
.auth-switch { margin: 20px 0 0; color: var(--muted); font-size: 14px; }
.auth-switch a { color: var(--brand); font-weight: 600; }

/* ---------- Guide ---------- */
.guide-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin-top: 44px; }
.guide-grid article { min-height: 190px; padding: 28px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); }
.guide-grid article > span { font: 700 18px var(--display); background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.guide-grid h2 { margin: 10px 0 8px; font-size: 21px; }
.guide-grid p { margin: 0; color: var(--muted); font-size: 14.5px; line-height: 1.75; }
.guide-grid a { color: var(--brand); text-decoration: underline; }

/* ---------- Empty / library / status ---------- */
.empty-state { padding: 60px 20px; text-align: center; }
.empty-state > .section-icon { width: 56px; height: 56px; margin: 0 auto 6px; display: grid; }
.empty-state > .section-icon .icon { width: 26px; height: 26px; }
.empty-state h3 { margin: 10px 0 6px; font-size: 24px; }
.empty-state p { color: var(--muted); font-size: 15px; }
.library-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; margin-top: 34px; }
.library-card { padding: 20px; display: flex; align-items: center; gap: 22px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); }
.library-card > img { width: 105px; height: 150px; object-fit: cover; border-radius: 3px 8px 8px 3px; box-shadow: 6px 10px 18px -8px #2a1f6b66; }
.library-card h2 { margin: 8px 0 4px; font-size: 20px; }
.library-card p:not(.eyebrow) { margin: 0 0 14px; color: var(--muted); font-size: 14px; }
.pending-box { margin: 30px 0; padding: 20px 22px; border: 1px solid #f3dc9c; border-radius: var(--radius); background: var(--warn-bg); font-size: 14px; }
.pending-box > p { color: var(--text); }
.pending-order { padding: 10px 0; border-top: 1px solid #f0d995; }
.pending-order span { float: right; color: var(--warn); font-weight: 600; }
.status-page { max-width: 640px; min-height: 430px; margin: 80px auto; padding: 0 24px; text-align: center; }
.status-icon { width: 56px; height: 56px; margin: 0 auto 20px; display: grid; place-items: center; border-radius: 50%; background: var(--grad); color: #fff; font-size: 24px; }
.status-icon.pending { background: var(--warn-bg); color: var(--warn); }
.status-icon .icon { width: 26px; height: 26px; stroke-width: 2.2; }
.status-page > p:not(.eyebrow) { color: var(--muted); font-size: 16px; line-height: 1.7; }
.status-page .button { margin-top: 16px; }

/* ---------- Status pills ---------- */
.status-pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.status-pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status-published, .status-paid { background: var(--ok-bg); color: var(--ok); }
.status-hidden, .status-cancelled { background: #eeedf4; color: #5d5a73; }
.status-pending { background: var(--warn-bg); color: var(--warn); }
.status-failed { background: var(--danger-bg); color: var(--danger); }
.status-admin { background: #efe8ff; color: var(--brand-dark); }
.table-actions { text-align: right; white-space: nowrap; }
/* Verified admin tick */
.verified-badge { width: 1.05em; height: 1.05em; margin-left: .3em; display: inline-block; flex: 0 0 auto; vertical-align: -0.15em; filter: drop-shadow(0 1px 2px #6c4cf74d); }
.verified-badge svg { display: block; width: 100%; height: 100%; }
.svg-defs { position: absolute; width: 0; height: 0; overflow: hidden; pointer-events: none; }
.name-with-badge, .profile-name, .studio-who { display: inline-flex; align-items: center; min-width: 0; }
.profile-name { color: var(--ink) !important; font-size: 15px !important; font-weight: 600 !important; }
.studio-who > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.table-actions form { margin: 0; display: inline; }
.panel + .publish-form { margin-top: 18px; }
.name-reminder { margin-bottom: 18px; padding: 14px 18px; border: 1px solid #f1d58a; border-radius: 14px; background: var(--warn-bg); color: var(--warn); font-size: 14px; line-height: 1.6; }
.name-reminder a { font-weight: 600; text-decoration: underline; }

/* =========================================================
   Admin Studio
   ========================================================= */
.studio-body main { background: var(--bg); }
.studio { max-width: 1320px; margin: 0 auto; padding: 28px 24px 72px; display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 28px; align-items: start; }
.studio-sidebar { position: sticky; top: 100px; padding: 18px; display: grid; gap: 18px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow); }
.studio-mark { display: flex; align-items: center; gap: 12px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.studio-mark img { width: 38px; height: 38px; padding: 6px; border-radius: 12px; background: var(--soft); object-fit: contain; }
.studio-mark div { min-width: 0; display: grid; }
.studio-mark strong { font: 600 16px var(--display); }
.studio-mark small { overflow: hidden; color: var(--muted); font-size: 11.5px; text-overflow: ellipsis; white-space: nowrap; }
.studio-nav { display: grid; gap: 4px; }
.studio-nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; color: var(--text); font-size: 14px; font-weight: 500; transition: background .15s, color .15s; }
.studio-nav a:hover { background: var(--soft); color: var(--brand-dark); }
.studio-nav a.active { background: var(--grad); color: #fff; box-shadow: 0 8px 18px -10px #5b3df0; }
.studio-nav svg { width: 19px; height: 19px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.studio-back { padding: 10px 12px; border-radius: 12px; background: var(--soft); color: var(--brand-dark); font-size: 13px; font-weight: 600; text-align: center; }
.studio-main { min-width: 0; }
.studio-main .back-link { margin-bottom: 12px; }

.studio-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.studio-head h1 { margin: 8px 0 0; font-size: clamp(30px, 3.4vw, 42px); line-height: 1.1; letter-spacing: -.025em; }
.studio-head .page-intro { margin: 10px 0 0; font-size: 15px; }
.studio-head .button { flex: 0 0 auto; }

.stat-grid { display: grid; grid-template-columns: 1.4fr repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.stat-card { padding: 18px 20px; display: grid; align-content: start; gap: 4px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); }
.stat-card p { margin: 0; color: var(--muted); font-size: 13px; font-weight: 500; }
.stat-card strong { font: 700 28px/1.2 var(--display); letter-spacing: -.02em; }
.stat-card strong span { margin-left: 4px; color: var(--muted); font-size: 16px; font-weight: 500; }
.stat-card small { color: var(--muted); font-size: 12px; }
.stat-feature { border: 0; background: var(--grad); color: #fff; box-shadow: var(--shadow-lg); }
.stat-feature p, .stat-feature small, .stat-feature strong span { color: #ffffffcc; }
.stat-feature strong { font-size: 26px; }

.studio-columns { display: grid; grid-template-columns: 1.6fr 1fr; gap: 18px; margin-bottom: 18px; }
.panel { padding: 22px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.panel h2, .panel-head h2 { margin: 0; font-size: 18px; }
.panel-empty { margin: 6px 0; color: var(--muted); font-size: 14px; }
.panel-copy { margin: 0 0 16px; color: var(--muted); font-size: 14px; line-height: 1.65; }

.table-wrap { overflow-x: auto; margin: 0 -6px; }
.data-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.data-table th { padding: 10px 8px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: .04em; text-align: left; text-transform: uppercase; white-space: nowrap; }
.data-table td { padding: 12px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: #faf9ff; }
.muted { color: var(--muted); }

.rank-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 12px; }
.rank-list li { display: grid; grid-template-columns: 38px 1fr auto; align-items: center; gap: 12px; }
.rank-list img { width: 38px; height: 54px; object-fit: cover; border-radius: 3px 6px 6px 3px; }
.rank-list div { min-width: 0; display: grid; }
.rank-list strong { overflow: hidden; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.rank-list small { color: var(--muted); font-size: 12px; }
.rank-list span { color: var(--brand); font-size: 13px; font-weight: 700; }

.check-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 12px; }
.check-list li { display: flex; gap: 12px; align-items: flex-start; }
.check-list li > span { width: 26px; height: 26px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 50%; font-size: 13px; font-weight: 700; }
.check-list .ok > span { background: var(--ok-bg); color: var(--ok); }
.check-list .warn > span { background: var(--warn-bg); color: var(--warn); }
.check-list div { display: grid; }
.check-list strong { font-size: 14px; }
.check-list small { color: var(--muted); font-size: 13px; }

.studio-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.filter-tabs { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.filter-tabs a { padding: 7px 14px; border-radius: 9px; color: var(--muted); font-size: 13px; font-weight: 600; }
.filter-tabs a:hover { color: var(--brand); }
.filter-tabs a.active { background: var(--soft); color: var(--brand-dark); }
.studio-search { display: flex; gap: 8px; min-width: min(340px, 100%); }
.studio-search input { padding: 9px 12px; font-size: 14px; }
.studio-search button { padding: 0 16px; border: 0; border-radius: 12px; background: var(--ink-solid); color: #fff; font-size: 13px; font-weight: 600; cursor: pointer; }

.admin-list { display: grid; gap: 10px; }
.admin-book { padding: 14px 16px; display: grid; grid-template-columns: 58px minmax(0, 1fr) auto; gap: 18px; align-items: center; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); transition: box-shadow .15s, border-color .15s; }
.admin-book:hover { border-color: var(--line-strong); box-shadow: var(--shadow); }
.admin-book > img { width: 58px; height: 82px; object-fit: cover; border-radius: 3px 7px 7px 3px; box-shadow: 4px 6px 12px -6px #2a1f6b66; }
.admin-book-info { min-width: 0; }
.admin-book-info h2 { margin: 0; overflow: hidden; font-size: 17px; text-overflow: ellipsis; white-space: nowrap; }
.admin-book-info p { margin: 2px 0 8px; color: var(--muted); font-size: 13px; }
.admin-book-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.admin-actions { display: flex; align-items: center; gap: 8px; }
.admin-actions form { margin: 0; }
.icon-action { width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--text); cursor: pointer; transition: border-color .15s, color .15s, background .15s; }
.icon-action:hover { border-color: var(--brand); color: var(--brand); }
.icon-action.danger:hover { border-color: var(--danger); background: var(--danger-bg); color: var(--danger); }
.icon-action svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.danger-zone { margin-top: 28px; padding: 18px 20px; display: flex; align-items: center; justify-content: space-between; gap: 18px; border: 1px solid #f4c3cd; border-radius: var(--radius-lg); background: #fff8f9; }
.danger-zone strong { color: var(--danger); font-size: 14px; }
.danger-zone p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.danger-zone form { margin: 0; }

/* Publish / edit form */
.publish-form { display: grid; gap: 16px; }
.form-panel { display: grid; gap: 8px; }
.form-panel > h2 { margin-bottom: 4px; }
.publish-form textarea { resize: vertical; line-height: 1.6; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-row > div, .form-row > label { min-width: 0; }
.form-row label, .price-fields label { display: block; margin-bottom: 6px; }
.price-fields { display: grid; grid-template-columns: 1fr 96px; gap: 10px; }
.price-fields input#currency { text-transform: uppercase; }
.optional { color: var(--muted); font-size: 12px; font-weight: 400; }
.upload-row { margin-top: 4px; }
.dropzone { position: relative; min-height: 170px; margin: 0 !important; padding: 22px; display: grid; justify-items: center; align-content: center; gap: 4px; border: 2px dashed var(--line-strong); border-radius: var(--radius-lg); background: #fcfbff; text-align: center; cursor: pointer; transition: border-color .15s, background .15s; }
.dropzone:hover, .dropzone.dragging { border-color: var(--brand); background: var(--soft); }
.dropzone.has-file { border-style: solid; border-color: var(--ok); background: var(--ok-bg); }
.dropzone svg { width: 30px; height: 30px; margin-bottom: 6px; fill: none; stroke: var(--brand); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.dropzone strong { color: var(--ink); font-size: 15px; }
.dropzone span { color: var(--muted); font-size: 12.5px; font-weight: 400; }
.dropzone em { max-width: 100%; margin-top: 6px; overflow: hidden; color: var(--brand-dark); font-size: 13px; font-style: normal; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.dropzone.has-file em { color: var(--ok); }
.dropzone input[type=file] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.form-footer { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.switch { position: relative; display: flex !important; align-items: center; gap: 14px; margin: 0 !important; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch-track { position: relative; width: 46px; height: 26px; flex: 0 0 auto; border-radius: 999px; background: var(--line-strong); transition: background .2s; }
.switch-track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px #0003; transition: transform .2s; }
.switch input:checked + .switch-track { background: var(--grad); }
.switch input:checked + .switch-track::after { transform: translateX(20px); }
.switch input:focus-visible + .switch-track { outline: 3px solid #8b3dff66; outline-offset: 2px; }
.switch > span:last-child { display: grid; }
.switch small { color: var(--muted); font-size: 12.5px; font-weight: 400; }

.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .trust-strip { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 24px; }
  .stat-grid { grid-template-columns: repeat(3, 1fr); }
  .stat-feature { grid-column: 1 / -1; }
  .studio-columns { grid-template-columns: 1fr; }
}
@media (max-width: 950px) {
  .site-header { padding: 0 5%; }
  .main-nav { gap: 8px; }
  .main-nav a { padding: 8px 14px; }
  .hero, .book-section, .quote-banner { padding-inline: 6%; }
  .book-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 26px 16px; }
  .book-detail { gap: 40px; }
  .studio { grid-template-columns: 1fr; }
  .studio-sidebar { position: static; grid-template-columns: 1fr; }
  .studio-nav { grid-auto-flow: column; grid-auto-columns: max-content; overflow-x: auto; }
  .studio-mark { padding-bottom: 12px; }
}
/* Compact header + slide-down menu for phones and tablets */
@media (max-width: 960px) {
  /* Mobile header: logo · account · menu button */
  .header-studio, .header-library { display: none; }
  .header-actions { gap: 8px; margin-left: auto; }
  .menu-toggle { order: 3; width: 42px; height: 42px; padding: 0; display: grid; place-content: center; gap: 5px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); box-shadow: 0 1px 2px #1b18340d; cursor: pointer; transition: border-color .2s, box-shadow .2s; }
  .menu-toggle span { display: block; width: 18px; height: 2px; margin: 0; border-radius: 2px; background: var(--ink); transition: transform .25s, opacity .2s; }
  .menu-toggle[aria-expanded="true"] { border-color: var(--line-strong); box-shadow: var(--shadow); }
  .menu-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .menu-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
  .menu-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  /* Slide-down menu sheet with dimmed page behind it */
  .main-nav { position: absolute; top: 100%; left: 0; right: 0; padding: 14px 16px 20px; display: flex; flex-direction: column; align-items: stretch; gap: 8px; background: var(--surface); border-bottom: 1px solid var(--line); border-radius: 0 0 22px 22px; box-shadow: 0 24px 40px -24px #1b183466; visibility: hidden; opacity: 0; transform: translateY(-10px); pointer-events: none; transition: opacity .22s, transform .25s cubic-bezier(.2,.8,.3,1), box-shadow .25s, visibility 0s .25s; }
  .main-nav.open { visibility: visible; opacity: 1; transform: none; pointer-events: auto; transition: opacity .22s, transform .25s cubic-bezier(.2,.8,.3,1), box-shadow .25s, visibility 0s; }
  .main-nav::after { content: ""; position: absolute; z-index: -1; left: 0; right: 0; top: 100%; height: 100vh; background: #1b183459; }
  .nav-title { display: block; margin: 2px 4px 4px; color: var(--muted); font-size: 11px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; }
  .main-nav a { min-height: 54px; padding: 0 14px; display: flex; align-items: center; gap: 14px; border-radius: 16px; font-size: 16px; }
  .main-nav a > span { flex: 1; }
  .nav-icon { display: grid; width: 22px; height: 22px; color: var(--brand); }
  .nav-chevron { display: block; width: 18px; height: 18px; color: var(--muted); }
  .main-nav a:hover, .main-nav a:focus-visible { transform: translateY(-2px); }
  .main-nav a:active { transform: scale(.98); box-shadow: none; }
  .main-nav a[aria-current="page"] .nav-icon, .main-nav a[aria-current="page"] .nav-chevron { color: #fff; }
  body.nav-open { overflow: hidden; }
  .trust-strip { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 24px; }
}
@media (max-width: 700px) {
  body { font-size: 14px; }
  .site-header { height: 66px; padding: 0 16px; gap: 10px; }
  .brand { width: 104px; }
  .header-link { font-size: 13px; }
  .header-library { display: none; }
  .profile-dropdown { position: fixed; top: 76px; left: 16px; right: 16px; width: auto; }
  .header-join, .header-studio { padding: 7px 12px; font-size: 12px; }
  .hero { display: flex; flex-direction: column; align-items: stretch; min-height: 0; padding: 44px 16px 64px; }
  .hero h1 { font-size: clamp(42px, 12vw, 60px); }
  .hero-description { font-size: 15px; }
  .hero-note { display: none; }
  .hero-art { height: min(90vw, 360px); min-height: 280px; margin-top: 12px; justify-self: stretch; max-width: none; }
  .scroll-cue { left: 16px; bottom: 20px; }
  .trust-strip { padding: 6px 16px; display: grid; grid-template-columns: 1fr; gap: 0; font-size: 15px; }
  .trust-strip span { padding: 12px 2px; gap: 14px; border-bottom: 1px solid var(--line); }
  .trust-strip span:last-child { border-bottom: 0; }
  .trust-strip .icon { width: 38px; height: 38px; padding: 9px; border-radius: 11px; background: var(--grad-soft); box-shadow: inset 0 0 0 1px var(--line); }
  .book-section { padding: 52px 16px 36px; }
  .shop-controls { flex-direction: column-reverse; align-items: stretch; gap: 12px; }
  .search-box { min-width: 0; }
  .book-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 12px; }
  .book-art { height: clamp(190px, 58vw, 250px); }
  .book-art img { width: 112px; height: 164px; }
  .book-info { flex-direction: column; gap: 4px; }
  .book-info h3 { font-size: 15px; }
  .section-bottom { flex-direction: column; gap: 6px; font-size: 12px; }
  .quote-banner { padding: 32px 16px; grid-template-columns: 1fr; }
  .quote-mark { font-size: 80px; }
  .quote-side { display: none; }
  .newsletter { margin: 48px 16px; padding: 36px 22px; grid-template-columns: 1fr; gap: 20px; }
  .site-footer { padding: 22px 16px; display: grid; grid-template-columns: auto 1fr; gap: 12px 16px; }
  .footer-nav { margin: 0; grid-column: 1 / -1; flex-wrap: wrap; gap: 14px; }
  .copyright { grid-column: 1 / -1; }
  .breadcrumbs { padding: 0 16px; }
  .book-detail { margin: 18px 0 44px; padding: 0 16px; grid-template-columns: 1fr; gap: 26px; }
  .detail-cover { min-height: 320px; }
  .detail-cover img { width: 180px; height: 264px; }
  .sample-teaser { margin: 0 16px 48px; padding: 30px 22px; grid-template-columns: 1fr; gap: 8px; }
  .reading-page, .content-page { padding: 0 16px; }
  .content-page { margin: 44px auto 64px; }
  .auth-page { padding: 36px 16px; grid-template-columns: 1fr; gap: 24px; }
  .form-card { padding: 24px 20px; }
  .guide-grid, .library-grid { grid-template-columns: 1fr; }
  .library-card { gap: 16px; padding: 14px; }
  .library-card > img { width: 84px; height: 120px; }
  .status-page { margin: 52px auto; }

  .studio { padding: 16px 16px 56px; gap: 18px; }
  .studio-head { flex-direction: column; align-items: flex-start; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .panel { padding: 18px 16px; }
  .admin-book { grid-template-columns: 48px minmax(0, 1fr); gap: 12px; }
  .admin-book > img { width: 48px; height: 68px; }
  .admin-actions { grid-column: 1 / -1; flex-wrap: wrap; }
  .admin-book-info h2 { white-space: normal; font-size: 16px; }
  .danger-zone, .form-footer { flex-direction: column; align-items: stretch; }
  .form-row { grid-template-columns: 1fr; gap: 8px; }
  .studio-toolbar { flex-direction: column; align-items: stretch; }
  .studio-search { min-width: 0; }
}
/* =========================================================
   Hero carousel (Studio-managed banners)
   ========================================================= */
.hero-carousel { position: relative; width: min(88%, 1560px); margin: 20px auto 0; overflow: hidden; border-radius: 30px; background: var(--ink-solid); box-shadow: var(--shadow-lg); isolation: isolate; }
/* Slides stack in one grid cell, so the box is exactly as tall as the banner image */
.slides { position: relative; display: grid; }
.slide { position: relative; grid-area: 1 / 1; display: flex; align-items: center; opacity: 0; visibility: hidden; transition: opacity .8s ease, visibility 0s linear .8s; }
.slide.is-active { opacity: 1; visibility: visible; transition: opacity .8s ease; z-index: 1; }
/* The banner image sets the size: shown edge to edge at its own proportions */
.slide-media { position: relative; width: 100%; height: 100%; overflow: hidden; }
.slide-img { display: block; width: 100%; height: 100%; object-fit: cover; transform: scale(1.03); transition: transform 7s ease-out; }
.slide.is-active .slide-img { transform: scale(1); }
.slide-shade { position: absolute; inset: 0; background: linear-gradient(90deg, #120d2fe6 0%, #1f1658b3 38%, #2a1f6b33 68%, transparent 100%), linear-gradient(0deg, #120d2f99, transparent 40%); }
.slide-copy { position: absolute; z-index: 1; inset: 0 auto 0 0; max-width: 620px; padding: 0 7%; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; color: #fff; }
.slide-copy .eyebrow { display: inline-block; padding: 6px 12px; border-radius: 999px; background: #ffffff22; color: #fff; backdrop-filter: blur(6px); }
.slide-copy h1, .slide-copy h2 { margin: 16px 0 14px; color: #fff; font-size: clamp(36px, 4.8vw, 66px); line-height: 1.04; letter-spacing: -.03em; text-wrap: balance; }
.slide-text { max-width: 480px; margin: 0; color: #e7e3ff; font-size: clamp(15px, 1.3vw, 18px); line-height: 1.65; }
.slide-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.slide.is-active .slide-copy > * { animation: rise .7s ease both; }
.slide.is-active .slide-copy > :nth-child(2) { animation-delay: .08s; }
.slide.is-active .slide-copy > :nth-child(3) { animation-delay: .16s; }
.slide.is-active .slide-copy > :nth-child(4) { animation-delay: .24s; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.button-light { background: #fff; color: #4b2fd1; box-shadow: 0 10px 24px -12px #000; }
.button-light:hover { transform: translateY(-1px); color: #7c3aed; }
.button-ghost { border-color: #ffffff66; background: #ffffff14; color: #fff; backdrop-filter: blur(6px); }
.button-ghost:hover { border-color: #fff; background: #ffffff26; }
.carousel-controls { position: absolute; z-index: 3; right: 28px; bottom: 26px; display: flex; align-items: center; gap: 8px; }
.carousel-btn { width: 42px; height: 42px; display: grid; place-items: center; border: 1px solid #ffffff4d; border-radius: 50%; background: #ffffff1f; color: #fff; cursor: pointer; backdrop-filter: blur(8px); transition: background .15s; }
.carousel-btn:hover { background: #ffffff40; }
.carousel-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.carousel-btn .i-play { display: none; fill: currentColor; }
.is-paused .carousel-btn .i-play { display: block; }
.is-paused .carousel-btn .i-pause { display: none; }
.carousel-dots { display: flex; gap: 6px; padding: 0 6px; }
.carousel-dots button { width: 9px; height: 9px; padding: 0; border: 0; border-radius: 999px; background: #ffffff66; cursor: pointer; transition: width .3s, background .3s; }
.carousel-dots button[aria-current="true"] { width: 28px; background: #fff; }
.carousel-progress { position: absolute; z-index: 3; left: 0; right: 0; bottom: 0; height: 3px; background: #ffffff1a; }
.carousel-progress span { display: block; width: 0; height: 100%; background: var(--grad); }
.is-timing .carousel-progress span { animation: progress var(--slide-delay, 6500ms) linear forwards; }
@keyframes progress { to { width: 100%; } }

/* Fallback hero: real covers from the catalogue */
.hero-stat { color: var(--muted); font-size: 14px; }
.hero-stat strong { font: 700 20px var(--display); background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-shelf { position: relative; width: 100%; max-width: 540px; height: 440px; justify-self: end; border-radius: 30px; background: var(--grad); box-shadow: var(--shadow-lg); overflow: hidden; }
.hero-shelf::before { content: ""; position: absolute; top: -80px; right: -60px; width: 300px; height: 300px; border-radius: 50%; background: #ffffff30; }
.hero-shelf-covers { position: absolute; inset: 40px 0 120px; display: flex; align-items: center; justify-content: center; }
.hero-cover { position: relative; display: block; width: 150px; transition: transform .3s; }
.hero-cover img { display: block; width: 100%; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 4px 10px 10px 4px; box-shadow: 0 24px 40px -14px #120d2fcc; }
.count-2 .hero-cover:first-child, .count-3 .hero-cover:first-child { z-index: 2; }
.count-2 .hero-cover:nth-child(2) { margin-left: -30px; transform: rotate(7deg) scale(.88); }
.count-3 .hero-cover:nth-child(2) { order: -1; margin-right: -36px; transform: rotate(-8deg) scale(.86); }
.count-3 .hero-cover:nth-child(3) { margin-left: -36px; transform: rotate(8deg) scale(.86); }
.hero-cover:hover { z-index: 3; transform: translateY(-8px) rotate(0) scale(1.02) !important; }
.hero-shelf-card { position: absolute; left: 20px; right: 20px; bottom: 20px; padding: 16px 18px; display: grid; gap: 2px; border-radius: 18px; background: var(--glass); backdrop-filter: blur(10px); transition: transform .15s; }
.hero-shelf-card:hover { transform: translateY(-2px); }
.hero-shelf-card strong { font: 600 18px var(--display); }
.hero-shelf-card small { color: var(--muted); font-size: 13px; }
.hero-mark { position: absolute; left: 50%; top: 46%; width: 140px; transform: translate(-50%, -50%); filter: brightness(0) invert(1); opacity: .95; }

/* =========================================================
   Shop toolbar: categories, search, price, sorting
   ========================================================= */
.shop-panel { margin-top: 26px; padding: 16px; display: grid; gap: 14px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow); }
.shop-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.shop-toolbar .search-box { flex: 1 1 280px; }
.segmented { display: inline-flex; padding: 4px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); }
.segmented label { position: relative; cursor: pointer; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented span { display: block; padding: 7px 14px; border-radius: 9px; color: var(--muted); font-size: 13px; font-weight: 600; transition: background .15s, color .15s; }
.segmented input:checked + span { background: var(--surface); color: var(--brand-dark); box-shadow: 0 1px 3px #1b183422; }
.segmented input:focus-visible + span { outline: 3px solid #8b3dff66; }
.sort-select { display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 6px 0 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.sort-select > span { color: var(--muted); font-size: 13px; white-space: nowrap; }
.sort-select select, .publish-form select, .tts-settings select { appearance: none; padding: 8px 30px 8px 10px; border: 0; border-radius: 9px; background: var(--soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236c4cf7' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 8px center / 14px; color: var(--brand-dark); font-size: 13px; font-weight: 600; cursor: pointer; }
.publish-form select { width: 100%; padding: 12px 34px 12px 14px; border: 1px solid var(--line-strong); border-radius: 12px; background-color: var(--field); color: var(--ink); font-size: 15px; font-weight: 400; }
.results-bar { margin-top: 22px; display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 14px; }
.results-bar p { margin: 0; }
.results-bar strong { color: var(--ink); }
.clear-link { color: var(--brand); font-size: 13px; font-weight: 600; }
.book-grid { padding-top: 18px; }
.book-badges { position: absolute; z-index: 1; top: 12px; left: 12px; display: flex; gap: 6px; }
.book-badges .book-tag { position: static; }
.book-tag-format { background: var(--ink-solid); color: #fff; }

/* =========================================================
   Studio: banners
   ========================================================= */
.banner-list { display: grid; gap: 12px; }
.banner-row { padding: 12px; display: grid; grid-template-columns: 220px minmax(0, 1fr) auto; gap: 18px; align-items: center; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); }
.banner-thumb { aspect-ratio: 16 / 7; overflow: hidden; border-radius: 12px; background: var(--soft); }
.banner-thumb img { width: 100%; height: 100%; object-fit: cover; }
.banner-row-info { min-width: 0; }
.banner-row-info h2 { margin: 4px 0; font-size: 18px; }
.banner-row-info > p:not(.eyebrow) { margin: 0 0 8px; color: var(--muted); font-size: 13px; }
.dropzone-wide { min-height: 220px; overflow: hidden; }
.dropzone-preview { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .28; pointer-events: none; }
.dropzone-preview[hidden] { display: none; }
.dropzone-wide > :not(img):not(input) { position: relative; }
.order-field { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.order-field label { margin: 0 !important; }
.order-field input { width: 90px !important; }

/* =========================================================
   Reader guide: listen player
   ========================================================= */
.tts-player { position: sticky; top: 92px; z-index: 5; margin-top: 30px; padding: 14px 16px; display: flex; align-items: center; gap: 16px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--glass); backdrop-filter: blur(10px); box-shadow: var(--shadow); }
.tts-player[hidden], .tts-section-btn[hidden], .tts-unsupported[hidden] { display: none; }
.tts-main { width: 52px; height: 52px; flex: 0 0 auto; display: grid; place-items: center; border: 0; border-radius: 50%; background: var(--grad); color: #fff; cursor: pointer; box-shadow: 0 10px 22px -10px #5b3df0; transition: transform .15s; }
.tts-main:hover { transform: scale(1.05); }
.tts-main svg { width: 22px; height: 22px; fill: currentColor; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.tts-main .i-play { margin-left: 3px; }
.tts-main .i-pause, .is-playing .tts-main .i-play { display: none; }
.is-playing .tts-main .i-pause { display: block; fill: none; }
.tts-info { flex: 1; min-width: 0; display: grid; gap: 2px; }
.tts-info strong { overflow: hidden; font: 600 16px var(--display); text-overflow: ellipsis; white-space: nowrap; }
.tts-info small { color: var(--muted); font-size: 13px; }
.tts-progress { height: 4px; margin-top: 6px; overflow: hidden; border-radius: 4px; background: var(--soft); }
.tts-progress span { display: block; width: 0; height: 100%; background: var(--grad); transition: width .4s ease; }
.tts-settings { display: flex; align-items: center; gap: 8px; }
.tts-voice select { max-width: 190px; }
.tts-icon { width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--text); cursor: pointer; }
.tts-icon:hover:not(:disabled) { border-color: var(--brand); color: var(--brand); }
.tts-icon:disabled { opacity: .4; cursor: default; }
.tts-icon svg { width: 16px; height: 16px; fill: currentColor; }
.tts-unsupported { margin-top: 24px; padding: 12px 16px; border-radius: 12px; background: var(--warn-bg); color: var(--warn); font-size: 14px; }
.guide-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.guide-card-lead { display: flex; align-items: center; gap: 12px; }
.guide-card-lead .section-icon { margin: 0; }
.guide-num { color: var(--muted); font-size: 14px; font-weight: 600; letter-spacing: .06em; }
.tts-section-btn { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--brand-dark); font-size: 12.5px; font-weight: 600; cursor: pointer; transition: border-color .15s, background .15s, color .15s; }
.tts-section-btn:hover { border-color: var(--brand); }
.tts-section-btn.is-active { border-color: transparent; background: var(--grad); color: #fff; }
.tts-section-btn svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.guide-grid article { transition: border-color .25s, box-shadow .25s, transform .25s; }
.guide-grid article.is-speaking { border-color: var(--brand); box-shadow: 0 0 0 4px #6c4cf71a, var(--shadow); transform: translateY(-2px); }

@media (max-width: 960px) {
  /* Banners: full image on top, text panel underneath */
  .hero-carousel { width: auto; aspect-ratio: auto; height: auto; margin: 14px 24px 0; }
  .slide { flex-direction: column; align-items: stretch; }
  .slide-media { height: auto; }
  .slide-img { height: auto; }
  .slide-shade { display: none; }
  .slide-copy { position: relative; inset: auto; max-width: none; padding: 24px 24px 84px; display: block; }
  .carousel-controls { left: 24px; right: auto; bottom: 22px; }
}
@media (max-width: 950px) {
  .banner-row { grid-template-columns: 160px minmax(0, 1fr); }
  .banner-row .admin-actions { grid-column: 1 / -1; }
}
@media (max-width: 700px) {
  .hero-carousel { width: auto; margin: 12px 12px 0; border-radius: 24px; }
  .slide-copy h1, .slide-copy h2 { margin: 12px 0 10px; font-size: clamp(28px, 8vw, 38px); }
  .slide-actions { margin-top: 20px; }
  .slide-actions .button { flex: 1 1 auto; }
  .carousel-controls { left: 22px; right: auto; bottom: 22px; }
  .carousel-btn { width: 38px; height: 38px; }
  .hero-shelf { height: 380px; max-width: none; justify-self: stretch; margin-top: 12px; }
  .hero-cover { width: 120px; }
  .shop-panel { padding: 12px; }
  .shop-toolbar { display: grid; grid-template-columns: 1fr 1fr; }
  .shop-toolbar .search-box { grid-column: 1 / -1; }
  .segmented { justify-content: space-between; }
  .segmented label { flex: 1; text-align: center; }
  .sort-select { justify-content: space-between; min-width: 0; }
  .sort-select select { max-width: 100%; min-width: 0; }
  .category-list { flex-wrap: nowrap; overflow-x: auto; margin: 0 -12px; padding: 0 12px 4px; scrollbar-width: none; }
  .category-chip { flex: 0 0 auto; }
  .banner-row { grid-template-columns: 1fr; }
  .tts-player { top: 74px; flex-wrap: wrap; }
  .tts-settings { width: 100%; }
  .tts-voice { flex: 1; min-width: 0; }
  .tts-voice select { width: 100%; max-width: none; }
  .order-field { margin-left: 0; }
}

/* =========================================================
   Mobile polish: shelf, empty state, quote, newsletter, footer
   ========================================================= */
@media (max-width: 700px) {
  /* Shelf heading: stacked, link underneath */
  .book-section { padding: 44px 16px 32px; }
  .section-heading { flex-direction: column; align-items: flex-start; gap: 12px; }
  .section-heading .section-icon { width: 40px; height: 40px; margin-bottom: 12px; }
  .section-heading h2 { font-size: 30px; }
  .section-heading .text-link { font-size: 14px; }

  /* Shop panel: chips row, search, then filter + sort side by side */
  .shop-panel { margin-top: 20px; padding: 12px; gap: 12px; border-radius: 18px; }
  .shop-toolbar { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
  .search-box { height: 46px; padding-left: 12px; }
  .search-box input { font-size: 16px; } /* 16px stops iOS zooming on focus */
  .segmented { height: 44px; padding: 3px; align-items: stretch; }
  .segmented span { height: 100%; padding: 0 6px; display: grid; place-items: center; font-size: 13px; }
  .sort-select { height: 44px; padding: 0 3px; }
  .sort-select > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .sort-select select { width: 100%; height: 38px; font-size: 13px; }
  .results-bar { margin-top: 16px; font-size: 14px; }

  /* Empty state: compact card instead of a big gap */
  .empty-state { margin-top: 16px; padding: 32px 20px; border: 1px dashed var(--line-strong); border-radius: 20px; background: var(--surface); }
  .empty-state h3 { font-size: 22px; }
  .empty-state p { margin: 0 auto; max-width: 300px; font-size: 14.5px; line-height: 1.6; }

  /* Quote: rounded card */
  .quote-banner { margin: 8px 16px 0; padding: 28px 22px 30px; min-height: 0; gap: 0; border-radius: 24px; }
  .quote-banner::after { width: 90%; height: 90%; inset: auto -30% -40% auto; }
  .quote-mark { font-size: 64px; line-height: .55; height: 30px; }
  .quote-banner blockquote { margin: 10px 0 10px; font-size: 24px; line-height: 1.3; }

  /* Newsletter: tighter, full-width action */
  .newsletter { margin: 28px 16px 40px; padding: 28px 22px; gap: 16px; border-radius: 24px; }
  .newsletter .section-icon { width: 40px; height: 40px; margin-bottom: 12px; }
  .newsletter h2 { font-size: 30px; }
  .newsletter > div:first-child > p:last-child { margin-top: 10px; }
  .newsletter-aside { gap: 16px; justify-items: stretch; }
  .newsletter-aside p { margin: 0; padding-top: 16px; border-top: 1px solid #6c4cf722; }
  .newsletter-aside .button { width: 100%; }
  .newsletter-art { display: none; }

  /* Footer: centered stack */
  .site-footer { padding: 32px 16px 24px; display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; }
  .footer-brand { width: 116px; }
  .site-footer > p { font-size: 14px; }
  .footer-nav { margin: 4px 0 0; width: 100%; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .footer-nav a { padding: 10px 6px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); font-size: 13px; }
  .footer-nav a:active { background: var(--soft); }
  .copyright { width: 100%; margin-top: 6px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 12px; }
}


/* Phones: Sign in / Join us live in the menu sheet, not the top bar */
@media (max-width: 700px) {
  .header-signin, .header-join { display: none; }
  .nav-auth { display: block; margin-top: 10px; padding-top: 14px; border-top: 1px solid var(--line); }
  .nav-auth .nav-title { margin-bottom: 10px; }
  .nav-auth-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  .main-nav .nav-auth a { min-height: 50px; padding: 0 14px; display: flex; align-items: center; justify-content: center; gap: 8px; border-radius: 14px; font-size: 15px; font-weight: 600; }
  .main-nav .nav-auth a:hover, .main-nav .nav-auth a:focus-visible { transform: translateY(-2px); }
  .main-nav .nav-auth-signin { border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); }
  .main-nav .nav-auth-join { border: 1px solid transparent; background: var(--grad); color: #fff; box-shadow: 0 10px 20px -12px #6c4cf7; }
  .main-nav .nav-auth-join:hover { color: #fff; }
  .main-nav .nav-auth a > span { flex: none; }
  .nav-auth-note { margin: 10px 2px 0; color: var(--muted); font-size: 12.5px; text-align: center; }
}


/* =========================================================
   Loading screen: the Veezol "V" draws itself, then fades away
   ========================================================= */
.page-loader { display: none; }
.show-loader body { overflow: hidden; }
.show-loader .page-loader { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; background: radial-gradient(circle at 50% 42%, #ffffff 0%, var(--bg) 55%, #eee9ff 100%); transition: opacity .5s ease, visibility 0s linear .5s; }
.page-loader.is-done { opacity: 0; visibility: hidden; }
.loader-stage { display: grid; justify-items: center; gap: 18px; }
.loader-mark { width: 116px; height: auto; overflow: visible; animation: loader-pop .9s cubic-bezier(.2,.8,.3,1.3) 1.05s both, loader-glow 1.6s ease-in-out 1.3s infinite alternate; }
.loader-stroke { stroke-dasharray: 1; stroke-dashoffset: 1; animation: loader-draw 1.1s cubic-bezier(.65,0,.35,1) .15s forwards; }
.loader-word { margin: 0; color: var(--ink); font: 500 22px/1 var(--display); letter-spacing: -.01em; opacity: 0; animation: loader-rise .6s ease 1.05s forwards; }
.loader-word em { font-style: normal; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.loader-bar { width: 120px; height: 3px; overflow: hidden; border-radius: 3px; background: var(--line); opacity: 0; animation: loader-rise .4s ease 1.2s forwards; }
.loader-bar span { display: block; width: 40%; height: 100%; border-radius: 3px; background: var(--grad); animation: loader-slide 1.1s ease-in-out infinite; }
@keyframes loader-draw { to { stroke-dashoffset: 0; } }
@keyframes loader-pop { 0% { transform: scale(1); } 40% { transform: scale(1.08); } 100% { transform: scale(1); } }
@keyframes loader-glow { from { filter: drop-shadow(0 8px 14px #8b3dff22); } to { filter: drop-shadow(0 10px 26px #8b3dff66); } }
@keyframes loader-rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes loader-slide { from { transform: translateX(-110%); } to { transform: translateX(260%); } }
@media (prefers-reduced-motion: reduce) {
  .loader-stroke { animation: none; stroke-dashoffset: 0; }
  .loader-mark, .loader-bar span { animation: none; }
  .loader-word, .loader-bar { animation: none; opacity: 1; }
}


/* =========================================================
   WhatsApp chat button: a round floating logo
   ========================================================= */
.whatsapp-fab { position: fixed; right: 22px; bottom: 22px; z-index: 60; width: 60px; height: 60px; display: grid; place-items: center; border-radius: 50%; background: var(--grad); color: #fff; box-shadow: 0 14px 30px -12px #6c4cf7cc, 0 2px 6px #1b18341f; transition: transform .2s cubic-bezier(.2,.8,.3,1.4), box-shadow .2s, filter .2s; }
.whatsapp-fab:hover { transform: translateY(-3px) scale(1.04); filter: brightness(1.06) saturate(1.1); box-shadow: 0 18px 34px -12px #6c4cf7, 0 2px 6px #1b18341f; }
.whatsapp-fab:active { transform: scale(.97); }
.whatsapp-fab:focus-visible { outline: 3px solid #8b3dff66; outline-offset: 3px; }
.whatsapp-fab .contact-wa { width: 32px; height: 32px; }
.studio-body .whatsapp-fab { display: none; }
@media (max-width: 700px) {
  .whatsapp-fab { right: 14px; bottom: calc(14px + env(safe-area-inset-bottom)); width: 56px; height: 56px; }
  .whatsapp-fab .contact-wa { width: 30px; height: 30px; }
}

.header-join, .header-studio, .header-link { white-space: nowrap; }

/* Narrow laptops: keep all nav buttons + account actions on one line */
@media (min-width: 961px) and (max-width: 1240px) {
  .site-header { padding: 0 2.5%; gap: 12px; }
  .brand { width: 104px; }
  .main-nav { gap: 5px; }
  .main-nav a { padding: 8px 12px; font-size: 13.5px; }
  .header-actions { gap: 10px; }
  .header-join { padding: 8px 14px; }
}
@media (min-width: 961px) and (max-width: 1060px) {
  .header-signin { display: none; }
}


/* =========================================================
   Announcements
   ========================================================= */
.nav-news { position: relative; }
.nav-dot { position: absolute; top: 6px; right: 8px; width: 8px; height: 8px; border-radius: 50%; background: #ff5a7a; box-shadow: 0 0 0 2px var(--surface); }
.main-nav a[aria-current="page"] .nav-dot { box-shadow: 0 0 0 2px #fff; background: #fff; }
.news-page .section-icon { display: grid; }
.news-list { margin-top: 34px; display: grid; gap: 16px; }
.news-card { position: relative; padding: 26px 28px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow); }
.news-card.is-pinned { border-color: transparent; background: linear-gradient(var(--surface), var(--surface)) padding-box, var(--grad) border-box; border: 1.5px solid transparent; }
.news-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.news-badge { padding: 3px 10px; display: inline-flex; align-items: center; gap: 5px; border-radius: 999px; font-size: 11.5px; font-weight: 600; letter-spacing: .03em; }
.news-badge .icon { width: 13px; height: 13px; }
.news-badge-pin { background: var(--soft); color: var(--brand-dark); }
.news-badge-new { background: var(--grad); color: #fff; }
.news-card h2 { margin: 10px 0 8px; font-size: clamp(22px, 2.4vw, 28px); line-height: 1.25; }
.news-body { color: var(--text); font-size: 15.5px; line-height: 1.75; }
.news-body p { margin: 0 0 10px; }
.news-link { margin-top: 8px; }
.news-row { grid-template-columns: minmax(0, 1fr) auto; }
.news-row.has-thumb { grid-template-columns: 160px minmax(0, 1fr) auto; }
.news-card.has-image { padding-top: 14px; }
.news-image { margin: 0 -14px 18px; overflow: hidden; border-radius: 16px; background: var(--soft); }
.news-image img { display: block; width: 100%; height: auto; max-height: 640px; object-fit: contain; }
.checkbox-line { margin-top: 12px !important; display: inline-flex; align-items: center; gap: 8px; font-weight: 500 !important; cursor: pointer; }
.checkbox-line input { width: 16px; height: 16px; accent-color: var(--brand); }
@media (max-width: 960px) {
  .nav-dot { position: static; margin-left: -6px; flex: 0 0 auto; }
}
@media (max-width: 700px) {
  .news-list { margin-top: 24px; gap: 12px; }
  .news-card { padding: 20px 18px; border-radius: 18px; }
  .news-row, .news-row.has-thumb { grid-template-columns: 1fr; }
  .news-card.has-image { padding-top: 10px; }
  .news-image { margin: 0 -8px 14px; border-radius: 12px; }
}


/* Homepage: latest 3 announcements */
.home-news { padding: 64px 8% 8px; }
.home-news .section-icon { display: grid; }
.home-news-grid { margin-top: 26px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; align-items: stretch; }
.home-news-card { display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow); transition: transform .2s, box-shadow .2s, border-color .2s; }
.home-news-card:hover, .home-news-card:focus-visible { transform: translateY(-4px); border-color: var(--line-strong); box-shadow: var(--shadow-lg); }
.home-news-img { display: block; aspect-ratio: 16 / 9; overflow: hidden; background: var(--soft); }
.home-news-img img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.home-news-card:hover .home-news-img img { transform: scale(1.03); }
.home-news-body { padding: 18px 20px 20px; display: flex; flex: 1; flex-direction: column; gap: 8px; }
.home-news-body .news-meta { min-height: 24px; }
.home-news-body strong { color: var(--ink); font: 500 20px/1.3 var(--display); }
.home-news-text { color: var(--muted); font-size: 14.5px; line-height: 1.65; }
.home-news-more { margin-top: auto; padding-top: 6px; color: var(--brand); font-size: 14px; font-weight: 600; }
.news-card { scroll-margin-top: 100px; }
@media (max-width: 900px) {
  .home-news-grid { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  .home-news { padding: 40px 16px 0; }
  .home-news .section-heading { flex-direction: column; align-items: flex-start; gap: 12px; }
  .home-news .section-icon { width: 40px; height: 40px; margin-bottom: 12px; }
  .home-news .section-heading h2 { font-size: 30px; }
  .home-news-grid { margin-top: 20px; grid-template-columns: 1fr; gap: 12px; }
  .home-news-card { border-radius: 18px; }
}


/* =========================================================
   Admin profiles, Meet the admins, following
   ========================================================= */
.admin-logo { width: 44px; height: 44px; flex: 0 0 auto; display: grid; place-items: center; overflow: hidden; border-radius: 50%; background: var(--grad); color: #fff; font: 600 18px/1 var(--display); }
.admin-logo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.admin-logo-xs { width: 22px; height: 22px; font-size: 11px; }
.admin-logo-sm { width: 30px; height: 30px; font-size: 13px; }
.admin-logo-lg { width: 76px; height: 76px; font-size: 30px; border: 4px solid var(--surface); box-shadow: 0 8px 20px -10px #1b183466; }
.admin-logo-xl { width: 128px; height: 128px; font-size: 52px; border: 5px solid var(--surface); box-shadow: 0 14px 30px -14px #1b183480; }

.home-admins { padding: 64px 8% 8px; }
.home-admins .section-icon { display: grid; }
.admin-grid { margin-top: 26px; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.admin-card { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow); transition: transform .2s, box-shadow .2s; }
.admin-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.admin-card-banner { display: block; height: 110px; background: var(--grad); }
.admin-card-banner img { width: 100%; height: 100%; object-fit: cover; display: block; }
.admin-card-body { padding: 0 20px 20px; }
.admin-card-body .admin-logo-lg { margin-top: -38px; }
.admin-card h3 { margin: 10px 0 2px; font-size: 20px; }
.admin-card h3 a:hover { color: var(--brand); }
.admin-card-role { margin: 0; color: var(--muted); font-size: 13px; }
.admin-card-bio { margin: 10px 0 0; color: var(--text); font-size: 14px; line-height: 1.6; }
.admin-card-actions { margin-top: 16px; display: flex; flex-wrap: wrap; gap: 8px; }
.follow-form { margin: 0; display: inline; }
.follow-btn { gap: 6px; }
.follow-btn .icon { width: 15px; height: 15px; stroke-width: 2.4; }
.follow-btn .unfollow-label { display: none; }
.follow-btn.is-following:hover { border-color: var(--danger); color: var(--danger); }
.follow-btn.is-following:hover .follow-label { display: none; }
.follow-btn.is-following:hover .unfollow-label { display: inline; }

.post-author { margin-bottom: 10px; display: inline-flex; align-items: center; gap: 9px; color: var(--ink); font-size: 14px; font-weight: 600; }
.post-author:hover { color: var(--brand); }
.home-news-author { display: inline-flex; align-items: center; gap: 7px; color: var(--text); font-size: 13px; font-weight: 600; }
.feed-tabs { margin-top: 22px; display: inline-flex; padding: 4px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.feed-tabs a { padding: 8px 16px; border-radius: 9px; color: var(--muted); font-size: 14px; font-weight: 600; }
.feed-tabs a[aria-current="page"] { background: var(--grad); color: #fff; box-shadow: 0 6px 14px -8px #6c4cf7; }

.profile-page { max-width: 1080px; margin: 24px auto 96px; padding: 0 24px; }
.profile-banner { aspect-ratio: 3 / 1; overflow: hidden; border-radius: 26px; background: var(--grad); box-shadow: var(--shadow); }
.profile-banner img { width: 100%; height: 100%; object-fit: cover; display: block; }
.profile-headline { margin-top: -64px; padding: 0 28px; display: flex; align-items: flex-start; gap: 20px; }
.profile-ident { flex: 1; min-width: 0; padding-top: 78px; }
.profile-ident h1 { margin: 0; font-size: clamp(28px, 3.4vw, 40px); }
.profile-role { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.profile-role strong { color: var(--ink); }
.profile-actions { padding-top: 84px; }
.profile-bio { max-width: 680px; margin: 18px 28px 0; color: var(--text); font-size: 16px; line-height: 1.7; }
.profile-posts { margin-top: 40px; }
.profile-posts > h2 { margin: 0; font-size: 26px; }
.profile-posts .news-list { margin-top: 18px; }

.profile-edit-row { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 20px; align-items: start; }
.logo-dropzone { min-height: 180px !important; }
.logo-dropzone .dropzone-preview { width: 96px !important; height: 96px !important; border-radius: 50%; object-fit: cover; }
.profile-edit-fields { display: grid; gap: 6px; }

@media (max-width: 700px) {
  .home-admins { padding: 40px 16px 0; }
  .home-admins .section-heading { flex-direction: column; align-items: flex-start; gap: 12px; }
  .home-admins .section-icon { width: 40px; height: 40px; margin-bottom: 12px; }
  .home-admins .section-heading h2 { font-size: 30px; }
  .admin-grid { margin-top: 20px; grid-template-columns: 1fr; gap: 12px; }
  .profile-page { margin-top: 12px; padding: 0 12px; }
  .profile-banner { border-radius: 18px; }
  .profile-headline { margin-top: -48px; padding: 0 12px; flex-wrap: wrap; gap: 12px; }
  .admin-logo-xl { width: 96px; height: 96px; font-size: 40px; }
  .profile-ident { flex-basis: 100%; padding-top: 0; }
  .profile-actions { padding-top: 0; }
  .profile-bio { margin: 14px 12px 0; font-size: 15px; }
  .profile-posts { margin-top: 28px; padding: 0 4px; }
  .profile-edit-row { grid-template-columns: 1fr; }
}


/* Posts: nav button, big plus, picture editing, gallery */
.main-nav .nav-posts { display: inline-flex; align-items: center; gap: 7px; }
.main-nav .nav-posts .nav-posts-icon { display: block; width: 17px; height: 17px; color: var(--brand); }
.main-nav .nav-posts[aria-current="page"] .nav-posts-icon { color: #fff; }
.plus-post { width: 60px; height: 60px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 50%; background: var(--grad); color: #fff; box-shadow: 0 14px 28px -12px #6c4cf7cc; transition: transform .2s cubic-bezier(.2,.8,.3,1.4), box-shadow .2s; }
.plus-post:hover { transform: translateY(-3px) rotate(90deg); box-shadow: 0 18px 32px -12px #6c4cf7; }
.plus-post svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; }
.post-pics-edit { margin-bottom: 14px; display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.post-pics-edit figure { margin: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.post-pics-edit img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.post-pics-edit figcaption { padding: 6px 8px; display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.post-pics-edit .checkbox-line { margin: 0 !important; font-size: 12.5px; }
.pic-tag { padding: 2px 8px; border-radius: 999px; background: var(--soft); color: var(--brand-dark); font-size: 11px; font-weight: 600; }
.multi-preview { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 8px; }
.multi-preview:empty { display: none; }
.multi-preview img { width: 84px; height: 64px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); }
.post-gallery { margin: 0 -14px 18px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; overflow: hidden; border-radius: 16px; }
.post-gallery-item { display: block; overflow: hidden; background: var(--soft); aspect-ratio: 1 / 1; }
.post-gallery-item img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .3s; }
.post-gallery-item:hover img { transform: scale(1.04); }
.post-gallery-item.is-cover { grid-column: 1 / -1; aspect-ratio: 16 / 9; }
.post-gallery.count-2 { grid-template-columns: 1fr; }
.post-gallery.count-2 .post-gallery-item:not(.is-cover) { aspect-ratio: 16 / 9; }
.post-gallery.count-3 { grid-template-columns: 1fr 1fr; }
@media (max-width: 960px) {
  .main-nav .nav-posts { display: flex; gap: 14px; }
  .main-nav .nav-posts .nav-posts-icon { width: 22px; height: 22px; }
}
@media (min-width: 961px) and (max-width: 1240px) {
  .header-library { display: none; }
}
@media (max-width: 700px) {
  .post-gallery { margin: 0 -8px 14px; border-radius: 12px; }
}

/* =========================================================
   Post videos
   ========================================================= */
.post-video { margin: 0 -14px 18px; overflow: hidden; border-radius: 16px; background: #0d0b1f; }
.post-video video { display: block; width: 100%; height: auto; max-height: 72vh; background: #0d0b1f; }
.post-video + .post-gallery, .post-video + .news-image { margin-top: -8px; }
.home-news-img { position: relative; }
.home-news-img video { display: block; width: 100%; height: 100%; object-fit: cover; background: #0d0b1f; pointer-events: none; }
.play-badge { position: absolute; left: 50%; top: 50%; width: 54px; height: 54px; display: grid; place-items: center; border-radius: 50%; background: var(--glass); color: var(--brand-dark); box-shadow: 0 10px 24px -10px #120d2fcc; transform: translate(-50%, -50%); transition: transform .2s; }
.play-badge svg { width: 22px; height: 22px; margin-left: 3px; fill: currentColor; }
.home-news-card:hover .play-badge { transform: translate(-50%, -50%) scale(1.08); }
.post-video-edit { margin: 0 0 14px; overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.post-video-edit video { display: block; width: 100%; max-height: 360px; background: #0d0b1f; }
.post-video-edit figcaption { padding: 8px 10px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.post-video-edit .checkbox-line { margin: 0 !important; font-size: 13px; }
.video-preview { width: 100%; max-height: 360px; margin-top: 10px; border-radius: 14px; background: #0d0b1f; }
.video-preview[hidden] { display: none; }
.publish-form.is-busy [data-busy-label] { opacity: .85; cursor: progress; }
@media (max-width: 700px) {
  .post-video { margin: 0 -8px 14px; border-radius: 12px; }
}

/* =========================================================
   Phone app bar (bottom tabs) + touch-friendly polish
   ========================================================= */
.tab-bar { display: none; }
.studio-nav { position: relative; }
html { -webkit-tap-highlight-color: transparent; -webkit-text-size-adjust: 100%; }
a, button, label, summary, select { touch-action: manipulation; }

/* Touch screens: no "stuck" hover lifts after a tap */
@media (hover: none) {
  .main-nav a:hover, .home-news-card:hover, .admin-card:hover, .hero-cover:hover,
  .button-dark:hover, .header-join:hover, .header-studio:hover, .google-button:hover, .hero-shelf-card:hover { transform: none; }
  .book-card:hover .book-art img, .home-news-card:hover .home-news-img img, .post-gallery-item:hover img { transform: none; }
  .home-news-card:hover .play-badge { transform: translate(-50%, -50%); }
  .plus-post:hover { transform: none; }
  .button:active, .home-news-card:active, .admin-card:active, .book-art:active, .category-chip:active { transform: scale(.98); }
}

@media (max-width: 700px) {
  :root { --tab-h: 64px; }
  body { padding-bottom: calc(var(--tab-h) + env(safe-area-inset-bottom)); }
  .studio-body { padding-bottom: calc(var(--tab-h) + env(safe-area-inset-bottom)); }
  .site-header { padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }

  /* Bottom tab bar */
  .tab-bar { position: fixed; z-index: 55; left: 0; right: 0; bottom: 0; height: calc(var(--tab-h) + env(safe-area-inset-bottom)); padding: 6px max(6px, env(safe-area-inset-left)) env(safe-area-inset-bottom) max(6px, env(safe-area-inset-right)); display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); align-items: stretch; border-top: 1px solid var(--line); background: var(--glass); backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px); box-shadow: 0 -10px 30px -22px #1b183466; transition: transform .25s ease; }
  .tab-bar a { position: relative; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; border-radius: 14px; color: var(--muted); font-size: 11px; font-weight: 600; letter-spacing: .01em; }
  .tab-bar a span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .tab-bar .icon { width: 24px; height: 24px; stroke-width: 1.8; transition: transform .2s; }
  .tab-bar a[aria-current="page"] { color: var(--brand-dark); }
  .tab-bar a[aria-current="page"]::before { content: ""; position: absolute; top: 4px; width: 46px; height: 30px; border-radius: 999px; background: var(--grad-soft); box-shadow: inset 0 0 0 1px var(--line); z-index: -1; }
  .tab-bar a[aria-current="page"] .icon { color: var(--brand); }
  .tab-bar a:active .icon { transform: scale(.88); }
  .tab-dot { position: absolute; top: 6px; left: calc(50% + 8px); width: 8px; height: 8px; border-radius: 50%; background: #ff5a7a; box-shadow: 0 0 0 2px var(--surface); }
  body.nav-open .tab-bar { transform: translateY(110%); }

  /* Keep the chat button clear of the tab bar */
  .whatsapp-fab { bottom: calc(var(--tab-h) + 14px + env(safe-area-inset-bottom)); width: 52px; height: 52px; }
  .whatsapp-fab .contact-wa { width: 28px; height: 28px; }

  /* Forms: 16px text so iOS doesn't zoom in, comfy touch targets */
  input:not([type=checkbox]):not([type=radio]):not([type=file]), textarea, select,
  .stack-form input, .publish-form input:not([type=checkbox]):not([type=file]), .publish-form textarea, .publish-form select, .studio-search input, .danger-input { font-size: 16px; }
  .button { min-height: 48px; }
  .button-small { min-height: 40px; }
  .icon-action { width: 40px; height: 40px; }
  .category-chip { min-height: 40px; }

  /* Dialogs slide up from the bottom like a native sheet */
  .confirm-dialog[open] { width: 100%; max-width: none; margin: auto 0 0; padding: 24px 20px calc(20px + env(safe-area-inset-bottom)); border-radius: 24px 24px 0 0; border-bottom: 0; animation: sheet-up .28s cubic-bezier(.2,.8,.3,1); }
  .confirm-actions { flex-direction: column-reverse; }
  .confirm-actions .button { width: 100%; }

  /* Account menu as a sheet under the header */
  .profile-dropdown { top: calc(66px + 8px); max-height: calc(100vh - 66px - var(--tab-h) - 24px); overflow-y: auto; border-radius: 20px; }
  .profile-dropdown a, .profile-signout, .avatar-form button { min-height: 46px; font-size: 15px; }

  /* Books: tighter, thumb-friendly cards */
  .book-grid { gap: 20px 12px; }
  .book-art { border-radius: 18px; }
  .book-meta { margin-top: 8px; }
  .add-button { padding: 6px 0; }

  /* Posts read like a social feed */
  .news-page .feed-tabs { display: flex; width: 100%; }
  .news-page .feed-tabs a { flex: 1; text-align: center; padding: 10px 12px; }
  .news-card h2 { font-size: 22px; }
  .news-body { font-size: 15.5px; }

  /* Studio: compact, sticky section strip under the header */
  .studio { padding-top: 0; }
  .studio-sidebar { position: sticky; top: 66px; z-index: 15; margin: 0 -16px; padding: 8px 0; gap: 0; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: var(--glass); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); box-shadow: none; }
  .studio-mark, .studio-back { display: none; }
  .studio-nav { gap: 6px; padding: 0 16px; scrollbar-width: none; scroll-snap-type: x proximity; -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 16px, #000 calc(100% - 24px), transparent); mask-image: linear-gradient(90deg, transparent 0, #000 16px, #000 calc(100% - 24px), transparent); }
  .studio-nav::-webkit-scrollbar { display: none; }
  .studio-nav a { padding: 8px 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); font-size: 13.5px; white-space: nowrap; scroll-snap-align: center; }
  .studio-nav a.active { border-color: transparent; }
  .studio-nav svg { width: 17px; height: 17px; }
  .studio-main { padding-top: 4px; }
  .studio-head { gap: 14px; margin-bottom: 18px; }
  .studio-head .plus-post { position: fixed; z-index: 50; right: 16px; bottom: calc(var(--tab-h) + 16px + env(safe-area-inset-bottom)); }
  .admin-actions .button, .admin-actions form { flex: 1 1 auto; }
  .admin-actions form .button { width: 100%; }
  .form-footer .button { width: 100%; }
  .dropzone { min-height: 150px; }
  .stat-card strong { font-size: 24px; }
}
/* =========================================================
   Hero banners: video slides + phone/tablet card layout
   ========================================================= */
.slide-video { object-fit: cover; background: #120d2f; }
.banner-thumb video { width: 100%; height: 100%; object-fit: cover; display: block; }
@media (max-width: 960px) {
  .hero-carousel { border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow); }
  .slide-media { aspect-ratio: auto; background: var(--soft); }
  .slide-img { width: 100%; height: auto; max-height: 62vh; object-fit: cover; transform: none !important; }
  .slide-copy { padding: 16px 18px 20px; color: var(--ink); }
  .slide-copy .eyebrow { padding: 5px 10px; background: var(--grad-soft); color: var(--brand-dark); font-size: 11px; backdrop-filter: none; box-shadow: inset 0 0 0 1px var(--line); }
  .slide-copy h1, .slide-copy h2 { margin: 10px 0 6px; color: var(--ink); font-size: clamp(22px, 5.6vw, 30px); line-height: 1.2; letter-spacing: -.02em; }
  .slide-copy .eyebrow + h1, .slide-copy .eyebrow + h2 { margin-top: 10px; }
  .slide-copy > h1:first-child, .slide-copy > h2:first-child { margin-top: 0; }
  .slide-text { color: var(--muted); font-size: 14.5px; line-height: 1.55; }
  .slide-actions { margin-top: 14px; gap: 8px; }
  .slide-actions .button { min-height: 46px; flex: 1 1 0; padding: 0 16px; border-radius: 14px; font-size: 14px; }
  .slide-actions .button-light { background: var(--grad); color: #fff; box-shadow: 0 10px 20px -12px #5b3df0; }
  .slide-actions .button-ghost { border-color: var(--line-strong); background: var(--surface); color: var(--brand-dark); backdrop-filter: none; }
  /* Dots + pause float as a small glass pill on the picture; swipe changes slides */
  .carousel-controls { top: 12px; right: 12px; bottom: auto; left: auto; gap: 2px; padding: 4px 4px 4px 8px; border-radius: 999px; background: #120d2f73; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
  .carousel-controls [data-carousel-prev], .carousel-controls [data-carousel-next] { display: none; }
  .carousel-btn { width: 30px; height: 30px; border: 0; background: transparent; }
  .carousel-btn svg { width: 14px; height: 14px; }
  .carousel-dots { padding: 0 4px; }
  .carousel-dots button { width: 7px; height: 7px; }
  .carousel-dots button[aria-current="true"] { width: 20px; }
  .carousel-progress { top: 0; bottom: auto; height: 3px; background: transparent; }
}
@media (max-width: 700px) {
  .hero-carousel { margin: 10px 12px 0; border-radius: 22px; }
  .slide-img { max-height: 56vh; }
}

@keyframes sheet-up { from { transform: translateY(40%); opacity: .4; } to { transform: none; opacity: 1; } }

/* =========================================================
   Sale events (brand colours)
   ========================================================= */
:root { --sale-a: #6c4cf7; --sale-b: #2bb8f5; --sale-grad: var(--grad); }

/* Site-wide ribbon above the header */
.sale-ribbon { position: relative; z-index: 21; display: block; overflow: hidden; background: var(--sale-grad); color: #fff; font-size: 13.5px; }
.sale-ribbon::after { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 30%, #ffffff2e 50%, transparent 70%); transform: translateX(-100%); animation: ribbon-shine 4.5s ease-in-out infinite; pointer-events: none; }
.sale-ribbon-inner { position: relative; z-index: 1; min-height: 40px; padding: 7px 5%; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px 14px; text-align: center; }
.sale-ribbon strong { font-weight: 700; letter-spacing: .01em; }
.sale-ribbon-deal { padding: 2px 10px; border-radius: 999px; background: #ffffff26; font-weight: 600; }
.sale-ribbon-timer { color: #ffffffd9; font-variant-numeric: tabular-nums; }
.sale-ribbon-timer span { color: #fff; font-weight: 700; }
.sale-ribbon-cta { padding: 3px 12px; border-radius: 999px; background: #fff; color: var(--sale-a); font-weight: 700; transition: transform .15s; }
a.sale-ribbon:hover .sale-ribbon-cta { transform: translateX(3px); }
.sale-ribbon.is-upcoming { background: var(--surface); color: var(--ink); border-bottom: 1px solid var(--line); }
.sale-ribbon.is-upcoming::after { display: none; }
.sale-ribbon.is-upcoming .sale-ribbon-deal { background: var(--soft); color: var(--sale-a); }
.sale-ribbon.is-upcoming .sale-ribbon-timer { color: var(--muted); }
.sale-ribbon.is-upcoming .sale-ribbon-timer span { color: var(--sale-a); }
@keyframes ribbon-shine { 0%, 55% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }

/* Prices on cards / book page */
.price-sale { display: inline-flex; flex-direction: column; align-items: flex-end; line-height: 1.15; }
.price-sale s { color: var(--muted); font-size: .82em; font-weight: 500; text-decoration-thickness: 1.5px; }
.price-sale strong { color: var(--sale-a, #c2255c); font-weight: 800; }
.book-card.is-on-sale .book-art { box-shadow: inset 0 0 0 2px var(--sale-a); }
.book-tag-sale { background: var(--sale-grad, var(--grad)); color: #fff; box-shadow: 0 6px 14px -6px var(--sale-a); animation: tag-pop 2.4s ease-in-out infinite; }
@keyframes tag-pop { 0%, 85%, 100% { transform: none; } 92% { transform: scale(1.12) rotate(-4deg); } }
.hero-shelf-card .price-sale { display: inline; }
.hero-shelf-card .price-sale strong { margin-left: 6px; }
.segmented-sale span { color: #c2255c; }
.segmented-sale input:checked + span { background: linear-gradient(120deg, #c2255c, #f06595); color: #fff; }

.sale-callout { margin: 20px 0 0; padding: 12px 16px; display: flex; align-items: center; gap: 12px; border-radius: 16px; background: var(--sale-grad); color: #fff; box-shadow: 0 14px 28px -18px var(--sale-a); }
.sale-callout div { display: grid; }
.sale-callout strong { font-size: 15px; }
.sale-callout small { color: #ffffffd9; font-size: 13px; font-variant-numeric: tabular-nums; }
.detail-price.is-sale .price-sale { flex-direction: row; align-items: baseline; gap: 14px; }
.detail-price.is-sale .price-sale s { font-size: 20px; }
.detail-price.is-sale .price-sale strong { font-size: 34px; color: #c2255c; }
.detail-save { margin-left: 4px; display: inline-block; padding: 3px 10px; border-radius: 999px; background: #fde8ef; color: #a61e4d; font: 700 12.5px var(--sans); font-style: normal; vertical-align: middle; }

/* =========================================================
   Studio: events & discounts
   ========================================================= */
.nav-live { margin-left: auto; padding: 2px 8px; border-radius: 999px; background: #e03131; color: #fff; font-size: 10.5px; font-weight: 700; letter-spacing: .04em; animation: live-pulse 1.6s ease-in-out infinite; }
.studio-nav a.active .nav-live { background: #fff; color: #e03131; }
@keyframes live-pulse { 50% { box-shadow: 0 0 0 4px #e0313133; } }
.studio-sale-banner { margin-bottom: 18px; padding: 14px 18px; display: flex; align-items: center; gap: 14px; border-radius: var(--radius-lg); background: var(--sale-grad); color: #fff; box-shadow: 0 16px 30px -20px var(--sale-a); transition: transform .15s; }
.studio-sale-banner:hover { transform: translateY(-2px); }
.studio-sale-banner > span { font-size: 28px; line-height: 1; }
.studio-sale-banner div { flex: 1; display: grid; min-width: 0; }
.studio-sale-banner small { color: #ffffffd9; font-size: 13px; }
.studio-sale-banner em { font-style: normal; font-weight: 700; white-space: nowrap; }
.studio-sale-banner.is-upcoming { background: var(--surface); color: var(--ink); border: 1px solid var(--line); box-shadow: var(--shadow); }
.studio-sale-banner.is-upcoming small { color: var(--muted); }
.studio-sale-banner.is-upcoming em { color: var(--sale-a); }

.event-list { display: grid; gap: 12px; }
.event-row { padding: 14px 16px; display: grid; grid-template-columns: 84px minmax(0, 1fr) auto; gap: 18px; align-items: center; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); transition: box-shadow .15s, border-color .15s; }
.event-row:hover { border-color: var(--line-strong); box-shadow: var(--shadow); }
.event-row.is-live { border-color: transparent; background: linear-gradient(var(--surface), var(--surface)) padding-box, var(--sale-grad) border-box; border: 2px solid transparent; }
.event-row.is-ended { opacity: .72; }
.event-badge { width: 84px; height: 84px; display: grid; place-content: center; justify-items: center; gap: 2px; border-radius: 20px; background: var(--sale-grad); color: #fff; box-shadow: 0 10px 20px -12px var(--sale-a); }
.event-badge span { font-size: 26px; line-height: 1; }
.event-badge strong { font: 800 20px/1 var(--display); }
.event-info { min-width: 0; }
.event-title { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.event-title h2 { margin: 0; font-size: 18px; }
.event-when { margin: 4px 0 8px; color: var(--muted); font-size: 13px; }
.event-status-live { background: var(--ok-bg); color: var(--ok); }
.event-status-live::before { animation: live-dot 1.2s ease-in-out infinite; }
.event-status-scheduled { background: #e8ecff; color: #3b4bc8; }
.event-status-paused { background: var(--warn-bg); color: var(--warn); }
.event-status-ended { background: #eeedf4; color: #5d5a73; }
@keyframes live-dot { 50% { opacity: .3; } }
.event-progress { height: 6px; margin-top: 10px; overflow: hidden; border-radius: 6px; background: var(--soft); }
.event-progress span { display: block; height: 100%; border-radius: 6px; background: var(--sale-grad); }
.event-help { margin-top: 22px; }
.event-help ul { margin: 10px 0 0; padding-left: 18px; display: grid; gap: 8px; color: var(--muted); font-size: 14px; line-height: 1.6; }
.event-help strong { color: var(--ink); }
.order-sale { display: block; margin-top: 2px; color: #c2255c; font-size: 11.5px; font-weight: 600; }

/* Event form */
.discount-row { display: flex; align-items: center; gap: 18px; }
.discount-range { flex: 1; height: 8px; appearance: none; -webkit-appearance: none; border-radius: 8px; background: linear-gradient(90deg, var(--violet), var(--sky)) 0 0 / var(--fill, 22%) 100% no-repeat, var(--soft); cursor: pointer; }
.discount-range::-webkit-slider-thumb { -webkit-appearance: none; width: 26px; height: 26px; border: 4px solid #fff; border-radius: 50%; background: var(--brand); box-shadow: 0 4px 12px -2px #4b2fd188; }
.discount-range::-moz-range-thumb { width: 20px; height: 20px; border: 4px solid #fff; border-radius: 50%; background: var(--brand); box-shadow: 0 4px 12px -2px #4b2fd188; }
.discount-input { display: flex; align-items: center; gap: 8px; }
.discount-input input { width: 92px !important; font: 700 20px var(--display) !important; text-align: center; }
.discount-input span { color: var(--muted); font-weight: 600; white-space: nowrap; }
.discount-chips { margin-top: 6px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.discount-chips button { padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--text); font-size: 13px; font-weight: 600; cursor: pointer; transition: border-color .15s, color .15s, background .15s; }
.discount-chips button:hover { border-color: var(--brand); color: var(--brand); }
.discount-chips button.is-active { border-color: transparent; background: var(--grad); color: #fff; }
.chips-label { margin-right: 4px; color: var(--muted); font-size: 13px; }
.discount-preview { margin-top: 10px; padding: 14px 16px; display: flex; align-items: center; gap: 16px; border: 1px dashed var(--line-strong); border-radius: 16px; background: var(--grad-soft); }
.discount-preview img { width: 48px; height: 70px; object-fit: cover; border-radius: 3px 7px 7px 3px; box-shadow: 4px 6px 12px -6px #2a1f6b66; }
.discount-preview small { color: var(--muted); font-size: 12.5px; }
.discount-preview p { margin: 2px 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px; }
.discount-preview s { color: var(--muted); font-size: 15px; }
.discount-preview strong { color: #c2255c; font: 800 24px var(--display); }
.discount-preview em { color: var(--ok); font-size: 13px; font-style: normal; font-weight: 600; }
.form-hint.is-error { color: var(--danger); font-weight: 600; }
.scope-picker { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.scope-option { margin: 0 !important; position: relative; cursor: pointer; }
.scope-option input { position: absolute; opacity: 0; pointer-events: none; }
.scope-option > span { height: 100%; padding: 14px 16px 14px 46px; display: grid; gap: 2px; border: 2px solid var(--line); border-radius: 16px; background: var(--surface); transition: border-color .15s, box-shadow .15s; }
.scope-option > span::before { content: ""; position: absolute; top: 17px; left: 16px; width: 18px; height: 18px; border: 2px solid var(--line-strong); border-radius: 50%; background: var(--surface); transition: border .15s; }
.scope-option input:checked + span { border-color: var(--brand); box-shadow: 0 0 0 4px #6c4cf71a; }
.scope-option input:checked + span::before { border: 6px solid var(--brand); }
.scope-option input:focus-visible + span { outline: 3px solid #8b3dff66; outline-offset: 2px; }
.scope-option b { color: var(--ink); font-size: 14.5px; }
.scope-option small { color: var(--muted); font-size: 12.5px; font-weight: 400; }
.book-picker { margin-top: 6px; }
.book-picker[hidden] { display: none; }
.book-picker-search { margin-bottom: 10px; }
.book-picker-grid { max-height: 420px; overflow-y: auto; padding: 2px; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.book-pick { margin: 0 !important; padding: 8px 10px; display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); cursor: pointer; transition: border-color .15s, background .15s; }
.book-pick[hidden] { display: none; }
.book-pick:hover { border-color: var(--line-strong); }
.book-pick:has(input:checked) { border-color: var(--brand); background: var(--soft); }
.book-pick input { width: 18px; height: 18px; flex: 0 0 auto; accent-color: var(--brand); }
.book-pick img { width: 34px; height: 48px; flex: 0 0 auto; object-fit: cover; border-radius: 2px 5px 5px 2px; }
.book-pick span { min-width: 0; display: grid; }
.book-pick b { overflow: hidden; color: var(--ink); font-size: 13.5px; text-overflow: ellipsis; white-space: nowrap; }
.book-pick small { color: var(--muted); font-size: 12px; font-weight: 400; }
.sale-chip { background: var(--sale-grad); color: #fff; }

@media (max-width: 960px) {
}
@media (max-width: 700px) {
  .sale-ribbon { font-size: 12.5px; }
  .sale-ribbon-inner { min-height: 36px; padding: 6px 12px; gap: 4px 10px; }
  .sale-ribbon-cta, .sale-ribbon.is-upcoming .sale-ribbon-deal { display: none; }
  .price-sale { align-items: flex-start; }
  .detail-price.is-sale .price-sale strong { font-size: 30px; }
  .event-row { grid-template-columns: 64px minmax(0, 1fr); gap: 12px; }
  .event-badge { width: 64px; height: 64px; border-radius: 16px; }
  .event-badge span { font-size: 20px; }
  .event-badge strong { font-size: 16px; }
  .event-row .admin-actions { grid-column: 1 / -1; flex-wrap: wrap; }
  .studio-sale-banner { align-items: flex-start; }
  .studio-sale-banner em { display: none; }
  .scope-picker { grid-template-columns: 1fr; }
  .discount-row { flex-direction: column; align-items: stretch; gap: 12px; }
  .discount-input { justify-content: center; }
  .book-picker-grid { grid-template-columns: 1fr; max-height: 360px; }
}

/* =========================================================
   Interface polish (desktop + phones)
   ========================================================= */
body { background:
  radial-gradient(1100px 520px at 105% -8%, #efe4ff 0, transparent 60%),
  radial-gradient(900px 480px at -8% 6%, #e1f3ff 0, transparent 58%),
  var(--bg); }
::selection { background: #8b3dff2e; color: var(--ink); }
/* Slim brand scrollbars on Windows (Chrome / Edge) and Firefox */
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { border: 3px solid transparent; border-radius: 999px; background: linear-gradient(var(--violet), var(--sky)) padding-box; }
::-webkit-scrollbar-thumb:hover { border-width: 2px; }
@supports not selector(::-webkit-scrollbar) { html { scrollbar-width: thin; scrollbar-color: #a48cf5 transparent; } }

.site-header { transition: box-shadow .25s, background .25s; }
.site-header.is-scrolled { background: var(--glass); box-shadow: 0 12px 30px -22px #3b2a9466; }

/* Scroll-in reveal (added by store.js, so pages still show everything without JS) */
.will-reveal { opacity: 0; translate: 0 18px; transition: opacity .6s ease var(--reveal-delay, 0ms), translate .6s cubic-bezier(.2,.8,.3,1) var(--reveal-delay, 0ms); }
.will-reveal.is-revealed { opacity: 1; translate: none; }

@media (hover: hover) {
  .book-art::after { content: ""; position: absolute; inset: 0; background: linear-gradient(115deg, transparent 35%, #ffffff66 50%, transparent 65%); transform: translateX(-120%); transition: transform .8s ease; pointer-events: none; }
  .book-card:hover .book-art::after { transform: translateX(120%); }
  .book-card:hover .book-art { box-shadow: var(--shadow-lg); }
  .book-card.is-on-sale:hover .book-art { box-shadow: inset 0 0 0 2px var(--sale-a), 0 20px 40px -22px var(--sale-a); }
  .stat-card { transition: transform .2s, box-shadow .2s; }
  .stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
  .category-chip:hover { transform: translateY(-1px); }
}
.category-chip { transition: border-color .15s, color .15s, transform .15s; }
.panel, .admin-book, .banner-row { box-shadow: 0 1px 2px #1b18340a; }

@media (max-width: 700px) {
  /* Phones: glassy header, tactile cards */
  .site-header { background: var(--glass); }
  .book-art { box-shadow: 0 10px 24px -20px #3b2a94; }
  .book-card:active .book-art img { transform: scale(.97); }
  .tab-bar a[aria-current="page"]::before { background: linear-gradient(135deg, #ece2ff, #dff2ff); }
}

@media (prefers-reduced-motion: reduce) {
  .will-reveal { opacity: 1; translate: none; }
  .sale-ribbon::after { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation: none !important; }
}

/* =========================================================
   Privacy policy + terms
   ========================================================= */
.legal-page { max-width: 820px; }
.legal-updated { margin: 0 0 6px; color: var(--muted); font-size: 13.5px; }
.legal-toc { margin: 26px 0 8px; display: flex; flex-wrap: wrap; gap: 8px; }
.legal-toc a { padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--text); font-size: 13px; font-weight: 600; transition: border-color .15s, color .15s; }
.legal-toc a:hover { border-color: var(--brand); color: var(--brand); }
.legal-page section { margin-top: 18px; padding: 24px 28px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); scroll-margin-top: 100px; }
.legal-page h2 { margin: 0 0 10px; font-size: 21px; }
.legal-page section p, .legal-page section li { color: var(--text); font-size: 15px; line-height: 1.75; }
.legal-page section p { margin: 0 0 10px; }
.legal-page section p:last-child { margin-bottom: 0; }
.legal-page ul { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
.legal-page section a { color: var(--brand); text-decoration: underline; text-underline-offset: 3px; }
.legal-see-also { padding-top: 12px; border-top: 1px solid var(--line); color: var(--muted) !important; font-size: 14px !important; }
.auth-legal { margin: 16px 0 0; color: var(--muted); font-size: 12.5px; line-height: 1.6; }
.auth-legal a { color: var(--brand); font-weight: 600; }
@media (max-width: 700px) {
  .legal-page section { padding: 18px 16px; border-radius: 18px; }
  .legal-page h2 { font-size: 19px; }
  .footer-nav { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}


/* Upload progress overlay on Studio forms (posts, banners, books) */
.upload-progress { position: fixed; inset: 0; z-index: 95; display: grid; place-items: center; padding: 20px; background: #1b183466; backdrop-filter: blur(3px); }
.upload-progress[hidden] { display: none; }
.upload-card { width: min(420px, 100%); padding: 24px; border-radius: 20px; background: var(--surface); box-shadow: var(--shadow-lg); }
.upload-card h2 { margin: 0 0 4px; font-size: 18px; }
.upload-card p { margin: 0; color: var(--muted); font-size: 13.5px; }
.upload-pct { margin: 18px 0 8px; display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.upload-pct strong { font: 700 34px/1 var(--display); font-variant-numeric: tabular-nums; }
.upload-pct span { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.upload-track { height: 10px; border-radius: 999px; background: var(--soft); overflow: hidden; }
.upload-track i { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--grad); transition: width .2s; }
.upload-card.is-processing .upload-track i { width: 100% !important; background-size: 200% 100%; animation: upload-shimmer 1.2s linear infinite; }
@keyframes upload-shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }
.upload-files { margin: 14px 0 0; padding: 0; list-style: none; display: grid; gap: 4px; color: var(--text); font-size: 12.5px; }
.upload-files li { display: flex; justify-content: space-between; gap: 10px; }
.upload-files li span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upload-card .button { margin-top: 16px; width: 100%; }
.upload-card.is-error .upload-track i { background: var(--danger); }

/* =========================================================
   App shell: site sidebar (desktop panel / icon rail, mobile drawer) + header search
   ========================================================= */
:root { --sb-w: 264px; --sb-rail: 76px; }
.app-sidebar { position: fixed; top: 0; bottom: 0; left: 0; z-index: 45; width: var(--sb-w); display: flex; flex-direction: column; gap: 10px; padding: 16px 10px 12px; border-right: 1px solid var(--line); background: var(--surface); transition: width .25s cubic-bezier(.2, .8, .3, 1), transform .3s cubic-bezier(.2, .8, .3, 1), box-shadow .3s; }
.sb-top { display: flex; align-items: center; gap: 6px; min-height: 46px; padding: 0 2px 0 10px; }
.sb-brand { flex: 1; min-width: 0; display: flex; align-items: center; }
.sb-logo { width: 122px; height: auto; display: block; }
.sb-mark { display: none; width: 36px; height: 36px; padding: 5px; border-radius: 11px; background: var(--soft); object-fit: contain; }
.sb-icon-btn { width: 34px; height: 34px; flex: 0 0 auto; display: grid; place-items: center; padding: 0; border: 0; border-radius: 10px; background: transparent; color: var(--muted); cursor: pointer; transition: background .15s, color .15s; }
.sb-icon-btn:hover, .sb-icon-btn:focus-visible { background: var(--soft); color: var(--brand-dark); }
.sb-icon-btn svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sb-close { display: none; }
.sb-search { position: relative; display: flex; align-items: center; margin: 2px 2px 0; }
.sb-search svg { position: absolute; left: 12px; width: 17px; height: 17px; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; pointer-events: none; }
.sb-search input { width: 100%; height: 40px; padding: 0 12px 0 38px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); color: var(--ink); font-size: 14px; transition: border-color .15s, box-shadow .15s, background .15s; }
.sb-search input:focus { outline: 0; border-color: var(--brand); background: var(--surface); box-shadow: 0 0 0 4px #6c4cf71a; }
.sb-scroll { flex: 1; min-height: 0; overflow-x: hidden; overflow-y: auto; padding: 0 2px 8px; scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
.sb-label { margin: 18px 12px 6px; color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; white-space: nowrap; }
.sb-link { position: relative; display: flex; align-items: center; gap: 12px; min-height: 40px; margin-bottom: 2px; padding: 0 10px; border-radius: 11px; color: var(--text); font-size: 14px; font-weight: 500; white-space: nowrap; transition: background .15s, color .15s; }
.sb-link:hover { background: var(--soft); color: var(--brand-dark); }
.sb-link:focus-visible { outline: 3px solid #8b3dff55; outline-offset: -2px; }
.sb-link[aria-current="page"] { background: var(--grad); color: #fff; box-shadow: 0 8px 18px -10px #5b3df0; }
.sb-icon { width: 20px; height: 20px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sb-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.sb-count { min-width: 24px; padding: 1px 7px; border-radius: 999px; background: var(--soft); color: var(--muted); font-size: 11.5px; font-weight: 600; font-variant-numeric: tabular-nums; text-align: center; }
.sb-link[aria-current="page"] .sb-count { background: #ffffff33; color: #fff; }
.sb-dot { width: 8px; height: 8px; flex: 0 0 auto; border-radius: 50%; background: #ff5d7a; box-shadow: 0 0 0 3px #ff5d7a33; }
.sb-live { padding: 1px 7px; border-radius: 999px; background: var(--danger); color: #fff; font-size: 10px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.sb-cat-dot { display: grid; place-items: center; border-radius: 7px; background: var(--grad-soft); color: var(--brand-dark); font-size: 11px; font-weight: 700; box-shadow: inset 0 0 0 1px var(--line); }
.sb-link[aria-current="page"] .sb-cat-dot { background: #ffffff33; color: #fff; box-shadow: none; }
.sb-foot { display: grid; gap: 6px; padding: 10px 2px 0; border-top: 1px solid var(--line); }
.sb-help { margin: 0; color: var(--muted); }
.sb-user { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 14px; background: var(--bg); box-shadow: inset 0 0 0 1px var(--line); }
.sb-avatar { width: 36px !important; height: 36px !important; flex: 0 0 auto; font-size: 14px; }
.sb-user-text { flex: 1; min-width: 0; display: grid; }
.sb-user-text strong { overflow: hidden; font-size: 13.5px; text-overflow: ellipsis; white-space: nowrap; }
.sb-user-text small { overflow: hidden; color: var(--muted); font-size: 11.5px; text-overflow: ellipsis; white-space: nowrap; }
.sb-auth { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.sb-auth .button { min-height: 40px; padding: 0 10px; }
.sb-backdrop { display: none; }

.header-search { position: relative; flex: 1; max-width: 560px; display: flex; align-items: center; }
.header-search svg { position: absolute; left: 16px; width: 18px; height: 18px; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; pointer-events: none; }
.header-search input { width: 100%; height: 46px; padding: 0 48px 0 46px; border: 1px solid var(--line); border-radius: 999px; background: var(--bg); color: var(--ink); font-size: 14.5px; transition: border-color .15s, box-shadow .15s, background .15s; }
.header-search input::placeholder { color: #8f8ba6; }
.header-search input:focus { outline: 0; border-color: var(--brand); background: var(--surface); box-shadow: 0 0 0 4px #6c4cf71a; }
.header-search kbd { position: absolute; right: 14px; padding: 1px 8px; border: 1px solid var(--line-strong); border-radius: 7px; background: var(--surface); color: var(--muted); font: 600 11.5px var(--sans); pointer-events: none; transition: opacity .15s; }
.header-search input:focus ~ kbd, .header-search input:not(:placeholder-shown) ~ kbd { opacity: 0; }

/* Studio pages now use the site sidebar instead of their own. */
.studio { grid-template-columns: minmax(0, 1fr); max-width: 1360px; padding-top: 26px; }

/* ---------- desktop: fixed panel that collapses to an icon rail ---------- */
@media (min-width: 1100px) {
  body.has-sidebar { padding-left: var(--sb-w); transition: padding-left .25s cubic-bezier(.2, .8, .3, 1); }
  .site-header { justify-content: flex-start; padding: 0 clamp(20px, 3vw, 40px); }
  .site-header .brand, .site-header .menu-toggle { display: none !important; }
  .site-header .header-actions { margin-left: auto; }

  .sb-collapsed body.has-sidebar, body.has-sidebar.bookstudio-app { padding-left: var(--sb-rail); }
  .sb-collapsed .app-sidebar, .bookstudio-app .app-sidebar { width: var(--sb-rail); padding-left: 10px; padding-right: 10px; }
  :is(.sb-collapsed, .bookstudio-app) .sb-top { flex-direction: column; padding: 0; gap: 8px; }
  :is(.sb-collapsed, .bookstudio-app) .sb-brand { flex: 0 0 auto; }
  :is(.sb-collapsed, .bookstudio-app) .sb-logo { display: none; }
  :is(.sb-collapsed, .bookstudio-app) .sb-mark { display: block; }
  :is(.sb-collapsed, .bookstudio-app) .sb-collapse svg { transform: scaleX(-1); }
  .bookstudio-app .sb-collapse { display: none; }
  :is(.sb-collapsed, .bookstudio-app) .sb-search { justify-content: center; cursor: pointer; }
  :is(.sb-collapsed, .bookstudio-app) .sb-search input { width: 44px; padding: 0; color: transparent; cursor: pointer; }
  :is(.sb-collapsed, .bookstudio-app) .sb-search input::placeholder { color: transparent; }
  :is(.sb-collapsed, .bookstudio-app) .sb-search svg { left: 50%; transform: translateX(-50%); }
  :is(.sb-collapsed, .bookstudio-app) .sb-label { height: 1px; margin: 14px 10px; overflow: hidden; background: var(--line); color: transparent; }
  :is(.sb-collapsed, .bookstudio-app) .sb-link { justify-content: center; padding: 0; }
  :is(.sb-collapsed, .bookstudio-app) :is(.sb-text, .sb-count, .sb-live, .sb-user-text, .sb-auth) { display: none; }
  :is(.sb-collapsed, .bookstudio-app) .sb-dot { position: absolute; top: 7px; right: 14px; }
  :is(.sb-collapsed, .bookstudio-app) .sb-user { flex-direction: column; padding: 6px 0; background: transparent; box-shadow: none; }
  /* Labels appear as tooltips beside the icons in the rail. */
  :is(.sb-collapsed, .bookstudio-app) .sb-link[data-tip]:hover::after,
  :is(.sb-collapsed, .bookstudio-app) .sb-link[data-tip]:focus-visible::after {
    content: attr(data-tip); position: fixed; left: calc(var(--sb-rail) + 6px); z-index: 80; padding: 6px 10px; border-radius: 8px;
    background: #1b1834; color: #fff; font-size: 12.5px; font-weight: 500; white-space: nowrap; box-shadow: 0 10px 24px -10px #1b1834aa; pointer-events: none;
  }
}

/* ---------- tablets & phones: slide-out drawer ---------- */
@media (max-width: 1099px) {
  .app-sidebar { z-index: 70; width: min(312px, 86vw); padding-top: max(14px, env(safe-area-inset-top)); transform: translateX(-104%); }
  body.sidebar-open .app-sidebar { transform: none; box-shadow: 24px 0 60px -20px #1b183477; }
  .sb-backdrop { position: fixed; inset: 0; z-index: 65; display: block; background: #1b183466; backdrop-filter: blur(2px); opacity: 0; pointer-events: none; transition: opacity .25s; }
  body.sidebar-open .sb-backdrop { opacity: 1; pointer-events: auto; }
  body.sidebar-open { overflow: hidden; }
  .sb-collapse { display: none; }
  .sb-close { display: grid; }
  .site-header .menu-toggle { order: -1; width: 42px; height: 42px; flex: 0 0 auto; padding: 0; display: grid !important; place-content: center; gap: 5px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); box-shadow: 0 1px 2px #1b18340d; cursor: pointer; }
  .site-header .menu-toggle span { display: block; width: 18px; height: 2px; border-radius: 2px; background: var(--ink); }
  .site-header { justify-content: flex-start; }
  .site-header .header-actions { margin-left: auto; }
  .header-search { max-width: 420px; }
}
@media (max-width: 700px) {
  .header-search { display: none; }
}

/* Book Studio focus mode hides the sidebar too. */
.is-focus-mode .app-sidebar { display: none; }
body.has-sidebar.is-focus-mode { padding-left: 0 !important; }
@media print { .app-sidebar, .sb-backdrop { display: none !important; } body.has-sidebar { padding-left: 0 !important; } }

/* Hero slides never get shorter than their text (e.g. a video banner before it loads). */
.slide { min-height: clamp(300px, 30vw, 520px); }
.slide-media { min-height: inherit; }
@media (max-width: 960px) { .slide { min-height: 0; } }

/* Password help & email settings */
.label-row { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-top: 8px; }
.label-row label { margin-top: 0 !important; }
.forgot-link { color: var(--brand); font-size: 13px; font-weight: 600; }
.forgot-link:hover { text-decoration: underline; }
.code-input { font: 600 24px/1 var(--display) !important; letter-spacing: .45em; text-align: center; font-variant-numeric: tabular-nums; }
.resend-form { margin: 0; }
.link-button { padding: 0; border: 0; background: none; color: var(--brand); font: inherit; font-weight: 600; cursor: pointer; }
.link-button:hover { text-decoration: underline; }
[data-match-hint].is-ok { color: var(--ok); }
[data-match-hint].is-bad { color: var(--danger); }
.prefs-page { max-width: 720px; margin: 0 auto; padding: 48px 24px 80px; }
.prefs-page h1 { margin: 8px 0 10px; font-size: clamp(32px, 4vw, 44px); }
.prefs-card { display: grid; gap: 22px; margin-top: 22px; padding: 26px; }
.prefs-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; padding-top: 18px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.prefs-center { display: grid; justify-items: center; text-align: center; padding-top: 80px; }
.prefs-center form { margin: 0; }

/* =========================================================
   Veezol 2026 polish — compact sidebar, floating icon rail, calmer cards
   ========================================================= */
:root {
  --bg: #f6f6fb; --line: #ebe9f4; --line-strong: #d9d5ec; --soft: #f2effd;
  --grad-nav: linear-gradient(100deg, #7c3aed 0%, #6366f1 60%, #4f8df7 100%);
  --sb-w: 240px; --sb-rail: 72px;
  --radius-lg: 18px;
  --card-shadow: 0 1px 2px #1b18340a, 0 6px 20px -14px #3b2a9433;
}
.panel, .stat-card { border-color: var(--line); box-shadow: var(--card-shadow); }

/* Sidebar */
.app-sidebar { padding: 18px 12px 12px; gap: 6px; }
.sb-logo { width: 112px; }
.sb-label { margin: 16px 12px 6px; font-size: 10.5px; letter-spacing: .1em; color: #8b88a3; }
.sb-link { min-height: 38px; gap: 11px; padding: 0 12px; border-radius: 10px; font-size: 13.5px; color: #3b3858; }
.sb-icon { width: 18px; height: 18px; }
.sb-link[aria-current="page"] { background: var(--grad-nav); box-shadow: 0 8px 18px -10px #6d3df0; }
.sb-foot { gap: 10px; border-top: 0; padding-top: 6px; }
.sb-help { color: var(--muted); }
.sb-user { background: var(--surface); }

/* Header */
.site-header { height: 68px; background: var(--glass); }
.header-search { max-width: 520px; }
.header-search input { height: 42px; background: var(--field); font-size: 14px; }
.header-studio { padding: 8px 18px; background: var(--grad-nav); }

@media (min-width: 1100px) {
  .app-sidebar .sb-search { display: none; }
  /* Collapsed: a floating rounded icon rail */
  .sb-collapsed .app-sidebar { top: 12px; bottom: 12px; left: 12px; width: 64px; padding: 14px 8px; border: 1px solid var(--line); border-radius: 20px; box-shadow: 0 18px 40px -24px #2b1f6b55, 0 1px 2px #1b18340d; }
  .sb-collapsed body.has-sidebar { padding-left: calc(64px + 24px); }
  .sb-collapsed .app-sidebar .sb-search { display: flex; }
  .sb-collapsed .sb-search input { width: 44px; height: 44px; border-radius: 13px; background: #f3f2f9; box-shadow: 0 2px 6px -2px #1b183422; }
  .sb-collapsed .sb-mark { width: 34px; height: 34px; padding: 4px; background: transparent; }
  .sb-collapsed .sb-link { width: 44px; min-height: 40px; margin: 0 auto 4px; border-radius: 12px; }
  .sb-collapsed .sb-link[aria-current="page"] { box-shadow: 0 8px 20px -6px #6d3df0cc, 0 0 0 4px #7c3aed14; }
  .sb-collapsed .sb-label { margin: 10px 8px; }
  .sb-collapsed .sb-link[data-tip]:hover::after { left: calc(64px + 24px); }
}

/* Studio headings + stat cards */
.studio-head h1 { font-size: clamp(28px, 2.6vw, 36px); letter-spacing: -.02em; }
.studio-head .page-intro { font-size: 14px; }
.studio-head .eyebrow { font-size: 11px; }
.stat-card { padding: 18px; gap: 6px; border-radius: 16px; }
.stat-feature { border: 1px solid var(--line); background: var(--surface); color: var(--ink); box-shadow: var(--card-shadow); position: relative; overflow: hidden; }
.stat-feature::before { content: ""; position: absolute; inset: 0 0 auto; height: 3px; background: var(--grad-nav); }
.stat-feature p, .stat-feature small, .stat-feature strong span { color: var(--muted); }
.stat-feature strong { font-size: 28px; }
.stat-icon { width: 36px; height: 36px; margin-bottom: 6px; display: grid; place-items: center; border-radius: 10px; background: #f1edff; color: #6d3df0; }
.stat-icon svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.stat-card:nth-child(5n+2) .stat-icon { background: #eaf1ff; color: #3e6ee8; }
.stat-card:nth-child(5n+3) .stat-icon { background: #e8f7f1; color: #12805c; }
.stat-card:nth-child(5n+4) .stat-icon { background: #fff3e3; color: #b76a00; }
.stat-card:nth-child(5n+5) .stat-icon { background: #fdeef6; color: #c2337d; }
@media (min-width: 1100px) {
  /* Collapsed rail: everything fits, no scrollbar, nothing clipped */
  .sb-collapsed .app-sidebar { gap: 4px; padding: 12px 0; overflow: visible; }
  .sb-collapsed .sb-top { gap: 6px; }
  .sb-collapsed .sb-scroll { padding: 6px 0; margin: 0; scrollbar-width: none; overflow-y: auto; overflow-x: visible; }
  .sb-collapsed .sb-scroll::-webkit-scrollbar { display: none; }
  .sb-collapsed .sb-link { width: 42px; min-height: 36px; margin: 0 auto 3px; }
  .sb-collapsed .sb-label { margin: 7px 14px; }
  .sb-collapsed .sb-foot { padding: 6px 0 0; gap: 4px; justify-items: center; border-top: 1px solid var(--line); margin: 0 10px; }
  .sb-collapsed .sb-user { padding: 2px 0; gap: 6px; }
  .sb-collapsed .sb-avatar { width: 34px !important; height: 34px !important; }
  .sb-collapsed .sb-icon-btn { width: 34px; height: 34px; }
}
@media (min-width: 1100px) and (max-height: 820px) {
  .sb-collapsed .sb-link { min-height: 32px; margin-bottom: 2px; }
  .sb-collapsed .sb-label { margin: 5px 14px; }
  .sb-collapsed .sb-search input { height: 38px; width: 40px; }
}

/* =========================================================
   Light / dark themes. <html data-theme> is set before paint by the script in base.html.
   ========================================================= */
:root { --field: #fbfaff; --glass: #ffffffe6; --ink-solid: #1b1834; color-scheme: light; }
html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0e0d18; --surface: #171628; --soft: #221f3b; --field: #12111f; --glass: #171628e6;
  --ink: #f2f0fb; --text: #d3cfe8; --muted: #9a96b8; --ink-solid: #2c2852;
  --line: #2a2744; --line-strong: #3b3760;
  --brand: #9b7dff; --brand-dark: #b9a5ff;
  --grad-soft: linear-gradient(135deg, #261d45 0%, #1d2244 55%, #16283a 100%);
  --ok: #4fd1a1; --ok-bg: #12352a; --warn: #f2c35b; --warn-bg: #3a2e12; --danger: #ff7b93; --danger-bg: #3d1823;
  --shadow: 0 1px 2px #0006, 0 8px 24px -12px #000a;
  --shadow-lg: 0 20px 50px -20px #000c;
  --card-shadow: 0 1px 2px #0005, 0 8px 24px -16px #000a;
  --ch-other: #24223b; --ch-other-ink: #f2f0fb; --ch-scroll-bg: #131222; --ch-quote: #ffffff12;
}
html[data-theme="dark"] body { background: var(--bg); }
html[data-theme="dark"] :is(input, textarea, select):not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]) { background-color: var(--field); color: var(--ink); border-color: var(--line-strong); }
html[data-theme="dark"] :is(input, textarea)::placeholder { color: #7d7999; }
html[data-theme="dark"] .site-header, html[data-theme="dark"] .tab-bar { background: var(--glass); border-color: var(--line); }
html[data-theme="dark"] :is(.app-sidebar, .profile-dropdown, .confirm-dialog, .panel, .stat-card, .site-footer, dialog) { background-color: var(--surface); color: var(--ink); border-color: var(--line); }
html[data-theme="dark"] :is(.sb-user, .header-search input, .avatar-button, .menu-toggle, .bell-button, .button-outline, .ch-head-btn) { background-color: var(--field); border-color: var(--line-strong); }
html[data-theme="dark"] .menu-toggle span { background: var(--ink); }
html[data-theme="dark"] :is(.sb-link, .profile-dropdown a, .avatar-form button) { color: var(--text); }
html[data-theme="dark"] .sb-link:hover { background: var(--soft); color: #fff; }
html[data-theme="dark"] .sb-link[aria-current="page"] { color: #fff; }
html[data-theme="dark"] .sb-mark, html[data-theme="dark"] .sb-logo, html[data-theme="dark"] .footer-brand img, html[data-theme="dark"] .brand img { filter: brightness(1.15); }
html[data-theme="dark"] .stat-icon { background: #ffffff10; }
html[data-theme="dark"] .ch-head-icon { background: var(--field); }
html[data-theme="dark"] .ch-msg:not(.is-mine) .ch-quote { border-left-color: var(--brand); }
html[data-theme="dark"] :is(.mt-google, .mt-row, .mt-past, .mt-member, .mt-empty) { background: var(--surface); border-color: var(--line); }
html[data-theme="dark"] img.cover-img, html[data-theme="dark"] .book-cover img { filter: none; }
html[data-theme="dark"] ::-webkit-scrollbar-thumb { background: #3b3760; }
html[data-theme="dark"] .status-pill { filter: saturate(.9) brightness(.95); }

/* Theme picker (account menu + signed-out header button) */
.theme-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px; color: var(--text); font-size: 14px; }
.theme-row > span { display: flex; align-items: center; gap: 10px; }
.theme-row .icon { width: 18px; height: 18px; }
.theme-seg { display: inline-flex; padding: 3px; border-radius: 10px; background: var(--soft); }
.theme-seg button { width: 30px; height: 26px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; }
.theme-seg button svg, .theme-toggle svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.theme-seg button[aria-pressed="true"] { background: var(--surface); color: var(--brand-dark); box-shadow: 0 1px 3px #1b183433; }
.theme-toggle { width: 40px; height: 40px; display: grid; place-items: center; padding: 0; border: 1px solid var(--line); border-radius: 50%; background: var(--surface); color: var(--text); cursor: pointer; }
.theme-toggle svg { width: 19px; height: 19px; }
.theme-toggle .i-moon, html[data-theme="dark"] .theme-toggle .i-sun { display: none; }
html[data-theme="dark"] .theme-toggle .i-moon { display: block; }
html.theme-switching *, html.theme-switching *::before, html.theme-switching *::after { transition: background-color .25s, border-color .25s, color .25s !important; }
html[data-theme="dark"] .ch-input-wrap textarea { background: transparent; border: 0; }
html[data-theme="dark"] .ch-input-wrap { background: var(--field); }
@media (min-width: 1100px) {
  /* Rail: size the icons to the window so the whole menu fits without scrolling */
  .sb-collapsed .sb-top { min-height: 0; }
  .sb-collapsed .sb-collapse { width: 30px; height: 30px; }
  .sb-collapsed .sb-search input { height: 38px; width: 42px; }
  .sb-collapsed .sb-scroll { display: flex; flex-direction: column; overflow-y: hidden; }
  .sb-collapsed .sb-scroll:hover { overflow-y: auto; }
  .sb-collapsed .sb-link { flex: 0 1 36px; min-height: 26px; max-height: 38px; margin-bottom: 2px; }
  .sb-collapsed .sb-label { flex: 0 0 1px; margin: 6px 14px; }
  .sb-collapsed .sb-cat { display: none; }
  .sb-collapsed .sb-cat + .sb-label, .sb-collapsed .sb-label:has(+ .sb-cat) { display: none; }
}

/* Dark mode: readable pills, chips and secondary text everywhere */
html[data-theme="dark"] body { color: var(--ink); }
html[data-theme="dark"] :is(.page-intro, .panel-copy, .panel-empty, small, .hint, .help-text, .muted) { color: var(--muted); }
html[data-theme="dark"] .status-pill.mt-ended { background: #2a2744; color: #c9c6e3; }
html[data-theme="dark"] .status-pill.mt-upcoming { background: #10304a; color: #7fd0ff; }
html[data-theme="dark"] :is(.stat-card:nth-child(5n+2), .stat-card:nth-child(5n+3), .stat-card:nth-child(5n+4), .stat-card:nth-child(5n+5)) .stat-icon { background: #ffffff10; }
html[data-theme="dark"] :is(table, thead, tbody, tr) { border-color: var(--line); }
html[data-theme="dark"] thead th { background: var(--field); color: var(--muted); }
html[data-theme="dark"] hr { border-color: var(--line); }
html[data-theme="dark"] .flash { color: var(--ink); }
html[data-theme="dark"] .tab-bar a { color: var(--muted); }
html[data-theme="dark"] .tab-bar a[aria-current="page"] { color: #fff; }

/* Account menu lives at the bottom of the sidebar */
.sb-collapse svg { transform: none !important; }
.sb-account { display: flex; align-items: center; gap: 6px; }
.sb-profile { position: relative; flex: 1; min-width: 0; }
.sb-profile .sb-user { width: 100%; border: 0; text-align: left; cursor: pointer; font: inherit; color: inherit; transition: box-shadow .15s, background .15s; }
.sb-profile .sb-user:hover, .sb-profile .sb-user[aria-expanded="true"] { box-shadow: inset 0 0 0 1px var(--line-strong), 0 6px 16px -10px #3b2a9455; }
.sb-user-caret { width: 16px; height: 16px; flex: 0 0 auto; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.sb-profile .profile-dropdown { top: auto; right: auto; bottom: calc(100% + 10px); left: 0; width: 272px; z-index: 90; }
.sb-logout { flex: 0 0 auto; }
@media (min-width: 1100px) {
  .sb-collapsed .sb-account { flex-direction: column; gap: 6px; }
  .sb-collapsed .sb-profile { flex: 0 0 auto; }
  .sb-collapsed .sb-profile .sb-user { width: auto; padding: 0; border-radius: 50%; background: transparent; box-shadow: none; }
  .sb-collapsed .sb-profile .sb-user:hover .sb-avatar, .sb-collapsed .sb-profile .sb-user[aria-expanded="true"] .sb-avatar { box-shadow: 0 0 0 3px #7c3aed55; }
  .sb-collapsed .sb-user-caret { display: none; }
  .sb-collapsed .sb-profile .profile-dropdown { left: calc(100% + 18px); bottom: -4px; }
  .sb-collapsed .sb-search input { border: 0; background: #f1f0f7; box-shadow: 0 1px 1px #fff inset, 0 3px 8px -3px #1b183433; }
  .sb-collapsed .sb-mark { width: 38px; height: 38px; }
  .sb-collapsed .sb-label { flex-basis: 1px; margin: 8px 12px; background: var(--line); }
  html[data-theme="dark"].sb-collapsed .sb-search input { background: #221f3b; box-shadow: none; }
}
/* Header: no account button any more — bell + Studio only */
.site-header .profile-menu { display: none; }

/* Legal page editor */
.legal-edit { display: inline-flex; align-items: center; gap: 6px; margin: 4px 0 6px; color: var(--brand); font-size: 13.5px; font-weight: 600; }
.legal-body > :not(section):not(nav) { color: var(--text); }
.lg-tabs { margin-bottom: 14px; }
.lg-editor-panel { padding: 0; overflow: hidden; }
.lg-toolbar { position: sticky; top: 68px; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; gap: 4px; padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--glass); backdrop-filter: blur(8px); }
.lg-toolbar select { height: 34px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: 9px; background: var(--field); font-size: 13px; }
.lg-toolbar button { min-width: 34px; height: 34px; display: grid; place-items: center; padding: 0 6px; border: 0; border-radius: 9px; background: transparent; color: var(--text); font-size: 15px; cursor: pointer; }
.lg-toolbar button:hover { background: var(--soft); color: var(--brand-dark); }
.lg-toolbar svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.lg-sep { width: 1px; height: 22px; margin: 0 4px; background: var(--line); }
.lg-state { margin-left: auto; color: var(--muted); font-size: 12.5px; }
.lg-doc { max-width: none; min-height: 60vh; padding: 22px clamp(16px, 4vw, 44px) 30px; background: var(--bg); outline: none; }
.lg-doc:focus { box-shadow: inset 0 0 0 2px #7c3aed33; }
.lg-doc section:focus-within { border-color: var(--brand); }
.lg-doc blockquote { margin: 10px 0; padding: 8px 14px; border-left: 3px solid var(--brand); color: var(--text); }
.lg-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 14px 18px; border-top: 1px solid var(--line); }
.lg-foot small { color: var(--muted); }

/* Veezol verified: the tick opens /verified/ */
[data-verified-link] { cursor: pointer; }
[data-verified-link]:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 50%; }
.verified-page { max-width: 1100px; margin: 0 auto; padding: 24px 16px 60px; }
.verified-head { display: flex; align-items: center; gap: 16px; margin-bottom: 24px; }
.verified-head h1 { margin: 0 0 6px; }
.verified-title { display: flex; align-items: center; gap: 12px; }
.verified-title .verified-badge { width: 1em; height: 1em; margin: 0; flex: none; vertical-align: 0; }
.verified-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 18px; }
.verify-row { display: flex; gap: 10px; align-items: flex-start; margin-top: 8px; }
.verify-row input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--brand); }
.verify-row span { display: grid; gap: 2px; }
.verify-row small { color: var(--muted); }
