/* ==========================================================================
   EventProse design system
   ==========================================================================
   Loaded after bff_app_framework's theme.css, so it re-skins the framework's
   shared tokens (--bg, --surface, --accent, ...) rather than fighting them.
   This product deliberately deviates from the Data Utopia look:

   * Light  -- "Paper & Garden": warm parchment, ink text, moss + terracotta.
   * Dark   -- "Midnight Library": ink-violet black, candle-amber + rose.

   Token blocks follow the framework's three-selector pattern (light default,
   [data-theme="dark"], and the prefers-color-scheme fallback when no
   explicit choice was made).
   ========================================================================== */

/* ── Tokens: light — Paper & Garden ───────────────────────────────────── */
:root {
  --bg:        #f3eee0;   /* parchment */
  --surface:   #fbf8ef;   /* cream paper */
  --surface-2: #f6f0e1;
  --border:    #ded4bb;
  --accent:    #3d6b4f;   /* moss / forest */
  --accent2:   #b4553d;   /* terracotta */
  --accent3:   #7f9d7f;   /* sage */
  --green:     #3d6b4f;
  --yellow:    #94650f;
  --red:       #a8372c;
  --muted:     #8b8670;
  --text:      #27271f;   /* warm ink */
  --subtext:   #5d5a48;
  --radius:    14px;

  --on-accent:     #fbf8ef;
  --highlight:     #b4553d;
  --eyebrow:       #a64d37;   /* 4.8:1 on --bg; used by small caps labels */
  --shadow-sm:     0 1px 2px rgba(60, 50, 20, .08), 0 2px 8px rgba(60, 50, 20, .06);
  --shadow-md:     0 10px 30px -8px rgba(60, 50, 20, .22);
  --hero-glow-a:   rgba(61, 107, 79, .18);
  --hero-glow-b:   rgba(180, 85, 61, .14);
  --grain-opacity: .5;

  --nav-bg:     rgba(243, 238, 224, .86);

  --nav-bg-solid: #f3eee0;
  --nav-border: #ded4bb;
  --nav-text:   #27271f;
  --nav-muted:  #6b6753;
  --nav-accent: #3d6b4f;
  --nav-height: 62px;

  --font-display: "Fraunces", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --font-body:    "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  /* bff-app-framework theme hooks (set instead of overriding its selectors). */
  --nav-active-tint: 16%;                                          /* active nav link background */
  --alert-info-bg:   color-mix(in srgb, var(--accent) 12%, transparent);  /* info alert follows our accent */
}

/* ── Tokens: dark — Midnight Library ──────────────────────────────────── */
[data-theme="dark"] {
  --bg:        #0d0b12;   /* ink-violet black */
  --surface:   #171320;
  --surface-2: #1d1827;
  --border:    #2d2638;
  --accent:    #f0b45a;   /* candle amber */
  --accent2:   #e8798f;   /* rose */
  --accent3:   #f6d9a0;
  --green:     #7fd1a3;
  --yellow:    #f0b45a;
  --red:       #f08a8a;
  --muted:     #7e7567;
  --text:      #f0e7d6;   /* warm page white */
  --subtext:   #b8ac9a;

  --on-accent:     #1a1208;
  --highlight:     #e8798f;
  --eyebrow:       #e8798f;
  --shadow-sm:     0 1px 2px rgba(0, 0, 0, .4), 0 2px 10px rgba(0, 0, 0, .3);
  --shadow-md:     0 14px 40px -10px rgba(0, 0, 0, .7);
  --hero-glow-a:   rgba(240, 180, 90, .34);
  --hero-glow-b:   rgba(232, 121, 143, .24);
  --grain-opacity: .35;

  --nav-bg:     rgba(13, 11, 18, .82);

  --nav-bg-solid: #0d0b12;
  --nav-border: #2d2638;
  --nav-text:   #f0e7d6;
  --nav-muted:  #a89d8b;
  --nav-accent: #f0b45a;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:        #0d0b12;
    --surface:   #171320;
    --surface-2: #1d1827;
    --border:    #2d2638;
    --accent:    #f0b45a;
    --accent2:   #e8798f;
    --accent3:   #f6d9a0;
    --green:     #7fd1a3;
    --yellow:    #f0b45a;
    --red:       #f08a8a;
    --muted:     #7e7567;
    --text:      #f0e7d6;
    --subtext:   #b8ac9a;

    --on-accent:     #1a1208;
    --highlight:     #e8798f;
  --eyebrow:       #e8798f;
    --shadow-sm:     0 1px 2px rgba(0, 0, 0, .4), 0 2px 10px rgba(0, 0, 0, .3);
    --shadow-md:     0 14px 40px -10px rgba(0, 0, 0, .7);
    --hero-glow-a:   rgba(240, 180, 90, .34);
    --hero-glow-b:   rgba(232, 121, 143, .24);
    --grain-opacity: .35;

    --nav-bg:     rgba(13, 11, 18, .82);

    --nav-bg-solid: #0d0b12;
    --nav-border: #2d2638;
    --nav-text:   #f0e7d6;
    --nav-muted:  #a89d8b;
    --nav-accent: #f0b45a;
  }
}

/* Bootstrap's own variables, both themes (the framework only maps dark). */
[data-bs-theme="light"],
[data-bs-theme="dark"] {
  --bs-body-bg: var(--bg);
  --bs-body-color: var(--text);
  --bs-emphasis-color: var(--text);
  --bs-secondary-color: var(--subtext);
  --bs-secondary-bg: var(--surface-2);
  --bs-tertiary-bg: var(--surface-2);
  --bs-border-color: var(--border);
  --bs-primary: var(--accent);
  --bs-link-color: var(--accent);
  --bs-link-hover-color: var(--highlight);
  --bs-body-font-family: var(--font-body);
}

/* ── Base ─────────────────────────────────────────────────────────────── */
body {
  font-family: var(--font-body);
  color: var(--text);
  background: var(--bg);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: var(--grain-opacity);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .5  0 0 0 0 .45  0 0 0 0 .35  0 0 0 .09 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

h1, h2, h3, h4, h5, .display-1, .display-2, .display-3, .display-4, .display-5, .display-6 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--text);
}

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--highlight); }

::selection { background: color-mix(in srgb, var(--highlight) 35%, transparent); }

.text-white-75 { color: rgba(255, 255, 255, 0.78); }
.text-muted { color: var(--subtext) !important; }

/* ── Navbar ───────────────────────────────────────────────────────────── */
.bff-topnav {
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  height: var(--nav-height, 62px);
}
.bff-nav-brand-name {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.bff-nav-link { font-size: 13.5px; border-radius: 999px; padding: 7px 14px; }
.bff-nav-link:hover { background: color-mix(in srgb, var(--nav-accent) 12%, transparent); color: var(--nav-text); }
.bff-user-dropdown,
.bff-notif-dropdown { background: var(--nav-bg-solid); }
@media (max-width: 768px) { .bff-nav-links { background: var(--nav-bg-solid); } }
.bff-nav-logo:has(img) { background: #1d1b16; border-radius: 9px; padding: 5px; }
[data-theme="dark"] .bff-nav-logo:has(img) { background: #241d2e; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .bff-nav-logo:has(img) { background: #241d2e; } }

/* ── Buttons ──────────────────────────────────────────────────────────── */
.btn { border-radius: 999px; font-weight: 600; letter-spacing: .005em; transition: transform .15s ease, box-shadow .15s ease, background .15s ease; }
.btn:active { transform: translateY(1px); }
.btn-lg { padding: .8rem 1.7rem; }

.btn-primary {
  --bs-btn-color: var(--on-accent);
  --bs-btn-bg: var(--accent);
  --bs-btn-border-color: var(--accent);
  --bs-btn-hover-color: var(--on-accent);
  --bs-btn-hover-bg: color-mix(in srgb, var(--accent) 86%, #fff);
  --bs-btn-hover-border-color: color-mix(in srgb, var(--accent) 86%, #fff);
  --bs-btn-active-color: var(--on-accent);
  --bs-btn-active-bg: color-mix(in srgb, var(--accent) 80%, #000);
  --bs-btn-active-border-color: color-mix(in srgb, var(--accent) 80%, #000);
  --bs-btn-disabled-color: var(--on-accent);
  --bs-btn-disabled-bg: var(--accent);
  --bs-btn-disabled-border-color: var(--accent);
  --bs-btn-focus-shadow-rgb: 200, 150, 80;
  box-shadow: 0 6px 18px -8px color-mix(in srgb, var(--accent) 70%, transparent);
}
.btn-primary:hover { transform: translateY(-1px); }

.btn-outline-primary {
  --bs-btn-color: var(--accent);
  --bs-btn-border-color: color-mix(in srgb, var(--accent) 60%, transparent);
  --bs-btn-hover-color: var(--on-accent);
  --bs-btn-hover-bg: var(--accent);
  --bs-btn-hover-border-color: var(--accent);
  --bs-btn-active-color: var(--on-accent);
  --bs-btn-active-bg: var(--accent);
  --bs-btn-active-border-color: var(--accent);
}
.btn-outline-secondary {
  --bs-btn-color: var(--subtext);
  --bs-btn-border-color: var(--border);
  --bs-btn-hover-color: var(--text);
  --bs-btn-hover-bg: var(--surface-2);
  --bs-btn-hover-border-color: var(--muted);
  --bs-btn-active-color: var(--text);
  --bs-btn-active-bg: var(--surface-2);
  --bs-btn-active-border-color: var(--muted);
}
.btn-outline-danger { --bs-btn-color: var(--red); --bs-btn-border-color: color-mix(in srgb, var(--red) 55%, transparent); --bs-btn-hover-bg: var(--red); --bs-btn-hover-border-color: var(--red); }
.btn-secondary { --bs-btn-bg: var(--surface-2); --bs-btn-border-color: var(--border); --bs-btn-color: var(--text); --bs-btn-hover-bg: var(--border); --bs-btn-hover-color: var(--text); --bs-btn-hover-border-color: var(--muted); --bs-btn-active-bg: var(--border); --bs-btn-active-color: var(--text); }
.btn-rose {
  background: var(--highlight); border-color: var(--highlight); color: #fff;
}
.btn-rose:hover { filter: brightness(1.08); color: #fff; }

/* ── Cards, lists, forms ──────────────────────────────────────────────── */
.card {
  --bs-card-bg: var(--surface);
  --bs-card-border-color: var(--border);
  --bs-card-cap-bg: transparent;
  --bs-card-cap-color: var(--text);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.card-header { border-bottom-color: var(--border); font-family: var(--font-display); font-weight: 600; }
.card-title { font-family: var(--font-display); }

.list-group { --bs-list-group-bg: transparent; --bs-list-group-border-color: var(--border); --bs-list-group-action-hover-bg: var(--surface-2); --bs-list-group-color: var(--text); --bs-list-group-action-color: var(--text); --bs-list-group-action-hover-color: var(--text); }

.form-control, .form-select {
  background-color: var(--surface-2);
  border-color: var(--border);
  color: var(--text);
  border-radius: 10px;
}
.form-control::placeholder { color: var(--muted); }
.form-control:focus, .form-select:focus {
  background-color: var(--surface);
  color: var(--text);
  border-color: var(--accent);
  box-shadow: 0 0 0 .22rem color-mix(in srgb, var(--accent) 25%, transparent);
}
.form-check-input:checked { background-color: var(--accent); border-color: var(--accent); }
.form-label { font-weight: 500; font-size: .88rem; color: var(--subtext); }

.table { --bs-table-bg: transparent; --bs-table-color: var(--text); --bs-table-border-color: var(--border); }
.breadcrumb { --bs-breadcrumb-divider-color: var(--muted); --bs-breadcrumb-item-active-color: var(--subtext); font-size: .9rem; }
.badge.bg-success { background-color: var(--green) !important; color: var(--on-accent); }
.badge.bg-warning { background-color: color-mix(in srgb, var(--accent2) 18%, var(--surface)) !important; color: var(--accent2) !important; border: 1px solid color-mix(in srgb, var(--accent2) 35%, transparent); }
.badge.bg-secondary { background-color: var(--surface-2) !important; color: var(--subtext); border: 1px solid var(--border); }

/* ── Layout helpers ───────────────────────────────────────────────────── */
.ac-section { padding: 4.5rem 0; }
.ac-section-tight { padding: 2.5rem 0; }
.ac-eyebrow {
  font-family: var(--font-body);
  text-transform: uppercase;
  letter-spacing: .16em;
  font-size: .72rem;
  font-weight: 700;
  /* Slightly deeper than --highlight in the light theme: 0.72rem text needs 4.5:1
     and --highlight (#b4553d) on parchment is only 4.2:1. Dark theme is unchanged. */
  color: var(--eyebrow, var(--highlight));
}
.ac-lede { font-size: 1.15rem; color: var(--subtext); max-width: 38rem; }
.ac-page-head { padding: 2.75rem 0 1.25rem; }
.ac-page-head h1 { font-size: clamp(2rem, 4vw, 2.9rem); margin: .25rem 0 .5rem; }
.ac-divider { display: flex; align-items: center; gap: .9rem; color: var(--muted); }
.ac-divider::before, .ac-divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }

/* ── Hero ─────────────────────────────────────────────────────────────── */
.ac-hero {
  position: relative;
  overflow: hidden;
  padding: 6rem 0 5rem;
  border-bottom: 1px solid var(--border);
  background:
    radial-gradient(60rem 30rem at 12% -10%, var(--hero-glow-a), transparent 60%),
    radial-gradient(48rem 28rem at 95% 10%, var(--hero-glow-b), transparent 60%),
    var(--bg);
}
.ac-hero h1 { font-size: clamp(2.5rem, 6vw, 4.6rem); line-height: 1.04; margin: .6rem 0 1.2rem; }
.ac-hero h1 em { font-style: italic; color: var(--accent); font-weight: 500; }
.ac-hero .ac-lede { font-size: 1.25rem; }
.ac-hero-art { position: absolute; inset: 0; pointer-events: none; opacity: .9; }
.ac-hero-art svg { position: absolute; color: var(--accent); opacity: .16; }
.ac-hero-art .sprig-a { right: -2%; top: -6%; width: 30rem; transform: rotate(8deg); }
.ac-hero-art .sprig-b { left: -5%; bottom: -14%; width: 24rem; transform: rotate(-168deg) scaleX(-1); color: var(--highlight); opacity: .12; }
[data-theme="dark"] .ac-hero-art svg { opacity: .13; }
.ac-hero .container { position: relative; z-index: 1; }

.ac-spines { display: flex; align-items: flex-end; gap: 7px; height: 250px; justify-content: center; }
.ac-spines span {
  display: block; width: 38px; border-radius: 4px 4px 2px 2px;
  box-shadow: var(--shadow-md), inset 0 0 0 1px rgba(255,255,255,.08);
  position: relative;
}
.ac-spines span::after { content: ""; position: absolute; left: 6px; right: 6px; top: 22px; height: 2px; background: rgba(255,255,255,.35); box-shadow: 0 6px 0 rgba(255,255,255,.22); }
.ac-spines span:nth-child(1) { height: 180px; background: linear-gradient(160deg, var(--accent), color-mix(in srgb, var(--accent) 55%, #000)); transform: rotate(-3deg); }
.ac-spines span:nth-child(2) { height: 230px; background: linear-gradient(160deg, var(--highlight), color-mix(in srgb, var(--highlight) 55%, #000)); }
.ac-spines span:nth-child(3) { height: 200px; background: linear-gradient(160deg, var(--accent3), color-mix(in srgb, var(--accent3) 50%, #000)); }
.ac-spines span:nth-child(4) { height: 245px; background: linear-gradient(160deg, color-mix(in srgb, var(--accent) 70%, var(--highlight)), color-mix(in srgb, var(--accent2) 55%, #000)); transform: rotate(2deg); }
.ac-spines span:nth-child(5) { height: 190px; background: linear-gradient(160deg, color-mix(in srgb, var(--accent3) 60%, var(--accent)), color-mix(in srgb, var(--accent) 45%, #000)); }

/* ── Cover / image placeholders ───────────────────────────────────────── */
.ac-cover {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, .92);
  background: linear-gradient(145deg, var(--c1), var(--c2));
  isolation: isolate;
}
.ac-cover::before { /* soft light + vignette */
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(120% 90% at 20% 0%, rgba(255,255,255,.28), transparent 55%),
    radial-gradient(100% 100% at 100% 100%, rgba(0,0,0,.35), transparent 60%);
}
.ac-cover svg { width: 34%; max-width: 64px; opacity: .85; filter: drop-shadow(0 2px 6px rgba(0,0,0,.3)); }
.ac-cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ac-cover-event { aspect-ratio: 16 / 9; }
.ac-event-photo { width: 200px; max-width: 100%; flex: none; }
.ac-event-photo .ac-cover { border-radius: var(--radius-sm, 10px); overflow: hidden; }
.ac-cover-book  { aspect-ratio: 2 / 3; border-radius: 6px 12px 12px 6px; box-shadow: var(--shadow-md); }
.ac-cover-book::after { content: ""; position: absolute; left: 7px; top: 0; bottom: 0; width: 2px; background: rgba(0,0,0,.25); box-shadow: 1px 0 0 rgba(255,255,255,.15); }
.ac-avatar { border-radius: 50%; aspect-ratio: 1; font-family: var(--font-display); font-weight: 600; letter-spacing: .02em; }
.ac-avatar span { font-size: 1.6em; }

.ac-tone-0 { --c1: #e0a14b; --c2: #c2526b; }
.ac-tone-1 { --c1: #4f7f5c; --c2: #b8c99a; }
.ac-tone-2 { --c1: #c2526b; --c2: #5b3a78; }
.ac-tone-3 { --c1: #2f6f73; --c2: #4f7f5c; }
.ac-tone-4 { --c1: #d4a24a; --c2: #b4553d; }
.ac-tone-5 { --c1: #5b3a78; --c2: #27406b; }

/* ── Event / author / book cards ──────────────────────────────────────── */
.ac-grid { display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); }
.ac-card {
  display: flex; flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none; color: var(--text);
  box-shadow: var(--shadow-sm);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
a.ac-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); color: var(--text); }
.ac-card-body { padding: 1.1rem 1.2rem 1.3rem; display: flex; flex-direction: column; gap: .35rem; flex: 1; }
.ac-card-title { font-family: var(--font-display); font-size: 1.22rem; font-weight: 600; line-height: 1.25; margin: 0; }
.ac-card-meta { font-size: .85rem; color: var(--subtext); display: flex; align-items: center; gap: .4rem; }
.ac-card-meta svg { width: 14px; height: 14px; flex: none; color: var(--highlight); }
.ac-card-text { font-size: .92rem; color: var(--subtext); margin: .25rem 0 0; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

.ac-card-event .ac-cover { border-bottom: 1px solid var(--border); }
.ac-date-chip {
  position: absolute; top: .8rem; left: .8rem; z-index: 2;
  background: var(--surface); color: var(--text);
  border-radius: 12px; padding: .35rem .65rem; text-align: center; line-height: 1.05;
  box-shadow: var(--shadow-sm); min-width: 3.1rem;
}
.ac-date-chip b { display: block; font-family: var(--font-display); font-size: 1.4rem; font-weight: 700; }
.ac-date-chip small { text-transform: uppercase; letter-spacing: .12em; font-size: .62rem; font-weight: 700; color: var(--highlight); }

.ac-card-author { align-items: center; text-align: center; padding-top: 1.6rem; }
.ac-card-author .ac-avatar { width: 92px; margin-bottom: .5rem; box-shadow: var(--shadow-md); }
.ac-card-author .ac-card-body { align-items: center; }

.ac-chip { display: inline-block; padding: .18rem .65rem; border-radius: 999px; font-size: .76rem; font-weight: 600; background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); border: 1px solid color-mix(in srgb, var(--accent) 28%, transparent); }
.ac-chip-rose { background: color-mix(in srgb, var(--highlight) 14%, transparent); color: var(--highlight); border-color: color-mix(in srgb, var(--highlight) 28%, transparent); }

.ac-toolbar { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; margin-bottom: 1.75rem; }
.ac-toolbar .form-control { max-width: 22rem; border-radius: 999px; padding-left: 1.1rem; }
.ac-empty { text-align: center; padding: 4rem 1rem; color: var(--subtext); }
.ac-empty .ac-cover { width: 84px; aspect-ratio: 1; border-radius: 50%; margin: 0 auto 1rem; }

/* ── Detail pages ─────────────────────────────────────────────────────── */
.ac-detail-hero { position: relative; border-radius: calc(var(--radius) + 6px); overflow: hidden; box-shadow: var(--shadow-md); margin-bottom: 2rem; }
.ac-detail-hero .ac-cover { aspect-ratio: 21 / 8; min-height: 200px; }
.ac-detail-hero .ac-cover svg { max-width: 90px; }
.ac-fact { display: flex; gap: .8rem; align-items: flex-start; padding: .85rem 0; border-bottom: 1px solid var(--border); }
.ac-fact:last-child { border-bottom: 0; }
.ac-fact svg { width: 20px; height: 20px; color: var(--highlight); margin-top: .15rem; flex: none; }
.ac-fact small { display: block; text-transform: uppercase; letter-spacing: .1em; font-size: .68rem; font-weight: 700; color: var(--muted); }
.ac-prose { white-space: pre-line; font-size: 1.05rem; color: var(--text); }
.ac-lineup { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr)); }
.ac-lineup a { display: flex; flex-direction: column; align-items: center; text-align: center; gap: .55rem; padding: 1rem; border: 1px solid var(--border); background: var(--surface); border-radius: var(--radius); text-decoration: none; color: var(--text); transition: transform .2s, border-color .2s; }
.ac-lineup a:hover { transform: translateY(-3px); border-color: var(--accent); color: var(--text); }
.ac-lineup .ac-avatar { width: 64px; }
.ac-signin-note { display: flex; gap: .8rem; align-items: center; padding: .9rem 1.1rem; border-radius: var(--radius); background: color-mix(in srgb, var(--accent) 10%, var(--surface)); border: 1px dashed color-mix(in srgb, var(--accent) 45%, var(--border)); font-size: .93rem; }
.ac-books { display: grid; gap: 1.6rem; grid-template-columns: repeat(auto-fill, minmax(10rem, 12rem)); }
.ac-book h3 { font-size: 1.02rem; margin: .8rem 0 .15rem; font-weight: 600; }
.ac-book p { font-size: .85rem; color: var(--subtext); margin: 0 0 .4rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* ── Landing blocks ───────────────────────────────────────────────────── */
.ac-steps { counter-reset: step; display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); }
.ac-steps-4 { grid-template-columns: repeat(2, 1fr); }
@media (min-width: 992px) { .ac-steps-4 { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 575px) { .ac-steps-4 { grid-template-columns: 1fr; } }
.ac-step { position: relative; padding: 1.6rem 1.5rem 1.5rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.ac-step::before { counter-increment: step; content: counter(step); font-family: var(--font-display); font-size: 2.6rem; font-weight: 700; line-height: 1; color: color-mix(in srgb, var(--highlight) 55%, transparent); position: absolute; top: .9rem; right: 1.2rem; }
.ac-step h3 { font-size: 1.25rem; }
.ac-audience { display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); }
.ac-audience .ac-card-body { padding: 1.6rem; }
.ac-audience .icon { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); margin-bottom: .6rem; }
.ac-audience .icon svg { width: 24px; height: 24px; }
.ac-cta { position: relative; overflow: hidden; text-align: center; padding: 4.5rem 1rem; border-radius: calc(var(--radius) + 8px); border: 1px solid var(--border); background: radial-gradient(40rem 18rem at 50% 0%, var(--hero-glow-a), transparent 70%), radial-gradient(34rem 18rem at 90% 100%, var(--hero-glow-b), transparent 70%), var(--surface); box-shadow: var(--shadow-md); }

/* ── Auth pages ───────────────────────────────────────────────────────── */
.ac-auth { flex: 1; display: flex; align-items: center; padding: 3rem 0; background: radial-gradient(48rem 26rem at 15% 0%, var(--hero-glow-a), transparent 60%), radial-gradient(40rem 24rem at 95% 100%, var(--hero-glow-b), transparent 60%); }
.ac-auth-card { max-width: 440px; width: 100%; margin: 0 auto; padding: 2.4rem; background: var(--surface); border: 1px solid var(--border); border-radius: calc(var(--radius) + 6px); box-shadow: var(--shadow-md); }

/* ── Footer ───────────────────────────────────────────────────────────── */
/* Content wrapper (.flex-grow-1) absorbs free space, so the footer is pinned to the bottom on short pages; the margin guarantees a gap on tall ones. */
.ac-footer { margin-top: 3rem; border-top: 1px solid var(--border); background: var(--surface); color: var(--subtext); padding: 2.5rem 0 2rem; font-size: .9rem; }
.ac-footer a { color: var(--subtext); text-decoration: none; }
.ac-footer a:hover { color: var(--accent); }
.ac-footer .brand { font-family: var(--font-display); font-size: 1.15rem; color: var(--text); font-weight: 600; }

/* ── Workspace (organizer tools) ──────────────────────────────────────── */
.nav-tabs {
  --bs-nav-tabs-border-color: var(--border);
  --bs-nav-tabs-link-hover-border-color: var(--border);
  --bs-nav-tabs-link-active-bg: var(--surface);
  --bs-nav-tabs-link-active-color: var(--text);
  --bs-nav-tabs-link-active-border-color: var(--border) var(--border) var(--surface);
  --bs-nav-link-color: var(--subtext);
  --bs-nav-link-hover-color: var(--text);
  flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden;
}
.nav-tabs .nav-link { font-weight: 600; white-space: nowrap; border-radius: 10px 10px 0 0; }
.nav-tabs .badge { margin-left: .4rem; }
.ac-pane { background: var(--surface); border: 1px solid var(--border); border-top: 0; border-radius: 0 0 var(--radius) var(--radius); padding: 1.4rem; box-shadow: var(--shadow-sm); }
.ac-kv { display: grid; grid-template-columns: max-content 1fr; gap: .1rem .8rem; margin: 0; font-size: .82rem; }
.ac-kv dt { color: var(--muted); font-weight: 600; }
.ac-kv dd { margin: 0; overflow-wrap: anywhere; }
.ac-person { display: flex; align-items: center; gap: .6rem; min-width: 0; }
.ac-person .ac-avatar { width: 36px; flex: none; font-size: .7rem; }
.ac-person a, .ac-person span.name { font-weight: 600; text-decoration: none; overflow-wrap: anywhere; }
.ac-inbox { display: grid; grid-template-columns: 15rem 1fr; gap: 1rem; min-height: 16rem; }
.ac-inbox .list-group-item.active { background: color-mix(in srgb, var(--accent) 16%, var(--surface)); border-color: var(--border); color: var(--text); }
.ac-thread { display: flex; flex-direction: column; gap: .6rem; max-height: 22rem; overflow-y: auto; padding: .25rem; }
.ac-bubble { max-width: 88%; padding: .55rem .8rem; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--border); overflow-wrap: anywhere; }
.ac-bubble.mine { align-self: flex-end; background: color-mix(in srgb, var(--accent) 14%, var(--surface)); }
.ac-bubble small { display: block; margin-top: .15rem; font-size: .72rem; color: var(--muted); }
@media (max-width: 768px) {
  .ac-inbox { grid-template-columns: 1fr; }
  .ac-pane { padding: 1rem; }
}

/* ── Motion (respect the user's setting) ──────────────────────────────── */
@keyframes ac-rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.ac-rise { animation: ac-rise .6s ease both; }
.ac-rise-2 { animation-delay: .1s; } .ac-rise-3 { animation-delay: .2s; }
@media (prefers-reduced-motion: reduce) {
  .ac-rise, .ac-card, .btn, .ac-lineup a { animation: none !important; transition: none !important; }
}

@media (max-width: 768px) {
  .ac-hero { padding: 4rem 0 3.5rem; }
  .ac-section { padding: 3rem 0; }
  .ac-spines { height: 180px; } .ac-spines span { width: 28px; }
  .ac-detail-hero .ac-cover { aspect-ratio: 16 / 9; }
}
