@import url("/assets/actiontext-e646701d.css");
@import url("https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,300;0,14..32,400;0,14..32,500;0,14..32,600;0,14..32,700;1,14..32,400&display=swap");

/* ─────────────────────────────────────────────────────
   TOKENS — light (default)
───────────────────────────────────────────────────── */

:root,
[data-color-scheme="light"] {
  color-scheme: light;

  /* Surfaces */
  --bg:            #f8f7f5;
  --bg-elevated:   #ffffff;
  --bg-sunken:     #f0eee9;
  --bg-overlay:    rgba(255, 255, 255, 0.88);

  /* Borders */
  --border:        #e4e1da;
  --border-strong: #cac7be;

  /* Text */
  --text:          #18150e;
  --text-muted:    #6b6860;
  --text-faint:    #a8a49b;

  /* Accent — VybeCod.ing ember */
  --accent:        #e8440a;
  --accent-hover:  #cf3d09;
  --accent-soft:   #f06030;
  --accent-bg:     #fff3ef;
  --accent-border: #f5c0aa;

  /* Semantic */
  --cyan:    oklch(52% 0.13 192);
  --success: oklch(52% 0.14 148);
  --danger:  #dc2626;

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(0,0,0,.06);
  --shadow-sm: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md: 0 4px 10px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.04);
  --shadow-lg: 0 16px 36px rgba(0,0,0,.09), 0 4px 12px rgba(0,0,0,.05);
  --shadow-focus: 0 0 0 3px rgba(232,68,10,.18);
}

/* ─────────────────────────────────────────────────────
   TOKENS — dark (system preference)
───────────────────────────────────────────────────── */

@media (prefers-color-scheme: dark) {
  :root:not([data-color-scheme="light"]) {
    color-scheme: dark;

    --bg:            #0f0e0d;
    --bg-elevated:   #1a1816;
    --bg-sunken:     #0b0a09;
    --bg-overlay:    rgba(15,14,13,.9);

    --border:        #2d2b27;
    --border-strong: #3f3c38;

    --text:          #f0ece4;
    --text-muted:    #8c8880;
    --text-faint:    #504d48;

    --accent:        #e8440a;
    --accent-hover:  #f05525;
    --accent-soft:   oklch(66% .16 38);
    --accent-bg:     #1d0d07;
    --accent-border: #5a1e0a;

    --cyan:    oklch(70% .13 190);
    --success: oklch(62% .14 148);
    --danger:  #f87171;

    --shadow-xs: 0 1px 2px rgba(0,0,0,.3);
    --shadow-sm: 0 1px 3px rgba(0,0,0,.35), 0 1px 2px rgba(0,0,0,.25);
    --shadow-md: 0 4px 10px rgba(0,0,0,.35), 0 2px 4px rgba(0,0,0,.25);
    --shadow-lg: 0 16px 36px rgba(0,0,0,.5), 0 4px 12px rgba(0,0,0,.3);
    --shadow-focus: 0 0 0 3px rgba(232,68,10,.25);
  }
}

/* ─────────────────────────────────────────────────────
   TOKENS — dark (manual override)
───────────────────────────────────────────────────── */

[data-color-scheme="dark"] {
  color-scheme: dark;

  --bg:            #0f0e0d;
  --bg-elevated:   #1a1816;
  --bg-sunken:     #0b0a09;
  --bg-overlay:    rgba(15,14,13,.9);

  --border:        #2d2b27;
  --border-strong: #3f3c38;

  --text:          #f0ece4;
  --text-muted:    #8c8880;
  --text-faint:    #504d48;

  --accent:        #e8440a;
  --accent-hover:  #f05525;
  --accent-soft:   oklch(66% .16 38);
  --accent-bg:     #1d0d07;
  --accent-border: #5a1e0a;

  --cyan:    oklch(70% .13 190);
  --success: oklch(62% .14 148);
  --danger:  #f87171;

  --shadow-xs: 0 1px 2px rgba(0,0,0,.3);
  --shadow-sm: 0 1px 3px rgba(0,0,0,.35), 0 1px 2px rgba(0,0,0,.25);
  --shadow-md: 0 4px 10px rgba(0,0,0,.35), 0 2px 4px rgba(0,0,0,.25);
  --shadow-lg: 0 16px 36px rgba(0,0,0,.5), 0 4px 12px rgba(0,0,0,.3);
  --shadow-focus: 0 0 0 3px rgba(232,68,10,.25);
}

/* ─────────────────────────────────────────────────────
   RESET + BASE
───────────────────────────────────────────────────── */

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

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

body {
  min-width: 320px;
  background: var(--bg);
  background-image: linear-gradient(180deg, color-mix(in oklch, var(--accent) 6%, transparent), transparent 360px);
  color: var(--text);
  font-family: "Inter", "system-ui", -apple-system, "Segoe UI", sans-serif;
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.65;
  transition: background-color .25s, color .25s;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration-color: color-mix(in oklch, var(--accent) 55%, transparent);
  text-underline-offset: .2em;
  transition: color .15s;
}

a:hover {
  color: var(--accent-soft);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ─────────────────────────────────────────────────────
   TYPOGRAPHY
───────────────────────────────────────────────────── */

h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -.025em;
  text-wrap: balance;
  color: var(--text);
}

h1 { font-size: clamp(2.6rem, 5vw + 1rem, 4.4rem); margin-bottom: .5em; }
h2 { font-size: clamp(1.4rem, 2.5vw, 1.75rem);   margin-bottom: .4em; }
h3 { font-size: 1.2rem;  margin-bottom: .35em; }

p  { margin-bottom: 1em; }
p:last-child { margin-bottom: 0; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: .6em;
  color: var(--cyan);
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.lede {
  max-width: 58ch;
  color: var(--text-muted);
  font-size: 1.1rem;
  font-weight: 400;
  line-height: 1.6;
  letter-spacing: 0;
}

.byline {
  color: var(--text-faint);
  font-size: .82rem;
  font-weight: 500;
}

/* ─────────────────────────────────────────────────────
   LAYOUT
───────────────────────────────────────────────────── */

.shell {
  width: min(1160px, calc(100% - 40px));
  margin-inline: auto;
}

.reading-width { max-width: 720px; }

.page-shell { min-height: 72vh; }

/* ─────────────────────────────────────────────────────
   SITE HEADER
───────────────────────────────────────────────────── */

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--bg-overlay);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  transition: background-color .25s, border-color .25s;
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px 0;
}

/* ─────────────────────────────────────────────────────
   BRAND MARK
───────────────────────────────────────────────────── */

.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  letter-spacing: -.02em;
  text-decoration: none;
  color: var(--text);
}

.brand-mark:hover { color: var(--text); }

.brand-mark__sigil {
  display: inline-grid;
  width: 36px;
  height: 36px;
  place-items: center;
  background: var(--accent-bg);
  border: 1.5px solid var(--accent-border);
  border-radius: 10px;
  color: var(--accent);
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .02em;
  flex-shrink: 0;
  transition: background .2s, border-color .2s;
}

.brand-mark:hover .brand-mark__sigil {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.brand-mark__name {
  font-size: .95rem;
  white-space: nowrap;
}

/* ─────────────────────────────────────────────────────
   NAV
───────────────────────────────────────────────────── */

.site-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.site-nav a {
  padding: 6px 12px;
  border-radius: 8px;
  color: var(--text-muted);
  font-size: .875rem;
  font-weight: 500;
  text-decoration: none;
  transition: background .15s, color .15s;
}

.site-nav a:hover {
  background: var(--bg-sunken);
  color: var(--text);
}

/* ─────────────────────────────────────────────────────
   THEME TOGGLE
───────────────────────────────────────────────────── */

.theme-toggle {
  display: inline-grid;
  width: 36px;
  height: 36px;
  place-items: center;
  padding: 0;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  background: var(--bg-elevated);
  color: var(--text-muted);
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
  flex-shrink: 0;
}

.theme-toggle:hover {
  background: var(--bg-sunken);
  border-color: var(--border-strong);
  color: var(--text);
}

.theme-toggle .icon-sun  { display: block; }
.theme-toggle .icon-moon { display: none; }

[data-color-scheme="dark"]  .theme-toggle .icon-sun  { display: none; }
[data-color-scheme="dark"]  .theme-toggle .icon-moon { display: block; }

@media (prefers-color-scheme: dark) {
  :root:not([data-color-scheme="light"]) .theme-toggle .icon-sun  { display: none; }
  :root:not([data-color-scheme="light"]) .theme-toggle .icon-moon { display: block; }
}

/* ─────────────────────────────────────────────────────
   FLASH MESSAGES
───────────────────────────────────────────────────── */

.flash {
  padding: 12px 16px;
  border-radius: 10px;
  font-size: .875rem;
  font-weight: 500;
  line-height: 1.4;
}

.flash--notice {
  background: color-mix(in oklch, var(--success) 10%, var(--bg-elevated));
  border: 1px solid color-mix(in oklch, var(--success) 30%, transparent);
  color: var(--success);
}

.flash--alert {
  background: color-mix(in oklch, var(--danger) 10%, var(--bg-elevated));
  border: 1px solid color-mix(in oklch, var(--danger) 30%, transparent);
  color: var(--danger);
}

/* ─────────────────────────────────────────────────────
   HERO
───────────────────────────────────────────────────── */

.content-hero,
.list-heading {
  border-bottom: 1px solid var(--border);
}

.content-hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 440px);
  gap: 56px;
  align-items: center;
  padding: 80px 0 60px;
}

.content-hero__copy { min-width: 0; }

.list-heading .shell {
  padding: 60px 0 36px;
}

/* ─────────────────────────────────────────────────────
   CONTENT BAND
───────────────────────────────────────────────────── */

.content-band {
  padding: 52px 0 72px;
}

/* ─────────────────────────────────────────────────────
   FEATURE MEDIA
───────────────────────────────────────────────────── */

.feature-media {
  margin: 0;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--bg-sunken);
  box-shadow: var(--shadow-md);
}

.feature-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ─────────────────────────────────────────────────────
   POST GRID + CARDS
───────────────────────────────────────────────────── */

.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
}

.post-card {
  display: grid;
  grid-template-rows: auto 1fr;
  min-width: 0;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: box-shadow .2s, transform .2s, border-color .2s;
}

.post-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-lg);
  transform: translateY(-3px);
}

.post-card__media {
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--bg-sunken);
  border-bottom: 1px solid var(--border);
}

.post-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .35s ease;
}

.post-card:hover .post-card__media img {
  transform: scale(1.03);
}

.post-card__body {
  min-width: 0;
  padding: 22px 24px 26px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.post-card h2 {
  font-size: 1.1rem;
  letter-spacing: -.015em;
  margin-bottom: 0;
}

.post-card h2 a {
  color: var(--text);
  text-decoration: none;
  transition: color .15s;
}

.post-card h2 a:hover {
  color: var(--accent);
}

.post-card p {
  color: var(--text-muted);
  font-size: .9rem;
  line-height: 1.55;
  margin-bottom: 0;
}

/* ─────────────────────────────────────────────────────
   TOPIC LIST + CHIPS
───────────────────────────────────────────────────── */

.topic-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.topic-chip {
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-muted);
  font-size: .78rem;
  font-weight: 500;
  text-decoration: none;
  transition: background .15s, border-color .15s, color .15s;
}

.topic-chip:hover {
  background: var(--accent-bg);
  border-color: var(--accent-border);
  color: var(--accent);
}

/* ─────────────────────────────────────────────────────
   STATUS PILL
───────────────────────────────────────────────────── */

.status-pill {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 10px;
  background: var(--accent-bg);
  border: 1px solid var(--accent-border);
  border-radius: 999px;
  color: var(--accent);
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
}

/* ─────────────────────────────────────────────────────
   SITE FOOTER
───────────────────────────────────────────────────── */

.site-footer {
  border-top: 1px solid var(--border);
  color: var(--text-faint);
  transition: border-color .25s;
}

.site-footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 20px 0;
  font-size: .84rem;
}

.site-footer a {
  color: var(--text-faint);
  text-decoration: none;
  transition: color .15s;
}

.site-footer a:hover { color: var(--text-muted); }

/* ─────────────────────────────────────────────────────
   TRIX / RICH TEXT OUTPUT
───────────────────────────────────────────────────── */

.trix-content {
  color: var(--text-muted);
  font-size: 1.05rem;
  line-height: 1.75;
  letter-spacing: -.005em;
}

.trix-content > * + * { margin-top: 1.2em; }

.trix-content h1,
.trix-content h2,
.trix-content h3 {
  color: var(--text);
  margin-top: 2em;
  margin-bottom: .4em;
}

.trix-content h1 { font-size: 1.8rem; }
.trix-content h2 { font-size: 1.4rem; }
.trix-content h3 { font-size: 1.15rem; }

.trix-content a {
  color: var(--accent-soft);
  text-decoration-color: color-mix(in oklch, var(--accent) 40%, transparent);
}

.trix-content a:hover { color: var(--accent); }

.trix-content strong { color: var(--text); font-weight: 600; }

.trix-content blockquote {
  padding: 16px 20px;
  border-left: 3px solid var(--accent);
  background: var(--accent-bg);
  border-radius: 0 10px 10px 0;
  color: var(--text);
  font-style: italic;
}

.trix-content code {
  padding: 2px 6px;
  background: var(--bg-sunken);
  border: 1px solid var(--border);
  border-radius: 5px;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: .88em;
  color: var(--accent-soft);
}

.trix-content pre {
  padding: 18px 20px;
  background: var(--bg-sunken);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow-x: auto;
}

.trix-content pre code {
  padding: 0;
  background: none;
  border: none;
  font-size: .9rem;
}

.trix-content ul,
.trix-content ol {
  padding-left: 1.5em;
}

.trix-content img {
  border-radius: 12px;
  box-shadow: var(--shadow-md);
}

/* ─────────────────────────────────────────────────────
   FORM ELEMENTS (global — auth + any inline forms)
───────────────────────────────────────────────────── */

.form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-field label {
  font-size: .85rem;
  font-weight: 500;
  color: var(--text-muted);
}

input[type="email"],
input[type="password"],
input[type="text"],
input[type="search"],
input[type="url"],
textarea,
select {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-elevated);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-family: inherit;
  font-size: .95rem;
  line-height: 1.5;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
  appearance: none;
  -webkit-appearance: none;
}

input[type="email"]:focus,
input[type="password"]:focus,
input[type="text"]:focus,
input[type="search"]:focus,
input[type="url"]:focus,
textarea:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: var(--shadow-focus);
}

input::placeholder,
textarea::placeholder {
  color: var(--text-faint);
}

select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23888' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
  cursor: pointer;
}

/* ─────────────────────────────────────────────────────
   BUTTONS
───────────────────────────────────────────────────── */

.btn,
input[type="submit"],
button[type="submit"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 42px;
  padding: 0 20px;
  background: var(--accent);
  border: none;
  border-radius: 10px;
  color: #fff;
  cursor: pointer;
  font-family: inherit;
  font-size: .9rem;
  font-weight: 600;
  letter-spacing: -.01em;
  text-decoration: none;
  transition: background .15s, box-shadow .15s, transform .1s;
  white-space: nowrap;
}

.btn:hover,
input[type="submit"]:hover,
button[type="submit"]:hover {
  background: var(--accent-hover);
  box-shadow: 0 4px 12px rgba(232,68,10,.3);
  transform: translateY(-1px);
  color: #fff;
}

.btn:active,
input[type="submit"]:active,
button[type="submit"]:active {
  transform: translateY(0);
  box-shadow: none;
}

.btn--secondary {
  background: var(--bg-elevated);
  border: 1.5px solid var(--border);
  color: var(--text);
}

.btn--secondary:hover {
  background: var(--bg-sunken);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
  color: var(--text);
}

.btn--ghost {
  background: transparent;
  border: 1.5px solid var(--border);
  color: var(--text-muted);
}

.btn--ghost:hover {
  background: var(--bg-sunken);
  color: var(--text);
  box-shadow: none;
}

.btn--full { width: 100%; }

/* ─────────────────────────────────────────────────────
   AUTH LAYOUT
───────────────────────────────────────────────────── */

.auth-shell {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 20px;
  background: var(--bg);
  background-image: linear-gradient(180deg, color-mix(in oklch, var(--accent) 6%, transparent), transparent 400px);
}

.auth-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 36px;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -.02em;
  color: var(--text);
  text-decoration: none;
}

.auth-brand .brand-mark__sigil {
  width: 40px;
  height: 40px;
  font-size: .85rem;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  padding: 36px 36px 40px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
}

.auth-card__header {
  margin-bottom: 28px;
}

.auth-card__header h1 {
  font-size: 1.5rem;
  margin-bottom: 6px;
  letter-spacing: -.025em;
}

.auth-card__header p {
  color: var(--text-muted);
  font-size: .9rem;
  margin-bottom: 0;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.auth-form .btn { margin-top: 6px; }

.auth-footer {
  margin-top: 24px;
  text-align: center;
  font-size: .84rem;
  color: var(--text-faint);
}

.auth-footer a {
  color: var(--text-muted);
  font-weight: 500;
}

.auth-footer a:hover { color: var(--accent); }

/* ─────────────────────────────────────────────────────
   RESPONSIVE
───────────────────────────────────────────────────── */

@media (max-width: 800px) {
  .site-header__inner {
    padding: 12px 0;
  }

  .brand-mark__name { display: none; }

  .content-hero__grid {
    grid-template-columns: 1fr;
    gap: 32px;
    padding: 52px 0 44px;
  }

  .content-hero__grid .feature-media {
    order: -1;
  }

  h1 { letter-spacing: -.03em; }

  .content-band { padding: 36px 0 56px; }

  .list-heading .shell { padding: 44px 0 28px; }

  .post-grid { grid-template-columns: 1fr; }

  .auth-card { padding: 28px 24px 32px; }
}

@media (max-width: 480px) {
  .shell { width: calc(100% - 32px); }

  .site-footer__inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 16px 0;
  }
}

/* ─────────────────────────────────────────────────────
   EMPTY STATE
───────────────────────────────────────────────────── */

.empty-state {
  grid-column: 1 / -1;
  padding: 48px 0;
  color: var(--text-muted);
  font-size: 1rem;
  text-align: center;
}

/* ─────────────────────────────────────────────────────
   PAGINATION (Pagy)
───────────────────────────────────────────────────── */

.pagy-nav {
  display: flex;
  justify-content: center;
  padding: 32px 0 8px;
}

.pagy nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.pagy nav a,
.pagy nav span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  border-radius: 8px;
  font-size: .875rem;
  font-weight: 500;
  text-decoration: none;
  transition: background .15s, color .15s;
}

.pagy nav a {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text);
}

.pagy nav a:hover {
  background: var(--accent-bg);
  border-color: var(--accent-border);
  color: var(--accent);
}

.pagy nav span.current {
  background: var(--accent);
  border: 1px solid var(--accent);
  color: #fff;
}

.pagy nav span.gap,
.pagy nav span.disabled {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-faint);
  cursor: default;
}

/* ─────────────────────────────────────────────────────
   MEDIA LIBRARY (admin)
───────────────────────────────────────────────────── */

/* Drop zone */
.media-drop-zone {
  border: 2px dashed var(--border-strong);
  border-radius: 12px;
  background: var(--bg-sunken);
  margin-bottom: 24px;
  transition: border-color .2s, background .2s;
}

.media-drop-zone.is-dragging,
.media-drop-zone:has(.is-dragging) {
  border-color: var(--accent);
  background: var(--accent-bg);
}

.media-drop-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 36px 24px;
  cursor: pointer;
  text-align: center;
  transition: opacity .2s;
}

.media-drop-label.is-uploading { opacity: .5; pointer-events: none; }

.media-drop-icon {
  font-size: 2rem;
  line-height: 1;
  color: var(--text-muted);
}

.media-drop-text {
  font-size: .95rem;
  color: var(--text-muted);
}

.media-drop-browse {
  color: var(--accent);
  text-decoration: underline;
  font-weight: 500;
}

.media-drop-hint {
  font-size: .78rem;
  color: var(--text-faint);
}

/* Toolbar: filter tabs + search */
.media-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.media-filter-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.tab-chip {
  display: inline-flex;
  align-items: center;
  padding: 5px 14px;
  border-radius: 999px;
  font-size: .8rem;
  font-weight: 500;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text-muted);
  text-decoration: none;
  transition: background .15s, color .15s, border-color .15s;
}

.tab-chip:hover {
  background: var(--accent-bg);
  border-color: var(--accent-border);
  color: var(--accent);
}

.tab-chip.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.media-search-form { display: flex; }

.media-search-input {
  padding: 7px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-elevated);
  color: var(--text);
  font-size: .875rem;
  outline: none;
  transition: border-color .15s;
  min-width: 220px;
}

.media-search-input:focus { border-color: var(--accent); }

/* Media grid */
.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

/* Media card */
.media-card {
  position: relative;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-elevated);
  overflow: hidden;
  transition: box-shadow .15s, border-color .15s;
}

.media-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
}

.media-card:has(.media-card__checkbox:checked) {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-border);
}

.media-card__checkbox-label {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 2;
}

.media-card__checkbox {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: var(--accent);
}

.media-card__preview {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--bg-sunken);
}

.media-card__thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.media-card__type-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-size: 2.5rem;
  color: var(--text-faint);
}

.media-card__meta {
  padding: 10px 12px 12px;
  border-top: 1px solid var(--border);
}

.media-card__title {
  font-size: .8rem;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
}

.media-card__info {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.media-card__size {
  font-size: .72rem;
  color: var(--text-faint);
}

/* Type badge chips */
.tag-chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: .7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.tag-chip--image    { background: #dbeafe; color: #1d4ed8; }
.tag-chip--audio    { background: #fce7f3; color: #9d174d; }
.tag-chip--video    { background: #fef3c7; color: #92400e; }
.tag-chip--document { background: #d1fae5; color: #065f46; }

/* Bulk bar */
.media-bulk-bar {
  display: flex;
  justify-content: flex-end;
  padding: 12px 0;
  border-top: 1px solid var(--border);
  margin-top: 8px;
}

/* Media detail (show page) */
.media-detail {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 40px;
  align-items: start;
}

@media (max-width: 768px) {
  .media-detail { grid-template-columns: 1fr; }
}

.media-detail__preview { border-radius: 10px; overflow: hidden; background: var(--bg-sunken); }
.media-detail__image   { width: 100%; display: block; }

.media-detail__icon-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 220px;
  background: var(--bg-sunken);
  border-radius: 10px;
}

.media-detail__type-label {
  font-size: 3rem;
  font-weight: 700;
  color: var(--text-faint);
}

.media-detail__filename {
  font-size: .875rem;
  color: var(--text-muted);
  word-break: break-all;
}

.media-detail__attrs {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px 16px;
  align-items: start;
  font-size: .875rem;
}

.media-detail__attrs dt {
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
}

.media-detail__attrs dd { color: var(--text); }

/* Admin form helpers */
.media-form { max-width: 560px; }

.field-unit { display: flex; flex-direction: column; gap: 4px; margin-bottom: 20px; }

.field-unit__label {
  font-size: .875rem;
  font-weight: 600;
  color: var(--text);
}

.field-unit__hint {
  font-size: .78rem;
  color: var(--text-faint);
}

.field-unit__input,
.field-unit__file {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-elevated);
  color: var(--text);
  font-size: .875rem;
  outline: none;
  transition: border-color .15s;
}

.field-unit__input:focus { border-color: var(--accent); box-shadow: var(--shadow-focus); }

textarea.field-unit__input { resize: vertical; min-height: 80px; }

/* Inline flash for form errors */
.flash-inline {
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 20px;
  font-size: .875rem;
}

.flash-inline--error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
}

.flash-inline ul { margin: 0; padding-left: 16px; }

/* Utility */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

.link { color: var(--accent); text-decoration: underline; }

/* ─────────────────────────────────────────────────────
   AUDIO PLAYER
───────────────────────────────────────────────────── */

.audio-player {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.875rem 1rem;
  max-width: 680px;
  box-shadow: var(--shadow-sm);
}

.audio-player__inner {
  display: flex;
  align-items: center;
  gap: 0.875rem;
}

/* Play / Pause button */
.audio-player__play-btn {
  flex-shrink: 0;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  border: none;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, transform 0.1s;
  position: relative;
}
.audio-player__play-btn:hover { background: var(--accent-hover); }
.audio-player__play-btn:active { transform: scale(0.93); }

/* Icon visibility: show play by default, swap to pause when is-playing */
.audio-player__icon--pause { display: none; }
.audio-player__play-btn.is-playing .audio-player__icon--play  { display: none; }
.audio-player__play-btn.is-playing .audio-player__icon--pause { display: block; }

/* Title + scrubber area */
.audio-player__meta {
  flex: 1;
  min-width: 0;
}

.audio-player__title {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 0.3rem;
  line-height: 1.3;
}

.audio-player__scrubber-row {
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.audio-player__time {
  font-size: 0.6875rem;
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
  white-space: nowrap;
  min-width: 2.25rem;
}
.audio-player__time--total { text-align: right; }

/* Scrubber range */
.audio-player__scrubber {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  border-radius: 2px;
  background:
    linear-gradient(
      to right,
      var(--accent) var(--pct, 0%),
      var(--border) var(--pct, 0%)
    );
  cursor: pointer;
  outline: none;
}
.audio-player__scrubber::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  transition: transform 0.1s;
}
.audio-player__scrubber::-webkit-slider-thumb:hover { transform: scale(1.35); }
.audio-player__scrubber::-moz-range-thumb {
  width: 13px;
  height: 13px;
  border: none;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
}

/* Right-side controls: speed, volume, download */
.audio-player__controls {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.audio-player__speed {
  font-size: 0.6875rem;
  background: var(--bg-sunken);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text);
  padding: 0.2rem 0.25rem;
  cursor: pointer;
  line-height: 1.4;
}
.audio-player__speed:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

.audio-player__vol-label {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  color: var(--text-muted);
}

.audio-player__volume {
  width: 60px;
  -webkit-appearance: none;
  appearance: none;
  height: 3px;
  border-radius: 2px;
  background: var(--border);
  cursor: pointer;
  outline: none;
}
.audio-player__volume::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--text);
  cursor: pointer;
  transition: transform 0.1s;
}
.audio-player__volume::-webkit-slider-thumb:hover { transform: scale(1.25); }
.audio-player__volume::-moz-range-thumb {
  width: 11px;
  height: 11px;
  border: none;
  border-radius: 50%;
  background: var(--text);
  cursor: pointer;
}

.audio-player__download {
  display: flex;
  align-items: center;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.15s;
}
.audio-player__download:hover { color: var(--accent); }

/* Admin media detail — audio preview wrapper */
.media-detail__audio-wrap {
  padding: 1rem 0;
}

/* Responsive: hide volume slider on narrow screens */
@media (max-width: 480px) {
  .audio-player__vol-label { display: none; }
  .audio-player__speed { display: none; }
}
.button--sm     { padding: 6px 14px; font-size: .8rem; }
.button--danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.button--danger:hover { background: color-mix(in srgb, var(--danger) 80%, #000); border-color: color-mix(in srgb, var(--danger) 80%, #000); }

/* ─────────────────────────────────────────────────────
   VIDEO PLAYER
───────────────────────────────────────────────────── */

.video-player {
  background: #000;
  border-radius: 10px;
  overflow: hidden;
  max-width: 800px;
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
}

/* Video screen area */
.video-player__screen {
  position: relative;
  cursor: pointer;
  background: #000;
  line-height: 0; /* remove inline baseline gap */
}

.video-player__video {
  width: 100%;
  display: block;
  max-height: 450px;
  object-fit: contain;
  background: #000;
}

.video-player__no-source {
  padding: 2rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.875rem;
}

/* Controls bar */
.video-player__bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: var(--bg-elevated);
  border-top: 1px solid var(--border);
  flex-wrap: nowrap;
}

/* Play / Pause button */
.video-player__play-btn {
  flex-shrink: 0;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  border: none;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, transform 0.1s;
}
.video-player__play-btn:hover  { background: var(--accent-hover); }
.video-player__play-btn:active { transform: scale(0.93); }

/* Icon swap identical to audio player */
.video-player__icon--pause { display: none; }
.video-player__play-btn.is-playing .video-player__icon--play  { display: none; }
.video-player__play-btn.is-playing .video-player__icon--pause { display: block; }

/* Time displays */
.video-player__time {
  font-size: 0.6875rem;
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
  white-space: nowrap;
  min-width: 2.25rem;
  flex-shrink: 0;
}
.video-player__time--total { text-align: right; }

/* Scrubber */
.video-player__scrubber {
  flex: 1;
  min-width: 40px;
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  border-radius: 2px;
  background:
    linear-gradient(
      to right,
      var(--accent) var(--pct, 0%),
      var(--border) var(--pct, 0%)
    );
  cursor: pointer;
  outline: none;
}
.video-player__scrubber::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  transition: transform 0.1s;
}
.video-player__scrubber::-webkit-slider-thumb:hover { transform: scale(1.35); }
.video-player__scrubber::-moz-range-thumb {
  width: 13px;
  height: 13px;
  border: none;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
}

/* Right-side controls */
.video-player__controls {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.video-player__vol-label {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  color: var(--text-muted);
}

.video-player__volume {
  width: 56px;
  -webkit-appearance: none;
  appearance: none;
  height: 3px;
  border-radius: 2px;
  background: var(--border);
  cursor: pointer;
  outline: none;
}
.video-player__volume::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--text);
  cursor: pointer;
}
.video-player__volume::-moz-range-thumb {
  width: 10px;
  height: 10px;
  border: none;
  border-radius: 50%;
  background: var(--text);
  cursor: pointer;
}

.video-player__speed {
  font-size: 0.6875rem;
  background: var(--bg-sunken);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text);
  padding: 0.2rem 0.25rem;
  cursor: pointer;
}
.video-player__speed:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

.video-player__download,
.video-player__fullscreen-btn {
  display: flex;
  align-items: center;
  background: none;
  border: none;
  padding: 0.2rem;
  color: var(--text-muted);
  cursor: pointer;
  text-decoration: none;
  transition: color 0.15s;
  border-radius: 4px;
}
.video-player__download:hover,
.video-player__fullscreen-btn:hover { color: var(--accent); }

/* Fullscreen state */
.video-player:fullscreen,
.video-player:-webkit-full-screen {
  max-width: 100vw;
  border-radius: 0;
  height: 100vh;
  justify-content: center;
}
.video-player:fullscreen .video-player__screen,
.video-player:-webkit-full-screen .video-player__screen {
  flex: 1;
  overflow: hidden;
}
.video-player:fullscreen .video-player__video,
.video-player:-webkit-full-screen .video-player__video {
  max-height: none;
  height: 100%;
}

/* Admin media detail — video preview wrapper */
.media-detail__video-wrap {
  padding: 0.5rem 0 1rem;
}

/* Responsive: collapse some controls on narrow screens */
@media (max-width: 520px) {
  .video-player__vol-label { display: none; }
  .video-player__speed     { display: none; }
}

/* ─────────────────────────────────────────────────────
   EMBED WIDGETS (shared/_embed.html.erb)
───────────────────────────────────────────────────── */

.embed-widget {
  margin: 1rem 0;
  border-radius: 10px;
  overflow: hidden;
  background: var(--bg-sunken);
}

/* 16:9 ratio container */
.embed-widget__ratio {
  position: relative;
  width: 100%;
}
.embed-widget__ratio iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

/* Fixed-height embeds (Spotify, SoundCloud, Apple Music) */
.embed-widget__frame {
  display: block;
  width: 100%;
  border: 0;
}

/* Provider accent colours on the wrapper */
.embed-widget--youtube    { border: 1px solid #ff000033; }
.embed-widget--vimeo      { border: 1px solid #1ab7ea33; }
.embed-widget--spotify    { border: 1px solid #1DB95433; }
.embed-widget--soundcloud { border: 1px solid #ff551533; }
.embed-widget--apple_music { border: 1px solid #fa233b33; }

/* ─────────────────────────────────────────────────────
   EMBED PICKER PANEL (embed_picker_controller.js)
───────────────────────────────────────────────────── */

.embed-picker-panel {
  margin-top: 0.5rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.embed-picker-panel__inner {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 0.75rem;
  border-bottom: 1px solid var(--border);
}

.embed-picker-panel__input {
  flex: 1;
  min-width: 0;
  height: 34px;
  padding: 0 0.625rem;
  border: 1px solid var(--border-strong);
  border-radius: 5px;
  background: var(--bg);
  color: var(--text);
  font-size: 0.875rem;
}
.embed-picker-panel__input:focus {
  outline: 2px solid var(--accent);
  outline-offset: -1px;
}

.embed-picker-panel__preview {
  padding: 0.75rem;
}

.embed-picker-panel__loading,
.embed-picker-panel__error,
.embed-picker-panel__hint {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin: 0;
  padding: 0.25rem 0;
}

.embed-picker-panel__error { color: var(--danger); }

/* Trix toolbar embed button */
.trix-button--embed {
  font-size: 0.7rem;
  white-space: nowrap;
  padding: 0 8px;
}

/* ─────────────────────────────────────────────────────
   BLOG ENHANCEMENTS (Phase 1.5)
───────────────────────────────────────────────────── */

/* Series badge in post header */
.series-badge {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}
.series-badge .link {
  color: var(--accent);
}

/* Related posts section */
.content-band--muted {
  background: var(--bg-sunken);
  border-top: 1px solid var(--border);
}

.section-heading {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  color: var(--text);
}

.post-grid--compact {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.25rem;
}

/* Series list (series show page) */
.series-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.series-list__item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: border-color 0.15s;
}
.series-list__item:hover {
  border-color: var(--border-strong);
}

.series-list__num {
  flex-shrink: 0;
  font-size: 1.5rem;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: var(--text-faint);
  line-height: 1;
  padding-top: 0.15rem;
}

.series-list__body {
  flex: 1;
  min-width: 0;
}
.series-list__body h2 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}
.series-list__body h2 a {
  color: var(--text);
  text-decoration: none;
}
.series-list__body h2 a:hover {
  color: var(--accent);
}
.series-list__body p {
  margin: 0.2rem 0;
  font-size: 0.875rem;
}

/* Reading time in byline */
.byline { color: var(--text-muted); font-size: 0.9rem; }

/* ─────────────────────────────────────────────────────
   AVATARS
───────────────────────────────────────────────────── */

.avatar {
  display: block;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--bg-sunken);
}

.avatar--sm  { width: 32px;  height: 32px;  }
.avatar--md  { width: 56px;  height: 56px;  }
.avatar--lg  { width: 80px;  height: 80px;  }
.avatar--xl  { width: 112px; height: 112px; }

.avatar--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--text-muted);
  font-size: 1.4rem;
  background: var(--bg-sunken);
  border: 2px solid var(--border);
}

.avatar--xl.avatar--placeholder { font-size: 2.2rem; }

/* ─────────────────────────────────────────────────────
   MEMBER PROFILE PAGE
───────────────────────────────────────────────────── */

.member-profile {
  display: flex;
  align-items: flex-start;
  gap: 28px;
  padding: 56px 0 44px;
}

.member-profile__meta { flex: 1; min-width: 0; }

.member-profile__name {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -.03em;
  margin-bottom: 10px;
}

.member-profile__bio {
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1.6;
  margin-bottom: 8px;
  max-width: 540px;
}

.member-profile__website {
  font-size: .9rem;
  margin-bottom: 0;
}

@media (max-width: 520px) {
  .member-profile {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 36px 0 32px;
    gap: 16px;
  }
  .member-profile__bio { margin: 0 auto 8px; }
}

/* ─────────────────────────────────────────────────────
   SETTINGS PAGE
───────────────────────────────────────────────────── */

.settings-shell {
  max-width: 640px;
  padding-top: 48px;
  padding-bottom: 80px;
}

.settings-shell .page-heading {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -.03em;
  margin-bottom: 40px;
}

.settings-section {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 28px 28px 24px;
  margin-bottom: 28px;
  background: var(--bg-elevated);
}

.settings-section--danger {
  border-color: var(--accent-border);
  background: var(--accent-bg);
}

.settings-section__heading {
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -.01em;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.settings-section--danger .settings-section__heading {
  border-bottom-color: var(--accent-border);
}

.settings-section__desc {
  color: var(--text-muted);
  font-size: .9rem;
  margin-bottom: 14px;
}

.settings-form { display: flex; flex-direction: column; gap: 0; }

.settings-actions {
  display: flex;
  justify-content: flex-end;
  padding-top: 8px;
}

.settings-avatar-preview {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 10px;
}

@media (max-width: 640px) {
  .settings-section { padding: 20px 16px 18px; }
  .settings-shell   { padding-top: 28px; }
}

/* ── Impersonation banner ──────────────────────────────────────────────────── */
.impersonation-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 20px;
  background: oklch(75% 0.18 60);
  color: #000;
  font-size: .875rem;
  font-weight: 500;
  position: sticky;
  top: 0;
  z-index: 1000;
  border-bottom: 2px solid var(--accent);
}
.impersonation-banner__label { flex: 1; }

/* ── Role badge ───────────────────────────────────────────────────────────── */
.role-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .02em;
  text-transform: uppercase;
}
.role-badge--admin      { background: oklch(40% 0.2 300); color: #fff; }
.role-badge--editor     { background: oklch(45% 0.2 240); color: #fff; }
.role-badge--author     { background: oklch(50% 0.15 170); color: #fff; }
.role-badge--subscriber { background: oklch(60% 0.15 60); color: #000; }
.role-badge--member     { background: var(--border); color: var(--text); }

/* ── Status badge ─────────────────────────────────────────────────────────── */
.status-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: .75rem;
  font-weight: 600;
}
.status-badge--verified   { background: oklch(85% 0.12 145); color: oklch(30% 0.12 145); }
.status-badge--unverified { background: var(--border); color: var(--text-muted); }
.status-badge--banned     { background: oklch(85% 0.18 30); color: oklch(25% 0.18 30); }
.status-badge--active     { background: oklch(88% 0.1 145); color: oklch(35% 0.1 145); }

/* ── User admin table ─────────────────────────────────────────────────────── */
.user-table-wrapper { overflow-x: auto; }

.user-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .875rem;
}
.user-table th {
  padding: 8px 12px;
  text-align: left;
  font-weight: 600;
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}
.user-table td {
  padding: 10px 12px;
  vertical-align: middle;
  border-bottom: 1px solid var(--border);
}
.user-table tbody tr:hover { background: var(--bg-elevated); }
.user-table__row--banned td { opacity: .6; }
.user-table__check { width: 36px; }
.user-table__date  { color: var(--text-muted); white-space: nowrap; }
.user-table__actions { text-align: right; white-space: nowrap; }
.user-table--compact td, .user-table--compact th { padding: 6px 10px; }

.button--xs {
  padding: 3px 10px;
  font-size: .75rem;
}
.button--warning {
  background: oklch(75% 0.18 60);
  color: #000;
  border: none;
}
.button--warning:hover { background: oklch(70% 0.2 60); }

/* ── User show page ───────────────────────────────────────────────────────── */
.user-show-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.user-show-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  align-items: start;
}
.user-attr-list {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 8px 16px;
  font-size: .9rem;
}
.user-attr-list dt {
  font-weight: 600;
  color: var(--text-muted);
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  align-self: center;
}
.user-show-section-heading {
  font-size: .95rem;
  font-weight: 600;
  margin: 0 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.user-show-post-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: .875rem;
}
.user-show-audit { margin-top: 32px; }
.empty-state--inline { color: var(--text-muted); font-size: .875rem; }

.form-select {
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-elevated);
  color: var(--text);
  font-size: .875rem;
}

@media (max-width: 900px) {
  .user-show-grid { grid-template-columns: 1fr; }
}

/* ─────────────────────────────────────────────────────
   SHOP — product grid + product detail
───────────────────────────────────────────────────── */

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 24px;
  padding-top: 8px;
}

.product-card {
  background: var(--bg-elevated);
  border-radius: 10px;
  border: 1px solid var(--border);
  overflow: hidden;
  transition: box-shadow .2s, transform .2s;
}

.product-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

/* Square cover image */
.product-card__media {
  display: block;
  overflow: hidden;
  aspect-ratio: 1 / 1;
  background: var(--bg-sunken);
}

.product-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .4s;
}

.product-card:hover .product-card__media img { transform: scale(1.04); }

.product-card__media--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  color: var(--text-faint);
  text-decoration: none;
}

.product-card__body { padding: 16px 20px 20px; }

.product-card__body h2 { font-size: 1.1rem; margin: 0 0 6px; }
.product-card__body h2 a { color: var(--text); text-decoration: none; }
.product-card__body h2 a:hover { color: var(--accent); }
.product-card__body p  { font-size: .875rem; color: var(--text-muted); margin: 0 0 10px; line-height: 1.5; }

.product-card__price {
  font-weight: 700;
  font-size: 1rem;
  color: var(--accent);
  margin: 0 !important;
}

.product-card__price--free { color: var(--success); }

/* ── Product detail page ──────────────────────────────────────────── */

.product-detail { padding: 48px 0 80px; }

.product-detail__inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: start;
}

.product-detail__cover {
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--border);
  display: block;
}

.product-detail__cover--placeholder {
  aspect-ratio: 1 / 1;
  background: var(--bg-sunken);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 5rem;
  color: var(--text-faint);
}

.product-detail__info h1 { margin: 12px 0; font-size: 2rem; }

.product-detail__price {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--accent);
  margin: 0 0 24px;
}

.product-detail__price--free { color: var(--success); }

.product-detail__description {
  margin: 0 0 28px;
  line-height: 1.75;
  color: var(--text-muted);
}

.product-detail__description p { margin: 0 0 .75em; }

.product-detail__actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.product-detail__actions .btn[disabled] {
  opacity: .6;
  cursor: not-allowed;
  pointer-events: none;
}

.product-detail__coming-soon {
  font-size: .8rem;
  color: var(--text-faint);
  margin: 0 0 24px;
}

.product-detail__back {
  font-size: .875rem;
  color: var(--text-muted);
}

.product-detail__back:hover { color: var(--accent); }

@media (max-width: 768px) {
  .product-grid { grid-template-columns: 1fr; }
  .product-detail__inner { grid-template-columns: 1fr; gap: 28px; }
  .product-detail__info h1 { font-size: 1.5rem; }
}

/* ─────────────────────────────────────────────────────
   CART — header toggle, sidebar drawer, item list
───────────────────────────────────────────────────── */

/* ── Cart toggle button in header ─────────────────────────────────────────── */
.cart-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  background: transparent;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  cursor: pointer;
  transition: background .15s, border-color .15s;
}

.cart-toggle:hover {
  background: var(--bg-sunken);
  border-color: var(--border-strong);
}

.cart-toggle__badge {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  background: var(--accent);
  border-radius: 9px;
  color: #fff;
  font-size: .65rem;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  pointer-events: none;
}

/* ── Dimmed overlay ────────────────────────────────────────────────────────── */
.cart-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .45);
  z-index: 200;
  backdrop-filter: blur(2px);
}

.cart-overlay--visible { display: block; }

/* Prevent body scroll when cart is open */
body.cart-open { overflow: hidden; }

/* ── Sliding panel ────────────────────────────────────────────────────────── */
.cart-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(400px, 100vw);
  background: var(--bg-elevated);
  border-left: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  z-index: 210;
  transform: translateX(100%);
  transition: transform .28s cubic-bezier(.4, 0, .2, 1);
}

.cart-panel--open { transform: translateX(0); }

.cart-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.cart-panel__title {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.cart-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 5px;
  background: var(--accent);
  border-radius: 11px;
  color: #fff;
  font-size: .7rem;
  font-weight: 700;
  line-height: 1;
}

.cart-close-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  background: transparent;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  color: var(--text-muted);
  cursor: pointer;
  font-size: .9rem;
  transition: color .15s, border-color .15s;
}

.cart-close-btn:hover { color: var(--text); border-color: var(--border-strong); }

.cart-panel__body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
}

/* ── Cart item list ────────────────────────────────────────────────────────── */
.cart-empty {
  text-align: center;
  color: var(--text-muted);
  padding: 32px 0;
}

.cart-item-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cart-item {
  display: grid;
  grid-template-columns: 56px 1fr auto auto;
  align-items: center;
  gap: 10px;
  padding: 10px;
  background: var(--bg-sunken);
  border-radius: 8px;
  border: 1px solid var(--border);
}

.cart-item__thumb {
  width: 56px;
  height: 56px;
  border-radius: 6px;
  overflow: hidden;
  background: var(--bg-elevated);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.cart-item__thumb img { width: 100%; height: 100%; object-fit: cover; }
.cart-item__thumb--empty { font-size: 1.4rem; color: var(--text-faint); }

.cart-item__details { min-width: 0; }
.cart-item__name { font-size: .875rem; font-weight: 600; margin: 0 0 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cart-item__name a { color: var(--text); text-decoration: none; }
.cart-item__name a:hover { color: var(--accent); }
.cart-item__price { font-size: .8rem; color: var(--text-muted); margin: 0; }

/* Quantity controls */
.cart-item__qty {
  display: flex;
  align-items: center;
  gap: 4px;
}

.qty-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  padding: 0;
  background: var(--bg-elevated);
  border: 1.5px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  cursor: pointer;
  font-size: .9rem;
  line-height: 1;
  font-weight: 700;
  transition: background .15s;
}

.qty-btn:hover { background: var(--bg-sunken); border-color: var(--border-strong); }

.qty-value {
  min-width: 24px;
  text-align: center;
  font-size: .875rem;
  font-weight: 600;
}

.cart-item__remove {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  background: transparent;
  border: none;
  color: var(--text-faint);
  cursor: pointer;
  font-size: .8rem;
  border-radius: 6px;
  transition: color .15s, background .15s;
}

.cart-item__remove:hover { color: var(--danger); background: var(--bg-sunken); }

/* ── Cart total + checkout ─────────────────────────────────────────────────── */
.cart-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 0 10px;
  border-top: 1px solid var(--border);
  margin-top: 12px;
  font-weight: 600;
}

.cart-checkout-row { margin-top: 12px; }

.cart-checkout-soon {
  font-size: .75rem;
  color: var(--text-faint);
  text-align: center;
  margin: 6px 0 0;
}

/* ── Full cart page ────────────────────────────────────────────────────────── */
.cart-page { max-width: 600px; }

/* ─────────────────────────────────────────────────────
   CHECKOUT page
───────────────────────────────────────────────────── */

.checkout-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 40px;
  align-items: start;
  padding: 8px 0 40px;
}

.checkout-section { margin-bottom: 28px; }

.checkout-section__title {
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.checkout-error {
  padding: 10px 14px;
  background: color-mix(in srgb, var(--danger) 12%, var(--bg-elevated));
  border: 1px solid color-mix(in srgb, var(--danger) 35%, var(--bg-elevated));
  border-radius: 8px;
  color: var(--danger);
  font-size: .875rem;
  margin-bottom: 16px;
}

.checkout-secure-note {
  margin: 12px 0 0;
  font-size: .75rem;
  color: var(--text-faint);
  text-align: center;
}

.checkout-secure-note a { color: var(--text-muted); }

/* ── Order summary sidebar ────────────────────────────────────────────────── */
.checkout-summary {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
  position: sticky;
  top: 80px;
}

.checkout-item-list {
  list-style: none;
  padding: 0;
  margin: 0 0 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.checkout-item {
  display: grid;
  grid-template-columns: 40px 1fr auto;
  gap: 8px;
  align-items: center;
}

.checkout-item__thumb {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  overflow: hidden;
  background: var(--bg-sunken);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  color: var(--text-faint);
  flex-shrink: 0;
}

.checkout-item__thumb img { width: 100%; height: 100%; object-fit: cover; }
.checkout-item__name { font-size: .875rem; font-weight: 600; margin: 0; }
.checkout-item__qty  { font-size: .75rem; color: var(--text-muted); margin: 0; }
.checkout-item__price { font-size: .875rem; font-weight: 600; }

.checkout-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  font-weight: 600;
}

/* ── Confirmation page ────────────────────────────────────────────────────── */
.checkout-confirmation {
  max-width: 580px;
  margin: 0 auto;
  text-align: center;
  padding: 40px 0 80px;
}

.confirmation-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  background: color-mix(in srgb, var(--success) 15%, var(--bg-elevated));
  border-radius: 50%;
  color: var(--success);
  font-size: 1.75rem;
  margin-bottom: 24px;
}

.confirmation-icon--pending {
  background: color-mix(in srgb, var(--accent) 12%, var(--bg-elevated));
  color: var(--accent);
}

.checkout-confirmation h1 { margin: 0 0 10px; font-size: 1.75rem; }
.confirmation-subhead { color: var(--text-muted); margin: 0 0 28px; }

.confirmation-details {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
  text-align: left;
  margin-bottom: 28px;
}

.confirmation-ref {
  font-size: .8rem;
  color: var(--text-muted);
  margin: 0 0 14px;
}

.confirmation-items {
  list-style: none;
  padding: 0;
  margin: 0 0 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.confirmation-items li {
  display: flex;
  justify-content: space-between;
  font-size: .875rem;
}

.confirmation-total {
  display: flex;
  justify-content: space-between;
  font-weight: 700;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

@media (max-width: 768px) {
  .checkout-layout {
    grid-template-columns: 1fr;
    gap: 28px;
  }
  .checkout-summary { position: static; }
}

/* ─────────────────────────────────────────────────────
   ACCOUNT — Downloads page
───────────────────────────────────────────────────── */

.downloads-page { max-width: 720px; }

.downloads-empty {
  text-align: center;
  padding: 60px 0;
}

.downloads-empty__message {
  color: var(--text-muted);
  margin-bottom: 20px;
  font-size: 1.05rem;
}

/* ── Product groups ───────────────────────────────── */
.download-product-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.download-product {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}

.download-product__header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--accent) 4%, var(--bg-elevated));
}

.download-product__name {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
}

.download-product__count {
  font-size: .8rem;
  color: var(--text-muted);
}

/* ── Individual file rows ─────────────────────────── */
.download-file-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.download-file {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
}

.download-file:last-child { border-bottom: none; }

.download-file__meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.download-file__name {
  font-weight: 500;
  font-size: .925rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.download-file__size {
  font-size: .75rem;
  color: var(--text-muted);
}

.download-btn {
  flex-shrink: 0;
  font-size: .8rem;
  padding: 5px 14px;
}

/* ── Admin file lists (inside Administrate) ───────── */
.admin-file-list { list-style: none; padding: 0; margin: 0; }
.admin-file-item { padding: 4px 0; font-size: .875rem; }
.admin-file-link { color: var(--accent); }
.admin-file-meta { color: var(--text-muted); font-size: .75rem; margin-left: 6px; }
.admin-file-empty { color: var(--text-faint); }
.admin-current-files { margin-bottom: 10px; padding: 10px; background: var(--bg-sunken); border-radius: 6px; }
.admin-current-files__label { font-size: .75rem; font-weight: 600; color: var(--text-muted); margin: 0 0 6px; }
.admin-current-files__hint { font-size: .75rem; color: var(--text-muted); margin: 8px 0 0; }

@media (max-width: 600px) {
  .download-file { flex-wrap: wrap; }
  .download-file__meta { flex: 1 1 100%; }
}

/* ─────────────────────────────────────────────────────
   ADMIN — Order show & Revenue
───────────────────────────────────────────────────── */

/* Order status pill next to the heading */
.admin-status-pill {
  display: inline-block;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 20px;
  vertical-align: middle;
  margin-left: 8px;
}
.admin-status-pill--pending  { background: #f5e9c8; color: #7a5a00; }
.admin-status-pill--paid     { background: #c8f5d0; color: #0a5e23; }
.admin-status-pill--failed   { background: #f5c8c8; color: #7a0000; }
.admin-status-pill--refunded { background: #e4e4e4; color: #444; }

.admin-order-actions { display: flex; gap: 10px; align-items: center; }

/* Revenue page */
.revenue-summary-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 32px;
}

.revenue-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 24px;
  min-width: 180px;
}

.revenue-card__label {
  font-size: .75rem;
  color: var(--text-muted);
  margin: 0 0 4px;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.revenue-card__total {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 0 2px;
}

.revenue-card__meta {
  font-size: .8rem;
  color: var(--text-muted);
  margin: 0;
}

.revenue-section-title {
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.revenue-empty {
  color: var(--text-muted);
  font-style: italic;
}

.revenue-table-wrap { overflow-x: auto; }

.revenue-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .9rem;
}

.revenue-table th,
.revenue-table td {
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.revenue-table thead th {
  font-weight: 700;
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-muted);
  background: var(--bg-elevated);
}

.revenue-table tbody tr:hover { background: var(--bg-elevated); }
.revenue-table__amount { text-align: right !important; font-variant-numeric: tabular-nums; }

/* ──────────────────────────────────────────────────────────────────────────────
   COMMUNITY — Phase 4
   ────────────────────────────────────────────────────────────────────────────── */

.community-page { padding-block: 2.5rem; }

/* Forum index — list of forums */
.forum-list { display: flex; flex-direction: column; gap: .75rem; margin-top: 1.5rem; }

.forum-card {
  display: grid;
  grid-template-columns: 2.5rem 1fr auto;
  gap: 1rem;
  align-items: start;
  padding: 1.25rem;
  background: var(--bg-elevated);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  text-decoration: none;
}

.forum-card__icon  { font-size: 1.5rem; line-height: 1; padding-top: .1rem; }
.forum-card__name  { font-size: 1.05rem; font-weight: 600; margin: 0 0 .2rem; display: flex; align-items: center; gap: .5rem; }
.forum-card__link  { color: var(--text); text-decoration: none; }
.forum-card__link:hover { color: var(--forum-accent, var(--accent)); }
.forum-card__description { font-size: .9rem; color: var(--text-muted); margin: 0; }
.forum-card__stats { font-size: .82rem; color: var(--text-muted); text-align: right; white-space: nowrap; display: flex; flex-direction: column; gap: .2rem; }
.forum-stat { display: block; }

.forum-badge {
  font-size: .7rem; font-weight: 600; padding: .1rem .45rem;
  border-radius: 999px; text-transform: uppercase; letter-spacing: .04em;
}
.forum-badge--members_only    { background: var(--forum-accent, var(--accent)); color: #fff; }
.forum-badge--subscribers_only { background: #7c3aed; color: #fff; }

/* Thread list — inside a forum */
.thread-list { display: flex; flex-direction: column; gap: .5rem; margin-top: 1.25rem; }

.thread-row {
  display: grid;
  grid-template-columns: 2rem 1fr auto;
  gap: .75rem;
  align-items: start;
  padding: .9rem 1rem;
  background: var(--bg-elevated);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.thread-row--pinned { border-left: 3px solid var(--accent); }
.thread-row--locked { opacity: .8; }

.thread-row__meta-icons { font-size: .9rem; }
.thread-badge { font-size: .9rem; }

.thread-row__title { font-size: .97rem; font-weight: 600; margin: 0 0 .2rem; }
.thread-row__link  { color: var(--text); text-decoration: none; }
.thread-row__link:hover { color: var(--accent); }
.thread-row__byline { font-size: .82rem; color: var(--text-muted); margin: 0; }

.thread-row__stats { font-size: .82rem; color: var(--text-muted); text-align: right; display: flex; flex-direction: column; gap: .15rem; white-space: nowrap; }
.thread-stat { display: block; }
.thread-stat--last-reply { font-size: .78rem; }

/* Thread show — original post + replies */
.forum-post {
  display: grid;
  grid-template-columns: 2.5rem 1fr;
  gap: 1rem;
  padding: 1.25rem;
  background: var(--bg-elevated);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin-bottom: .75rem;
}
.forum-post--op { border-left: 3px solid var(--accent); }

.forum-post__avatar {
  width: 2.2rem; height: 2.2rem;
  border-radius: 50%;
  background: var(--accent);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.forum-post__initials { color: #fff; font-size: .85rem; font-weight: 700; }

.forum-post__header {
  display: flex; flex-wrap: wrap; align-items: center; gap: .5rem;
  margin-bottom: .6rem;
}
.forum-post__author { font-size: .9rem; }
.forum-post__time   { font-size: .8rem; color: var(--text-muted); }
.forum-post__body   { font-size: .95rem; line-height: 1.65; }

.reply-list { margin-top: 1.5rem; margin-bottom: 1rem; }

.solution-badge {
  font-size: .75rem; font-weight: 700; color: #16a34a;
  padding: .1rem .4rem; border-radius: 4px;
  background: #dcfce7;
}

/* Reply form */
.reply-form { margin-top: 2rem; }
.locked-notice, .login-prompt {
  margin-top: 2rem; padding: 1rem 1.25rem;
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: var(--radius); color: var(--text-muted); font-size: .9rem;
}

/* New thread form */
.thread-form { max-width: 680px; }

/* Page header utilities used in community */
.page-header         { margin-bottom: 1.5rem; }
.page-header__back   { margin-bottom: .5rem; }
.page-header__title  { font-size: 1.9rem; font-weight: 700; margin: 0 0 .35rem; }
.page-header__lead   { color: var(--text-muted); margin: 0 0 1rem; }
.page-header__byline { color: var(--text-muted); font-size: .88rem; margin: .25rem 0 0; }
.back-link           { font-size: .88rem; color: var(--text-muted); text-decoration: none; }
.back-link:hover     { color: var(--forum-accent, var(--accent)); }

@media (max-width: 600px) {
  .forum-card  { grid-template-columns: 2rem 1fr; }
  .forum-card__stats { display: none; }
  .thread-row  { grid-template-columns: 2rem 1fr; }
  .thread-row__stats { display: none; }
  .forum-post  { grid-template-columns: 1fr; }
  .forum-post__avatar { display: none; }
}

/* ── Phase 4.2: Likes & Reports ─────────────────────────────────────────── */
.forum-post__actions {
  display: flex; align-items: center; gap: .75rem; flex-wrap: wrap;
  margin-top: .75rem; padding-top: .75rem;
  border-top: 1px solid var(--border);
}

/* button_to generates a <form> — collapse it so it renders inline */
.forum-post__actions form { display: contents; }

.like-wrap  { display: flex; align-items: center; gap: .35rem; }
.like-btn {
  background: none; border: 1px solid var(--border); color: var(--text-muted);
  padding: .18rem .55rem; border-radius: var(--radius-sm); font-size: .82rem;
  cursor: pointer; line-height: 1.4; transition: border-color .15s, color .15s;
}
.like-btn:hover        { border-color: var(--accent); color: var(--accent); }
.like-btn--active      { border-color: var(--accent); color: var(--accent);
                         background: color-mix(in oklch, var(--accent) 10%, transparent); }
.like-btn[disabled]    { cursor: default; opacity: .45; }
.like-count            { font-size: .82rem; color: var(--text-muted); font-weight: 600; }

.report-wrap    { display: contents; }
.report-details { list-style: none; }
.report-link    { font-size: .82rem; color: var(--text-muted); cursor: pointer; user-select: none; }
.report-link:hover { color: var(--accent); }
.report-form-inner { margin-top: .45rem; }
.report-form { display: flex; flex-direction: column; gap: .4rem; max-width: 340px; }
.report-textarea {
  width: 100%; font-size: .85rem; padding: .4rem .6rem;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--bg); color: var(--text); resize: vertical; min-height: 3rem;
}
.report-submit-btn {
  align-self: flex-start; background: #c0392b; color: #fff; border: none;
  padding: .25rem .7rem; border-radius: var(--radius-sm); font-size: .82rem;
  cursor: pointer;
}
.report-submit-btn:hover { background: #a93226; }
.report-confirmation { font-size: .82rem; color: var(--text-muted); }
.reported-badge {
  font-size: .78rem; color: #c0392b;
  background: color-mix(in oklch, #c0392b 10%, transparent);
  padding: .15rem .45rem; border-radius: var(--radius-sm);
}

/* ── Phase 4.2: Admin Moderation Queue ──────────────────────────────────── */
.moderation-count { color: var(--text-muted); font-size: .9rem; margin-bottom: .75rem; }
.moderation-queue { display: flex; flex-direction: column; gap: 1.25rem; }
.moderation-row {
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.25rem 1.5rem;
}
.moderation-row__meta { font-size: .85rem; color: var(--text-muted); margin-bottom: .5rem; }
.moderation-row__meta strong { color: var(--text); }
.moderation-row__meta a      { color: var(--accent); text-decoration: none; }
.moderation-row__meta a:hover { text-decoration: underline; }
.moderation-row__reason {
  font-style: italic; font-size: .88rem; color: var(--text-muted);
  background: var(--bg); padding: .4rem .75rem;
  border-left: 3px solid var(--accent); margin: .5rem 0;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.moderation-row__body  { font-size: .92rem; margin: .5rem 0 1rem; line-height: 1.55; }
.moderation-row__actions { display: flex; gap: .6rem; flex-wrap: wrap; }
.moderation-empty { color: var(--text-muted); font-size: .95rem; margin-top: 1.5rem; }

/* ─────────────────────────────────────────────────────
   PHASE 4.3 — PER-REPLY DELETE BUTTON
───────────────────────────────────────────────────── */

.reply-delete-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-faint);
  font-size: .78rem;
  padding: 2px 8px;
  border-radius: 5px;
  cursor: pointer;
  line-height: 1.5;
  transition: color .15s, background .15s, border-color .15s;
}
.reply-delete-btn:hover {
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 40%, transparent);
  background: color-mix(in srgb, var(--danger) 8%, transparent);
}

/* ─────────────────────────────────────────────────────
   PHASE 4.4 — NOTIFICATION BELL
───────────────────────────────────────────────────── */

/* Bell icon in site header */
.notification-bell {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  text-decoration: none;
  padding: 4px;
  border-radius: 6px;
  transition: color .15s, background .15s;
}
.notification-bell:hover        { color: var(--text); background: var(--bg-sunken); }
.notification-bell--active      { color: var(--accent); }
.notification-bell--active:hover { color: var(--accent); }

.notification-bell__badge {
  position: absolute;
  top: -2px;
  right: -4px;
  min-width: 16px;
  height: 16px;
  padding: 0 3px;
  border-radius: 9999px;
  background: var(--accent);
  color: #fff;
  font-size: .65rem;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
  pointer-events: none;
}

/* Notification list page */
.notification-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  max-width: 680px;
}

.notification-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  padding: .875rem 1rem;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  font-size: .9rem;
  transition: background .15s;
}
.notification-item:last-child { border-bottom: none; }
.notification-item:hover      { background: var(--bg-sunken); }

.notification-item__content { flex: 1; line-height: 1.5; }
.notification-item__time    { font-size: .78rem; color: var(--text-muted); white-space: nowrap; flex-shrink: 0; padding-top: .1rem; }

.notification-link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}
.notification-link:hover { text-decoration: underline; }

/* ─────────────────────────────────────────────────────
   PHASE 5 — ADMIN GROUP CHAT
───────────────────────────────────────────────────── */

/* Overall two-panel layout */
.chat-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  grid-template-rows: 1fr;
  height: calc(100vh - 120px);
  min-height: 400px;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: var(--bg-elevated);
}

/* Sidebar */
.chat-sidebar {
  display: flex;
  flex-direction: column;
  background: var(--bg-sunken);
  border-right: 1px solid var(--border);
  overflow-y: auto;
}

.chat-sidebar__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .75rem 1rem .5rem;
  border-bottom: 1px solid var(--border);
}

.chat-sidebar__title {
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
  margin: 0;
}

.chat-sidebar__add {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1;
  flex-shrink: 0;
}

.chat-sidebar__channels {
  flex: 1;
  padding: .5rem 0;
}

.chat-sidebar__channel {
  display: flex;
  align-items: center;
  gap: .35rem;
  padding: .375rem 1rem;
  text-decoration: none;
  color: var(--text-muted);
  font-size: .875rem;
  border-radius: 0;
  transition: background .12s, color .12s;
}
.chat-sidebar__channel:hover          { background: var(--bg-elevated); color: var(--text); }
.chat-sidebar__channel--active        { background: var(--bg-elevated); color: var(--text); font-weight: 600; }

.chat-sidebar__channel-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-sidebar__lock         { font-size: .75rem; }

.chat-sidebar__empty {
  padding: 1rem;
  font-size: .8rem;
  color: var(--text-muted);
}

.chat-sidebar__footer {
  padding: .75rem;
  border-top: 1px solid var(--border);
}

/* Main panel */
.chat-main {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.chat-main__header {
  padding: .75rem 1.25rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.chat-main__title {
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 .15rem;
}

.chat-main__desc {
  font-size: .8rem;
  color: var(--text-muted);
  margin: 0;
}

/* Message list */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: .75rem 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.chat-empty-state {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: .9rem;
  padding: 2rem;
}

/* Individual message */
.chat-message {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 0 .75rem;
  padding: .375rem 1.25rem;
  transition: background .1s;
}
.chat-message:hover           { background: var(--bg-sunken); }
.chat-message--own            {}
.chat-message--deleted        { grid-template-columns: 1fr; opacity: .55; }

.chat-message__avatar {
  padding-top: .2rem;
  flex-shrink: 0;
}
.chat-message__avatar-img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
}
.chat-message__avatar-placeholder {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: .875rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chat-message__body   { min-width: 0; }
.chat-message__meta   { display: flex; align-items: baseline; gap: .5rem; margin-bottom: .1rem; }
.chat-message__author { font-size: .875rem; font-weight: 700; }
.chat-message__time   { font-size: .72rem; color: var(--text-muted); }
.chat-message__edited { font-size: .72rem; color: var(--text-muted); font-style: italic; }
.chat-message__text   { font-size: .875rem; line-height: 1.5; margin: 0; white-space: pre-wrap; word-break: break-word; }

.chat-message__attachment { margin-top: .4rem; }
.chat-message__image      { max-width: 360px; max-height: 280px; border-radius: 6px; display: block; }
.chat-message__file-link  { font-size: .8rem; color: var(--accent); text-decoration: none; }
.chat-message__file-link:hover { text-decoration: underline; }

.chat-message__deleted-body { padding: .25rem 0; }
.chat-message__deleted-text { font-size: .8rem; color: var(--text-muted); }

/* Message action bar (shows on hover) */
.chat-message__actions {
  display: none;
  align-items: center;
  gap: .25rem;
  margin-top: .25rem;
}
.chat-message:hover .chat-message__actions { display: flex; }

.chat-action-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 6px;
  font-size: .85rem;
  cursor: pointer;
  color: var(--text-muted);
  transition: background .12s, color .12s;
}
.chat-action-btn:hover           { background: var(--bg-sunken); color: var(--text); }
.chat-action-btn--danger:hover   { background: color-mix(in srgb, var(--danger) 10%, transparent); color: var(--danger); }

/* Emoji picker */
.chat-emoji-picker { position: relative; }

.chat-emoji-picker__panel {
  position: absolute;
  bottom: calc(100% + 4px);
  left: 0;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: .4rem;
  display: flex;
  flex-wrap: wrap;
  gap: .2rem;
  z-index: 50;
  box-shadow: 0 4px 16px rgba(0,0,0,.12);
}

.chat-emoji-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.2rem;
  padding: .25rem;
  border-radius: 4px;
  transition: background .1s;
  line-height: 1;
}
.chat-emoji-btn:hover { background: var(--bg-sunken); }

/* Reaction chips */
.chat-reactions {
  display: flex;
  flex-wrap: wrap;
  gap: .25rem;
  margin-top: .35rem;
}

.chat-reaction-chip {
  display: inline-flex;
  align-items: center;
  gap: .2rem;
  padding: 2px 7px;
  border-radius: 9999px;
  border: 1px solid var(--border);
  background: var(--bg-sunken);
  font-size: .8rem;
  cursor: pointer;
  transition: background .12s, border-color .12s;
}
.chat-reaction-chip:hover      { background: var(--bg-elevated); }
.chat-reaction-chip--own       { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); }

/* Composer */
.chat-composer {
  border-top: 1px solid var(--border);
  padding: .75rem 1.25rem;
  flex-shrink: 0;
  background: var(--bg-elevated);
}

.chat-composer__form {
  display: flex;
  flex-direction: column;
  gap: .5rem;
}

.chat-composer__input {
  width: 100%;
  padding: .5rem .75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font-size: .875rem;
  resize: none;
  line-height: 1.4;
  transition: border-color .15s;
  font-family: inherit;
  box-sizing: border-box;
}
.chat-composer__input:focus   { outline: none; border-color: var(--accent); }

.chat-composer__actions {
  display: flex;
  align-items: center;
  gap: .5rem;
}

.chat-composer__attach-label {
  cursor: pointer;
  font-size: 1.1rem;
  padding: 3px 6px;
  border-radius: 4px;
  border: 1px solid var(--border);
  color: var(--text-muted);
  transition: background .12s;
}
.chat-composer__attach-label:hover { background: var(--bg-sunken); }

.chat-composer__file-input { display: none; }
.chat-composer__filename   { font-size: .75rem; color: var(--text-muted); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-composer__send       { margin-left: auto; }

/* Edit form */
.chat-edit-form { margin-top: .5rem; }

/* New channel form (floats over layout) */
.chat-channel-form {
  position: absolute;
  bottom: 80px;
  left: 240px;
  width: 320px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.25rem;
  box-shadow: 0 8px 32px rgba(0,0,0,.15);
  z-index: 20;
}

/* ─────────────────────────────────────────────────────
   PHASE 6 — ALBUM MANAGER
───────────────────────────────────────────────────── */

/* Admin kanban */
.album-kanban {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  align-items: start;
}
@media (max-width: 900px) { .album-kanban { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 540px) { .album-kanban { grid-template-columns: 1fr; } }

.album-kanban__column {
  background: var(--bg-sunken);
  border-radius: 10px;
  padding: .75rem;
}

.album-kanban__status {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
  margin: 0 0 .75rem;
}

.album-kanban__empty  { font-size: .8rem; color: var(--text-muted); padding: .5rem 0; }

.album-kanban__cards  { display: flex; flex-direction: column; gap: .5rem; }

/* Album card (kanban) */
.album-card {
  background: var(--bg-elevated);
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
  transition: box-shadow .15s;
}
.album-card:hover { box-shadow: 0 2px 12px rgba(0,0,0,.1); }

.album-card__artwork {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
}
.album-card__artwork--placeholder {
  background: var(--bg-sunken);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  aspect-ratio: 1;
}
.album-card__body   { padding: .6rem .75rem; }
.album-card__title  { display: block; font-size: .85rem; font-weight: 600; text-decoration: none; color: var(--text); }
.album-card__artist { display: block; font-size: .75rem; color: var(--text-muted); margin-top: .1rem; }
.album-card__meta   { display: flex; gap: .5rem; font-size: .72rem; color: var(--text-muted); margin-top: .3rem; }

/* Album detail page */
.album-detail { display: grid; grid-template-columns: 240px 1fr; gap: 2rem; align-items: start; }
@media (max-width: 640px) { .album-detail { grid-template-columns: 1fr; } }

.album-detail__sidebar {}

.album-detail__artwork {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 8px;
  display: block;
  margin-bottom: 1rem;
}
.album-detail__artwork--placeholder {
  background: var(--bg-sunken);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  border-radius: 8px;
  aspect-ratio: 1;
  margin-bottom: 1rem;
}

.album-detail__meta { display: grid; grid-template-columns: auto 1fr; gap: .3rem .75rem; font-size: .85rem; margin: 0; }
.album-detail__meta dt { color: var(--text-muted); font-weight: 600; }
.album-detail__meta dd { margin: 0; }
.album-detail__desc { font-size: .875rem; color: var(--text-muted); margin-top: .75rem; line-height: 1.5; }

.album-section { margin-bottom: 1.5rem; }
.album-section__header { display: flex; align-items: center; justify-content: space-between; margin-bottom: .75rem; }
.album-section__header h2 { font-size: 1rem; font-weight: 700; margin: 0; }
.album-empty { font-size: .875rem; color: var(--text-muted); }

/* Collaborator list */
.collaborator-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .4rem; }
.collaborator-item { display: flex; align-items: center; gap: .5rem; font-size: .875rem; }
.collaborator-item__name { flex: 1; }
.album-badge { display: inline-block; padding: 2px 8px; border-radius: 9999px; font-size: .7rem; font-weight: 600; }
.album-badge--producer { background: #7c3aed22; color: #7c3aed; }
.album-badge--engineer { background: #059669223; color: #059669; }
.album-badge--artist   { background: color-mix(in srgb, var(--accent) 15%, transparent); color: var(--accent); }
.album-badge--manager  { background: #2563eb22; color: #2563eb; }

/* Track list (admin drag-to-reorder) */
.track-list { border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }

.track-row {
  display: grid;
  grid-template-columns: 20px 28px 1fr auto;
  align-items: center;
  gap: .5rem;
  padding: .6rem .75rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg-elevated);
  cursor: grab;
  transition: background .1s;
}
.track-row:last-child   { border-bottom: none; }
.track-row:hover        { background: var(--bg-sunken); }
.track-row--dragging    { opacity: .4; cursor: grabbing; }

.track-row__handle   { color: var(--text-muted); font-size: .9rem; cursor: grab; user-select: none; }
.track-row__number   { font-size: .75rem; color: var(--text-muted); text-align: right; }
.track-row__info     { display: flex; flex-direction: column; gap: .1rem; min-width: 0; }
.track-row__info strong { font-size: .875rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.track-row__duration { font-size: .75rem; color: var(--text-muted); }
.track-row__status   { display: flex; align-items: center; gap: .35rem; }

.track-badge           { font-size: .85rem; }
.track-badge--missing  { color: var(--text-muted); }
.track-badge--audio    { color: var(--accent); }
.track-badge--comments { font-size: .75rem; color: var(--text-muted); }

/* Track detail page */
.track-detail { display: flex; flex-direction: column; gap: 1.5rem; max-width: 720px; }
.track-detail__player { background: var(--bg-sunken); border-radius: 10px; padding: 1rem; }
.track-detail__no-audio { color: var(--text-muted); font-size: .875rem; }
.track-detail__meta { display: grid; grid-template-columns: auto 1fr; gap: .3rem .75rem; font-size: .875rem; margin: 0; }
.track-detail__meta dt { color: var(--text-muted); font-weight: 600; }
.track-detail__meta dd { margin: 0; }

.track-section { border-top: 1px solid var(--border); padding-top: 1rem; }
.track-section h3 { font-size: .95rem; font-weight: 700; margin: 0 0 .75rem; }

/* Version history */
.version-list { display: flex; flex-direction: column; gap: .5rem; }
.version-item { display: flex; align-items: center; gap: .75rem; font-size: .85rem; padding: .5rem; background: var(--bg-sunken); border-radius: 6px; }
.version-item__number  { font-weight: 700; color: var(--accent); min-width: 28px; }
.version-item__uploader { flex: 1; }
.version-item__date    { color: var(--text-muted); }
.version-item__notes   { color: var(--text-muted); font-style: italic; }

/* Track comments */
.track-comment-list { display: flex; flex-direction: column; gap: .75rem; margin-bottom: .75rem; }
.track-comment { background: var(--bg-sunken); border-radius: 8px; padding: .75rem; }
.track-comment__meta { display: flex; align-items: center; gap: .5rem; font-size: .78rem; color: var(--text-muted); margin-bottom: .35rem; }
.track-comment__meta strong { color: var(--text); font-size: .85rem; }
.track-comment__body { font-size: .875rem; margin: 0; line-height: 1.5; white-space: pre-wrap; }

/* Status pills (also used by album statuses) */
.status-pill--in_review  { background: #2563eb22; color: #2563eb; }
.status-pill--mastered   { background: #059669223; color: #059669; }

/* Public album grid */
.album-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1.5rem; }

.album-grid-card { text-decoration: none; color: var(--text); display: flex; flex-direction: column; }
.album-grid-card:hover .album-grid-card__artwork { transform: scale(1.02); }

.album-grid-card__artwork-wrap { overflow: hidden; border-radius: 8px; margin-bottom: .5rem; aspect-ratio: 1; }
.album-grid-card__artwork { width: 100%; height: 100%; object-fit: cover; transition: transform .2s; }
.album-grid-card__artwork--placeholder {
  width: 100%;
  height: 100%;
  background: var(--bg-sunken);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
}
.album-grid-card__title  { font-weight: 700; font-size: .95rem; }
.album-grid-card__artist { font-size: .8rem; color: var(--text-muted); margin-top: .1rem; display: block; }
.album-grid-card__year   { font-size: .75rem; color: var(--text-muted); margin-top: .1rem; display: block; }

/* Public album show page */
.album-page { max-width: 760px; margin: 0 auto; padding: 1.5rem 1rem; }
.album-page__header { display: grid; grid-template-columns: 200px 1fr; gap: 2rem; align-items: start; margin-bottom: 2rem; }
@media (max-width: 600px) { .album-page__header { grid-template-columns: 1fr; } }

.album-page__artwork { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; display: block; }
.album-page__title   { font-size: 1.6rem; font-weight: 800; margin: 0 0 .25rem; }
.album-page__artist  { font-size: 1rem; color: var(--text-muted); margin: 0 0 .5rem; }
.album-page__meta    { display: flex; flex-wrap: wrap; gap: .5rem .75rem; font-size: .8rem; color: var(--text-muted); margin-bottom: .75rem; }
.album-page__desc    { font-size: .9rem; line-height: 1.6; color: var(--text-muted); margin-bottom: 1rem; }
.album-page__actions { display: flex; gap: .75rem; }

.album-page__tracks h2 { font-size: 1.1rem; font-weight: 700; margin: 0 0 .75rem; border-top: 1px solid var(--border); padding-top: 1.25rem; }

.public-track-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.public-track-item {
  display: grid;
  grid-template-columns: 28px 1fr auto auto;
  align-items: center;
  gap: .75rem;
  padding: .75rem 1rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg-elevated);
  transition: background .1s;
}
.public-track-item:last-child { border-bottom: none; }
.public-track-item:hover      { background: var(--bg-sunken); }
.public-track-item__num       { font-size: .8rem; color: var(--text-muted); text-align: right; }
.public-track-item__info      { display: flex; flex-direction: column; gap: .1rem; min-width: 0; }
.public-track-item__title     { font-size: .9rem; font-weight: 600; }
.public-track-item__credits   { font-size: .75rem; color: var(--text-muted); }
.public-track-item__duration  { font-size: .78rem; color: var(--text-muted); }
.public-track-item__player    { display: flex; flex-direction: column; align-items: flex-end; gap: .2rem; }
.public-track-preview         { width: 200px; height: 32px; }
.public-track-preview__label  { font-size: .65rem; color: var(--text-muted); }

/* Admin table */
.admin-table { width: 100%; border-collapse: collapse; font-size: .875rem; }
.admin-table th { text-align: left; padding: .5rem .75rem; border-bottom: 2px solid var(--border); font-size: .78rem; color: var(--text-muted); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.admin-table td { padding: .6rem .75rem; border-bottom: 1px solid var(--border); }
.admin-table tr:last-child td { border-bottom: none; }
.admin-empty { color: var(--text-muted); font-size: .875rem; }

/* ─────────────────────────────────────────────────────
   PHASE 7 — AI ASSISTANT
   ───────────────────────────────────────────────────── */

/* Layout */
.ai-layout { display: grid; grid-template-columns: 240px 1fr; height: calc(100vh - 3.5rem); overflow: hidden; }

/* Sidebar */
.ai-sidebar { background: var(--bg-elevated); border-right: 1px solid var(--border); display: flex; flex-direction: column; overflow: hidden; }
.ai-sidebar__header { display: flex; align-items: center; justify-content: space-between; padding: .75rem 1rem; border-bottom: 1px solid var(--border); }
.ai-sidebar__title { font-size: .875rem; font-weight: 700; margin: 0; }
.ai-convo-list { flex: 1; overflow-y: auto; list-style: none; margin: 0; padding: 0; }
.ai-convo-item { display: flex; align-items: center; border-bottom: 1px solid var(--border); }
.ai-convo-item--active { background: var(--accent); }
.ai-convo-item--active .ai-convo-item__link { color: #fff; }
.ai-convo-item__link { flex: 1; padding: .625rem .75rem; text-decoration: none; color: var(--text); display: flex; flex-direction: column; gap: .125rem; min-width: 0; }
.ai-convo-item__title { font-size: .8rem; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ai-convo-item__date { font-size: .7rem; color: var(--text-muted); }
.ai-convo-item__delete { background: none; border: none; color: var(--text-muted); padding: .25rem .5rem; cursor: pointer; font-size: 1rem; line-height: 1; }
.ai-convo-item__delete:hover { color: var(--danger, #c0392b); }
.button--icon { background: none; border: none; cursor: pointer; padding: .25rem; }

/* Main area */
.ai-main { display: flex; flex-direction: column; overflow: hidden; }
.ai-main__header { padding: .75rem 1.25rem; border-bottom: 1px solid var(--border); }
.ai-main__title { font-size: 1rem; font-weight: 600; margin: 0; }

/* Messages */
.ai-messages { flex: 1; overflow-y: auto; padding: 1rem 1.25rem; display: flex; flex-direction: column; gap: .875rem; }
.ai-message { border-radius: .5rem; padding: .75rem 1rem; max-width: 90%; }
.ai-message--user { background: var(--accent); color: #fff; align-self: flex-end; }
.ai-message--user .ai-message__role { color: rgba(255,255,255,.75); }
.ai-message--assistant { background: var(--bg-elevated); border: 1px solid var(--border); align-self: flex-start; }
.ai-message__role { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; margin-bottom: .25rem; color: var(--text-muted); }
.ai-message__body { font-size: .875rem; line-height: 1.6; }
.ai-message__body p { margin: 0 0 .5rem; }
.ai-message__body p:last-child { margin-bottom: 0; }
.ai-message__meta { font-size: .7rem; color: var(--text-muted); margin-top: .5rem; }

/* Composer */
.ai-composer { padding: .75rem 1.25rem; border-top: 1px solid var(--border); background: var(--bg); display: flex; flex-direction: column; gap: .5rem; }
.ai-composer__textarea { width: 100%; resize: vertical; padding: .625rem .75rem; border: 1px solid var(--border); border-radius: .375rem; font: inherit; font-size: .875rem; background: var(--bg-elevated); color: var(--text); }
.ai-composer__actions { display: flex; align-items: center; gap: .75rem; }
.ai-composer__hint { font-size: .75rem; color: var(--text-muted); }

/* Welcome / new conversation */
.ai-welcome { display: flex; flex-direction: column; align-items: center; justify-content: center; flex: 1; padding: 2rem; text-align: center; }
.ai-welcome__title { font-size: 1.5rem; font-weight: 700; margin-bottom: .5rem; }
.ai-welcome__sub { color: var(--text-muted); margin-bottom: 1.5rem; }
.ai-new-form { width: 100%; max-width: 600px; }
.ai-new-form__textarea { width: 100%; padding: .75rem; border: 1px solid var(--border); border-radius: .5rem; font: inherit; font-size: .9rem; background: var(--bg-elevated); color: var(--text); resize: vertical; }
.ai-new-form__actions { margin-top: .75rem; display: flex; justify-content: flex-end; }

@media (max-width: 700px) {
  .ai-layout { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .ai-sidebar { max-height: 200px; border-right: none; border-bottom: 1px solid var(--border); }
}

/* ─────────────────────────────────────────────────────
   PHASE 8 — PLUGIN SYSTEM
   ───────────────────────────────────────────────────── */
.plugin-available-card { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; padding: .875rem 0; border-top: 1px solid var(--border); }
.admin-divider { border: none; border-top: 2px solid var(--border); margin: 1.5rem 0; }
.admin-section-title { font-size: 1rem; font-weight: 700; margin: 0 0 .25rem; }
.admin-muted { color: var(--text-muted); font-size: .85em; }
.admin-hint { color: var(--text-muted); font-size: .8rem; margin: .25rem 0 0; }
.admin-table__actions { white-space: nowrap; display: flex; gap: .375rem; }
.button--danger { background: #c0392b; color: #fff; }
.button--danger:hover { background: #96281b; }
.status-pill { display: inline-block; padding: .125rem .5rem; border-radius: 999px; font-size: .7rem; font-weight: 700; text-transform: uppercase; }
.status-pill--active   { background: #d4edda; color: #155724; }
.status-pill--installed { background: #fff3cd; color: #856404; }
.status-pill--disabled { background: #f8d7da; color: #721c24; }

/* ─────────────────────────────────────────────────────
   PHASE 9 — DESIGN SYSTEM / THEME EDITOR
   ───────────────────────────────────────────────────── */
.theme-editor-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; align-items: start; }
@media (max-width: 900px) { .theme-editor-layout { grid-template-columns: 1fr; } }

.theme-section { margin-bottom: 1.75rem; }
.theme-section__title { font-size: .7rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); margin-bottom: .75rem; padding-bottom: .5rem; border-bottom: 1px solid var(--border); }

.theme-token { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .35rem 0; }
.theme-token__label-text { font-size: .875rem; color: var(--text); min-width: 90px; }
.theme-token__control { display: flex; align-items: center; gap: .5rem; }
.theme-token__color-input { width: 2.5rem; height: 2.25rem; border: 1px solid var(--border); border-radius: 4px; cursor: pointer; padding: 2px; background: var(--bg-elevated); flex-shrink: 0; }
.theme-token__text-input { width: 6.5rem; font-family: monospace; font-size: .8rem; }

.theme-import-form { display: inline-flex; align-items: center; }

/* Preview */
.theme-preview-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; position: sticky; top: 1rem; }
.theme-preview-label { font-size: .7rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); margin-bottom: .4rem; }
.theme-preview { border-radius: 8px; overflow: hidden; border: 1px solid var(--border-strong); background: var(--bg); color: var(--text); font-size: .78rem; line-height: 1.4; }

.tp-nav { display: flex; align-items: center; justify-content: space-between; padding: .5rem .75rem; background: var(--bg-elevated); border-bottom: 1px solid var(--border); }
.tp-brand { font-weight: 700; font-size: .8rem; color: var(--accent); }
.tp-nav-links { display: flex; gap: .5rem; }
.tp-nav-link { font-size: .7rem; color: var(--text-muted); }
.tp-content { padding: .75rem; }
.tp-h2 { font-size: .9rem; font-weight: 700; margin: 0 0 .3rem; color: var(--text); }
.tp-body { margin-bottom: .5rem; color: var(--text); }
.tp-muted { color: var(--text-muted); }
.tp-btn { display: inline-block; background: var(--button-accent, var(--accent)); color: #fff; border: none; border-radius: var(--radius-sm, 4px); padding: .25rem .65rem; font-size: .72rem; font-weight: 600; cursor: pointer; margin-bottom: .6rem; }
.tp-card { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-md, 5px); box-shadow: var(--shadow-sm, none); padding: .5rem .6rem; margin-top: .1rem; }
.tp-card-title { font-weight: 600; font-size: .78rem; margin-bottom: .15rem; color: var(--card-accent, var(--text)); }
.tp-card-body { font-size: .72rem; color: var(--text-muted); margin: 0; }
.tp-hero { background: var(--bg-sunken); border-radius: var(--radius-lg, 0); padding: .35rem .5rem; margin-bottom: .5rem; }
.tp-tags { display: flex; flex-wrap: wrap; gap: .25rem; margin-top: .4rem; }
.tp-tag { font-size: .6rem; font-weight: 600; padding: .1rem .4rem; border-radius: var(--radius-full, 9999px); background: var(--accent); color: #fff; opacity: .85; }

/* ── Theme token form — range + shadow inputs ──────────────────────────── */
.theme-token--full { flex-direction: column; align-items: flex-start; gap: .3rem; }
.theme-token__control--range { gap: .6rem; }
.theme-token__range-input { flex: 1; min-width: 100px; max-width: 160px; accent-color: var(--accent); }
.theme-token__range-text { width: 5rem; font-family: monospace; font-size: .8rem; }
.theme-token__shadow-input { width: 100%; font-family: monospace; font-size: .78rem; }
.theme-section__hint { font-size: .7rem; font-weight: 400; text-transform: none; letter-spacing: 0; opacity: .7; margin-left: .35rem; }

/* ── FAQ blocks (public) ───────────────────────────────────────────────── */
.faq-list { display: flex; flex-direction: column; gap: .5rem; }
.faq-item { border: 1px solid var(--border); border-radius: var(--radius-md, 8px); background: var(--bg-elevated); }
.faq-item__question { font-size: 1rem; font-weight: 600; cursor: pointer; padding: .85rem 1rem; list-style: none; display: flex; align-items: center; justify-content: space-between; color: var(--text); }
.faq-item__question::-webkit-details-marker { display: none; }
.faq-item__question::after { content: "+"; font-size: 1.1rem; font-weight: 400; color: var(--accent); flex-shrink: 0; margin-left: .5rem; }
details[open] .faq-item__question::after { content: "−"; }
.faq-item__answer { padding: 0 1rem 1rem; font-size: .925rem; color: var(--text-muted); line-height: 1.6; }
.faq-item__answer p { margin: 0 0 .5rem; }

/* ── Focal-point artwork crop picker (admin) ───────────────────────────── */
.focal-point-picker { margin-top: .75rem; }
.focal-point-picker__wrap { position: relative; display: inline-block; cursor: crosshair; border-radius: var(--radius-md, 8px); overflow: hidden; max-width: 260px; }
.focal-point-picker__img { display: block; width: 100%; max-width: 260px; height: 260px; object-fit: cover; }
.focal-point-dot { position: absolute; width: 18px; height: 18px; border-radius: 50%; background: var(--accent); border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.3); transform: translate(-50%, -50%); pointer-events: none; transition: left .1s, top .1s; }

/* ── AI streaming cursor ───────────────────────────────────────────────── */
.ai-streaming-cursor { display: inline-block; width: .6em; animation: blink .8s step-end infinite; color: var(--accent); font-weight: 700; vertical-align: baseline; }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }

/* ── Admin code block (webhook payloads) ────────────────────────────────── */
.admin-code { font-family: monospace; font-size: .82em; background: var(--bg-sunken); padding: .1em .35em; border-radius: 4px; }
.admin-code-block { background: var(--bg-sunken); border: 1px solid var(--border); border-radius: var(--radius-md, 8px); padding: 1rem; font-family: monospace; font-size: .8rem; overflow-x: auto; white-space: pre; line-height: 1.5; max-height: 28rem; overflow-y: auto; }
.admin-error { color: var(--danger); font-size: .875rem; }
.status-pill--processed { background: oklch(92% .08 148); color: oklch(38% .14 148); }
.status-pill--pending   { background: oklch(94% .07 80);  color: oklch(42% .12 80); }
.status-pill--failed    { background: oklch(93% .08 25);  color: oklch(42% .15 25); }
