:root {
  color-scheme: dark;
  --bg: #0e0e0c;
  --sidebar: #141411;
  --surface: #181815;
  --surface-2: #1d1d19;
  --surface-3: #23231e;
  --surface-4: #2a2923;
  --line: rgba(236,232,221,.075);
  --line-strong: rgba(236,232,221,.14);
  --text: #ece9e1;
  --muted: #a6a198;
  --faint: #706d65;
  --accent: #b08a57;
  --accent-2: #7f9182;
  --accent-soft: rgba(176,138,87,.12);
  --danger: #b87474;
  --shadow: 0 22px 70px rgba(0,0,0,.38);
  --sidebar-w: 252px;
  --radius-xl: 26px;
  --radius-lg: 18px;
  --radius-md: 14px;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  overflow-x: hidden;
}
button, input, select { font: inherit; }
button { color: inherit; }
button, .brand { -webkit-tap-highlight-color: transparent; }

.app-shell { min-height: 100vh; }
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-w);
  padding: 22px 16px 14px;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(circle at 24% 0%, rgba(176,138,87,.045), transparent 30%),
    linear-gradient(180deg, #161612 0%, #11110f 100%);
  border-right: 1px solid var(--line);
  z-index: 30;
}
.brand {
  height: 56px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 12px;
  margin-bottom: 22px;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: .02em;
  cursor: pointer;
}
.brand-mark { width: 34px; height: 34px; color: var(--accent-2); }
.brand-mark svg { width: 100%; height: 100%; }
.nav-group, .utility-group { display: grid; gap: 8px; }
.nav-item, .accent-action {
  width: 100%;
  border: 0;
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 12px 14px;
  border-radius: 12px;
  background: transparent;
  color: #c2c3cb;
  text-align: left;
  cursor: pointer;
  transition: background .2s ease, color .2s ease, transform .2s ease;
}
.nav-item:hover, .accent-action:hover { background: rgba(255,255,255,.05); color: #fff; transform: translateX(2px); }
.nav-item.active { background: rgba(255,255,255,.075); color: #fff; }
.nav-item.active .nav-icon { color: var(--accent); }
.nav-icon, .search-icon { width: 18px; height: 18px; display: inline-grid; place-items: center; flex: 0 0 auto; }
.nav-icon svg, .search-icon svg, [data-icon] svg { width: 100%; height: 100%; display: block; }
.sidebar-divider { height: 1px; background: var(--line); margin: 18px 4px; }
.accent-action { border: 1px solid rgba(176,138,87,.25); background: rgba(176,138,87,.07); color: #c8ae88; }
.sidebar-spacer { flex: 1; }
.nav-item.quiet { font-size: 14px; padding-block: 10px; color: #b2b3bc; }
.profile-chip {
  margin-top: 18px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255,255,255,.055), rgba(255,255,255,.025));
  border-radius: 14px;
  padding: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}
.profile-avatar {
  width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
  background: linear-gradient(135deg, #8d785d, #4a4b42 58%, #1a1a17);
  font-size: 12px; font-weight: 800; border: 1px solid rgba(255,255,255,.18);
}
.profile-copy { min-width: 0; text-align: left; display: grid; gap: 3px; }
.profile-copy strong { font-size: 13px; }
.profile-copy small { max-width: 128px; overflow: hidden; text-overflow: ellipsis; color: var(--muted); }
.chevron { margin-left: auto; color: var(--accent); font-size: 22px; }

.main-area { min-height: 100vh; margin-left: var(--sidebar-w); position: relative; }
.view { min-height: 100vh; display: none; }
.view.active { display: block; animation: viewIn .32s ease both; }
@keyframes viewIn { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: none; } }

/* Home */
#homeView { position: relative; overflow: hidden; }
.hero-bg { position: absolute; inset: 0; background: #0e0e0c; overflow: hidden; }
.grid-lines {
  position: absolute; inset: 0;
  background-image: linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(circle at 50% 42%, #000 0%, transparent 72%);
}
.orb { position: absolute; border-radius: 999px; filter: blur(100px); opacity: .1; }
.orb-a { width: 500px; height: 500px; background: #85745e; top: -190px; left: 18%; }
.orb-b { width: 520px; height: 520px; background: #56645b; right: -210px; top: 18%; }
.orb-c { width: 360px; height: 360px; background: #6f6559; left: 22%; bottom: -220px; }
.home-content {
  position: relative; z-index: 2; min-height: 100vh; padding: 56px 56px 46px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
}
.mascot { width: min(360px, 48vw); height: 305px; position: relative; margin-bottom: -30px; }
.mascot svg { width: 100%; height: 100%; position: relative; z-index: 1; filter: drop-shadow(0 28px 30px rgba(0,0,0,.35)); }
.mascot-glow { position: absolute; width: 210px; height: 210px; border-radius: 50%; background: radial-gradient(circle, rgba(176,138,87,.16), transparent 70%); left: 50%; top: 50%; transform: translate(-50%,-42%); filter: blur(18px); }
.hero-copy { max-width: 760px; }
.eyebrow { color: #b69a74; text-transform: uppercase; letter-spacing: .16em; font-size: 11px; font-weight: 800; }
.hero-copy h1 { margin: 12px 0 14px; font-size: clamp(38px, 5.1vw, 68px); line-height: .98; letter-spacing: -.055em; }
.hero-copy h1 span { color: #b6afa4; }
.hero-copy p { margin: 0 auto; max-width: 650px; color: var(--muted); font-size: 16px; line-height: 1.7; }
.hero-search {
  margin-top: 30px; width: min(680px, 90vw); height: 70px; padding: 0 18px 0 22px; border-radius: 24px;
  display: flex; align-items: center; gap: 14px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(25,25,21,.88); backdrop-filter: blur(18px);
  box-shadow: 0 18px 60px rgba(0,0,0,.42), inset 0 1px rgba(255,255,255,.04);
}
.hero-search:focus-within { border-color: rgba(176,138,87,.48); box-shadow: 0 18px 60px rgba(0,0,0,.34), 0 0 0 4px rgba(176,138,87,.07); }
.hero-search input { flex: 1; min-width: 0; background: transparent; border: 0; outline: 0; color: #fff; font-size: 17px; }
.hero-search input::placeholder { color: #8b8c97; }
kbd { border: 1px solid var(--line-strong); background: #0b0c10; border-radius: 8px; padding: 6px 8px; color: #858692; font-size: 11px; }
.service-row { margin-top: 22px; display: grid; grid-template-columns: repeat(4, minmax(118px, 1fr)); gap: 12px; width: min(680px, 90vw); }
.service-card {
  min-height: 92px; border: 1px solid var(--line); border-radius: 18px; background: rgba(16,17,22,.78); backdrop-filter: blur(12px);
  display: grid; place-items: center; align-content: center; gap: 8px; cursor: pointer; color: #d5d5dc; transition: transform .22s ease, border-color .22s ease, background .22s ease;
}
.service-card:hover { transform: translateY(-3px); border-color: rgba(176,138,87,.3); background: rgba(34,34,29,.92); }
.service-logo { width: 38px; height: 38px; display: grid; place-items: center; font-weight: 900; font-size: 22px; }
.service-logo.patreon { color: #b58d66; border-left: 7px solid currentColor; }
.service-logo.discord { border-radius: 12px; background: #777a70; }
.service-logo.fanbox { color: #82938a; border: 4px solid currentColor; border-radius: 9px; }
.service-logo.gumroad { color: #9b8475; border-radius: 50%; border: 4px solid currentColor; }
.home-note { max-width: 700px; margin: 24px auto 0; color: #858792; font-size: 13px; line-height: 1.65; }

/* Directory */
#creatorsView, #contentView { padding: 34px 36px 40px; }
.page-header { display: flex; justify-content: space-between; align-items: end; gap: 24px; margin-bottom: 24px; }
.page-header h2, .profile-title-line h2 { margin: 6px 0 0; font-size: clamp(30px, 3vw, 44px); letter-spacing: -.04em; }
.round-icon { width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--line-strong); background: var(--surface); color: var(--accent); vertical-align: 6px; margin-left: 8px; cursor: pointer; transition: transform .25s ease, background .2s ease; }
.round-icon:hover { transform: rotate(80deg); background: var(--surface-3); }
.round-icon span { width: 18px; height: 18px; display: inline-block; }
.header-meta { color: var(--muted); font-size: 13px; padding-bottom: 7px; }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 24px; }
.toolbar-actions { display: flex; align-items: center; gap: 10px; }
.search-control {
  height: 46px; min-width: 260px; display: flex; align-items: center; gap: 10px; padding: 0 14px;
  border-radius: 16px; background: var(--surface); border: 1px solid var(--line); color: var(--muted);
}
.search-control:focus-within { border-color: rgba(176,138,87,.45); box-shadow: 0 0 0 4px rgba(176,138,87,.065); }
.search-control span { width: 18px; height: 18px; }
.search-control input { border: 0; outline: 0; background: transparent; color: #fff; min-width: 0; width: 100%; }
.search-form-row { display: flex; align-items: center; gap: 10px; width: 100%; }
.search-form-row .search-control { flex: 1 1 auto; min-width: 0; }
.search-form-row .accent-action { width: auto; flex: 0 0 auto; padding: 12px 20px; }
select {
  height: 46px; padding: 0 38px 0 14px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); color: #d8d9df; outline: none;
}
.pagination { display: flex; align-items: center; }
.pagination.compact { border: 1px solid var(--line); border-radius: 18px; overflow: hidden; background: var(--surface); }
.pagination.compact > * { height: 46px; min-width: 42px; border: 0; background: transparent; color: #aaaab4; display: grid; place-items: center; }
.page-pill, .page-arrow { cursor: pointer; }
.page-pill.active { background: var(--surface-4) !important; color: #fff !important; border-radius: 15px; margin: 3px; height: 40px !important; }
.page-arrow { border-left: 1px solid var(--line) !important; }
.page-arrow span { width: 18px; height: 18px; }
.creator-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.creator-card {
  position: relative; min-height: 120px; border-radius: var(--radius-lg); border: 1px solid var(--line); overflow: hidden;
  background: var(--surface); cursor: pointer; isolation: isolate; transition: transform .22s ease, border-color .22s ease, box-shadow .22s ease;
}
.creator-card:hover { transform: translateY(-2px); border-color: rgba(176,138,87,.27); box-shadow: 0 16px 40px rgba(0,0,0,.28); }
.creator-card-bg { position: absolute; inset: 0; opacity: .48; z-index: -2; }
.creator-card::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(10,11,15,.96) 0%, rgba(10,11,15,.8) 53%, rgba(10,11,15,.34)); z-index: -1; }
.creator-card-inner { min-height: 120px; padding: 16px; display: grid; grid-template-columns: 82px minmax(0, 1fr); gap: 15px; align-items: center; }
.creator-avatar { width: 82px; height: 82px; border-radius: 15px; display: grid; place-items: center; font-size: 22px; font-weight: 900; letter-spacing: -.04em; border: 1px solid rgba(255,255,255,.14); box-shadow: inset 0 1px rgba(255,255,255,.12); }
.creator-info { min-width: 0; display: grid; gap: 12px; }
.creator-info h3 { font-size: 18px; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.creator-meta-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.service-badges { display: flex; gap: 5px; min-width: 0; }
.service-badge { width: 28px; height: 28px; border-radius: 9px; background: rgba(255,255,255,.075); border: 1px solid var(--line); display: grid; place-items: center; font-size: 10px; font-weight: 800; color: #d9d9df; }
.followers { text-align: right; line-height: 1.05; }
.followers strong { display: block; font-size: 14px; }
.followers small { color: var(--muted); font-size: 10px; }
.empty-state { grid-column: 1 / -1; padding: 70px 24px; border: 1px dashed var(--line-strong); border-radius: var(--radius-xl); text-align: center; color: var(--muted); }
.bottom-pagination { display: flex; justify-content: center; margin-top: 28px; }

/* Content */
.content-toolbar { align-items: center; }
.creator-sort-bar {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin: 0 0 20px;
}
.creator-filter-bar {
  display: flex; flex-wrap: wrap; gap: 18px;
  margin: 0 0 20px; align-items: center;
}
.creator-filter-group { display: flex; flex-wrap: wrap; gap: 6px; }
.creator-filter-group + .creator-filter-group { padding-left: 12px; border-left: 1px solid var(--line); }
@media (max-width: 700px) {
  .creator-filter-group + .creator-filter-group { padding-left: 0; border-left: 0; }
}
.creator-sort-pill {
  display: inline-flex; align-items: center;
  padding: 7px 14px; border-radius: 999px;
  border: 1px solid var(--line); background: rgba(255,255,255,.03);
  color: var(--muted); font-size: 12px; font-weight: 600;
  text-decoration: none;
  transition: background .15s, border-color .15s, color .15s;
}
.creator-sort-pill:hover { background: rgba(255,255,255,.06); color: var(--text); }
.creator-sort-pill.is-active {
  background: rgba(176,138,87,.12);
  border-color: rgba(176,138,87,.4);
  color: #e8c79a;
}

.creator-stats {
  display: flex; flex-wrap: wrap; gap: 10px;
  font-size: 12px; color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.creator-stats .creator-stat {
  display: inline-flex; align-items: center; gap: 5px;
}
.creator-stats .creator-stat [data-icon] { width: 13px; height: 13px; }
.creator-stats .creator-stat-bytes {
  margin-left: auto; color: #d5b683; font-weight: 600;
}

.segmented { display: inline-flex; padding: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 15px; }
.segment { height: 36px; padding: 0 15px; border: 0; border-radius: 11px; background: transparent; color: var(--muted); cursor: pointer; }
.segment.active { background: var(--surface-4); color: #fff; }
.content-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; }
.content-grid.wide { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.content-card {
  min-width: 0; aspect-ratio: .82; border-radius: 17px; overflow: hidden; border: 1px solid var(--line); background: var(--surface);
  position: relative; cursor: pointer; transition: transform .22s ease, border-color .22s ease, box-shadow .22s ease;
}
.content-card:hover { transform: translateY(-3px); border-color: rgba(176,138,87,.28); box-shadow: 0 18px 40px rgba(0,0,0,.28); }
.content-art { position: absolute; inset: 0; overflow: hidden; }
.content-art::before, .content-art::after { content: ""; position: absolute; border-radius: 999px; filter: blur(2px); }
.content-art::before { width: 78%; height: 46%; left: -14%; top: 9%; background: rgba(255,255,255,.11); transform: rotate(-18deg); }
.content-art::after { width: 72%; height: 72%; right: -24%; bottom: -20%; background: rgba(0,0,0,.3); }
.art-lines { position: absolute; inset: 0; opacity: .3; background-image: linear-gradient(rgba(255,255,255,.13) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.13) 1px, transparent 1px); background-size: 28px 28px; transform: rotate(8deg) scale(1.15); }
.art-glyph { position: absolute; inset: 0; display: grid; place-items: center; font-size: clamp(34px, 4vw, 70px); opacity: .85; text-shadow: 0 12px 30px rgba(0,0,0,.36); }
.content-overlay { position: absolute; inset: auto 0 0; padding: 44px 13px 12px; background: linear-gradient(transparent, rgba(5,6,9,.96)); }
.content-overlay h4 { margin: 0 0 8px; font-size: 13px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.content-meta { display: flex; align-items: center; justify-content: space-between; color: #a4a5af; font-size: 10px; }
.content-type { background: rgba(0,0,0,.35); border: 1px solid rgba(255,255,255,.1); padding: 4px 7px; border-radius: 999px; text-transform: capitalize; }

/* Profile */
#profileView { background: var(--bg); }
.profile-hero { position: relative; min-height: 266px; border-bottom: 1px solid var(--line); overflow: hidden; }
.profile-banner { position: absolute; inset: 0; opacity: .64; }
.profile-banner::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(14,14,12,.95) 0%, rgba(14,14,12,.7) 55%, rgba(14,14,12,.82)), linear-gradient(0deg, #0e0e0c 0%, transparent 44%); }
.back-button { position: absolute; top: 24px; left: 28px; z-index: 2; height: 40px; padding: 0 13px; border-radius: 12px; border: 1px solid var(--line); background: rgba(9,10,14,.62); backdrop-filter: blur(10px); display: flex; align-items: center; gap: 8px; cursor: pointer; }
.back-button span { width: 16px; height: 16px; }
.profile-header-content { position: relative; z-index: 1; min-height: 266px; padding: 70px 34px 24px; display: flex; align-items: end; gap: 24px; }
.large-avatar { width: 142px; height: 142px; border-radius: 28px; display: grid; place-items: center; flex: 0 0 auto; font-size: 42px; font-weight: 900; border: 3px solid rgba(255,255,255,.14); box-shadow: var(--shadow); }
.profile-title-block { padding-bottom: 2px; }
.profile-title-line { display: flex; align-items: center; gap: 12px; }
.profile-title-line h2 { margin-top: 0; }
.profile-title-block > p { color: #a7a8b1; margin: 5px 0 14px; }
.profile-services { display: flex; gap: 6px; }
.profile-actions { display: flex; gap: 10px; }
.followers-button, .secondary-button { height: 42px; border-radius: 13px; border: 1px solid var(--line-strong); background: rgba(16,17,22,.7); backdrop-filter: blur(10px); padding: 0 14px; cursor: pointer; }
.followers-button span { color: var(--accent); font-size: 18px; margin-left: 8px; }
.secondary-button { display: flex; align-items: center; gap: 8px; }
.secondary-button span { width: 16px; height: 16px; }
.profile-tabs { height: 62px; padding: 0 34px; border-bottom: 1px solid var(--line); display: flex; align-items: end; gap: 28px; overflow-x: auto; }
.profile-tab { height: 61px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: #a5a6b0; cursor: pointer; white-space: nowrap; }
.profile-tab.active { color: #fff; border-bottom-color: var(--accent); }
.profile-body { padding: 24px 34px 38px; }
.profile-toolbar { margin-bottom: 20px; }
.toast { position: fixed; right: 24px; bottom: 24px; z-index: 50; padding: 12px 16px; border-radius: 12px; border: 1px solid var(--line-strong); background: rgba(20,21,28,.94); box-shadow: var(--shadow); color: #e8e8ed; opacity: 0; transform: translateY(12px); pointer-events: none; transition: .25s ease; }
.toast.show { opacity: 1; transform: none; }

@media (max-width: 1280px) {
  :root { --sidebar-w: 220px; }
  .creator-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .content-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .content-grid.wide { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 980px) {
  :root { --sidebar-w: 78px; }
  .sidebar { padding-inline: 10px; }
  .brand { justify-content: center; padding: 0; }
  .brand > span, .nav-item > span:last-child, .accent-action > span:last-child, .profile-copy, .chevron { display: none; }
  .nav-item, .accent-action { justify-content: center; padding-inline: 0; }
  .profile-chip { justify-content: center; padding: 8px; }
  .toolbar { align-items: stretch; flex-direction: column; }
  .toolbar-actions { flex-wrap: wrap; }
  .search-control { flex: 1 1 250px; }
  .profile-toolbar .pagination { align-self: flex-start; }
  .content-grid, .content-grid.wide { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .service-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
  :root { --sidebar-w: 0px; }
  .sidebar { position: fixed; inset: auto 10px 10px; width: auto; height: 64px; padding: 7px; border: 1px solid var(--line-strong); border-radius: 18px; flex-direction: row; align-items: center; background: rgba(10,11,15,.9); backdrop-filter: blur(18px); box-shadow: var(--shadow); }
  .brand, .sidebar-divider, .accent-action, .sidebar-spacer, .utility-group, .profile-chip { display: none; }
  .nav-group { width: 100%; grid-template-columns: repeat(3, 1fr); gap: 6px; }
  .nav-item { height: 48px; }
  .nav-item > span:last-child { display: block; font-size: 11px; }
  .nav-item { flex-direction: column; gap: 3px; }
  .nav-icon { width: 17px; height: 17px; }
  .main-area { margin-left: 0; padding-bottom: 76px; }
  .home-content { padding: 30px 18px 100px; justify-content: flex-start; }
  .mascot { margin-top: 24px; width: 320px; max-width: 88vw; height: 265px; }
  .hero-copy h1 { font-size: 43px; }
  .hero-copy p { font-size: 14px; }
  .hero-search { height: 60px; border-radius: 19px; }
  .hero-search kbd { display: none; }
  #creatorsView, #contentView { padding: 24px 16px 100px; }
  .page-header { align-items: start; }
  .header-meta { display: none; }
  .creator-grid { grid-template-columns: 1fr; }
  .toolbar-actions { display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
  .toolbar-actions .search-control { grid-column: 1 / -1; min-width: 0; }
  .toolbar-actions select { width: 100%; }
  .pagination.compact { max-width: 100%; overflow-x: auto; }
  .content-grid, .content-grid.wide { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .profile-header-content { padding: 74px 18px 22px; align-items: start; flex-direction: column; gap: 14px; }
  .large-avatar { width: 112px; height: 112px; border-radius: 24px; }
  .profile-title-line { align-items: flex-start; }
  .profile-title-line h2 { font-size: 34px; }
  .profile-tabs { padding-inline: 18px; gap: 22px; }
  .profile-body { padding: 20px 16px 100px; }
  .profile-toolbar { flex-direction: column; }
}
@media (max-width: 440px) {
  .service-row { gap: 8px; }
  .service-card { min-height: 82px; }
  .creator-card-inner { grid-template-columns: 70px minmax(0, 1fr); }
  .creator-avatar { width: 70px; height: 70px; }
  .content-grid, .content-grid.wide { grid-template-columns: 1fr 1fr; }
}

/* Single post / file page */
#postView {
  background:
    radial-gradient(circle at 86% 0%, rgba(176,138,87,.035), transparent 29%),
    linear-gradient(180deg, #0e0e0c 0%, #10100e 100%);
}
.post-page { width: 100%; max-width: 1500px; margin: 0 auto; padding: 28px 32px 54px; }
.post-topbar { display: flex; align-items: end; justify-content: space-between; gap: 28px; margin-bottom: 22px; }
.post-heading { min-width: 0; }
.text-back {
  height: 34px; padding: 0; margin-bottom: 14px; border: 0; background: transparent; color: #9698a5;
  display: inline-flex; align-items: center; gap: 7px; cursor: pointer; transition: color .2s ease, transform .2s ease;
}
.text-back:hover { color: #fff; transform: translateX(-2px); }
.text-back span { width: 17px; height: 17px; }
.post-kickers { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 10px; }
.post-chip { padding: 5px 9px; border: 1px solid rgba(176,138,87,.28); border-radius: 999px; background: rgba(176,138,87,.075); color: #c9ad84; font-size: 10px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.post-chip.subtle { border-color: var(--line); background: rgba(255,255,255,.035); color: #989aa7; }
.post-heading h1 { margin: 0; max-width: 900px; font-size: clamp(30px, 3.2vw, 48px); line-height: 1.04; letter-spacing: -.045em; }
.post-author-row { margin-top: 18px; display: flex; align-items: center; flex-wrap: wrap; gap: 11px; }
.post-author { padding: 0; border: 0; background: transparent; display: flex; align-items: center; gap: 10px; cursor: pointer; text-align: left; }
.post-author-avatar { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.17); font-size: 12px; font-weight: 900; box-shadow: inset 0 1px rgba(255,255,255,.1); }
.post-author > span:last-child { display: grid; gap: 2px; }
.post-author strong { font-size: 13px; }
.post-author small { color: var(--muted); font-size: 11px; }
.post-date { height: 36px; padding: 0 11px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255,255,255,.025); color: #aaaab4; display: inline-flex; align-items: center; gap: 7px; font-size: 11px; }
.post-date > span:first-child { width: 15px; height: 15px; }
.post-actions { display: flex; gap: 7px; }
.icon-action { width: 36px; height: 36px; border-radius: 11px; border: 1px solid var(--line); background: var(--surface); display: grid; place-items: center; color: #aaaab5; cursor: pointer; transition: color .2s ease, border-color .2s ease, background .2s ease, transform .2s ease; }
.icon-action:hover { color: #fff; border-color: var(--line-strong); transform: translateY(-1px); }
.icon-action.active { color: #d0b58d; border-color: rgba(176,138,87,.38); background: rgba(176,138,87,.11); }
.icon-action span { width: 17px; height: 17px; }
.icon-action.active svg { fill: currentColor; }
.post-nav-buttons { display: flex; gap: 10px; flex: 0 0 auto; padding-bottom: 3px; }
.post-nav-button { min-width: 122px; height: 42px; padding: 0 15px; border-radius: 14px; border: 1px solid rgba(176,138,87,.18); background: rgba(176,138,87,.045); color: #c6c2d4; display: flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer; transition: background .2s ease, border-color .2s ease, transform .2s ease; }
.post-nav-button:hover { background: rgba(176,138,87,.085); border-color: rgba(176,138,87,.32); transform: translateY(-1px); }
.post-nav-button span { width: 17px; height: 17px; color: var(--accent); }
.post-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; align-items: start; }
.post-document { min-width: 0; border: 1px solid var(--line); border-radius: 22px; background: #151512; overflow: hidden; box-shadow: 0 24px 70px rgba(0,0,0,.18); }
.post-section { padding: 24px; border-bottom: 1px solid var(--line); }
.post-section:last-child { border-bottom: 0; }
.intro-section > p, .expanded-notes p { max-width: 920px; margin: 14px 0 0; color: #a8a9b3; line-height: 1.68; font-size: 14px; }
.expanded-notes p { color: #c0c1ca; }
.section-title { display: flex; align-items: center; min-width: 0; gap: 10px; }
.section-rule { width: 3px; height: 23px; border-radius: 99px; background: var(--accent); box-shadow: none; }
.section-title h2 { margin: 0; font-size: 16px; letter-spacing: -.01em; }
.section-count { margin-left: auto; color: #747681; font-size: 11px; white-space: nowrap; }
.search-section { margin-top: 40px; }
.search-section + .search-section { margin-top: 48px; }
.search-section .section-title { margin-bottom: 18px; }
.search-section .section-title h2 { font-size: 18px; }
.search-section .creator-grid { gap: 16px; }
.read-more { margin-top: 12px; padding: 0; border: 0; background: transparent; color: #c4a77f; cursor: pointer; font-size: 12px; font-weight: 700; }
.post-gallery { margin-top: 16px; display: grid; gap: 10px; }
.post-art { position: relative; overflow: hidden; border: 1px solid rgba(255,255,255,.1); isolation: isolate; }
.post-art::before { content: ""; position: absolute; z-index: -1; inset: -30%; background: conic-gradient(from 210deg, transparent 0 22%, rgba(255,255,255,.09) 24% 31%, transparent 34% 58%, rgba(127,145,130,.1) 61% 66%, transparent 69%); animation: artDrift 18s linear infinite; }
.post-art::after { content: ""; position: absolute; z-index: -1; inset: 0; background: radial-gradient(circle at 68% 36%, transparent 0 8%, rgba(0,0,0,.2) 9% 11%, transparent 12%), linear-gradient(0deg, rgba(5,6,9,.58), transparent 52%); }
@keyframes artDrift { to { transform: rotate(360deg); } }
.art-grid { position: absolute; inset: 0; opacity: .19; background-image: linear-gradient(rgba(255,255,255,.14) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.14) 1px, transparent 1px); background-size: 38px 38px; transform: perspective(500px) rotateX(58deg) scale(1.4) translateY(22%); transform-origin: bottom; }
.art-symbol { position: absolute; inset: 0; display: grid; place-items: center; font-size: clamp(46px, 8vw, 112px); font-weight: 300; opacity: .78; text-shadow: 0 16px 42px rgba(0,0,0,.46); }
.art-orbit { position: absolute; left: 50%; top: 50%; border: 1px solid rgba(255,255,255,.2); border-radius: 50%; transform: translate(-50%,-50%) rotate(-18deg); }
.orbit-one { width: 56%; aspect-ratio: 1; }
.orbit-two { width: 78%; aspect-ratio: 2.2; transform: translate(-50%,-50%) rotate(28deg); }
.gallery-feature { width: 100%; min-height: 430px; border-radius: 18px; cursor: zoom-in; }
.gallery-strip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.gallery-thumb { min-width: 0; aspect-ratio: 1.62; border-radius: 14px; cursor: zoom-in; }
.gallery-thumb .art-symbol { font-size: clamp(28px, 4vw, 52px); }
.gallery-label { position: absolute; z-index: 2; left: 13px; bottom: 12px; padding: 6px 9px; border-radius: 9px; background: rgba(5,6,9,.66); backdrop-filter: blur(8px); color: #dedee4; font-size: 10px; font-weight: 700; }
.post-video { width: 100%; min-height: 390px; margin-top: 16px; border-radius: 18px; cursor: pointer; }
.video-wave { position: absolute; width: 84%; height: 34%; left: 8%; top: 36%; opacity: .5; background: repeating-linear-gradient(90deg, transparent 0 11px, rgba(255,255,255,.54) 12px 14px, transparent 15px 23px); mask-image: radial-gradient(ellipse, #000 30%, transparent 73%); transform: scaleY(.7); }
.video-play { position: absolute; left: 50%; top: 50%; width: 66px; height: 66px; transform: translate(-50%,-50%); border-radius: 50%; display: grid; place-items: center; background: rgba(7,8,11,.83); border: 1px solid rgba(255,255,255,.15); box-shadow: 0 14px 40px rgba(0,0,0,.42); transition: transform .25s ease, background .25s ease; }
.video-play > span { width: 24px; height: 24px; margin-left: 4px; }
.post-video:hover .video-play { transform: translate(-50%,-50%) scale(1.06); background: rgba(20,21,29,.92); }
.post-video.playing .video-play { transform: translate(-50%,-50%) scale(.78); opacity: .25; }
.post-video.playing::before { animation-duration: 2.4s; }
.video-status { position: absolute; z-index: 2; right: 14px; bottom: 13px; padding: 6px 9px; border-radius: 9px; background: rgba(5,6,9,.66); color: #d8d8df; font-size: 10px; }
.video-thumbs { margin-top: 10px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.video-thumb { min-width: 0; aspect-ratio: 2.15; border-radius: 13px; cursor: pointer; }
.video-thumb .art-symbol { font-size: 24px; opacity: .35; }
.mini-play { position: absolute; left: 50%; top: 50%; width: 31px; height: 31px; transform: translate(-50%,-50%); border-radius: 50%; display: grid; place-items: center; padding: 8px; background: rgba(4,5,8,.76); }
.download-list { display: grid; gap: 9px; margin-top: 16px; }
.download-row { min-width: 0; padding: 13px 14px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.018); display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; gap: 12px; align-items: center; color: inherit; text-decoration: none; transition: background .2s ease, border-color .2s ease, transform .2s ease; }
.download-row:hover { background: rgba(176,138,87,.045); border-color: rgba(176,138,87,.23); transform: translateX(2px); }
.file-icon { width: 42px; height: 42px; border-radius: 11px; display: grid; place-items: center; color: #b8a58a; background: rgba(176,138,87,.075); border: 1px solid rgba(176,138,87,.14); }
.file-icon > span { width: 20px; height: 20px; }
.file-copy { min-width: 0; display: grid; gap: 4px; }
.file-copy strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 13px; }
.file-copy small { color: #7f818d; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 10px; }
.download-button { height: 34px; padding: 0 11px; border-radius: 10px; border: 1px solid var(--line); background: #111218; color: #b7b8c2; display: inline-flex; align-items: center; gap: 7px; font-size: 10px; font-weight: 700; }
.download-button > span:first-child { width: 15px; height: 15px; color: var(--accent-2); }
.comments-panel { position: sticky; top: 18px; max-height: calc(100vh - 36px); min-width: 0; border: 1px solid var(--line); border-radius: 20px; background: #171714; overflow: hidden; display: flex; flex-direction: column; }
.comments-header { min-height: 60px; padding: 0 16px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.comments-header > div { display: flex; align-items: center; gap: 9px; }
.comments-header > div > span { width: 18px; height: 18px; color: var(--accent); }
.comments-header strong { font-size: 13px; }
.comment-sort { height: 32px; padding: 0 9px; border-radius: 9px; border: 1px solid var(--line); background: rgba(255,255,255,.025); color: #8f919d; font-size: 10px; cursor: pointer; }
.comment-form { padding: 14px; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 32px minmax(0,1fr); gap: 9px; }
.comment-avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; flex: 0 0 auto; background: linear-gradient(135deg, #7b776d, #33332d); border: 1px solid rgba(255,255,255,.13); font-size: 9px; font-weight: 900; }
.comment-avatar.violet { background: linear-gradient(135deg, #8e8274, #403b34); }
.comment-avatar.teal { background: linear-gradient(135deg, #829389, #304039); }
.comment-avatar.amber { background: linear-gradient(135deg, #a98860, #4a3723); }
.comment-avatar.rose { background: linear-gradient(135deg, #9b7d73, #48322d); }
.comment-compose { min-width: 0; border: 1px solid var(--line); border-radius: 12px; background: #0a0b0f; overflow: hidden; }
.comment-compose:focus-within { border-color: rgba(176,138,87,.32); }
.comment-compose textarea { width: 100%; min-height: 52px; resize: vertical; padding: 10px 11px 4px; border: 0; outline: 0; background: transparent; color: #e6e6eb; font: inherit; font-size: 11px; line-height: 1.45; }
.comment-compose textarea::placeholder { color: #666873; }
.comment-compose-footer { padding: 5px 7px 7px 11px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.comment-compose-footer > span { color: #656773; font-size: 9px; }
.comment-compose-footer button { height: 27px; padding: 0 10px; border-radius: 8px; border: 0; background: var(--accent); color: white; font-size: 9px; font-weight: 800; cursor: pointer; }
.comments-list { padding: 3px 14px 16px; overflow-y: auto; }
.comment { display: grid; grid-template-columns: 32px minmax(0,1fr); gap: 10px; padding: 14px 0; border-bottom: 1px solid rgba(255,255,255,.055); }
.comment:last-child { border-bottom: 0; }
.comment.reply-comment { margin-left: 20px; padding-left: 11px; border-left: 2px solid rgba(176,138,87,.3); }
.comment-meta { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px; }
.comment-meta strong { color: #d0c2ad; font-size: 10px; }
.comment-meta strong em { margin-left: 3px; padding: 2px 5px; border-radius: 999px; background: rgba(127,145,130,.1); color: #a9b9ad; font-style: normal; font-size: 8px; }
.comment-meta > span { color: #6f717c; font-size: 8px; }
.comment p { margin: 5px 0 7px; color: #c3c4cc; font-size: 11px; line-height: 1.48; }
.comment-tools { display: flex; gap: 12px; }
.comment-tools button { padding: 0; border: 0; background: transparent; color: #747681; font-size: 9px; cursor: pointer; }
.comment-tools button:hover { color: #c3c4cc; }
.newly-added { animation: commentIn .35s ease both; }
@keyframes commentIn { from { opacity: 0; transform: translateY(-8px); } }

/* ─── Comment system additions (V1) ────────────────────────────── */
.comments-count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 22px; height: 22px; padding: 0 7px;
  background: rgba(176,138,87,.12); border: 1px solid rgba(176,138,87,.25);
  color: #e8c79a; border-radius: 999px;
  font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums;
}
.comments-locked {
  margin: 0; padding: 16px 18px; border-bottom: 1px solid var(--line);
  color: var(--muted); font-size: 13px;
}
.comments-locked a { color: #e8c79a; text-decoration: underline; }
.comments-flash {
  margin: 0; padding: 10px 16px;
  background: rgba(225,176,80,.08); border-bottom: 1px solid rgba(225,176,80,.25);
  color: #ecd29a; font-size: 12px;
}
.comments-empty {
  list-style: none; padding: 18px 4px; color: var(--muted);
  font-size: 12px; text-align: center;
}
.comment-delete-form { display: inline; margin-left: auto; }
.comment-delete {
  background: transparent; border: 0; cursor: pointer;
  color: #6b6c75; font-size: 16px; line-height: 1; padding: 0 4px;
}
.comment-delete:hover { color: #e69191; }
.comment-meta {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
}
.hp-field {
  position: absolute !important;
  left: -9999px !important; top: -9999px !important;
  width: 1px !important; height: 1px !important;
  opacity: 0 !important; pointer-events: none;
}
.lightbox { width: min(1080px, 92vw); padding: 0; border: 1px solid var(--line-strong); border-radius: 22px; background: #121210; color: #fff; box-shadow: 0 40px 110px rgba(0,0,0,.68); overflow: hidden; }
.lightbox::backdrop { background: rgba(2,3,5,.82); backdrop-filter: blur(8px); }
.lightbox-art { min-height: min(70vh, 720px); border: 0; border-radius: 0; }
.lightbox-art .art-symbol { font-size: clamp(84px, 13vw, 190px); }
.lightbox-close { position: absolute; z-index: 5; right: 12px; top: 12px; width: 38px; height: 38px; border-radius: 50%; border: 1px solid rgba(255,255,255,.14); background: rgba(7,8,11,.7); color: #fff; font-size: 22px; cursor: pointer; }
.lightbox-caption { height: 54px; padding: 0 18px; display: flex; align-items: center; justify-content: space-between; color: #a9abb5; font-size: 11px; }
.lightbox-caption strong { color: #e4e4e8; }

@media (max-width: 1180px) {
  .post-layout { grid-template-columns: minmax(0, 1fr) 310px; }
  .gallery-feature { min-height: 360px; }
  .post-video { min-height: 330px; }
}
@media (max-width: 980px) {
  .post-page { padding: 24px 22px 46px; }
  .post-topbar { align-items: start; flex-direction: column; }
  .post-nav-buttons { align-self: stretch; }
  .post-nav-button { flex: 1; }
  .post-layout { grid-template-columns: 1fr; }
  .comments-panel { position: relative; top: auto; max-height: none; }
  .comments-list { max-height: none; }
}
@media (max-width: 700px) {
  .post-page { padding: 20px 14px 100px; }
  .post-heading h1 { font-size: 31px; }
  .post-author-row { align-items: flex-start; }
  .post-actions { width: 100%; }
  .post-nav-buttons { gap: 8px; }
  .post-nav-button { min-width: 0; }
  .post-document, .comments-panel { border-radius: 17px; }
  .post-section { padding: 18px 15px; }
  .gallery-feature { min-height: 250px; border-radius: 14px; }
  .gallery-strip, .video-thumbs { gap: 7px; }
  .gallery-thumb, .video-thumb { border-radius: 11px; }
  .post-video { min-height: 250px; border-radius: 14px; }
  .download-row { grid-template-columns: 38px minmax(0,1fr); padding: 11px; }
  .file-icon { width: 38px; height: 38px; }
  .download-button { grid-column: 2; justify-self: start; }
}
@media (max-width: 440px) {
  .post-kickers { margin-bottom: 8px; }
  .post-heading h1 { font-size: 28px; }
  .post-date { order: 3; }
  .gallery-feature { min-height: 215px; }
  .gallery-label { left: 8px; bottom: 8px; }
  .post-video { min-height: 215px; }
  .comment.reply-comment { margin-left: 10px; }
}
.post-art { padding: 0; color: inherit; }
.post-art::before, .post-art::after { z-index: 0; pointer-events: none; }
.art-grid, .art-symbol, .art-orbit, .video-wave { z-index: 1; }

/* Quiet editorial palette refinements */
.nav-item, .accent-action, .service-card, .creator-card, .content-card,
.round-icon, .icon-action, .post-nav-button, .download-row {
  transition-duration: .18s;
}

.service-card,
.creator-card,
.content-card,
.post-document,
.comments-panel {
  box-shadow: none;
}

.creator-card-bg,
.profile-banner {
  filter: saturate(.62) contrast(.96);
}

.content-art,
.post-art {
  filter: saturate(.68);
}

.art-glyph,
.art-symbol {
  opacity: .58;
}

.grid-lines {
  opacity: .55;
}

.round-icon:hover {
  transform: rotate(24deg);
}

.comment-compose-footer button {
  background: #a27e50;
  color: #f3eee5;
}


/* Horizontal navigation concept */
:root { --topbar-h: 76px; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  min-height: var(--topbar-h);
  border-bottom: 1px solid var(--line);
  background: rgba(14, 14, 12, .9);
  backdrop-filter: blur(18px) saturate(110%);
}

.topbar::after {
  content: "";
  position: absolute;
  inset: auto 0 -1px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(176,138,87,.22), transparent);
  pointer-events: none;
}

.topbar-inner {
  width: min(1600px, 100%);
  min-height: var(--topbar-h);
  margin: 0 auto;
  padding: 0 28px;
  display: flex;
  align-items: center;
  gap: 28px;
}

.topbar .brand {
  height: auto;
  flex: 0 0 auto;
  margin: 0;
  padding: 0;
  gap: 10px;
  font-size: 20px;
}

.topbar .brand-mark { width: 31px; height: 31px; }
.topbar .brand > span { display: inline; }
.topbar .nav-item > span:last-child,
.topbar .accent-action > span:last-child { display: block; }

.topbar .primary-nav {
  display: flex;
  align-items: center;
  gap: 3px;
}

.topbar .nav-item {
  width: auto;
  min-height: 42px;
  padding: 0 14px;
  border-radius: 10px;
  gap: 8px;
  color: #a9a69f;
  white-space: nowrap;
}

.topbar .nav-item:hover {
  transform: none;
  background: rgba(255,255,255,.045);
}

.topbar .nav-item.active {
  color: var(--text);
  background: rgba(255,255,255,.065);
  box-shadow: inset 0 -2px var(--accent);
  border-radius: 9px 9px 3px 3px;
}

.topbar .nav-icon { width: 16px; height: 16px; }

.topbar-actions {
  min-width: 0;
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 7px;
}

.top-link {
  height: 38px;
  padding: 0 10px;
  border: 0;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: transparent;
  color: #99978f;
  font-size: 12px;
  cursor: pointer;
}

.top-link:hover { color: var(--text); background: rgba(255,255,255,.04); }
.topbar .accent-action {
  width: auto;
  height: 38px;
  padding: 0 12px;
  border-radius: 10px;
  gap: 8px;
  white-space: nowrap;
}
.topbar .accent-action:hover { transform: none; }

.topbar .profile-chip {
  min-width: 0;
  height: 46px;
  margin: 0 0 0 3px;
  padding: 5px 7px;
  border-radius: 12px;
}
.topbar .profile-avatar { width: 34px; height: 34px; }
.topbar .profile-copy { gap: 1px; }
.topbar .profile-copy strong { font-size: 11px; }
.topbar .profile-copy small { max-width: 110px; font-size: 9px; }
.topbar .chevron { margin-left: 2px; font-size: 15px; color: var(--muted); }

.main-area {
  margin-left: 0;
  padding-bottom: 0;
}

.view { min-height: calc(100vh - var(--topbar-h)); }
.home-content { min-height: calc(100vh - var(--topbar-h)); }
.comments-panel { top: calc(var(--topbar-h) + 18px); max-height: calc(100vh - var(--topbar-h) - 36px); }

@media (max-width: 1250px) {
  .topbar-inner { gap: 18px; padding-inline: 22px; }
  .topbar .nav-item { padding-inline: 11px; gap: 6px; }
  .topbar-search { min-width: 0; flex: 1 1 220px; max-width: 320px; }
  .topbar-search kbd { display: none; }
  .topbar .profile-copy small { display: none; }
}

@media (max-width: 1120px) {
  .topbar-inner { gap: 14px; }
  .top-link span:last-child { display: none; }
  .top-link { width: 38px; justify-content: center; padding: 0; }
  .topbar .accent-action > span:last-child { display: none; }
  .topbar .accent-action { width: 38px; padding: 0; justify-content: center; }
  .topbar .profile-copy, .topbar .chevron { display: none; }
  .topbar-search { flex: 1 1 180px; max-width: 260px; }
}

@media (max-width: 960px) {
  .topbar .nav-item > span:last-child { display: none; }
  .topbar .nav-item { padding-inline: 10px; min-width: 38px; justify-content: center; }
}

@media (max-width: 820px) {
  :root { --topbar-h: 112px; }
  .topbar-inner {
    min-height: var(--topbar-h);
    padding: 10px 14px 8px;
    flex-wrap: wrap;
    align-content: center;
    gap: 8px 14px;
  }
  .topbar .brand { display: flex !important; }
  .topbar .brand > span { display: inline !important; }
  .topbar-actions { margin-left: auto; }
  .topbar .top-link, .topbar .accent-action { display: none; }
  .topbar .profile-chip { display: flex !important; }
  .topbar .primary-nav {
    order: 3;
    width: 100%;
    display: flex !important;
    grid-template-columns: none;
    gap: 4px;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .topbar .primary-nav::-webkit-scrollbar { display: none; }
  .topbar .nav-item {
    display: flex;
    flex: 1 0 auto;
    min-height: 38px;
    padding: 0 14px;
    flex-direction: row;
    justify-content: center;
    gap: 7px;
  }
  .topbar .nav-item > span:last-child { display: block !important; font-size: 12px; }
  .main-area { margin-left: 0; padding-bottom: 0; }
  .home-content { padding-bottom: 44px; }
  .comments-panel { top: auto; max-height: none; }
}

@media (max-width: 480px) {
  :root { --topbar-h: 106px; }
  .topbar-inner { padding-inline: 12px; }
  .topbar .brand { font-size: 18px; }
  .topbar .brand-mark { width: 28px; height: 28px; }
  .topbar .profile-chip { border: 0; background: transparent; padding: 2px; }
  .topbar .profile-avatar { width: 32px; height: 32px; }
  .topbar .nav-item { padding-inline: 11px; }
  .topbar .nav-icon { width: 15px; height: 15px; }
}

/* ────────────────────────────────────────────────────────────────────
 * SERVER-RENDERED SUPPLEMENT
 * Adds elements / pages the original mock didn't cover, and tweaks
 * the SPA-style .view show/hide so server-rendered pages stay visible.
 * ──────────────────────────────────────────────────────────────────── */

.topnav-shell .view { display: block; }
.topnav-shell .view.active { animation: none; }

.topbar { position: relative; }
.topbar-search {
  display: flex; align-items: center; gap: 10px; padding: 0 12px 0 16px;
  height: 42px; min-width: 280px;
  background: rgba(255,255,255,.04); border: 1px solid var(--line);
  border-radius: 14px; color: var(--muted);
}
.topbar-search:focus-within { border-color: rgba(176,138,87,.45); }
.topbar-search input {
  flex: 1; min-width: 0; background: transparent; border: 0; outline: 0;
  color: var(--text); font-size: 14px;
}
.topbar-search input::placeholder { color: #7d7c75; }
.topbar-search kbd {
  border: 1px solid var(--line-strong); background: rgba(0,0,0,.4);
  border-radius: 6px; padding: 4px 6px; color: #777166; font-size: 11px;
}
.top-link {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 14px; border-radius: 12px;
  border: 1px solid var(--line); background: transparent;
  color: var(--muted); text-decoration: none; font-size: 14px; cursor: pointer;
}
.top-link:hover { background: rgba(255,255,255,.05); color: var(--text); }

/* Profile dropdown anchored to the topbar */
.profile-dropdown {
  position: absolute; top: 64px; right: 18px;
  min-width: 220px; padding: 6px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 22px 60px rgba(0,0,0,.5);
  display: none; z-index: 50;
}
.profile-dropdown.open { display: block; animation: viewIn .14s ease both; }
.dropdown-item {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 9px 12px; border-radius: 10px;
  background: transparent; border: 0; color: var(--text);
  text-decoration: none; font-size: 14px; cursor: pointer; text-align: left;
}
.dropdown-item:hover { background: rgba(255,255,255,.05); }
.dropdown-item [data-icon] { width: 16px; height: 16px; color: var(--muted); }
.dropdown-divider { height: 1px; background: var(--line); margin: 6px 4px; }
.dropdown-form { margin: 0; }

/* Page frame for sub-views (importer, search, tags, admin, …) */
.page-frame { padding: 34px 36px 60px; max-width: 1280px; margin: 0 auto; }
.center-frame { display: grid; place-items: center; min-height: 70vh; }

/* Home extras */
.home-stage {
  position: relative; z-index: 2; min-height: 70vh; padding: 56px 56px 46px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 8px;
}
.home-recent { padding: 0 36px 60px; max-width: 1280px; margin: 0 auto; }

/* Auth pages */
.auth-page { display: grid; place-items: center; padding: 60px 20px; min-height: 70vh; }
.auth-card {
  width: 100%; max-width: 420px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-xl); padding: 36px 32px;
  box-shadow: var(--shadow);
}
.auth-card h2 { margin: 4px 0 8px; font-size: 28px; letter-spacing: -.025em; }
.auth-card .form-card { background: transparent; padding: 0; border: 0; margin-top: 18px; }
.auth-switch { margin-top: 22px; text-align: center; color: var(--muted); }

/* 404 / stub card */
.error-card {
  text-align: center; padding: 50px 36px; max-width: 500px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-xl); box-shadow: var(--shadow);
}
.error-card h2 { font-size: 36px; margin: 4px 0 14px; letter-spacing: -.03em; }
.error-card .accent-action { display: inline-flex; margin-top: 20px; padding: 10px 22px; border-radius: 12px; }

/* Empty state */
.empty-state {
  padding: 40px 24px; text-align: center; color: var(--muted);
  border: 1px dashed var(--line); border-radius: var(--radius-lg);
  background: var(--surface); display: grid; place-items: center; gap: 16px;
}
.empty-state p { margin: 0; }
.empty-state .accent-action { display: inline-flex; padding: 8px 16px; border-radius: 10px; }

/* Data card wrapper for tables */
.data-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 20px 22px; overflow-x: auto;
}

/* ─── Admin dashboard ────────────────────────────────────────────── */
.admin-stats .page-header { align-items: center; }
.admin-stats .page-header .header-meta { display: flex; align-items: center; gap: 10px; }

.pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface);
  color: var(--muted); font-size: 12px; font-weight: 600;
}
.pill-dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.pill-dot-ok { background: #6cd27a; box-shadow: 0 0 8px rgba(108,210,122,.6); }
.pill-ok    { border-color: rgba(108,210,122,.35); background: rgba(108,210,122,.08); color: #9ee0a8; }
.pill-warn  { border-color: rgba(225,176,80,.4); background: rgba(225,176,80,.08); color: #d8b574; }
.pill-bad   { border-color: rgba(225,108,108,.4); background: rgba(225,108,108,.08); color: #e69191; }

.kpi-row {
  display: grid; grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px; margin: 8px 0 28px;
}
.kpi-tile {
  position: relative;
  background: linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.015));
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 16px 18px 14px;
  display: grid; gap: 4px;
  overflow: hidden;
}
.kpi-tile::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: .55;
}
.kpi-tile .kpi-label {
  color: var(--muted); font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .08em;
}
.kpi-tile .kpi-num {
  font-size: 30px; font-weight: 700; letter-spacing: -.02em;
  font-variant-numeric: tabular-nums; line-height: 1.05;
}
.kpi-tile .kpi-delta {
  font-size: 11px; color: #b6a883; font-weight: 600;
}
.kpi-tile .kpi-delta.muted { color: #6f7079; font-weight: 500; }

.admin-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.admin-grid .span-2 { grid-column: span 2; }
.admin-grid .data-card { padding: 0; overflow: hidden; }

.card-header {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 12px;
  padding: 16px 22px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255,255,255,.02), transparent);
}
.card-header h3 { margin: 0; font-size: 14px; font-weight: 700; letter-spacing: -.005em; }
.card-header .card-sub {
  color: var(--muted); font-size: 11px; font-weight: 500;
  text-transform: uppercase; letter-spacing: .07em;
}

.stat-list { list-style: none; margin: 0; padding: 8px 14px; display: grid; gap: 2px; }
.stat-list li {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; padding: 9px 8px; border-radius: 8px;
}
.stat-list li:hover { background: rgba(255,255,255,.025); }
.stat-list .stat-label { color: #c5c6cd; font-size: 13px; }
.stat-list .stat-num {
  font-variant-numeric: tabular-nums; font-weight: 700;
  color: #e8e9ee; font-size: 15px; font-family: ui-monospace, Menlo, monospace;
}
.stat-list .stat-num-bad { color: #e69191; }

.state-chip {
  display: inline-flex; align-items: center; padding: 3px 10px;
  border-radius: 999px; font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .06em;
  border: 1px solid var(--line); background: rgba(255,255,255,.04); color: #c5c6cd;
}
.state-completed { color: #9ee0a8; border-color: rgba(108,210,122,.3); background: rgba(108,210,122,.07); }
.state-failed    { color: #e69191; border-color: rgba(225,108,108,.35); background: rgba(225,108,108,.07); }
.state-running   { color: #a9c6f0; border-color: rgba(141,167,229,.35); background: rgba(141,167,229,.07); }
.state-awaiting_selection { color: #d8b574; border-color: rgba(225,176,80,.35); background: rgba(225,176,80,.07); }
.state-pending,
.state-queued    { color: #b6b7c0; border-color: var(--line); background: rgba(255,255,255,.04); }

.minion-table { display: grid; padding: 6px 14px 14px; gap: 1px; }
.minion-row {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) minmax(180px, 2fr) 70px 80px 110px;
  gap: 16px; align-items: center;
  padding: 11px 8px; border-radius: 8px;
  font-size: 13px;
}
.minion-row:hover { background: rgba(255,255,255,.025); }
.minion-head {
  font-size: 11px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--muted); font-weight: 700; border-bottom: 1px solid var(--line);
  border-radius: 0; padding-bottom: 10px; margin-bottom: 4px;
}
.minion-head:hover { background: transparent; }
.minion-name { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.minion-num { font-variant-numeric: tabular-nums; font-family: ui-monospace, Menlo, monospace; }
.minion-time { color: var(--muted); font-variant-numeric: tabular-nums; font-family: ui-monospace, Menlo, monospace; }

.counter-groups {
  padding: 16px 18px 18px;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
}
.counter-group {
  background: rgba(255,255,255,.02);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
}
.counter-group-head {
  font-size: 11px; font-weight: 800; text-transform: uppercase;
  letter-spacing: .1em; color: var(--accent); margin-bottom: 8px;
}
.counter-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.counter-list li {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; padding: 6px 4px; border-radius: 6px;
}
.counter-list li:hover { background: rgba(255,255,255,.03); }
.counter-name { color: #b6b7c0; font-size: 12px; }
.counter-num {
  color: #5c5e68; font-variant-numeric: tabular-nums;
  font-family: ui-monospace, Menlo, monospace; font-size: 13px; font-weight: 600;
}
.counter-num.is-active { color: #e8e9ee; }

/* ─── Admin OF-sessions ───────────────────────────────────────────── */
.filter-tabs { display: flex; gap: 4px; margin: 0 0 18px; flex-wrap: wrap; }
.filter-tab {
  padding: 7px 14px; border-radius: 999px;
  border: 1px solid var(--line); background: rgba(255,255,255,.03);
  color: var(--muted); font-size: 12px; font-weight: 600;
  text-decoration: none; transition: background .15s, color .15s, border-color .15s;
}
.filter-tab:hover { background: rgba(255,255,255,.06); color: var(--text); }
.filter-tab.is-active {
  background: rgba(176,138,87,.12); border-color: rgba(176,138,87,.4);
  color: #e8c79a;
}

.session-table { display: grid; padding: 6px 14px 14px; gap: 1px; }
.session-row {
  display: grid;
  grid-template-columns: 80px minmax(120px, 1fr) 100px 140px 60px 130px 130px 80px;
  gap: 14px; align-items: center;
  padding: 11px 8px; border-radius: 8px;
  font-size: 13px;
}
.session-row:hover { background: rgba(255,255,255,.025); }
.session-head {
  font-size: 11px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--muted); font-weight: 700; border-bottom: 1px solid var(--line);
  border-radius: 0; padding-bottom: 10px; margin-bottom: 4px;
}
.session-head:hover { background: transparent; }
.session-id code { font-size: 12px; }
.session-flags { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.session-flags .pill { padding: 3px 8px; font-size: 10px; }
.session-num { font-variant-numeric: tabular-nums; font-family: ui-monospace, Menlo, monospace; }
.session-time { color: var(--muted); font-variant-numeric: tabular-nums; font-family: ui-monospace, Menlo, monospace; font-size: 12px; }

.admin-session-detail .page-header .header-meta { display: flex; gap: 8px; flex-wrap: wrap; }

.payload-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px; padding: 18px 22px;
}
.payload-field {
  display: grid; gap: 6px;
  padding: 12px 14px;
  background: rgba(255,255,255,.02); border: 1px solid var(--line);
  border-radius: 10px;
}
.payload-field.payload-wide { grid-column: span 2; }
.payload-field.payload-secret { grid-template-columns: 1fr auto; align-items: center; gap: 6px 10px; }
.payload-field.payload-secret .payload-label { grid-column: 1 / -1; }
.payload-label {
  font-size: 10px; text-transform: uppercase; letter-spacing: .08em;
  color: var(--muted); font-weight: 700;
}
.payload-value {
  font-family: ui-monospace, Menlo, monospace; font-size: 12px;
  word-break: break-all; color: #e8e9ee;
  background: transparent; border: 0; padding: 0; white-space: normal;
}
.payload-value[data-secret] { color: transparent; text-shadow: 0 0 12px rgba(232,233,238,.7); user-select: none; }
.payload-value[data-secret][data-revealed="1"] { color: #e8c79a; text-shadow: none; user-select: text; }
.secret-reveal {
  background: rgba(176,138,87,.1); border: 1px solid rgba(176,138,87,.3);
  color: #e8c79a; border-radius: 8px; padding: 4px 10px; font-size: 11px;
  font-weight: 700; cursor: pointer;
}
.secret-reveal:hover { background: rgba(176,138,87,.18); }

.curl-block {
  position: relative; padding: 16px 22px;
}
.curl-block pre {
  margin: 0; padding: 16px;
  background: rgba(0,0,0,.4); border: 1px solid var(--line);
  border-radius: 10px;
  font-family: ui-monospace, Menlo, monospace; font-size: 12px;
  color: #d8d9df; white-space: pre-wrap; word-break: break-all;
  overflow-x: auto;
}
.curl-block .btn-link { position: absolute; top: 24px; right: 32px; }

.btn-link {
  background: transparent; border: 0; color: #e8c79a;
  font-size: 13px; font-weight: 600; cursor: pointer; text-decoration: none;
  padding: 6px 0;
}
.btn-link:hover { color: #f1d6b0; text-decoration: underline; }

@media (max-width: 1100px) {
  .kpi-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .session-row { grid-template-columns: 60px 1fr 90px 110px 50px 100px 100px 70px; gap: 10px; font-size: 12px; }
}
@media (max-width: 820px) {
  .kpi-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-grid { grid-template-columns: minmax(0, 1fr); }
  .admin-grid .span-2 { grid-column: auto; }
  .minion-row { grid-template-columns: 1fr 1fr; row-gap: 4px; }
  .minion-head { display: none; }
  .session-row { grid-template-columns: 1fr 1fr; row-gap: 4px; }
  .session-head { display: none; }
  .payload-grid { grid-template-columns: 1fr; }
  .payload-field.payload-wide { grid-column: auto; }
}

/* Anchor-tags styled as segments */
a.segment { text-decoration: none; color: inherit; display: inline-flex; align-items: center; padding: 8px 14px; }

/* Stats row */
.stats-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin: 14px 0 24px; }
.stat-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 20px 22px;
  display: grid; gap: 4px;
}
.stat-card .stat-num { font-size: 32px; font-weight: 700; letter-spacing: -.02em; }
.stat-card .stat-label { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .05em; }

/* Banners */
.banner { padding: 12px 16px; border-radius: 12px; margin: 0 0 16px; border: 1px solid var(--line); background: var(--surface); }
.banner-info  { border-color: rgba(141,167,229,.35); background: rgba(141,167,229,.06); }
.banner-ok    { border-color: rgba(143,220,153,.35); background: rgba(143,220,153,.06); }
.banner-warn  { border-color: rgba(225,176,80,.45); background: rgba(225,176,80,.08); color: #ecd29a; }
.banner-error { border-color: rgba(184,116,116,.45); background: rgba(184,116,116,.08); }
.banner code  { background: rgba(0,0,0,.3); padding: 1px 5px; border-radius: 4px; }

/* Import-history block */
.import-history { margin: 28px 0; }
.import-history .section-title { margin: 0 0 14px; }
.job-creator-list { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.job-creator-list li {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px 6px 6px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 999px;
}
.job-creator-list li a { display: inline-flex; align-items: center; gap: 6px; color: inherit; text-decoration: none; }
.job-creator-list img { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; }
.job-creator-handle { font-weight: 600; font-size: 13px; }
.job-creator-count { font-size: 12px; color: var(--muted); }

/* Jobs table */
.jobs-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.jobs-table th, .jobs-table td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.jobs-table th { color: var(--muted); font-weight: 600; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; }
.jobs-table td.num { font-variant-numeric: tabular-nums; }
.job-link { color: var(--accent); text-decoration: none; }
.job-link:hover { text-decoration: underline; }
.state { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px; border: 1px solid var(--line); text-transform: capitalize; }
.state-running, .state-dispatching, .state-queued { color: #aac3ff; }
.state-awaiting_selection                         { color: #ffd479; }
.state-completed                                  { color: #8fdc99; }
.state-failed                                     { color: #ff9e9e; }

/* Tag chips */
.tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line);
  color: var(--text); text-decoration: none; font-size: 13px;
}
.tag-chip:hover { border-color: var(--accent); color: var(--accent); }
.tag-chip .tag-count { color: var(--muted); font-size: 11px; }

/* Content card (used by partials/cards.html) */
.content-card {
  display: grid; gap: 0;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-lg); overflow: hidden;
  color: inherit; text-decoration: none;
  transition: transform .22s ease, border-color .22s ease;
}
.content-card:hover { transform: translateY(-2px); border-color: rgba(176,138,87,.27); }
.content-thumb {
  aspect-ratio: 4 / 5; background: var(--surface-3);
  position: relative; overflow: hidden;
}
.content-thumb img { width: 100%; height: 100%; object-fit: cover; }
.content-thumb .thumb-fallback {
  position: absolute; inset: 0; display: grid; place-items: center;
  color: var(--faint);
}
.content-thumb .thumb-fallback svg { width: 32px; height: 32px; }
.kind-badge {
  position: absolute; top: 10px; right: 10px;
  width: 28px; height: 28px; display: grid; place-items: center;
  background: rgba(0,0,0,.6); border-radius: 50%; color: #fff;
}
.kind-badge svg { width: 13px; height: 13px; }
.creator-pager {
  display: flex; align-items: center; justify-content: center;
  gap: 12px; margin: 32px 0 8px;
}
.creator-pager-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 16px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--surface);
  color: var(--text); font-size: 13px; font-weight: 600;
  text-decoration: none;
  transition: background .15s, border-color .15s, transform .15s;
}
.creator-pager-btn:hover {
  background: rgba(176,138,87,.08);
  border-color: rgba(176,138,87,.32);
}
.creator-pager-btn [data-icon] { width: 14px; height: 14px; }
.creator-pager-btn.is-disabled {
  opacity: .35; pointer-events: none; cursor: not-allowed;
}
.creator-pager-meta {
  color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums;
  padding: 0 4px;
}

.date-badge {
  position: absolute; left: 10px; bottom: 10px;
  padding: 3px 8px;
  background: rgba(0,0,0,.62); color: #f1ddb8;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 999px;
  font-size: 11px; font-weight: 600;
  letter-spacing: .01em;
  backdrop-filter: blur(6px);
  white-space: nowrap;
}
.content-meta { padding: 12px 14px 14px; display: grid; gap: 6px; }
.content-meta-row { display: flex; align-items: center; gap: 8px; }
.source-chip {
  display: inline-block; padding: 2px 8px; border-radius: 999px;
  background: var(--surface-3); color: var(--muted); font-size: 11px;
  border: 1px solid var(--line);
}
.content-meta time { color: var(--faint); font-size: 12px; }
.content-title { margin: 0; font-size: 14px; line-height: 1.4; color: var(--text); }

/* Creator-card avatar: keep the design's 82px rounded-square shape;
 * just contain the image inside it (the mock used gradient initials
 * placeholders — we have real photos now). */
.creator-card .creator-avatar { overflow: hidden; font-size: 22px; font-weight: 900; }
.creator-card .creator-avatar img {
  width: 100%; height: 100%; object-fit: cover;
}

/* Profile-page large avatar — round, fills container. */
.large-avatar { display: grid; place-items: center; overflow: hidden; }
.large-avatar img { width: 100%; height: 100%; object-fit: cover; }

/* Creator grid: the design hard-codes 3 columns. On ultrawide that
 * leaves giant ~700px cards; on narrow, 3 of 360px doesn't fit. Switch
 * to auto-fill so cards stay around the design's intended width. */
.creator-grid {
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)) !important;
}
@media (max-width: 760px) {
  .creator-grid { grid-template-columns: 1fr !important; }
}

/* The creators / search directory benefits from more horizontal room
 * than the 1280px page-frame: bump it. */
.page-frame { max-width: 1600px; }

/* Profile bio + tabs */
.profile-bio { padding: 18px 36px 0; max-width: 1280px; margin: 0 auto; color: var(--muted); }
.profile-tabs { display: flex; gap: 6px; padding: 12px 36px 0; max-width: 1280px; margin: 0 auto; }
.profile-tab {
  padding: 8px 16px; border-radius: 12px;
  background: transparent; border: 1px solid var(--line); color: var(--muted); cursor: pointer;
}
.profile-tab.active { color: var(--text); border-color: var(--accent); }
.profile-body { padding: 24px 36px 60px; max-width: 1280px; margin: 0 auto; }

/* Post-page media list + download row */
.post-media-list { display: grid; gap: 24px; }
.media-item { margin: 0; display: grid; gap: 8px; }
.media-item img, .media-item video {
  width: 100%; max-height: 80vh; object-fit: contain;
  background: var(--surface-3); border-radius: var(--radius-md);
}
.download-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius-md);
  text-decoration: none; color: inherit;
  transition: background .2s ease;
}
.download-row:hover { background: var(--surface-2); border-color: rgba(176,138,87,.32); }
.download-row .file-icon { color: var(--accent); display: grid; place-items: center; width: 22px; height: 22px; }
.download-row .file-copy { display: grid; gap: 2px; }
.download-row .file-copy small { color: var(--muted); font-size: 12px; }
.download-row-inline { margin-top: 6px; max-width: 320px; }

/* Buttons */
.btn-primary {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 18px; border: 0; border-radius: 12px;
  background: var(--accent); color: #1a1410; font-weight: 600;
  cursor: pointer; font-size: 14px;
}
.btn-primary:hover { background: #c5a26e; }
.btn-primary:disabled { background: var(--surface-3); color: var(--faint); cursor: not-allowed; }
.btn-secondary {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 16px; border: 1px solid var(--line); border-radius: 12px;
  background: transparent; color: var(--text); cursor: pointer; font-size: 14px;
}
.btn-secondary:hover { border-color: var(--accent); }
.btn-link {
  background: transparent; border: 0; padding: 0; color: var(--accent);
  cursor: pointer; text-decoration: none; font-size: 14px;
}
.btn-link:hover { text-decoration: underline; }

/* Form rows */
.form-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 24px 26px;
  display: grid; gap: 16px;
}
.form-row { display: grid; gap: 6px; }
.form-row .label { color: var(--muted); font-size: 13px; font-weight: 500; }
.form-row input, .form-row select, .form-row textarea {
  width: 100%; padding: 11px 14px; border-radius: 12px;
  background: var(--surface-2); border: 1px solid var(--line);
  color: var(--text); outline: 0;
}
.form-row input:focus, .form-row select:focus, .form-row textarea:focus { border-color: var(--accent); }
.form-row .hint { color: var(--muted); font-size: 12px; line-height: 1.55; }
.form-row .hint code { background: rgba(0,0,0,.3); padding: 1px 5px; border-radius: 4px; }
code, kbd { font-family: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace; font-size: .92em; }
:not(pre) > code {
  background: rgba(176,138,87,.12);
  border: 1px solid rgba(176,138,87,.22);
  color: #e8c79a;
  padding: 1px 7px;
  border-radius: 6px;
  word-break: break-word;
  overflow-wrap: anywhere;
}
.banner code, .banner-error code, .form-row .hint code {
  display: inline-block; max-width: 100%;
  border: 0; padding: 4px 8px; border-radius: 6px;
  background: rgba(0,0,0,.35); color: #e8d4ae;
  font-size: .88em; line-height: 1.45;
  white-space: pre-wrap; word-break: break-word; overflow-wrap: anywhere;
}
.banner-error { white-space: normal; word-break: break-word; }
.banner-error code { margin-top: 6px; }
fieldset.form-row { border: 0; padding: 0; margin: 0; }
.form-check { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; padding: 6px 0; }
.form-check input[type=checkbox] { margin-top: 3px; accent-color: var(--accent); }
.form-check strong { display: block; }
.form-check .muted { color: var(--muted); font-size: 13px; }

/* Reading-mode tweaks */
html.reading-mode body { background: #0a0a08; }
html.reading-mode .orb, html.reading-mode .grid-lines { opacity: 0 !important; }

/* Lightbox */
.lightbox::backdrop { background: rgba(0,0,0,.85); }
.lightbox { border: 0; padding: 0; background: transparent; max-width: 95vw; max-height: 95vh; }
.lightbox-art {
  width: min(90vw, 1000px); height: min(75vh, 800px);
  background: #0e0e0c center/contain no-repeat;
  border-radius: var(--radius-lg);
}
.lightbox-close {
  position: absolute; top: 12px; right: 12px;
  width: 38px; height: 38px; border-radius: 50%;
  border: 1px solid var(--line); background: rgba(0,0,0,.6);
  color: var(--text); font-size: 22px; cursor: pointer;
}
.lightbox-caption {
  margin-top: 14px; text-align: center; color: var(--text);
  display: flex; gap: 12px; justify-content: center; align-items: baseline;
}
.lightbox-caption span { color: var(--muted); font-size: 13px; }

/* Toast */
.toast {
  position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%) translateY(8px);
  padding: 12px 18px; background: var(--surface);
  border: 1px solid var(--line-strong); border-radius: 14px;
  box-shadow: var(--shadow); opacity: 0; pointer-events: none;
  transition: opacity .2s ease, transform .2s ease; z-index: 100;
  color: var(--text); font-size: 14px;
}
.toast.visible { opacity: 1; transform: translateX(-50%) translateY(0); }

/* Service badges on creator-cards */
.service-badge {
  display: inline-grid; place-items: center;
  width: 22px; height: 22px; border-radius: 6px;
  background: var(--surface-3); border: 1px solid var(--line);
  color: var(--accent); font-size: 11px; font-weight: 800;
}
.service-badge.verified { color: #8fdc99; }

/* Brand link styling override (anchor in header) */
.brand { text-decoration: none; color: var(--text); }

/* The original design's #creatorsView used padding; ours is in .page-frame.
 * Strip the extra padding when our shell wraps the creators grid. */
.page-frame > .creator-grid { margin-top: 8px; }

/* Make .nav-item work as an <a> tag */
a.nav-item { text-decoration: none; }

/* Override main-area's left-margin from the design (sidebar version) */
.topnav-shell .main-area { margin-left: 0; }


/* ────────────────────────────────────────────────────────────────────
 * IMPORTER PICKER + EXTRACTOR + SAVED-SESSION
 * Ported from the legacy main.css using nocturne's design tokens so
 * /importer and /importer/jobs/{id}/select keep their interactive UI
 * after main.css is dropped.
 * ──────────────────────────────────────────────────────────────────── */

.saved-session {
  margin: 12px 0 20px; padding: 18px 22px;
  border: 1px solid var(--accent);
  border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--accent) 8%, transparent);
}
.saved-session h2 { font-size: 16px; margin: 0 0 6px; }
.saved-session p.muted { margin: 0 0 12px; }
.saved-session .form-card { margin: 0; }
.session-picker { display: grid; gap: 6px; }
.session-picker .session-option {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 10px;
  background: rgba(0,0,0,.18); border: 1px solid var(--line);
  transition: background .15s, border-color .15s;
}
.session-picker .session-option:hover { background: rgba(0,0,0,.28); }
.session-picker .session-option:has(input:checked) {
  border-color: rgba(176,138,87,.5);
  background: rgba(176,138,87,.08);
}
.session-picker .session-option-pick { flex: 1 1 auto; margin: 0; padding: 0; cursor: pointer; }
.session-picker input[type=radio] { accent-color: var(--accent); }

.session-single-meta {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin: 0 0 12px;
}
.session-delete {
  flex: 0 0 auto;
  background: transparent; border: 1px solid var(--line);
  color: #d8a0a0; border-radius: 8px;
  padding: 4px 12px; font-size: 12px; font-weight: 600;
  cursor: pointer; transition: background .15s, border-color .15s, color .15s;
}
.session-delete:hover {
  background: rgba(225,108,108,.1);
  border-color: rgba(225,108,108,.45);
  color: #f1baba;
}

.extractor {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 14px 18px; margin: 0 0 16px;
}
.extractor > summary {
  cursor: pointer; font-weight: 600; padding: 4px 0; list-style: none;
}
.extractor > summary::-webkit-details-marker { display: none; }
.extractor > summary::before { content: "▸ "; color: var(--muted); }
.extractor[open] > summary::before { content: "▾ "; color: var(--accent); }
.extractor[open] { padding-bottom: 16px; }
.extractor ol { margin: 8px 0 12px 20px; padding: 0; color: var(--muted); }
.extractor ol li { margin: 4px 0; }
.extractor .curl-input {
  width: 100%;
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 10px; padding: 12px;
  font: 12px/1.4 ui-monospace, "JetBrains Mono", Menlo, monospace;
  color: var(--text); resize: vertical; min-height: 110px;
}
.extractor .curl-input:focus { outline: none; border-color: var(--accent); }
.extractor-actions {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  margin-top: 10px;
}
.extractor-actions .hint.ok    { color: #8fdc99; }
.extractor-actions .hint.warn  { color: #f2c97d; }
.extractor kbd {
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 4px; padding: 1px 5px; font: 12px/1 monospace;
}

/* Stats cards on importer status page (legacy class name) */
.importer-status { max-width: 1280px; margin: 0 auto; }
.stats { display: flex; gap: 16px; margin: 18px 0; }
.stat {
  flex: 1; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 18px 22px;
  display: grid; gap: 4px;
}
.stat .stat-num { font-size: 30px; font-weight: 700; letter-spacing: -.02em; }
.stat .stat-label { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .05em; }

/* The picker — sticky toolbar + scrollable two-section list. */
.picker { display: flex; flex-direction: column; gap: 12px; }
.picker-toolbar {
  display: flex; gap: 12px; align-items: center; flex-wrap: wrap;
  padding: 12px 14px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 12px; position: sticky; top: 0; z-index: 2;
}
.picker-toolbar input[type=search] {
  flex: 1 1 220px; min-width: 160px; padding: 8px 12px;
  background: var(--surface-2); border: 1px solid var(--line); color: var(--text);
  border-radius: 8px;
}
.picker-actions { display: flex; gap: 6px; }
.picker-actions button {
  padding: 7px 12px; background: var(--surface-2); color: var(--text);
  border: 1px solid var(--line); border-radius: 8px; cursor: pointer;
  font-size: 13px;
}
.picker-actions button:hover { border-color: var(--accent); }
.picker-count { margin-left: auto; color: var(--muted); font-size: 13px; }

.picker-list {
  list-style: none; margin: 0; padding: 0;
  max-height: 60vh; overflow-y: auto;
  border: 1px solid var(--line); border-radius: 12px;
  background: var(--surface);
}
.picker-row { border-bottom: 1px solid var(--line); }
.picker-row:last-child { border-bottom: 0; }
.picker-row label {
  display: grid; grid-template-columns: auto 1fr auto auto;
  gap: 12px; align-items: center; padding: 10px 14px; cursor: pointer;
}
.picker-row input[type=checkbox] { accent-color: var(--accent); }
.picker-row label:hover { background: rgba(255,255,255,.03); }
.picker-row .picker-handle { font-weight: 600; }
.picker-row .picker-name   { color: var(--muted); font-size: 13px; }
.picker-row .picker-price  {
  font-variant-numeric: tabular-nums; font-size: 12px;
  padding: 2px 10px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--line);
  color: var(--muted);
}
.picker-row.is-free .picker-price { color: var(--faint); }
.picker-row.is-paid-only .picker-price {
  background: color-mix(in srgb, var(--accent) 25%, transparent);
  color: var(--accent);
  border-color: var(--accent);
}

.picker-section-title {
  font-size: 13px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .05em; color: var(--muted); margin: 0;
}
.picker-section-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin: 18px 0 6px;
}
.picker-section-actions { display: flex; gap: 4px; }
.picker-section-actions button {
  padding: 5px 11px; font-size: 12px;
  background: var(--surface-2); color: var(--text);
  border: 1px solid var(--line); border-radius: 8px;
  cursor: pointer;
}
.picker-section-actions button:hover { border-color: var(--accent); }
.picker-footer {
  display: flex; justify-content: space-between; align-items: center;
  padding-top: 12px;
}

/* importer-form sources fieldset.
 *
 * <fieldset> + display:grid mixes badly with the legacy
 * fieldset-anonymous-box render rules and ends up spreading checkbox
 * rows across the width. Force the fieldset itself to a plain block
 * with min-width:0, and let each .form-check row keep its own flex. */
fieldset.form-row {
  display: block !important;
  padding: 0; border: 0; min-width: 0; margin: 0;
}
fieldset.form-row.sources > legend.label { margin-bottom: 8px; padding: 0; float: none; width: auto; }
fieldset.form-row.sources > .form-check { margin-bottom: 4px; }
.form-check { display: flex !important; align-items: flex-start; gap: 10px; justify-content: flex-start; }
.form-check > input[type=checkbox] { flex: 0 0 auto; }
.form-check > span { flex: 1 1 auto; min-width: 0; }


/* Creator-page source tabs */
.creator-source-tabs {
  display: flex; flex-wrap: wrap; gap: 8px;
  padding: 18px 36px 0; max-width: 1600px; margin: 0 auto;
}
.source-tab {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 14px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--muted); text-decoration: none;
  font-size: 13px; font-weight: 500;
  text-transform: capitalize;
  transition: background .2s ease, border-color .2s ease, color .2s ease;
}
.source-tab:hover { color: var(--text); border-color: var(--line-strong); }
.source-tab.active {
  color: var(--text); background: var(--surface-3);
  border-color: var(--accent);
}
.source-tab .tab-icon { width: 14px; height: 14px; opacity: .85; }
.source-tab.active .tab-icon { color: var(--accent); }
.source-tab .tab-count {
  display: inline-grid; place-items: center;
  min-width: 22px; padding: 2px 7px;
  background: var(--surface-3); border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 11px; font-weight: 700; color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.source-tab.active .tab-count {
  background: var(--accent-soft); border-color: rgba(176,138,87,.4);
  color: var(--accent);
}

/* Subtle per-source accent on the active tab */
.source-tab.source-paid.active     { border-color: #e0b06f; }
.source-tab.source-paid.active .tab-count { color: #e0b06f; }
.source-tab.source-messages.active { border-color: #8ad2c6; }
.source-tab.source-messages.active .tab-count { color: #8ad2c6; }
.source-tab.source-archived.active { border-color: #a89bd3; }
.source-tab.source-archived.active .tab-count { color: #a89bd3; }

/* The mock used <article class="creator-card">; we render <a> so the
 * whole card is clickable. Strip the browser's default link colors so
 * h3 / handle / @ text inherit var(--text) instead of looking magenta. */
a.creator-card,
a.creator-card:visited,
a.creator-card:link,
a.content-card,
a.content-card:visited,
a.content-card:link {
  color: var(--text);
  text-decoration: none;
}
a.creator-card h3,
a.creator-card p,
a.creator-card strong { color: inherit; }

/* Same fix for any other link-as-card patterns (download rows, etc.) */
.download-row, .download-row:visited { color: var(--text); }
.tag-chip, .tag-chip:visited { color: var(--text); }

/* And the `&` paragraph that shows the @handle on profile-hero */
.profile-title-block p, .profile-title-block p strong { color: var(--muted); }

/* ────────────────────────────────────────────────────────────────────
 * GLOBAL COMPACT-WIDTH OVERRIDE
 * Tighten the max content width across every page-frame / profile /
 * tabs / importer-status section. Single source of truth so adjusting
 * the site-wide density is one variable change.
 * ──────────────────────────────────────────────────────────────────── */

:root { --content-max: 1180px; }

.page-frame { max-width: var(--content-max) !important; padding: 28px 32px 56px !important; }
.home-recent { max-width: var(--content-max) !important; }
.profile-bio,
.profile-tabs,
.profile-body,
.creator-source-tabs,
.importer-status { max-width: var(--content-max) !important; }

/* The creators directory pages still want a little more room because
 * each card is ~360px wide and we need at least 3 per row to avoid the
 * "one giant card" effect. */
.page-frame:has(> .creator-grid) { max-width: 1280px !important; }
.creator-grid { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)) !important; gap: 12px; }

/* ────────────────────────────────────────────────────────────────────
 * GLOBAL LINK COLOR
 * Every <a> inherits var(--text) by default — no more browser default
 * purple/magenta. Explicit accent shows up where I opt in via .btn-link,
 * .accent-link, or specific component rules below.
 * ──────────────────────────────────────────────────────────────────── */

a, a:link, a:visited {
  color: var(--text);
  text-decoration: none;
}
/* Hover lifts subtly without going magenta. */
a:hover { color: var(--accent); }

/* But chrome-y links that already have their own component style keep
 * inheriting the component's color, not the global accent on hover. */
.brand:hover, .brand:link, .brand:visited,
.nav-item:hover, .nav-item:link, .nav-item:visited,
.dropdown-item:hover, .dropdown-item:link, .dropdown-item:visited,
.top-link:hover, .top-link:link, .top-link:visited,
.back-button:hover, .back-button:link, .back-button:visited,
.followers-button:hover, .followers-button:link, .followers-button:visited,
.content-card:hover, .creator-card:hover,
.tag-chip:hover, .source-tab:hover,
.profile-tab:hover, .segment:hover,
.btn-link:link, .btn-link:visited,
.dropdown-item, .profile-tab, .segment {
  color: inherit;
}

/* Opt-in link emphasis: .btn-link and .accent-link still pop accent. */
.btn-link, .accent-link, .accent-link:link, .accent-link:visited {
  color: var(--accent);
}
.btn-link:hover, .accent-link:hover { text-decoration: underline; }

/* Profile-hero is full-bleed (banner extends to the edge), but the
 * content inside should align with the rest of the page. */
.profile-header-content {
  max-width: var(--content-max); margin: 0 auto;
  padding-left: 32px !important; padding-right: 32px !important;
}

/* Back-button matches the design's chip style — never pink. */
.back-button { color: var(--text); text-decoration: none; }
.back-button:hover { color: var(--accent); border-color: var(--line-strong); }

/* `.form-row input` was a catch-all from the legacy main.css port —
 * it gives every input a 11px+14px padding, surface-2 background, and
 * `width: 100%`. That accidentally inflates checkboxes and radios
 * into giant styled boxes, squeezing their sibling labels into a
 * narrow vertical strip. Restore native rendering for these. */
.form-row input[type=checkbox],
.form-row input[type=radio],
.form-check input[type=checkbox],
.form-check input[type=radio] {
  width: auto !important;
  padding: 0 !important;
  background: transparent !important;
  border: 0 !important;
  margin: 3px 0 0;
  flex: 0 0 auto;
}
