/* Swiftieverse design system — extracted from the reference ranking app and
   extended to full-site chrome. Palette = "personal listening ledger". */

:root {
  --paper: #FAF6EE;
  --paper-2: #F1EADA;
  --ink: #2B2620;
  --ink-soft: #786F60;
  --ink-faint: #A69C89;
  --rule: #E4D9C3;
  --card: #FFFFFF;
  --gold: #C9A34E;
  --danger: #B23A48;
  --danger-soft: #E9CDD0;
  --ok: #2F8C7D;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(43, 38, 32, 0.07), 0 1px 1px rgba(43, 38, 32, 0.04);
  --shadow-lg: 0 8px 28px rgba(43, 38, 32, 0.18);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: 'Inter', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; }
a { color: var(--ink); text-decoration-color: var(--rule); text-underline-offset: 2px; }
::selection { background: var(--gold); color: #fff; }

/* ---------- Nav ---------- */
.nav { border-bottom: 1px solid var(--rule); background: var(--paper); position: sticky; top: 0; z-index: 20; }
.nav-inner { max-width: 1180px; margin: 0 auto; padding: 14px 24px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { font-family: 'Fraunces', serif; font-style: italic; font-weight: 600; font-size: 22px; text-decoration: none; color: var(--ink); }
.brand span { color: var(--gold); }
.nav-links { display: flex; align-items: center; gap: 18px; font-size: 14px; }
.nav-links a { text-decoration: none; color: var(--ink-soft); }
.nav-links a:hover { color: var(--ink); }
.inline { display: inline; margin: 0; }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--rule); margin-top: 64px; }
.footer-inner { max-width: 1180px; margin: 0 auto; padding: 24px; display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: center; }
.disclaimer { font-size: 12px; color: var(--ink-faint); max-width: 60ch; margin: 0; line-height: 1.5; }
.footer-links { display: flex; gap: 16px; font-size: 13px; }
.footer-links a { color: var(--ink-soft); text-decoration: none; }

/* ---------- Layout primitives ---------- */
.wrap { max-width: 1180px; margin: 0 auto; padding: 40px 24px; }
.narrow { max-width: 460px; margin: 0 auto; padding: 48px 24px; }
.eyebrow { font-family: 'IBM Plex Mono', monospace; font-size: 11px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-soft); margin: 0 0 6px; }
h1 { font-family: 'Fraunces', serif; font-style: italic; font-weight: 600; font-size: 38px; line-height: 1.05; margin: 0 0 12px; letter-spacing: -0.01em; }
h2 { font-family: 'Fraunces', serif; font-weight: 600; font-size: 24px; margin: 0 0 12px; }
.sub { font-size: 15px; color: var(--ink-soft); margin: 0; max-width: 60ch; line-height: 1.6; }

/* ---------- Buttons ---------- */
.btn { height: 38px; padding: 0 16px; border-radius: 8px; border: 1px solid var(--rule); background: var(--card); color: var(--ink); font-family: 'Inter', sans-serif; font-size: 14px; font-weight: 600; cursor: pointer; white-space: nowrap; transition: background .12s, border-color .12s; display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.btn:hover { background: var(--paper-2); }
.btn-primary { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.btn-primary:hover { background: #413A2E; }
.btn-ghost { border-color: transparent; background: transparent; color: var(--ink-soft); font-weight: 500; }
.btn-ghost:hover { color: var(--ink); background: transparent; }
.btn-lg { height: 46px; padding: 0 24px; font-size: 15px; }
.btn-block { width: 100%; }

/* ---------- Forms ---------- */
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; font-weight: 600; color: var(--ink-soft); margin-bottom: 6px; }
.field input, .field textarea { width: 100%; padding: 10px 12px; border: 1px solid var(--rule); border-radius: 8px; background: var(--card); font-family: 'Inter', sans-serif; font-size: 14px; color: var(--ink); }
.field input:focus, .field textarea:focus { outline: 2px solid var(--gold); outline-offset: 1px; }
.field .hint { font-size: 12px; color: var(--ink-faint); margin-top: 4px; }
.card { background: var(--card); border: 1px solid var(--rule); border-radius: 12px; padding: 28px; box-shadow: var(--shadow); }
.alert { padding: 12px 14px; border-radius: 8px; font-size: 13px; margin-bottom: 16px; line-height: 1.5; }
.alert-error { background: var(--danger-soft); color: var(--danger); }
.alert-ok { background: #D9EDE9; color: var(--ok); }
.alert-info { background: var(--paper-2); color: var(--ink-soft); }

/* ---------- Marketing hero ---------- */
.hero { position: relative; padding: 20px 0 8px; }
.tape { position: absolute; top: -10px; left: 8px; width: 120px; height: 36px; background: repeating-linear-gradient(45deg, rgba(201,163,78,.55) 0 6px, rgba(201,163,78,.32) 6px 12px); border: 1px solid rgba(201,163,78,.4); transform: rotate(-4deg); opacity: .85; }
.hero h1 { font-size: 52px; }
.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; margin-top: 40px; }
.feature { background: var(--card); border: 1px solid var(--rule); border-left: 4px solid var(--gold); border-radius: 10px; padding: 22px; box-shadow: var(--shadow); }
.feature h3 { font-family: 'Fraunces', serif; font-size: 18px; margin: 0 0 8px; }
.feature p { font-size: 14px; color: var(--ink-soft); margin: 0; line-height: 1.55; }

/* ---------- Profile ---------- */
.profile-head { display: flex; gap: 20px; align-items: center; margin-bottom: 28px; flex-wrap: wrap; }
.profile-action { margin-left: auto; }
@media (max-width: 600px) { .profile-action { margin-left: 0; flex-basis: 100%; } }
.avatar { width: 88px; height: 88px; border-radius: 50%; object-fit: cover; border: 2px solid var(--rule); background: var(--paper-2); flex-shrink: 0; }
.avatar-lg { width: 88px; height: 88px; }
.profile-meta h1 { margin: 0 0 4px; font-size: 30px; }
.profile-meta .handle { font-family: 'IBM Plex Mono', monospace; font-size: 13px; color: var(--ink-faint); }
.profile-meta .bio { margin: 8px 0 0; color: var(--ink-soft); font-size: 14px; max-width: 60ch; }
.profile-stats { display: flex; gap: 24px; margin: 12px 0; }
.profile-stats a { text-decoration: none; color: var(--ink-soft); font-size: 13px; }
.profile-stats b { color: var(--ink); font-family: 'IBM Plex Mono', monospace; }

/* ---------- Feed layout ---------- */
.feed-wrap { display: grid; grid-template-columns: minmax(0, 640px) 300px; gap: 36px; justify-content: center; align-items: start; }
.feed-main { min-width: 0; }
.feed-side { position: sticky; top: 76px; display: flex; flex-direction: column; gap: 16px; }
.side-card { padding: 20px; }
.side-title { font-family: 'Fraunces', serif; font-size: 16px; font-weight: 600; margin: 0 0 12px; }
.side-fan { display: flex; align-items: center; gap: 10px; padding: 7px 0; }
.side-fan .avatar { width: 36px; height: 36px; }
.side-fan-meta { min-width: 0; display: flex; flex-direction: column; }
.side-fan-name { font-size: 13.5px; font-weight: 600; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-fan-name:hover { text-decoration: underline; }
.side-fan-sub { font-family: 'IBM Plex Mono', monospace; font-size: 11px; color: var(--ink-faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-more { display: inline-block; margin-top: 10px; font-size: 13px; color: var(--ink-soft); text-decoration: none; }
.side-more:hover { color: var(--ink); }
@media (max-width: 1020px) { .feed-wrap { grid-template-columns: minmax(0, 640px); } .feed-side { display: none; } }

.feed { max-width: 640px; margin: 0 auto; min-width: 0; }
.feed-header { display: flex; align-items: end; justify-content: space-between; margin-bottom: 4px; }
.feed-more { text-align: center; margin: 20px 0; }
.feed-empty { text-align: center; padding: 40px 24px; }
.feed-empty h3 { font-family: 'Fraunces', serif; font-size: 20px; margin: 0 0 6px; }
.feed-empty .sub { margin: 0 auto; }
.empty-art { font-size: 28px; color: var(--gold); margin: 0 0 10px; }
.backlink { margin: 0 0 14px; font-size: 13px; }
.backlink a { color: var(--ink-soft); text-decoration: none; }
.backlink a:hover { color: var(--ink); }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 4px; margin: 18px 0 18px; border-bottom: 1px solid var(--rule); }
.tab { font-size: 14px; font-weight: 600; color: var(--ink-soft); text-decoration: none; padding: 8px 14px 10px; border-bottom: 2px solid transparent; margin-bottom: -1px; transition: color .12s; }
.tab:hover { color: var(--ink); }
.tab.active { color: var(--ink); border-bottom-color: var(--gold); }

/* ---------- Composer ---------- */
.composer { padding: 16px 18px; margin-bottom: 18px; }
.composer-row { display: flex; gap: 12px; align-items: flex-start; }
.composer-row .avatar { width: 40px; height: 40px; }
.composer textarea { flex: 1; border: none; background: transparent; resize: none; font-family: 'Inter', sans-serif; font-size: 15px; color: var(--ink); line-height: 1.55; padding: 9px 0 0; min-height: 44px; }
.composer textarea:focus { outline: none; }
.composer textarea::placeholder { color: var(--ink-faint); }
.composer-foot { display: flex; align-items: center; gap: 12px; margin-top: 10px; padding-top: 12px; border-top: 1px solid var(--rule); }
.composer-link { flex: 1; min-width: 0; border: none; background: transparent; font-family: 'IBM Plex Mono', monospace; font-size: 12px; color: var(--ink-soft); padding: 6px 0; }
.composer-link:focus { outline: none; border-bottom: 1px solid var(--gold); }
.composer-link::placeholder { color: var(--ink-faint); }
.composer-count { font-family: 'IBM Plex Mono', monospace; font-size: 11px; color: var(--ink-faint); }
.composer-count.low { color: var(--danger); }
.composer-cta { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 20px; margin-bottom: 18px; flex-wrap: wrap; }
.composer-cta .sub { font-size: 14px; }

/* ---------- Posts ---------- */
.post { background: var(--card); border: 1px solid var(--rule); border-radius: 10px; padding: 16px 18px 10px; margin-bottom: 14px; box-shadow: var(--shadow); }
.post.official { border-left: 4px solid var(--gold); }
.post-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.post-head .avatar { width: 38px; height: 38px; }
.post-who { display: flex; flex-direction: column; min-width: 0; }
.post-author { font-weight: 600; font-size: 14px; text-decoration: none; }
a.post-author:hover { text-decoration: underline; }
.post-handle { font-family: 'IBM Plex Mono', monospace; font-size: 11px; color: var(--ink-faint); }
.post-official-mark { color: var(--gold); font-size: 18px; line-height: 1; }
.post-time { font-family: 'IBM Plex Mono', monospace; font-size: 11px; color: var(--ink-faint); margin-left: auto; text-decoration: none; white-space: nowrap; }
.post-time:hover { color: var(--ink-soft); text-decoration: underline; }
.post-body { font-size: 14.5px; line-height: 1.6; color: var(--ink); overflow-wrap: break-word; }
.post-link { display: inline-block; margin-top: 6px; font-size: 13px; color: var(--ink-soft); }
.post-link:hover { color: var(--ink); }
.post-embed { margin-top: 12px; }
.post-embed iframe { max-width: 100%; border: 0; border-radius: 8px; }
.badge { font-family: 'IBM Plex Mono', monospace; font-size: 10px; text-transform: uppercase; letter-spacing: .08em; color: var(--gold); border: 1px solid var(--gold); border-radius: 4px; padding: 1px 5px; white-space: nowrap; }
.badge-pin { color: var(--ink-soft); border-color: var(--ink-faint); }

/* ---------- Post actions ---------- */
.post-actions { display: flex; align-items: center; gap: 4px; margin-top: 8px; padding-top: 6px; border-top: 1px solid var(--paper-2); }
.action-btn { display: inline-flex; align-items: center; gap: 6px; border: none; background: transparent; color: var(--ink-faint); font-family: 'IBM Plex Mono', monospace; font-size: 12px; font-weight: 600; padding: 7px 10px; border-radius: 8px; cursor: pointer; text-decoration: none; transition: background .12s, color .12s; }
.action-btn svg { width: 17px; height: 17px; }
.action-btn:hover { background: var(--paper-2); color: var(--ink-soft); }
.like-btn.liked { color: var(--danger); }
.like-btn.liked:hover { color: var(--danger); }
@keyframes likePop { 0% { transform: scale(1); } 40% { transform: scale(1.25); } 100% { transform: scale(1); } }
.like-btn.pop svg { animation: likePop .28s ease; }
.post-menu { position: relative; margin-left: auto; }
.post-menu summary { list-style: none; cursor: pointer; color: var(--ink-faint); font-size: 16px; font-weight: 700; padding: 4px 10px; border-radius: 8px; line-height: 1; }
.post-menu summary::-webkit-details-marker { display: none; }
.post-menu summary:hover { background: var(--paper-2); color: var(--ink); }
.post-menu-panel { position: absolute; right: 0; top: calc(100% + 4px); background: var(--card); border: 1px solid var(--rule); border-radius: 10px; box-shadow: var(--shadow-lg); padding: 6px; z-index: 10; min-width: 150px; display: flex; flex-direction: column; }
.post-menu-panel button { width: 100%; text-align: left; border: none; background: transparent; font-family: 'Inter', sans-serif; font-size: 13px; font-weight: 500; color: var(--ink); padding: 8px 10px; border-radius: 6px; cursor: pointer; }
.post-menu-panel button:hover { background: var(--paper-2); }
.post-menu-panel button.danger { color: var(--danger); }
.post-menu-panel button.danger:hover { background: var(--danger-soft); }

/* ---------- Comments ---------- */
.comments { padding: 20px; }
.comment { display: flex; gap: 10px; padding: 10px 0; border-top: 1px solid var(--paper-2); }
.comment:first-of-type { border-top: none; }
.comment .avatar { width: 30px; height: 30px; }
.comment-main { flex: 1; min-width: 0; }
.comment-head { display: flex; align-items: baseline; gap: 8px; }
.comment-author { font-size: 13px; font-weight: 600; text-decoration: none; }
.comment-author:hover { text-decoration: underline; }
.comment-time { font-family: 'IBM Plex Mono', monospace; font-size: 10.5px; color: var(--ink-faint); }
.comment-delete { border: none; background: transparent; color: var(--ink-faint); font-size: 14px; cursor: pointer; border-radius: 50%; width: 20px; height: 20px; line-height: 1; }
.comment-delete:hover { background: var(--danger-soft); color: var(--danger); }
.comment-body { margin: 3px 0 0; font-size: 13.5px; line-height: 1.55; overflow-wrap: break-word; }
.comment-form { display: flex; gap: 10px; align-items: flex-end; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--paper-2); }
.comment-form textarea { flex: 1; border: 1px solid var(--rule); border-radius: 8px; background: var(--paper); font-family: 'Inter', sans-serif; font-size: 13.5px; color: var(--ink); padding: 9px 11px; resize: vertical; min-height: 40px; }
.comment-form textarea:focus { outline: 2px solid var(--gold); outline-offset: 1px; }

/* ---------- Fans directory ---------- */
.fans-search { display: flex; gap: 10px; margin: 18px 0 24px; max-width: 460px; }
.fans-search input { flex: 1; height: 38px; padding: 0 14px; border: 1px solid var(--rule); border-radius: 8px; background: var(--card); font-size: 14px; color: var(--ink); }
.fans-search input:focus { outline: 2px solid var(--gold); outline-offset: 1px; }
.fans-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.fan-card { display: flex; gap: 14px; align-items: flex-start; padding: 18px; }
.fan-card .avatar { width: 52px; height: 52px; }
.fan-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.fan-name { font-family: 'Fraunces', serif; font-size: 16px; font-weight: 600; text-decoration: none; }
.fan-name:hover { text-decoration: underline; }
.fan-sub { font-family: 'IBM Plex Mono', monospace; font-size: 11px; color: var(--ink-faint); }
.fan-bio { font-size: 12.5px; color: var(--ink-soft); line-height: 1.5; margin: 6px 0 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.fan-stats { font-family: 'IBM Plex Mono', monospace; font-size: 10.5px; color: var(--ink-faint); margin-top: 8px; }
.btn-sm { height: 30px; padding: 0 12px; font-size: 12.5px; border-radius: 7px; }

/* ---------- Embeds (all markup generated server-side by lib/oembed) ---------- */
.embed-video { position: relative; width: 100%; aspect-ratio: 16 / 9; margin-top: 4px; }
.embed-video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; border-radius: 8px; background: var(--ink); }
.embed-quote { margin: 4px 0 0; padding: 14px 16px; border: 1px solid var(--rule); border-left: 3px solid var(--gold); border-radius: 8px; background: var(--paper); }
.embed-quote p { margin: 0 0 8px; font-size: 14px; line-height: 1.6; }
.embed-quote footer { font-size: 12px; color: var(--ink-soft); }
.embed-card { display: flex; align-items: center; gap: 10px; margin-top: 4px; padding: 12px 14px; border: 1px solid var(--rule); border-radius: 8px; background: var(--paper); text-decoration: none; transition: border-color .12s; }
.embed-card:hover { border-color: var(--gold); }
.embed-card-label { font-size: 13px; font-weight: 600; white-space: nowrap; }
.embed-card-url { font-family: 'IBM Plex Mono', monospace; font-size: 11.5px; color: var(--ink-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.embed-card-cta { font-size: 12px; color: var(--gold); font-weight: 600; white-space: nowrap; }

/* ---------- Admin console ---------- */
.stat-row { display: flex; gap: 14px; flex-wrap: wrap; margin: 18px 0 24px; }
.stat { background: var(--card); border: 1px solid var(--rule); border-radius: 10px; padding: 14px 20px; min-width: 110px; box-shadow: var(--shadow); }
.stat-num { display: block; font-family: 'Fraunces', serif; font-size: 26px; font-weight: 600; }
.stat-label { font-family: 'IBM Plex Mono', monospace; font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-soft); }
.stat-warn { border-color: var(--danger); }
.stat-warn .stat-num { color: var(--danger); }
.admin-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: 20px; align-items: start; }
.admin-section h2 { font-size: 19px; }
.admin-users { grid-column: 1 / -1; }
.check { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--ink-soft); margin: 4px 0 16px; cursor: pointer; }
.btn-danger { border-color: var(--danger); color: var(--danger); }
.btn-danger:hover { background: var(--danger-soft); }
.badge-warn { color: var(--danger); border-color: var(--danger); }
.report-item { border-top: 1px solid var(--paper-2); padding: 12px 0; }
.report-item:first-of-type { border-top: none; }
.report-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.report-meta { font-family: 'IBM Plex Mono', monospace; font-size: 11px; color: var(--ink-faint); }
.report-body { margin: 0 0 10px; font-size: 13.5px; line-height: 1.55; color: var(--ink); overflow-wrap: break-word; }
.report-gone { color: var(--ink-faint); font-style: italic; }
.report-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.source-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--paper-2); }
.source-row:first-of-type { border-top: none; }
.source-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ink-faint); flex-shrink: 0; }
.source-dot.on { background: var(--ok); }
.source-url { flex: 1; font-family: 'IBM Plex Mono', monospace; font-size: 11.5px; color: var(--ink-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.source-add { display: flex; gap: 8px; margin-top: 12px; }
.source-add input { flex: 1; height: 32px; padding: 0 10px; border: 1px solid var(--rule); border-radius: 7px; background: var(--paper); font-family: 'IBM Plex Mono', monospace; font-size: 11.5px; color: var(--ink); }
.source-add input:focus { outline: 2px solid var(--gold); outline-offset: 1px; }
.user-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--paper-2); flex-wrap: wrap; }
.user-row:first-of-type { border-top: none; }
.user-row-meta { display: flex; flex-direction: column; min-width: 0; }
.user-row-meta b { font-size: 14px; }
.user-row-sub { font-family: 'IBM Plex Mono', monospace; font-size: 11px; color: var(--ink-soft); }
.user-suspended { color: var(--danger); font-weight: 600; }
.comment-head form:first-of-type { margin-left: auto; }
.comment-report-form + .inline { margin-left: 4px; }

/* ---------- Home: era strip, pulse, podium ---------- */
.era-strip { display: flex; gap: 5px; margin-top: 22px; max-width: 420px; }
.era-block { flex: 1; height: 10px; border-radius: 3px; background: var(--c, var(--rule)); transform-origin: bottom; transition: transform .18s ease; }
.era-strip:hover .era-block { transform: scaleY(1.6); }
.era-block:hover { transform: scaleY(2.4) !important; }
.pulse-row { display: flex; gap: 14px; flex-wrap: wrap; margin: 34px 0 8px; }
.pulse-stat { flex: 1 1 130px; background: var(--card); border: 1px solid var(--rule); border-radius: 10px; padding: 14px 18px; box-shadow: var(--shadow); }
.pulse-stat b { display: block; font-family: 'Fraunces', serif; font-size: 24px; font-weight: 600; }
.pulse-stat span { font-family: 'IBM Plex Mono', monospace; font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-soft); }
.home-top3 { margin: 36px 0 8px; }
.home-top3-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.home-top3-head h2 { margin: 0; }
.home-top3-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.podium { position: relative; display: flex; flex-direction: column; gap: 4px; background: var(--card); border: 1px solid var(--rule); border-top: 5px solid var(--accent, var(--gold)); border-radius: 12px; padding: 18px; box-shadow: var(--shadow); text-decoration: none; transition: transform .14s ease, box-shadow .14s ease; }
.podium:hover { transform: translateY(-3px) rotate(0.4deg); box-shadow: var(--shadow-lg); }
.podium-1:hover { transform: translateY(-3px) rotate(-0.4deg); }
.podium-place { position: absolute; top: 10px; right: 14px; font-family: 'Fraunces', serif; font-style: italic; font-size: 30px; font-weight: 600; color: var(--paper-2); -webkit-text-stroke: 1.5px var(--accent, var(--gold)); }
.podium-title { font-family: 'Fraunces', serif; font-size: 16px; font-weight: 600; line-height: 1.25; padding-right: 34px; }
.podium-album { font-family: 'IBM Plex Mono', monospace; font-size: 10px; font-weight: 700; letter-spacing: .06em; color: var(--accent, var(--ink-faint)); }
.podium-score { margin-top: 8px; font-family: 'IBM Plex Mono', monospace; font-size: 15px; font-weight: 600; }
.podium-score em { font-style: normal; font-size: 10.5px; color: var(--ink-faint); }

/* ---------- Composer prompt chips ---------- */
.composer-prompts { display: flex; gap: 7px; flex-wrap: wrap; margin: 8px 0 0 52px; }
.prompt-chip { border: 1px solid var(--rule); background: var(--paper); color: var(--ink-soft); font-family: 'Inter', sans-serif; font-size: 12px; font-weight: 600; border-radius: 20px; padding: 4px 11px; cursor: pointer; transition: border-color .12s, color .12s, transform .12s; }
.prompt-chip:hover { border-color: var(--gold); color: var(--ink); transform: translateY(-1px); }
@media (max-width: 600px) { .composer-prompts { margin-left: 0; } }

/* ---------- Era chip ---------- */
.era-chip { display: inline-block; margin: 6px 0 2px; font-family: 'IBM Plex Mono', monospace; font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--era, var(--gold)); border: 1px solid var(--era, var(--gold)); border-radius: 20px; padding: 3px 10px; background: color-mix(in srgb, var(--era, var(--gold)) 8%, transparent); }

/* ---------- Lists (cards on profile) ---------- */
.profile-lists { margin-bottom: 36px; }
.lists-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.list-card { display: flex; flex-direction: column; gap: 6px; background: var(--card); border: 1px solid var(--rule); border-radius: 12px; padding: 18px; box-shadow: var(--shadow); text-decoration: none; transition: transform .14s ease, box-shadow .14s ease, border-color .14s; position: relative; overflow: hidden; }
.list-card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: linear-gradient(180deg, var(--gold), #8B6BA8, #4F8FB5); opacity: .85; }
.list-card:hover { transform: translateY(-2px) rotate(-0.3deg); box-shadow: var(--shadow-lg); border-color: var(--ink-faint); }
.list-card-title { font-family: 'Fraunces', serif; font-size: 17px; font-weight: 600; line-height: 1.25; }
.list-card-desc { font-size: 12.5px; color: var(--ink-soft); line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.list-card-meta { font-family: 'IBM Plex Mono', monospace; font-size: 10.5px; color: var(--ink-faint); margin-top: auto; padding-top: 6px; }
.list-card-spotify { color: #1DB954; font-weight: 700; }
.list-card-new { border-style: dashed; background: transparent; box-shadow: none; align-items: flex-start; }
.list-card-new::before { display: none; }
.list-card-new:hover { background: var(--card); }
.list-card-plus { font-family: 'Fraunces', serif; font-size: 26px; color: var(--gold); line-height: 1; }

/* ---------- List page ---------- */
.list-head { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.list-head-main { flex: 1; min-width: 240px; }
.list-head-actions { display: flex; gap: 8px; }
.list-meta { font-family: 'IBM Plex Mono', monospace; font-size: 11px; color: var(--ink-faint); margin: 10px 0 0; }
.list-body { display: grid; grid-template-columns: minmax(0, 1fr); gap: 28px; align-items: start; }
.list-body.has-player { grid-template-columns: minmax(0, 1.5fr) minmax(280px, 1fr); }
@media (max-width: 860px) { .list-body.has-player { grid-template-columns: 1fr; } .list-player { order: -1; } }
.list-tracklist { list-style: none; margin: 0; padding: 0; }
.list-track { display: flex; align-items: baseline; gap: 12px; background: var(--card); border: 1px solid var(--rule); border-left: 4px solid var(--accent, var(--gold)); border-radius: 9px; padding: 11px 14px; margin-bottom: 7px; box-shadow: var(--shadow); flex-wrap: wrap; }
.list-track-no { font-family: 'IBM Plex Mono', monospace; font-size: 11px; color: var(--ink-faint); }
.list-track-main { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.list-track-title { font-size: 14px; font-weight: 600; }
.list-track-album { font-family: 'IBM Plex Mono', monospace; font-size: 10px; font-weight: 700; letter-spacing: .06em; color: var(--accent, var(--ink-faint)); }
.list-track-note { font-size: 12.5px; color: var(--ink-soft); font-style: italic; flex-basis: 100%; margin-top: 2px; }
.list-player-sticky { position: sticky; top: 76px; }
.list-player iframe { width: 100%; height: 420px; border: 0; border-radius: 12px; display: block; }
@media (max-width: 860px) { .list-player iframe { height: 152px; } }

/* ---------- List editor ---------- */
.select { width: 100%; padding: 10px 12px; border: 1px solid var(--rule); border-radius: 8px; background: var(--card); font-family: 'Inter', sans-serif; font-size: 14px; color: var(--ink); }
.select:focus { outline: 2px solid var(--gold); outline-offset: 1px; }
.list-editor-card { padding: 20px; }
.list-editor-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 12px; }
.list-search { position: relative; margin-bottom: 10px; }
.list-search input { width: 100%; height: 40px; padding: 0 14px; border: 1px solid var(--rule); border-radius: 9px; background: var(--paper); font-size: 14px; color: var(--ink); }
.list-search input:focus { outline: 2px solid var(--gold); outline-offset: 1px; }
.list-search-results { position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 15; background: var(--card); border: 1px solid var(--rule); border-radius: 10px; box-shadow: var(--shadow-lg); overflow: hidden; }
.list-search-hit { display: flex; gap: 10px; align-items: baseline; width: 100%; text-align: left; border: none; background: transparent; padding: 10px 14px; cursor: pointer; font-family: 'Inter', sans-serif; }
.list-search-hit:hover { background: var(--paper-2); }
.list-search-hit .hit-album { font-family: 'IBM Plex Mono', monospace; font-size: 10px; font-weight: 700; letter-spacing: .05em; min-width: 84px; }
.list-search-hit .hit-title { font-size: 13.5px; font-weight: 500; color: var(--ink); }
.list-search-hit.custom .hit-album { color: var(--ink-faint); }
.list-editor-items { min-height: 20px; }
.list-editor-item { display: flex; align-items: center; gap: 10px; background: var(--card); border: 1px solid var(--rule); border-left: 4px solid var(--accent, var(--gold)); border-radius: 8px; padding: 8px 10px; margin-bottom: 6px; box-shadow: var(--shadow); }
.list-editor-item .handle { color: var(--ink-faint); cursor: grab; }
.list-item-no { font-family: 'IBM Plex Mono', monospace; font-size: 11px; color: var(--ink-faint); min-width: 20px; }
.list-item-main { display: flex; flex-direction: column; min-width: 120px; max-width: 220px; }
.list-item-title { font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-item-album { font-family: 'IBM Plex Mono', monospace; font-size: 9.5px; font-weight: 700; letter-spacing: .05em; color: var(--accent, var(--ink-faint)); }
.list-item-note { flex: 1; min-width: 80px; border: none; border-bottom: 1px dashed var(--rule); background: transparent; font-family: 'Inter', sans-serif; font-size: 12.5px; font-style: italic; color: var(--ink-soft); padding: 4px 2px; }
.list-item-note:focus { outline: none; border-bottom-color: var(--gold); }
@media (max-width: 640px) {
  .list-editor-item { flex-wrap: wrap; }
  .list-item-main { max-width: none; flex: 1; }
  .list-item-note { flex-basis: 100%; order: 5; }
}

/* ---------- Community charts ---------- */
.charts-head { margin-bottom: 24px; }
.charts-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(280px, 1fr); gap: 28px; align-items: start; }
@media (max-width: 900px) { .charts-grid { grid-template-columns: minmax(0, 1fr); } }
.charts-section-title { font-size: 20px; margin-bottom: 14px; }
.chart-list { list-style: none; margin: 0; padding: 0; counter-reset: chart; }
.chart-row { display: flex; align-items: center; gap: 12px; background: var(--card); border: 1px solid var(--rule); border-left: 4px solid var(--accent, var(--gold)); border-radius: 9px; padding: 10px 14px; margin-bottom: 7px; box-shadow: var(--shadow); position: relative; }
.chart-row.medal { padding-top: 13px; padding-bottom: 13px; }
.chart-rank { font-family: 'Fraunces', serif; font-weight: 600; font-size: 18px; color: var(--ink-soft); min-width: 30px; text-align: right; font-variant-numeric: tabular-nums; }
.medal .chart-rank { font-size: 24px; color: var(--ink); }
.medal-gold { background: linear-gradient(100deg, #FFF9EA, var(--card) 45%); border-left-width: 6px; }
.medal-silver { background: linear-gradient(100deg, #F6F6F4, var(--card) 45%); }
.medal-bronze { background: linear-gradient(100deg, #FBF1E7, var(--card) 45%); }
.chart-song { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.chart-title { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chart-album { font-family: 'IBM Plex Mono', monospace; font-size: 10px; font-weight: 700; letter-spacing: .06em; color: var(--accent, var(--ink-faint)); }
.chart-vibes { position: relative; }
.chart-vibes summary { list-style: none; display: flex; align-items: center; gap: 8px; cursor: pointer; padding: 4px 6px; border-radius: 6px; }
.chart-vibes summary::-webkit-details-marker { display: none; }
.chart-vibes summary:hover { background: var(--paper-2); }
.chart-meter { width: 72px; height: 5px; border-radius: 3px; background: var(--rule); overflow: hidden; display: inline-block; }
.chart-meter span { display: block; height: 100%; background: var(--accent, var(--gold)); border-radius: 3px; }
.chart-total { font-family: 'IBM Plex Mono', monospace; font-size: 13px; font-weight: 600; min-width: 34px; text-align: right; font-variant-numeric: tabular-nums; }
.vibe-pop { position: absolute; right: 0; top: calc(100% + 6px); z-index: 12; background: var(--card); border: 1px solid var(--rule); border-radius: 10px; box-shadow: var(--shadow-lg); padding: 12px 14px; min-width: 220px; }
.vibe-bar { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.vibe-label { font-family: 'IBM Plex Mono', monospace; font-size: 10px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-soft); width: 64px; }
.vibe-track { flex: 1; height: 5px; border-radius: 3px; background: var(--rule); overflow: hidden; }
.vibe-track span { display: block; height: 100%; background: var(--accent, var(--gold)); }
.vibe-num { font-family: 'IBM Plex Mono', monospace; font-size: 11px; font-weight: 600; min-width: 24px; text-align: right; }
.vibe-raters { margin: 6px 0 0; font-family: 'IBM Plex Mono', monospace; font-size: 10.5px; color: var(--ink-faint); }
.delta { font-family: 'IBM Plex Mono', monospace; font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 10px; background: var(--paper-2); color: var(--ink-soft); white-space: nowrap; }
.delta.up { background: #E9F4EF; color: var(--ok); }
.delta.down { background: var(--danger-soft); color: var(--danger); }
.era-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid var(--paper-2); }
.era-row:first-of-type { border-top: none; }
.era-rank { font-family: 'IBM Plex Mono', monospace; font-size: 11px; color: var(--ink-faint); }
.era-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.era-name { font-size: 12.5px; font-weight: 700; letter-spacing: .04em; color: var(--accent, var(--ink)); text-transform: uppercase; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.era-sub { font-family: 'IBM Plex Mono', monospace; font-size: 10.5px; color: var(--ink-faint); }
.era-score { font-family: 'Fraunces', serif; font-size: 18px; font-weight: 600; }
.era-score.spread { color: var(--danger); font-size: 15px; }
.side-note { font-size: 12.5px; color: var(--ink-soft); line-height: 1.5; margin: 0 0 10px; }
.charts-cta { border-left: 4px solid var(--gold); }

/* ---------- Spotify connect + playlist picker ---------- */
.spotify-mark { width: 28px; height: 28px; color: #1DB954; flex-shrink: 0; }
.spotify-connect-card { display: flex; gap: 16px; align-items: flex-start; }
.spotify-connected-row { display: flex; gap: 12px; align-items: center; }
.spotify-connected-row b { font-size: 14.5px; display: block; }
.spotify-account { font-family: 'IBM Plex Mono', monospace; font-size: 11.5px; color: var(--ink-soft); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.playlist-pick-head { display: flex; align-items: baseline; justify-content: space-between; margin: 4px 0 12px; }
.playlist-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.playlist-pick { position: relative; display: flex; flex-direction: column; background: var(--card); border: 1.5px solid var(--rule); border-radius: 10px; padding: 10px; cursor: pointer; transition: border-color .12s, box-shadow .12s; }
.playlist-pick:hover { border-color: var(--ink-faint); }
.playlist-pick.picked { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(201,163,78,.25); }
.playlist-pick.blocked { opacity: .45; cursor: not-allowed; }
.playlist-pick input { position: absolute; top: 14px; right: 14px; width: 16px; height: 16px; accent-color: var(--gold); }
.playlist-pick img, .playlist-noart { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 7px; background: var(--paper-2); }
.playlist-noart { display: flex; align-items: center; justify-content: center; }
.playlist-pick-name { font-size: 13px; font-weight: 600; margin-top: 8px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.playlist-pick-meta { font-family: 'IBM Plex Mono', monospace; font-size: 10.5px; color: var(--ink-faint); margin-top: 2px; }
.playlist-save { position: sticky; bottom: 0; padding: 14px 0; background: linear-gradient(transparent, var(--paper) 30%); text-align: right; }
.connection-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.connection-meta { display: flex; flex-direction: column; min-width: 0; }
.connection-meta b { font-size: 14px; }
.connection-sub { font-size: 12.5px; color: var(--ink-soft); }

/* ---------- Profile playlist showcase ---------- */
.showcase { margin-bottom: 36px; }
.showcase-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.showcase-item iframe { width: 100%; height: 152px; border: 0; border-radius: 12px; display: block; }
.showcase-empty { max-width: 460px; padding: 20px; }
.showcase-manage { margin: 10px 0 0; font-size: 13px; }
.showcase-manage a { color: var(--ink-soft); text-decoration: none; }
.showcase-manage a:hover { color: var(--ink); }

/* ---------- Nav user menu ---------- */
.nav-user { position: relative; }
.nav-user summary { list-style: none; cursor: pointer; display: flex; }
.nav-user summary::-webkit-details-marker { display: none; }
.nav-avatar { width: 32px; height: 32px; border-width: 1.5px; transition: border-color .12s; }
.nav-user summary:hover .nav-avatar, .nav-user[open] .nav-avatar { border-color: var(--gold); }
.nav-menu { position: absolute; right: 0; top: calc(100% + 8px); background: var(--card); border: 1px solid var(--rule); border-radius: 10px; box-shadow: var(--shadow-lg); padding: 6px; z-index: 30; min-width: 180px; display: flex; flex-direction: column; }
.nav-menu a, .nav-menu button { display: block; width: 100%; text-align: left; font-family: 'Inter', sans-serif; font-size: 13.5px; font-weight: 500; color: var(--ink); text-decoration: none; border: none; background: transparent; padding: 8px 10px; border-radius: 6px; cursor: pointer; }
.nav-menu a:hover, .nav-menu button:hover { background: var(--paper-2); }
.nav-menu-name { margin: 4px 10px 8px; padding-bottom: 8px; border-bottom: 1px solid var(--paper-2); font-size: 13.5px; font-weight: 600; display: flex; flex-direction: column; }
.nav-menu-name span { font-family: 'IBM Plex Mono', monospace; font-size: 11px; font-weight: 500; color: var(--ink-faint); }

/* ---------- Ranking ledger (ported from the reference app) ---------- */
.rank-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 20px 0 16px; }
.search-wrap { position: relative; flex: 1 1 220px; min-width: 180px; }
.search-wrap input { width: 100%; height: 36px; padding: 0 12px 0 32px; border: 1px solid var(--rule); border-radius: 8px; background: var(--card); font-size: 13px; color: var(--ink); }
.search-wrap input:focus { outline: 2px solid var(--gold); outline-offset: 1px; }
.search-icon { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 14px; height: 14px; color: var(--ink-faint); pointer-events: none; }
.rank-spacer { flex: 1; }
.rank-status { font-family: 'IBM Plex Mono', monospace; font-size: 11px; color: var(--ink-faint); white-space: nowrap; }
.rank-status.err { color: var(--danger); }
.rank-count { font-family: 'IBM Plex Mono', monospace; font-size: 11px; color: var(--ink-soft); }

.table-scroll { overflow-x: auto; border-radius: 12px; }
.table-inner { min-width: 920px; }
.rank-cols { --cols: 30px 46px 128px minmax(200px, 1.7fr) 170px 42px 42px 42px 42px 104px 34px; }
.rank-cols.readonly { --cols: 46px 140px minmax(220px, 2fr) 190px 48px 48px 48px 48px 120px; }
.header-row { display: grid; grid-template-columns: var(--cols); gap: 8px; align-items: end; padding: 0 14px 8px; position: sticky; top: 0; background: var(--paper); z-index: 2; }
.header-row .h { font-family: 'IBM Plex Mono', monospace; font-size: 10px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-faint); border-bottom: 1px solid var(--rule); padding-bottom: 8px; }
.header-row .h.center { text-align: center; }
ul.list { list-style: none; margin: 0; padding: 0; }
.row { display: grid; grid-template-columns: var(--cols); gap: 8px; align-items: center; background: var(--card); border: 1px solid var(--rule); border-left: 4px solid var(--accent, var(--gold)); border-radius: 8px; padding: 9px 10px; margin-bottom: 6px; box-shadow: var(--shadow); }
.row.dragging-ghost { opacity: 0.4; }
.row.sortable-chosen { box-shadow: var(--shadow-lg); }
.cell { min-width: 0; }
.handle { color: var(--ink-faint); cursor: grab; display: flex; align-items: center; justify-content: center; height: 100%; touch-action: none; }
.handle:active { cursor: grabbing; }
.list.filtering .handle { opacity: 0.25; pointer-events: none; }
.rank { font-family: 'Fraunces', serif; font-weight: 600; font-size: 19px; color: var(--ink-soft); text-align: right; padding-right: 2px; font-variant-numeric: tabular-nums; }
.cell-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cell-album { font-size: 11px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--accent, var(--ink-soft)); }
.cell-title { font-size: 14px; font-weight: 500; }
.cell-producer { font-size: 11.5px; color: var(--ink-soft); }
input.album-input, input.title-input, input.producer-input { width: 100%; border: none; background: transparent; font-family: 'Inter', sans-serif; color: var(--ink); padding: 4px 2px; border-radius: 4px; }
input.album-input:focus, input.title-input:focus, input.producer-input:focus { outline: none; background: var(--paper-2); }
input.album-input { font-size: 11px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--accent, var(--ink-soft)); }
input.title-input { font-size: 14px; font-weight: 500; }
input.producer-input { font-size: 11.5px; color: var(--ink-soft); }
.cell.score { display: flex; justify-content: center; }
.score-num { font-family: 'IBM Plex Mono', monospace; font-size: 13px; font-weight: 600; text-align: center; }
input.score-input { width: 38px; text-align: center; border: none; border-bottom: 1.5px solid var(--rule); background: transparent; font-family: 'IBM Plex Mono', monospace; font-size: 13px; font-weight: 600; color: var(--ink); padding: 4px 0; -moz-appearance: textfield; }
input.score-input::-webkit-outer-spin-button, input.score-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
input.score-input:focus { outline: none; border-bottom-color: var(--gold); }
.cell.total { display: flex; align-items: center; gap: 8px; }
.meter { flex: 1; height: 5px; border-radius: 3px; background: var(--rule); overflow: hidden; }
.meter-fill { height: 100%; background: var(--accent, var(--gold)); border-radius: 3px; width: 0%; transition: width .18s ease; }
.total-num { font-family: 'IBM Plex Mono', monospace; font-size: 13px; font-weight: 600; min-width: 20px; text-align: right; font-variant-numeric: tabular-nums; }
.cell.delete { display: flex; justify-content: center; }
.delete-btn { width: 24px; height: 24px; border-radius: 50%; border: none; background: transparent; color: var(--ink-faint); font-size: 16px; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.delete-btn:hover { background: var(--danger-soft); color: var(--danger); }
.empty { text-align: center; padding: 48px 16px; color: var(--ink-faint); font-size: 13px; }
.drafts-section { margin: 0 0 20px; }
.drafts-label { font-family: 'IBM Plex Mono', monospace; font-size: 11px; font-weight: 600; color: var(--ink-soft); margin: 0 0 8px; }
.row-draft { border-style: dashed; border-color: var(--ink-faint); background: var(--paper-2); box-shadow: none; }
.row-draft .handle { visibility: hidden; }
.publish-btn { width: 100%; height: 26px; border-radius: 6px; border: 1px solid var(--accent, var(--gold)); background: transparent; color: var(--accent, var(--gold)); display: flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; }
.publish-btn svg { width: 13px; height: 13px; }
.publish-btn:hover { background: var(--accent, var(--gold)); color: var(--card); }
@keyframes justPublished { 0% { background: var(--paper-2); } 100% { background: var(--card); } }
.row.just-published { animation: justPublished 1.4s ease; }
@media (max-width: 760px) {
  .rank-cols { --cols: 26px 38px 108px minmax(160px, 1fr) 0px 36px 36px 36px 36px 92px 30px; }
  .cell.producer { padding: 0; opacity: 0; }
}

@media (max-width: 600px) {
  h1 { font-size: 30px; }
  .hero h1 { font-size: 38px; }
  .nav-links { gap: 12px; font-size: 13px; }
}
@media (prefers-reduced-motion: reduce) { .meter-fill { transition: none; } .row.just-published { animation: none; } * { scroll-behavior: auto !important; } }
