﻿/* =========================================================
   The Hired Gun â€” Developer Den
   Palette: charcoal + off-white line-art (logo) + a hair of bone.
   Mood: old-school metal / Ozzy-era rock â€” not cyberpunk.
   ========================================================= */

:root {
  --bg:        #161313;   /* near-black warm charcoal */
  --bg-alt:    #1d1a1a;   /* panel */
  --bg-raised: #262121;
  --ink:       #efe9dd;   /* off-white, off-yellow (bone) */
  --ink-dim:   #bcb4a4;
  --ink-faint: #6e675d;
  --line:      #3a3430;
  --line-strong:#6e675d;
  --accent:    #efe9dd;   /* same as ink â€” the OFF-WHITE accent from the logo */
  --accent-dim:#bcb4a4;
  --danger:    #a03a3a;

  --font-display: "Impact", "Haettenschweiler", "Franklin Gothic Bold",
                  "Arial Narrow Bold", "Arial Black", system-ui, sans-serif;
  --font-body:    "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-mono:    "Consolas", "SF Mono", "Cascadia Code", monospace;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  padding: 0;
  background: #131111;
  background-image:
    radial-gradient(120% 80% at 50% 10%, #1c1a1a 0%, #141212 60%, #111 100%);
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.55;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  text-rendering: optimizeLegibility;
  font-feature-settings: "ss01";
}

a { color: inherit; text-decoration: none; }

code {
  font-family: var(--font-mono);
  background: rgba(255,255,255,0.05);
  padding: 1px 6px;
  border-radius: 3px;
  color: var(--ink);
  font-size: 0.9em;
}

/* =================== header / nav ===================== */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 28px;
  border-bottom: 1px solid var(--line);
  background: #131111;
  position: sticky;
  top: 0;
  z-index: 30;
}
.site-brand { display: flex; align-items: center; gap: 14px; }
.site-brand__logo {
  width: 42px; height: 42px; object-fit: contain;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: #0e0c0c;
  padding: 2px;
}
.site-brand__name { display: flex; flex-direction: column; line-height: 1.05; }
.site-brand__name strong {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 1.05rem;
  color: var(--ink);
}
.site-brand__name em {
  font-style: normal;
  color: var(--ink-dim);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.site-nav a {
  margin-left: 22px;
  color: var(--ink-dim);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.78rem;
  padding: 4px 0;
  border-bottom: 1px solid transparent;
  transition: color 120ms ease, border-color 120ms ease;
}
.site-nav a:hover, .site-nav a:focus-visible { color: var(--ink); border-color: var(--ink); }
.site-nav a.is-on { color: var(--ink); border-color: var(--ink); }
.site-nav a.is-admin { color: var(--ink-faint); }
.site-nav a.is-admin::before { content: "âš“"; margin-right: 4px; opacity: 0.6; }
.site-nav .nav-form { display: inline; margin-left: 22px; }

/* =================== app shell (X-style: side nav + column) === */
.nav-toggle {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}
.nav-scrim { display: none; }
.shell {
  flex: 1;
  display: flex;
  align-items: flex-start;
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
}
.shell:has(.composer) { max-width: min(1680px, 100%); }
body.shell-office { height: 100vh; overflow: hidden; }
body.shell-office .site-header { display: none; }
body.shell-office .shell { max-width: none; height: 100%; min-height: 0; align-items: stretch; }
body.shell-office .sidenav { top: 0; height: 100vh; width: 200px; flex-basis: 200px; }
body.shell-office .shell__main { height: 100%; min-height: 0; border: 0; }
body.shell-office .site-main { padding: 0; height: 100%; min-height: 0; display: flex; flex-direction: column; }
body.shell-office .site-footer { display: none; }
body.shell-office .office {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  flex: 1;
  min-height: 0;
  height: 100%;
}
body.shell-office .office__rail {
  border-right: 1px solid var(--line);
  padding: 0.85rem 0.7rem 1.2rem;
  overflow: auto;
  background: var(--bg-alt);
}
body.shell-office .office__brand {
  display: block;
  font-family: var(--font-display);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin: 0 0 0.7rem;
}
body.shell-office .office__nav { display: grid; gap: 2px; margin-bottom: 1rem; }
body.shell-office .office__nav a,
body.shell-office .office__channels a {
  display: block;
  color: var(--ink-dim);
  border-radius: 8px;
  padding: 0.4rem 0.55rem;
  text-decoration: none;
}
body.shell-office .office__nav a.is-on,
body.shell-office .office__nav a:hover,
body.shell-office .office__channels a:hover { background: var(--bg-raised); color: var(--ink); }
body.shell-office .office__rail h2 {
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 0 0 0.35rem;
}
body.shell-office .office__channels { display: grid; }
body.shell-office .office__channels a { padding: 0.28rem 0.45rem; font-size: 0.92rem; }
body.shell-office .office__empty { margin: 0; color: var(--ink-faint); font-size: 0.85rem; }
body.shell-office .office__main {
  min-width: 0;
  min-height: 0;
  overflow: auto;
  padding: 0.4rem 1.25rem 2rem;
}
body.shell-office .office-ask { margin: 0.2rem 0 1rem; }
body.shell-office .office-ask h2 { margin: 0 0 0.35rem; font-size: 1rem; }
body.shell-office .office-ask__note { margin: 0 0 0.5rem; color: var(--ink-dim); font-size: 0.88rem; }
body.shell-office .composer { margin: 0; min-height: 0; }
body.shell-office .composer__rail {
  top: 0;
  height: auto;
  max-height: calc(100vh - 1.5rem);
  overflow: auto;
}
.shell-feed .shell { max-width: 1280px; }
.shell__main {
  flex: 1;
  min-width: 0;
  min-height: 60vh;
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  background: rgba(0,0,0,0.12);
}
.shell-feed .shell__main { max-width: 800px; min-width: 0; overflow-x: hidden; }
.shell-feed .feed { max-width: 800px; }

.sidenav {
  position: sticky;
  top: 64px;
  align-self: flex-start;
  z-index: 8;
  width: 240px;
  flex: 0 0 240px;
  height: calc(100vh - 64px);
  padding: 16px 12px 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.sidenav__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px 16px;
}
.sidenav__brand img {
  width: 36px; height: 36px; object-fit: contain;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: #0e0c0c;
  padding: 2px;
}
.sidenav__brand span { display: flex; flex-direction: column; line-height: 1.1; }
.sidenav__brand strong {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 0.95rem;
}
.sidenav__brand em {
  font-style: normal;
  color: var(--ink-dim);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.sidenav__list { display: flex; flex-direction: column; gap: 2px; }
.sidenav__list--owner { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.sidenav__item {
  display: block;
  padding: 10px 12px;
  border-radius: 999px;
  color: var(--ink);
  font-size: 1.05rem;
  letter-spacing: 0.01em;
}
.sidenav__item:hover, .sidenav__item:focus-visible {
  background: rgba(255,255,255,0.05);
}
.sidenav__item.is-on { font-weight: 700; background: rgba(255,255,255,0.07); }
.sidenav__post { margin-top: 14px; text-align: center; }
.sidenav__out { margin-top: auto; padding: 12px 10px 0; }

.nav-burger {
  display: none;
  cursor: pointer;
  color: var(--ink-dim);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-size: 0.78rem;
  margin-right: 12px;
  border-bottom: 1px solid transparent;
}
.nav-burger:hover { color: var(--ink); border-color: var(--ink); }

/* =================== main ============================= */
.site-main {
  flex: 1;
  width: 100%;
  margin: 0;
  padding: 0 0 48px;
}
.shell-wide .site-main { padding: 0 28px 48px; }

/* =================== hero ============================= */
.hero {
  position: relative;
  z-index: 12;
  text-align: center;
  padding: 56px 20px 48px;
  background: #131111;
  background-image:
    radial-gradient(120% 80% at 50% 10%, #1c1a1a 0%, #141212 60%, #111 100%);
  border-bottom: 1px solid var(--line);
}
.hero--photo {
  background-image:
    linear-gradient(180deg, rgba(19,17,17,0.42) 0%, rgba(19,17,17,0.62) 55%, #131111 100%),
    var(--hero-bg);
  background-size: cover;
  background-position: center;
}
.hero__logo {
  width: 220px;
  height: 220px;
  margin: 0 auto 28px;
  border-radius: 50%;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  background: #0e0c0c;
  box-shadow: 0 12px 28px rgba(0,0,0,0.5);
}
.hero__logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 28%;
  transform: scale(1.32);
  display: block;
}
.hero__headline {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: clamp(2.8rem, 9vw, 5rem);
  line-height: 0.95;
  margin: 0 0 10px;
  color: var(--ink);
  text-shadow: 0 2px 0 #000c, 0 8px 24px #000a;
}
.hero__tagline {
  margin: 0;
  color: var(--ink-dim);
  letter-spacing: 0.28em;
  text-transform: uppercase;
  font-size: 0.9rem;
  text-shadow: 0 1px 8px #000c;
}
.hero__bgtools {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 22px;
}
.hero__bgtools .btn { cursor: pointer; }
.hero__bgstatus { font-family: var(--font-mono); font-size: 0.78rem; color: var(--ink-dim); }
.hero__bgstatus.is-err { color: #e8b4b4; }
.hero-bg-admin { margin: 8px 0 28px; }

/* =================== proof card ======================= */
.proof { margin-top: 56px; }
.proof__kicker {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 0.9rem;
  color: var(--ink-dim);
  margin: 0 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}
.proof__card {
  background: linear-gradient(180deg, var(--bg-alt), #191511);
  border: 1px solid var(--line);
  border-left: 3px solid var(--ink-dim);
  border-radius: 4px;
  padding: 22px 24px;
}
.proof__title {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 1.5rem;
  margin: 0 0 6px;
}
.proof__when { color: var(--ink-faint); font-size: 0.82rem; margin: 0 0 14px; letter-spacing: 0.04em; }
.proof__body { margin: 0; color: var(--ink); font-size: 1rem; }
.proof--empty .proof__empty {
  margin: 0;
  padding: 22px 24px;
  background: var(--bg-alt);
  border: 1px dashed var(--line-strong);
  border-radius: 4px;
  color: var(--ink-dim);
}

/* =================== admin ============================ */
.admin-head { padding: 40px 0 12px; }
.admin-head__title {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 2.2rem;
  margin: 0 0 6px;
}
.admin-head__count { margin: 0; color: var(--ink-dim); font-size: 0.85rem; letter-spacing: 0.06em; }
.admin-empty {
  padding: 28px;
  margin: 24px 0;
  border: 1px dashed var(--line-strong);
  border-radius: 4px;
  background: var(--bg-alt);
  text-align: center;
  color: var(--ink-dim);
}
.admin-foot { margin-top: 32px; }
.admin-head__actions { margin: 14px 0 0; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }

/* =================== storage meter (inventory) ================= */
.storage {
  margin: 6px 0 26px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: rgba(0,0,0,0.16);
}
.storage__head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.storage__label { color: var(--ink-dim); letter-spacing: 0.12em; text-transform: uppercase; font-size: 0.72rem; }
.storage__value { color: var(--ink); font: 500 0.88rem var(--font-mono); }
.storage__bar { margin-top: 10px; height: 8px; background: #080707; border: 1px solid var(--line-strong); border-radius: 6px; overflow: hidden; }
.storage__fill { height: 100%; background: linear-gradient(90deg, var(--accent) 0%, #d98f2b 100%); transition: width 220ms ease; }
.storage__fill.warn { background: linear-gradient(90deg, #a5541f, #e0b06a); }
.storage__hint { margin: 8px 0 0; color: var(--ink-faint); font-size: 0.78rem; }
.inv .cov, .inv .inv__c { text-align: center; color: var(--ink-dim); }

/* =================== shared bits ===================== */
.dot { color: var(--ink-faint); margin: 0 4px; }
.linklike {
  background: none; border: 0; cursor: pointer;
  color: var(--ink-dim);
  font: inherit; letter-spacing: 0.06em;
  padding: 0; margin: 0;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 120ms, border-color 120ms;
}
.linklike:hover, .linklike:focus-visible { color: var(--ink); border-color: var(--ink); }

.btn {
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-size: 0.8rem;
  padding: 10px 18px;
  background: var(--bg-raised);
  color: var(--ink);
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  text-decoration: none;
  cursor: pointer;
  transition: background 120ms, border-color 120ms, transform 80ms;
}
.btn:hover, .btn:focus-visible { background: var(--bg-alt); border-color: var(--ink-dim); }
.btn:active { transform: translateY(1px); }
.btn--primary {
  background: var(--ink);
  color: #141212;
  border-color: var(--ink);
}
.btn--primary:hover, .btn--primary:focus-visible { background: #fff; border-color: #fff; }

.nav-form { display: inline; }

.field { display: block; margin: 0 0 14px; }
.field label {
  display: block;
  margin-bottom: 6px;
  color: var(--ink-dim);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-size: 0.72rem;
}
.field .opt { color: var(--ink-faint); text-transform: none; letter-spacing: 0; margin-left: 4px; }
.field input[type="datetime-local"] { color-scheme: dark; }
.when-pick {
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 12px 14px;
  margin: 0 0 16px;
  background: rgba(0,0,0,0.16);
}
.when-pick legend {
  color: var(--ink-dim);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-size: 0.72rem;
  padding: 0 6px;
}
.when-pick__opt {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-right: 18px;
  color: var(--ink);
  letter-spacing: 0.02em;
  cursor: pointer;
}
.when-pick__opt input { accent-color: var(--ink-dim); }
.field input, .field textarea {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: #0f0d0d;
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  padding: 10px 12px;
  line-height: 1.5;
  transition: border-color 120ms, background 120ms;
}
.field input:focus, .field textarea:focus {
  outline: none;
  border-color: var(--ink-dim);
  background: #0c0a0a;
}
.field textarea { resize: vertical; min-height: 96px; }
.field input[readonly] { color: var(--ink-faint); cursor: default; }
.form-error {
  color: #e8b4b4;
  background: rgba(160,58,58,0.12);
  border: 1px solid var(--danger);
  padding: 10px 12px;
  border-radius: 3px;
  margin: 0 0 14px;
}

/* =================== feed (home) â€” X-style timeline ===================== */
.hero--compact { padding: 40px 0 24px; }
.hero--compact .hero__logo img { max-width: 120px; margin-bottom: 18px; }
.hero--compact .hero__headline { font-size: clamp(2.1rem, 7vw, 3.4rem); }

.feed { margin: 0; min-width: 0; overflow-x: hidden; }
.feed__head {
  position: sticky;
  top: 64px;
  z-index: 6;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding: 14px 20px;
  background: #161313;
}
.feed__kicker {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-size: 1.15rem;
  color: var(--ink);
  margin: 0;
}
.feed__empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--ink-dim);
  margin: 16px;
  border-bottom: 1px solid var(--line);
}

.feed-compose {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  color: inherit;
}
.feed-compose:hover { background: rgba(255,255,255,0.03); }
.feed-compose__avatar {
  width: 40px; height: 40px; border-radius: 50%;
  object-fit: contain; background: #0e0c0c;
  border: 1px solid var(--line-strong); padding: 2px;
}
.feed-compose__ph { flex: 1; color: var(--ink-faint); font-size: 1.05rem; }

.feed__list { list-style: none; margin: 0; padding: 0; }

.card {
  background: linear-gradient(180deg, var(--bg-alt), #191511);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 20px 22px;
}

.post-card {
  display: flex;
  gap: 12px;
  padding: 12px 16px 10px;
  border-bottom: 1px solid var(--line);
  transition: background 120ms;
  min-width: 0;
  max-width: 100%;
}
.post-card:hover { background: rgba(255,255,255,0.03); }
.post-card__avatar { flex: 0 0 40px; }
.post-card__avatar img {
  width: 40px; height: 40px; border-radius: 50%;
  object-fit: contain; background: #0e0c0c;
  border: 1px solid var(--line-strong); padding: 2px; display: block;
}
.post-card__body { flex: 1; min-width: 0; }
.post-card__link { display: block; color: inherit; }
.post-card__title {
  font-family: var(--font-body);
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
  font-size: 1.05rem;
  margin: 0 0 4px;
  line-height: 1.35;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.post-card__meta {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 2px;
  font-size: 0.92rem;
  color: var(--ink-faint);
  flex-wrap: wrap;
}
.post-card__author { color: var(--ink); font-weight: 700; letter-spacing: 0; text-transform: none; font-size: 0.95rem; }
.post-card__handle { color: var(--ink-faint); }
.post-card__excerpt {
  color: var(--ink-dim);
  font-size: 1.05rem;
  line-height: 1.55;
  margin: 0 0 8px;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.post-card__foot { margin-top: 8px; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; min-width: 0; max-width: 100%; }
.post-card__edit { margin-left: auto; }
.post-card__action { color: var(--ink-faint); font-size: 0.88rem; }
.post-card__action:hover { color: var(--ink); }
.comments-count { color: var(--ink-dim); }
.comments-count:hover { color: var(--ink); }

/* =================== story (post detail) ============= */
.story {
  max-width: 800px;
  margin: 0 auto;
  padding: 40px 0 8px;
  min-width: 0;
  overflow-wrap: anywhere;
}
.story__head { border-bottom: 1px solid var(--line); padding-bottom: 20px; margin-bottom: 28px; }
.story__kicker {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 0.82rem;
  color: var(--ink-dim);
  margin: 0 0 12px;
}
.story__title {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: clamp(1.9rem, 6vw, 3rem);
  line-height: 1.05;
  margin: 0 0 14px;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.story__owner { margin: 12px 0 0; display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; }
.story__meta { display: flex; align-items: baseline; gap: 6px; font-size: 0.85rem; color: var(--ink-faint); margin-bottom: 14px; }
.share {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 4px 0 0;
  min-width: 0;
  max-width: 100%;
}
.share__label {
  color: var(--ink-faint);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-size: 0.7rem;
  margin-right: 4px;
}
.share__btn {
  display: inline-block;
  font: inherit;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  color: var(--ink-dim);
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 10px;
  cursor: pointer;
}
.share__btn:hover, .share__btn:focus-visible {
  color: var(--ink);
  border-color: var(--ink-dim);
}
.share--compact { margin: 0; }
.share--compact .share__btn { font-size: 0.72rem; padding: 3px 8px; }
.story__author { color: var(--ink-dim); letter-spacing: 0.08em; text-transform: uppercase; font-size: 0.78rem; }
/* =================== cover carousel (post page) =======================
 * Multi-image covers are paged: each "page" is a small mosaic of up to 4
 * tiles. Users arrow through with the â€¹ â€º buttons, dots, keyboard, or
 * swipe. Progressive enhancement: without JS the first page still shows
 * and the stage is scrollable.
 */
.cover { position: relative; width: 100%; margin: 0 0 10px; border-radius: 4px; overflow: hidden; border: 1px solid var(--line); background: #0d0b0b; }
.cover:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.cover__stage { overflow: hidden; }
.cover__track { display: flex; transition: transform 220ms ease; will-change: transform; }
.cover__page { flex: 0 0 100%; min-width: 100%; display: grid; gap: 3px; background: #080707; }
.cover__tile { margin: 0; padding: 0; min-width: 0; min-height: 0; position: relative; background: #0c0a0a; overflow: hidden; }
.cover__tile img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Per-tile-count grid (aspect-ratio chosen to match the number of tiles
 * so the "small montage" reads naturally at each count) */
.cover__page--1 { grid-template-columns: 1fr; aspect-ratio: 16 / 7; }
.cover__page--2 { grid-template-columns: repeat(2, 1fr); aspect-ratio: 16 / 6; }
.cover__page--3 { grid-template-columns: repeat(3, 1fr); aspect-ratio: 16 / 6; }
.cover__page--4 { grid-template-columns: repeat(2, 1fr); aspect-ratio: 16 / 7; }

.cover__arrow {
  position: absolute; top: 50%; transform: translateY(-50%);
  z-index: 2;
  width: 40px; height: 44px;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(9,7,7,0.55); color: var(--ink);
  border: 1px solid var(--line-strong);
  font: 600 22px/1 var(--font-body);
  cursor: pointer;
  transition: background 120ms, color 120ms, opacity 120ms;
  opacity: 0.92;
}
.cover__arrow--prev { left: 8px; border-radius: 0 3px 3px 0; border-left: 0; }
.cover__arrow--next { right: 8px; border-radius: 3px 0 0 3px; border-right: 0; }
.cover__arrow:hover, .cover__arrow:focus-visible { background: rgba(20,16,14,0.86); color: #fff; opacity: 1; }
.cover__arrow[disabled] { opacity: 0.28; cursor: default; }
.cover:focus-visible .cover__arrow, .cover:hover .cover__arrow, .cover:active .cover__arrow { opacity: 1; }

.cover__dots { position: absolute; bottom: 8px; left: 50%; transform: translateX(-50%); z-index: 2; display: flex; gap: 6px; padding: 4px 8px; background: rgba(9,7,7,0.55); border-radius: 20px; }
.cover__dot { width: 9px; height: 9px; padding: 0; margin: 0; border-radius: 50%; background: rgba(255,255,255,0.28); border: 0; cursor: pointer; transition: background 120ms, transform 120ms; }
.cover__dot.is-active { background: var(--ink); transform: scale(1.15); }
.cover__dot:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.cover__count { position: absolute; top: 8px; right: 10px; z-index: 2; background: rgba(9,7,7,0.55); color: var(--ink-dim); padding: 3px 8px; border-radius: 3px; font: 600 0.8rem/1.1 var(--font-mono); letter-spacing: 0.06em; }
.cover__count b { color: var(--ink); }

/* =================== feed-card cover (small montage) ==================
 * 4-tile 2Ã—2 grid; when a cover has more than 4 tiles (i.e. multiple
 * pages) an "+ N" badge sits on the corner of the 3rd tile to hint
 * that the post opens into a carousel.
 */
.post-card__hero { position: relative; aspect-ratio: 16 / 8; margin: 8px 0 4px; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); background: #0d0b0b; display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; gap: 2px; }
.post-card__hero--1 { grid-template-columns: 1fr; grid-template-rows: 1fr; aspect-ratio: 16 / 9; }
.post-card__hero--2 { grid-template-rows: 1fr; aspect-ratio: 16 / 8; }
.post-card__hero--3 { grid-template-columns: 1.2fr 1fr; }
.post-card__hero img { width: 100%; height: 100%; object-fit: cover; display: block; }
.post-card__hero-plus { position: absolute; top: 8px; right: 8px; z-index: 2; background: rgba(9,7,7,0.78); color: var(--ink); font: 600 0.72rem/1 var(--font-mono); letter-spacing: 0.08em; padding: 3px 8px; border-radius: 12px; border: 1px solid var(--line-strong); pointer-events: none; }

.story__body { font-size: 1.08rem; line-height: 1.78; color: var(--ink); overflow-wrap: anywhere; word-break: break-word; }
.story__body p { margin: 0 0 18px; }
.story__body p:last-child { margin-bottom: 0; }
.story__body img { max-width: 100%; height: auto; display: block; margin: 18px 0; border: 1px solid var(--line); border-radius: 3px; }
.story__body div { margin: 0 0 16px; }
.story__body figure { margin: 8px 0 18px; }
.story__body figure img { margin: 0 0 6px; }
.story__body figcaption,
#top .story__body figcaption,
#top .story__body figcaption span {
  display: block;
  font-family: var(--font-body) !important;
  font-size: 0.82rem !important;
  font-weight: 400 !important;
  font-style: italic !important;
  letter-spacing: 0.01em !important;
  text-transform: none !important;
  line-height: 1.45 !important;
  color: var(--ink-faint);
  margin: 0 0 4px;
}
.story__body h1, .story__body h2, .story__body h3 { font-family: var(--font-display); font-weight: 400; letter-spacing: 0.04em; text-transform: uppercase; line-height: 1.15; margin: 22px 0 10px; }
.story__body h1 { font-size: 1.85rem; }
.story__body h2 { font-size: 1.4rem; }
.story__body h3 { font-size: 1.15rem; text-transform: none; letter-spacing: 0.02em; }
.story__body img + h1, .story__body img + h2, .story__body img + h3 { margin-top: 10px; }
.story__body ul, .story__body ol { margin: 0 0 18px; padding: 0 0 0 26px; }
.story__body li { margin: 0 0 6px; }
.story__body li::marker { color: var(--ink-dim); }
.story__body blockquote { margin: 0 0 20px; padding: 10px 18px; border-left: 3px solid var(--ink-dim); color: var(--ink-dim); font-style: italic; background: rgba(255,255,255,0.025); }
.story__body code { font-family: var(--font-mono); font-size: 0.92em; background: rgba(255,255,255,0.06); padding: 1px 6px; border-radius: 3px; }
.story__body pre { padding: 12px 14px; background: #0d0b0b; border: 1px solid var(--line); border-radius: 4px; overflow: auto; font-family: var(--font-mono); font-size: 0.9em; line-height: 1.55; }
.story__body hr { border: 0; border-top: 1px solid var(--line); margin: 22px 0; }
.story__body ins, .story__body mark { background: rgba(239,233,221,0.16); color: var(--ink); }
.story__body a { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; text-decoration-color: var(--ink-dim); }
.story__body a:hover, .story__body a:focus-visible { text-decoration-color: var(--ink); }

/* =================== comments ======================== */
.comments { max-width: 800px; margin: 40px auto 0; }
.comments__kicker {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.95rem;
  color: var(--ink-dim);
  margin: 0 0 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}
.comments__count { font-size: 0.72rem; color: var(--ink-faint); letter-spacing: 0.06em; text-transform: none; margin-left: 6px; }

.comments__list { list-style: none; margin: 0 0 22px; padding: 0; }
.comments__empty {
  padding: 20px;
  border: 1px dashed var(--line-strong);
  border-radius: 4px;
  color: var(--ink-dim);
  text-align: center;
}
.comment {
  border-left: 2px solid var(--line-strong);
  padding: 4px 0 4px 16px;
  margin: 0 0 14px;
}
.comment:last-child { margin-bottom: 0; }
.comment__meta { display: flex; align-items: baseline; gap: 6px; margin-bottom: 4px; font-size: 0.78rem; color: var(--ink-faint); }
.comment__author { color: var(--ink); letter-spacing: 0.05em; text-transform: uppercase; font-size: 0.72rem; }
.comment__body { color: var(--ink-dim); font-size: 0.98rem; line-height: 1.6; }
.comment__body p { margin: 0 0 6px; }
.comment__body p:last-child { margin-bottom: 0; }

.comment-form {
  background: linear-gradient(180deg, var(--bg-alt), #191511);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 18px 20px;
}
.comment-form .btn { margin-top: 4px; }
.back { max-width: 720px; margin: 18px auto 0; }

/* =================== auth (login) ==================== */
.auth { max-width: 420px; margin: 40px auto 0; text-align: center; }
.auth__logo { margin: 0 auto 18px; }
.auth__logo img { border-radius: 50%; border: 1px solid var(--line-strong); background: #0e0c0c; padding: 4px; box-shadow: 0 10px 24px rgba(0,0,0,0.5); }
.auth__title {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 1.8rem;
  margin: 0 0 8px;
}
.auth__sub { color: var(--ink-dim); font-size: 0.92rem; margin: 0 0 22px; }
.auth__form { text-align: left; background: var(--bg-alt); border: 1px solid var(--line); border-radius: 5px; padding: 20px; }
.auth__back { margin-top: 18px; }

/* =================== composer ======================== */
.composer { max-width: none; margin: 8px auto 0; }
.composer__layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 16px; align-items: start; }
.composer__main { min-width: 0; }
.composer__rail {
  position: sticky;
  top: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  height: calc(100vh - 5.5rem);
  min-height: 520px;
}
.composer__card { background: rgba(0,0,0,0.16); border: 1px solid var(--line); border-radius: 4px; padding: 12px 14px; }
.composer__card h2 { margin: 0 0 6px; font-size: 0.95rem; letter-spacing: 0.08em; text-transform: uppercase; font-weight: 600; }
.composer__savestatus { margin: 0 0 8px; color: var(--ink-dim); font-size: 0.84rem; line-height: 1.45; min-height: 1.2em; }
.composer__savestatus.is-ok { color: #cfe6c2; }
.composer__savestatus.is-err { color: #e8b4b4; }
.composer__titlefield { position: relative; }
.composer label[for="p-title"] {
  position: absolute;
  width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); border: 0;
}
.composer__headline {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  font-size: clamp(1.7rem, 2.6vw, 2.45rem);
  line-height: 1.12;
  padding: 2px 2px 10px;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
}
.composer__headline:focus { background: transparent; border-bottom-color: var(--ink-dim); }
.crew-desk__row { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.crew-desk__row .rbtn { height: auto; min-height: 28px; padding: 4px 8px; letter-spacing: 0.02em; text-align: left; }
.crew-desk select, .crew-desk textarea { width: 100%; margin-top: 4px; }
.crew-desk__reply { margin-top: 8px; background: #0f0d0d; border: 1px solid var(--line); border-radius: 3px; padding: 8px; }
.crew-desk__reply pre { margin: 0 0 8px; white-space: pre-wrap; font-family: var(--font-body); font-size: 0.84rem; line-height: 1.45; color: var(--ink); max-height: 220px; overflow: auto; }
.composer__actions { position: sticky; bottom: 0; background: linear-gradient(180deg, rgba(29,26,26,0), var(--bg-alt) 28%); padding-top: 12px; }
@media (max-width: 860px) {
  .composer__layout { grid-template-columns: 1fr; }
  .composer__rail { position: static; height: auto; min-height: 0; }
  .doc-chat { min-height: 68vh; }
  .story-stage.is-preview { grid-template-columns: 1fr; }
  .composer .rte__body, .composer .rte__body.rte__empty { min-height: 420px; }
}
.composer__head { border-bottom: 1px solid var(--line); padding-bottom: 10px; margin-bottom: 14px; }
.composer__title {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 1.25rem;
  margin: 0 0 4px;
}
.composer__sub { color: var(--ink-dim); font-size: 0.94rem; margin: 0; line-height: 1.6; }
.composer__form { background: transparent; border: 0; border-radius: 0; padding: 0; }
.composer__hint { color: var(--ink-faint); font-size: 0.82rem; margin: 4px 0 16px; }

/* =================== story style (per-post style sheet) ============ */
.story-style { margin: 0 0 26px; padding: 14px 16px; background: var(--bg-alt);
  border: 1px solid var(--line); border-radius: 4px; }
.story-style__label { font-size: 0.9rem; margin: 0 0 6px; display: block; }
.story-style__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin: 12px 0; }
.story-style__cell label { display: block; font-size: 0.76rem; color: var(--ink-dim); margin-bottom: 4px; }
.story-style__cell .rselect, .story-style__cell select { width: 100%; }
.story-style__preview { display: flex; align-items: baseline; gap: 8px; padding: 10px 12px; background: var(--bg);
  border: 1px dashed var(--line); border-radius: 3px; margin-top: 4px; }
.story-style__sample { line-height: 1.5; overflow-wrap: anywhere; }
.story-style__sample strong { display: inline; font-weight: 700; }
.story-style__status { font-size: 0.8rem; color: var(--ink-dim); margin: 10px 0 0; min-height: 1.1em; }
.composer__actions { display: flex; justify-content: space-between; align-items: center; margin-top: 6px; }
.composer__actions .linklike { margin-right: auto; }

/* --- cover / hero picker ------------------------------------------ */
.composer__hero { border: 1px solid var(--line); border-radius: 4px; padding: 14px 16px; background: rgba(0,0,0,0.16); margin: 14px 0; }
.composer__hero-label { display: flex; align-items: baseline; gap: 8px; color: var(--ink-dim); margin-bottom: 8px; letter-spacing: 0.1em; text-transform: uppercase; font-size: 0.72rem; }
.composer__hero-controls { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.composer__hero-controls .btn { cursor: pointer; }
.composer__hero-controls .linklike { color: var(--ink-dim); border-bottom: 1px solid transparent; }
.composer__hero-controls .linklike:hover { color: var(--ink); border-color: var(--ink); }
.composer__hero-count { color: var(--ink-dim); font-size: 0.78rem; letter-spacing: 0.10em; text-transform: uppercase; margin-left: auto; }
.composer__hero-mosaic { margin: 12px 0 6px; display: grid; gap: 3px; background: #080707; border-radius: 4px; overflow: hidden; }
.composer__hero-tile { position: relative; margin: 0; padding: 0; min-width: 0; min-height: 0; background: #0c0a0a; overflow: hidden; }
.composer__hero-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.composer__hero-tile__num { position: absolute; left: 6px; bottom: 6px; background: rgba(0,0,0,0.6); color: #fff; font: 600 11px/1 var(--font-mono); padding: 3px 6px; border-radius: 2px; letter-spacing: 0.06em; }
.composer__hero-tile__remove {
  position: absolute; top: 6px; right: 6px;
  background: rgba(0,0,0,0.62); color: var(--ink);
  border: 1px solid var(--line-strong); border-radius: 50%;
  width: 24px; height: 24px; line-height: 1; cursor: pointer; padding: 0;
  font-size: 15px; opacity: 0.85;
  transition: background 120ms, color 120ms, opacity 120ms;
}
.composer__hero-tile__remove:hover, .composer__hero-tile__remove:focus-visible { background: #1a1512; color: #fff; opacity: 1; }
/* Same tile-count rules as the public mosaic, but a bit taller so they read cleanly in the form */
.composer__hero-mosaic[data-count="1"] { grid-template-columns: 1fr;         aspect-ratio: 21 / 9; }
.composer__hero-mosaic[data-count="2"] { grid-template-columns: repeat(2, 1fr); aspect-ratio: 21 / 9; }
.composer__hero-mosaic[data-count="3"] { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 1fr; aspect-ratio: 14 / 10; }
.composer__hero-mosaic[data-count="3"] .composer__hero-tile:nth-child(1) { grid-column: 1 / -1; }
.composer__hero-mosaic[data-count="4"] { grid-template-columns: repeat(2, 1fr); aspect-ratio: 21 / 9; }
.composer__hero-mosaic[data-count="5"] { grid-template-columns: repeat(3, 1fr); grid-auto-rows: 1fr; aspect-ratio: 18 / 10; }
.composer__hero-mosaic[data-count="5"] .composer__hero-tile:nth-child(1) { grid-column: 1 / -1; }
.composer__hero-mosaic[data-count="6"] { grid-template-columns: repeat(3, 1fr); aspect-ratio: 21 / 9; }
.composer__hero-mosaic[data-count="7"] { grid-template-columns: repeat(4, 1fr); grid-auto-rows: 1fr; aspect-ratio: 24 / 11; }
.composer__hero-mosaic[data-count="7"] .composer__hero-tile:nth-child(1) { grid-column: 1 / 3; grid-row: 1 / 3; }
.composer__hero-mosaic[data-count="8"] { grid-template-columns: repeat(4, 1fr); aspect-ratio: 24 / 10; }

/* Legacy single-image preview (kept for re-rendered 1-tile hero before JS kicks in) */
.composer__hero-preview { position: relative; margin: 12px 0 6px; }
.composer__hero-preview img { display: block; width: 100%; max-height: 240px; object-fit: cover; border: 1px solid var(--line-strong); border-radius: 4px; background: #0d0b0b; }

/* --- ribbon (PowerPoint / Word home tab) ------------------------- */
.rte {
  display: flex; align-items: stretch; gap: 0; flex-wrap: nowrap;
  overflow-x: auto; margin-bottom: 8px;
  background: #1c1918; border: 1px solid #3a3430; border-radius: 4px;
  padding: 4px 2px 0;
}
.ribbon__group {
  display: flex; flex-direction: column; align-items: center; justify-content: space-between;
  padding: 2px 8px 3px; border-right: 1px solid #3a3430; flex: 0 0 auto;
}
.ribbon__group:last-of-type { border-right: 0; }
.ribbon__tools { display: flex; flex-direction: column; gap: 2px; }
.ribbon__row { display: flex; align-items: center; gap: 1px; }
.ribbon__name {
  margin-top: 3px; font: 600 10px/1.2 "Segoe UI", system-ui, sans-serif;
  color: #8a8176; letter-spacing: 0.01em;
}
.ribbon__styles { display: flex; gap: 4px; align-items: center; height: 52px; }
.ribbon__style {
  width: 78px; min-width: 78px; height: 46px; padding: 2px 4px;
  border: 1px solid #4a433d; background: #141211; color: var(--ink);
  font-size: 12px; letter-spacing: 0; line-height: 1.15; white-space: normal;
}
.ribbon__style--h1 { font-size: 15px; font-weight: 700; }
.ribbon__style--h2 { font-size: 13px; font-weight: 700; }
.ribbon__style--q { font-family: Georgia, serif; font-style: italic; }
.ribbon__pop { position: relative; display: inline-flex; }
.ribbon__menu {
  position: absolute; top: calc(100% + 4px); left: 0; z-index: 20;
  min-width: 168px; padding: 6px;
  background: #2a2523; border: 1px solid #5c554e; border-radius: 3px;
  box-shadow: 0 10px 24px rgba(0,0,0,.45);
  display: flex; flex-direction: column; gap: 2px;
}
.ribbon__menu[hidden] { display: none; }
.ribbon__menu .rbtn { width: 100%; justify-content: flex-start; height: auto; min-height: 26px; padding: 4px 8px; letter-spacing: 0; font-size: 13px; }
.ribbon__swatches { display: flex; flex-wrap: wrap; gap: 4px; padding: 2px; }
.ribbon__swatch { width: 18px; height: 18px; min-width: 18px; padding: 0; border: 1px solid rgba(255,255,255,.35); border-radius: 2px; cursor: pointer; }
.ribbon__swatch--none { background: linear-gradient(135deg, transparent 46%, #c0392b 46%, #c0392b 54%, transparent 54%), #fff; }
.ribbon__more { display: flex; align-items: center; gap: 8px; color: var(--ink-dim); font-size: 12px; padding: 4px 2px 0; }
.ribbon__more input { width: 28px; height: 18px; padding: 0; border: 0; background: transparent; }
.rico { width: 16px; height: 16px; display: block; }
.rbtn--icon { min-width: 26px; width: 26px; height: 24px; padding: 0; letter-spacing: 0; }
.rbtn--b { font-weight: 700; font-size: 14px; }
.rbtn--i { font-style: italic; font-family: Georgia, serif; font-size: 15px; }
.rbtn--u { text-decoration: underline; font-size: 14px; }
.rbtn--s { text-decoration: line-through; font-size: 14px; }
.rbtn--case { font-size: 13px; font-weight: 600; letter-spacing: 0; }
.rselect--font { width: 148px; height: 24px; background: #141211; border: 1px solid #4a433d; }
.rselect--size { width: 58px; height: 24px; background: #141211; border: 1px solid #4a433d; }
#imgTools { display: none; }
#imgTools.is-on { display: flex; }
.rte__group { display: inline-flex; align-items: center; gap: 2px; }
.rbtn {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 26px; height: 24px; padding: 0 6px;
  background: transparent; border: 1px solid transparent; border-radius: 2px;
  color: #d9d0c4; font: inherit; font-size: 0.85rem;
  cursor: pointer; letter-spacing: 0; text-transform: none;
}
.rbtn:hover, .rbtn:focus-visible { background: rgba(255,255,255,0.06); color: var(--ink); border-color: var(--line-strong); }
.rbtn.is-active { background: #2a2422; color: #fff; border-color: var(--ink-dim); }
.rbtn.is-active:hover { background: #332c2a; color: #fff; }
.rselect {
  height: 28px; padding: 0 6px;
  background: transparent; border: 1px solid transparent; border-radius: 2px;
  color: var(--ink-dim); font: inherit; font-size: 0.85rem; cursor: pointer;
}
.rselect:hover, .rselect:focus-visible { color: var(--ink); border-color: var(--line-strong); background: rgba(255,255,255,0.04); }
.rselect option { color: var(--ink); background: #171312; }
.rselect--font, .rselect--size { height: 24px; background: #141211; border: 1px solid #4a433d; color: #d9d0c4; }
.rte__grouplabel { color: var(--ink-faint); font: 600 0.66rem/1 var(--font-mono); letter-spacing: 0.14em; text-transform: uppercase; padding-right: 8px; margin-right: 4px; border-right: 1px solid var(--line); }
.rte__imgtools button[disabled], .rte__imgtools .rselect[disabled] { opacity: 0.42; cursor: default; }
.rte__imgtools[data-layout=""] button:not([disabled]):hover { opacity: 0.9; }

/* Inline image, selected for layout control â€” a distinct accent outline */
#rteBody img { cursor: pointer; }
#rteBody img.composer-img-focused { outline: 2px solid var(--accent); outline-offset: 2px; }

.rte__body {
  min-height: 340px;
  padding: 18px 20px;
  background: #0f0d0d;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  outline: none;
  line-height: 1.72;
  color: var(--ink);
  font-size: 1.05rem;
  white-space: pre-wrap;
  overflow-wrap: break-word;
}
.rte__body:focus { border-color: var(--ink-dim); background: #0c0a0a; }
.doc-chat {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: #141211;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
}
.doc-chat__head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: #1c1918;
}
.doc-chat__head label { color: var(--ink-dim); font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase; }
.doc-chat__head select { flex: 1; min-width: 0; background: #0f0d0d; color: var(--ink); border: 1px solid var(--line); border-radius: 3px; padding: 6px 8px; }
.doc-chat__quick { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 12px; border-bottom: 1px solid var(--line); }
.doc-chat__quick .rbtn { height: auto; min-height: 28px; padding: 4px 10px; font-size: 0.78rem; }
.doc-chat__log {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #100e0e;
}
.doc-chat__msg { max-width: 92%; }
.doc-chat__msg p { margin: 2px 0 0; white-space: pre-wrap; line-height: 1.45; font-size: 0.9rem; }
.doc-chat__name { font-size: 0.72rem; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-faint); }
.doc-chat__msg.is-you { align-self: flex-end; }
.doc-chat__msg.is-you p { background: #2a2622; border-radius: 10px 10px 2px 10px; padding: 8px 10px; }
.doc-chat__msg.is-hire p { background: #1a1816; border: 1px solid var(--line); border-radius: 10px 10px 10px 2px; padding: 8px 10px; }
.doc-chat__msg.is-live p { color: #e7c56a; font-style: italic; }
.doc-chat__compose { display: flex; gap: 8px; align-items: flex-end; padding: 10px 12px; border-top: 1px solid var(--line); background: #1c1918; }
.doc-chat__compose textarea {
  flex: 1;
  min-height: 7.5rem;
  max-height: 14rem;
  resize: vertical;
  margin: 0;
  background: #0f0d0d;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 8px 10px;
  font: inherit;
  line-height: 1.45;
}
.doc-chat__state { margin: 0; padding: 0 12px 8px; color: var(--ink-faint); font-size: 0.75rem; background: #1c1918; }
.doc-chat__state.is-live { color: #e7c56a; }
.cowrite-live { color: #e7c56a; font-style: italic; }
.doc-chat .composer__hint { margin: 0; padding: 0 12px 8px; background: #1c1918; }

/* Writing desk: the story is the page, the chat sits beside it. */
.composer__hero,
.composer .story-style,
.composer .when-pick,
.composer__card,
.doc-chat,
.composer__rich,
.read-sheet {
  border-radius: 10px;
}
.composer .field input:not(.composer__headline),
.composer .field textarea,
.composer .story-style select,
.doc-chat__head select,
.doc-chat__compose textarea,
.story-label__actions .btn {
  border-radius: 8px;
}
.composer__card {
  position: relative;
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 8px 12px;
}
.composer__card h2 {
  position: absolute;
  width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0, 0, 0, 0); border: 0;
}
.composer__savestatus { margin: 0; flex: 1; }
.doc-chat { border-radius: 10px; }
.doc-chat__compose textarea { border-radius: 8px; }
.doc-chat__msg.is-you p { border-radius: 8px 8px 3px 8px; }
.doc-chat__msg.is-hire p { border-radius: 8px 8px 8px 3px; }
.composer__hero { padding: 12px 14px; }
.story-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}
.story-label label { margin: 0; }
.story-label__actions { display: flex; gap: 8px; }
.story-label__actions .btn.is-on {
  background: var(--ink);
  color: #141212;
  border-color: var(--ink);
}
.composer__rich {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #100e0d;
  padding: 0 0 6px;
}
.composer__rich .rte {
  position: sticky;
  top: 72px;
  z-index: 6;
  border: 0;
  border-radius: 10px 10px 0 0;
  margin: 0;
  border-bottom: 1px solid #3a3430;
}
.composer .rbtn,
.composer .ribbon__style,
.composer .ribbon__menu,
.composer .rselect {
  border-radius: 6px;
}
.composer .ribbon__swatch { border-radius: 4px; }
.composer .rte__body img,
.composer .rte__body pre { border-radius: 8px; }
.composer .rte__body {
  min-height: clamp(520px, 64vh, 920px);
  padding: 28px 32px 40px;
  border: 0;
  border-radius: 0;
  background: transparent;
  font-size: 1.14rem;
  line-height: 1.78;
}
.composer .rte__body:focus { background: transparent; }
.composer .rte__body.rte__empty { min-height: clamp(520px, 64vh, 920px); }
.composer .rte__body.rte__empty::before { top: 28px; left: 32px; }
.composer .rte__meta { padding: 0 16px; }
.story-stage.is-preview {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
  gap: 14px;
  align-items: stretch;
}
.read-sheet {
  margin: 0;
  padding: 22px 22px 32px;
  background: #141211;
  border: 1px solid var(--line);
  overflow: auto;
  max-height: calc(100vh - 7rem);
}
.read-sheet[hidden] { display: none !important; }
.read-sheet__kicker {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 0.72rem;
  color: var(--ink-faint);
}
.read-sheet__title {
  margin: 0 0 16px;
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: clamp(1.4rem, 2vw, 2rem);
  line-height: 1.08;
}
.read-sheet__title.is-empty { color: var(--ink-faint); }
.read-sheet__empty { margin: 0; color: var(--ink-faint); font-style: italic; }
.bench { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; }
.bench__row a {
  display: flex; justify-content: space-between; gap: 1rem; align-items: baseline;
  border: 1px solid var(--line); border-radius: 10px; padding: 0.75rem 0.9rem;
  color: inherit; text-decoration: none; background: var(--bg-alt);
}
.bench__row small { color: var(--ink-faint); }
.approvals { display: grid; gap: 0.45rem; margin: 0.4rem 0; }
.approvals:empty { display: none; }
.approvals__card {
  border: 1px solid var(--line); border-radius: 10px; padding: 0.55rem 0.7rem; background: #1c1918;
}
.approvals__card p { margin: 0 0 0.4rem; }
.approvals__card small { display: block; color: var(--ink-faint); margin-bottom: 0.35rem; }
.composer__notes { margin: 8px 2px 0; color: var(--ink-faint); font-size: 0.8rem; }
.composer__notes summary { cursor: pointer; letter-spacing: 0.04em; }
.composer__notes p { margin: 6px 0 0; line-height: 1.5; }
@media (max-width: 1180px) {
  .story-stage.is-preview { grid-template-columns: 1fr; }
  .read-sheet { max-height: 70vh; }
}
@media (max-width: 700px) {
  .cowrite { grid-template-columns: 1fr auto; }
  .cowrite__who { grid-column: 1 / -1; }
}
/* Editor headings stay larger + bold so they read as headings, but they do
   NOT force case or font â€” the case + font tools must visibly affect them.
   (Forcing text-transform/font here was hiding the owner's edits.) */
.rte__body h1 { font-weight: 700; font-size: 1.8rem; line-height: 1.15; margin: 0 0 12px; }
.rte__body h2 { font-weight: 700; font-size: 1.35rem; line-height: 1.2; margin: 0 0 10px; }
.rte__body h3 { font-weight: 700; font-size: 1.15rem; margin: 0 0 8px; }
.rte__body p { margin: 0 0 14px; }
.rte__body p:last-child { margin-bottom: 0; }
.rte__body img { max-width: 100%; height: auto; display: block; margin: 14px auto; border-radius: 3px; border: 1px solid var(--line); }
.rte__body div { margin: 0 0 14px; }
.rte__body figure { margin: 12px 0 16px; }
.rte__body figure img { margin: 0 auto 6px; }
.rte__body figcaption { font-size: 0.82rem; font-style: italic; font-weight: 400; letter-spacing: normal; text-transform: none; color: var(--ink-faint); line-height: 1.4; margin: 0; }
.rte { position: sticky; top: 0; z-index: 5; }
.rte__body ul, .rte__body ol { margin: 0 0 14px; padding: 0 0 0 26px; }
.rte__body li { margin: 0 0 6px; }
.rte__body blockquote { margin: 0 0 16px; padding: 8px 18px; border-left: 3px solid var(--ink-dim); color: var(--ink-dim); font-style: italic; background: rgba(255,255,255,0.025); }
.rte__body code { font-family: var(--font-mono); font-size: 0.92em; background: rgba(255,255,255,0.06); padding: 1px 6px; border-radius: 3px; }
.rte__body pre { padding: 12px 14px; background: #0d0b0b; border: 1px solid var(--line); border-radius: 4px; overflow: auto; font-family: var(--font-mono); font-size: 0.9em; line-height: 1.55; }
.rte__body a { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; text-decoration-color: var(--ink-dim); }
.rte__body a:hover, .rte__body a:focus-visible { text-decoration-color: var(--ink); }
.rte__body.rte__empty::before {
  content: attr(data-placeholder);
  position: absolute;
  top: 18px;
  left: 20px;
  color: var(--ink-faint);
  pointer-events: none;
}
.rte__body { position: relative; }
.rte__body.rte__empty { min-height: 340px; }
.rte__meta { min-height: 1.2em; margin: 6px 2px 0; color: var(--ink-faint); font-size: 0.78rem; letter-spacing: 0.04em; font-style: italic; }
.rte__meta.ok { color: #a8c985; font-style: normal; }
.rte__meta.err { color: #e8b4b4; font-style: normal; }

.inv {
  width: 100%;
  border-collapse: collapse;
  margin-top: 16px;
  font-size: 0.92rem;
}
.inv th, .inv td {
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
}
.inv th {
  color: var(--ink-faint);
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.75rem;
}
.inv tr:hover td { background: rgba(255,255,255,0.02); }
.inv__slug  { color: var(--ink-dim); font-family: var(--font-mono); }
.inv__title { color: var(--ink); }

/* =================== Inventory: stored images + delete ===================== */
.inv__section {
  margin: 34px 0 4px;
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  font-size: 1.4rem;
  color: var(--ink);
}
.inv__act { text-align: center; }
.inv__thumb img { width: 44px; height: 44px; object-fit: cover; border-radius: 3px; border: 1px solid var(--line-strong); background: #0d0b0b; display: block; }
.inv__name code { font-family: var(--font-mono); font-size: 0.82rem; color: var(--ink); background: rgba(255,255,255,0.04); padding: 2px 6px; border-radius: 3px; }
.inv__size, .inv__date { color: var(--ink-dim); font-family: var(--font-mono); font-size: 0.82rem; }
.inv__usage { display: inline-block; padding: 2px 8px; border-radius: 12px; font-size: 0.74rem; letter-spacing: 0.04em; cursor: help; }
.inv__usage.in-use { background: rgba(176,58,58,0.16); color: #e8b4b4; border: 1px solid rgba(176,58,58,0.5); }
.inv__usage.orphan { background: rgba(108,176,58,0.14); color: #cfe6c2; border: 1px solid rgba(108,176,58,0.42); }

.inv__archive { min-width: 15rem; vertical-align: top; }
.inv__archive .inv__when {
  display: block;
  width: 100%;
  max-width: 14rem;
  margin: 2px 0 6px;
  font: 0.82rem var(--font-mono);
  color: var(--ink);
  background: #0f0d0d;
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  padding: 4px 8px;
  color-scheme: dark;
}
.inv__when-lab {
  display: block;
  color: var(--ink-faint);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.68rem;
  margin-top: 6px;
}
.inv__archive-acts { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.inv__badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.74rem;
  letter-spacing: 0.04em;
}
.inv__badge--live { background: rgba(108,176,58,0.14); color: #cfe6c2; border: 1px solid rgba(108,176,58,0.42); }
.inv__badge--scheduled { background: rgba(217,143,43,0.16); color: #e0b06a; border: 1px solid rgba(217,143,43,0.45); }
.inv__badge--archived { background: rgba(176,58,58,0.16); color: #e8b4b4; border: 1px solid rgba(176,58,58,0.5); }
.inv__badge--draft { background: rgba(255,255,255,0.06); color: var(--ink-dim); border: 1px solid var(--line); }
.file-del { margin: 0; display: inline-block; }
.inv__hint { margin: 8px 0 0; color: var(--ink-faint); font-size: 0.8rem; }

.btn--danger {
  color: #fff;
  background: var(--danger);
  border-color: var(--danger);
}
.btn--danger:hover, .btn--danger:focus-visible { background: #b34a4a; border-color: #b34a4a; }
.btn--sm { padding: 4px 12px; font-size: 0.8rem; height: auto; }

/* Shared per-row delete cell: button + an inline status that swaps in after
   the fetch resolves (busy â†’ ok / err). Stays on the same page, no JSON view. */
.del-cell { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.del-status { font-family: var(--font-mono); font-size: 0.8rem; min-width: 1ch; }
.del-status[hidden] { display: none; }
.del-status--busy { color: var(--ink-faint); animation: del-pulse 900ms ease-in-out infinite; }
.del-status--ok   { color: #cfe6c2; }
.del-status--err  { color: #e8b4b4; }
@keyframes del-pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.45; } }

@media (max-width: 640px) {
  .inv__thumb { width: 1px; }
  .inv__thumb img { display: none; }
  .inv__act { padding: 4px 0; }
}

.story__sched {
  margin: 0 0 10px;
  padding: 8px 10px;
  border-radius: 3px;
  font-size: 0.85rem;
  letter-spacing: 0.02em;
}
.story__sched--scheduled {
  background: rgba(217,143,43,0.16);
  color: #e0b06a;
  border: 1px solid rgba(217,143,43,0.45);
}
.story__sched--draft {
  background: rgba(255,255,255,0.05);
  color: var(--ink-dim);
  border: 1px solid var(--line);
}
.story__sched--archived {
  background: rgba(176,58,58,0.16);
  color: #e8b4b4;
  border: 1px solid rgba(176,58,58,0.5);
}

/* =================== owner calendar ===================== */
.cal { margin: 4px 0 32px; }
.cal__toolbar {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.cal__month {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 1.35rem;
  margin: 0;
  text-align: center;
}
.cal__legend { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 14px; }
.cal__board {
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  background: #120f0f;
}
.cal__weekdays, .cal__grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}
.cal__weekdays { background: #1a1716; border-bottom: 1px solid var(--line); }
.cal__weekdays span {
  text-align: center;
  color: var(--ink-faint);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.68rem;
  padding: 8px 0;
}
.cal__cell {
  min-height: 7.75rem;
  min-width: 0;
  background: var(--bg-alt);
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 6px 6px 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.cal__cell:nth-child(7n) { border-right: 0; }
.cal__cell--pad { background: #0e0c0c; min-height: 0; }
.cal__cell.is-today { background: #1c1814; box-shadow: inset 0 0 0 1px var(--ink-dim); }
.cal__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  min-width: 0;
}
.cal__num {
  color: var(--ink);
  font: 600 0.82rem/1 var(--font-mono);
}
.cal__acts { display: flex; gap: 3px; flex: 0 0 auto; }
.cal__add {
  width: 1.35rem;
  height: 1.35rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 3px;
  color: var(--ink-faint);
  background: transparent;
  font-size: 0.85rem;
  line-height: 1;
  text-decoration: none;
}
.cal__add:hover, .cal__add:focus-visible { color: var(--ink); border-color: var(--ink-dim); }
.cal__items {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.cal__item, button.cal__item {
  display: block;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  margin: 0;
  padding: 3px 6px;
  border: 0;
  border-radius: 3px;
  font: inherit;
  font-size: 0.72rem;
  line-height: 1.3;
  text-align: left;
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}
.cal__item-k { letter-spacing: 0.04em; text-transform: uppercase; font-size: 0.6rem; opacity: 0.75; margin-right: 3px; }
.cal__item--scheduled { background: rgba(217,143,43,0.18); color: #e0b06a; }
.cal__item--live { background: rgba(108,176,58,0.16); color: #cfe6c2; }
.cal__item--draft { background: rgba(255,255,255,0.06); color: var(--ink-dim); }
.cal__item--archived { background: rgba(176,58,58,0.16); color: #e8b4b4; }
.cal__item--end { background: transparent; color: var(--ink-faint); box-shadow: inset 0 0 0 1px var(--line); }
.cal__item--proposal { background: rgba(231,197,106,0.12); color: #e7c56a; box-shadow: inset 0 0 0 1px rgba(231,197,106,0.45); }
.cal__desk { display: grid; gap: 8px; margin: 0 0 16px; }
.cal__hand {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  gap: 8px 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 10px 12px;
  background: var(--bg-alt);
}
.cal__hand h3 { margin: 0; font-size: 0.95rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal__hand p { margin: 2px 0 0; color: var(--ink-faint); font-size: 0.78rem; }
.cal__hand-when { display: flex; align-items: center; gap: 6px; color: var(--ink-dim); font-size: 0.78rem; }
.cal__hand-when input { background: #0f0d0d; color: var(--ink); border: 1px solid var(--line); border-radius: 3px; padding: 4px 6px; }
.cal__hand pre {
  grid-column: 1 / -1;
  margin: 0;
  white-space: pre-wrap;
  max-height: 160px;
  overflow: auto;
  font: 0.86rem/1.45 var(--font-body);
  color: var(--ink-dim);
}
.cal__hand pre[hidden] { display: none; }
@media (max-width: 860px) {
  .cal__toolbar { grid-template-columns: auto 1fr auto; }
  .cal__toolbar .btn { grid-column: 1 / -1; justify-self: start; }
  .cal__cell { min-height: 5.4rem; padding: 4px; }
  .cal__num, .cal__item { font-size: 0.68rem; }
  .cal__hand { grid-template-columns: 1fr; }
}

/* =================== error ============================ */
.err { text-align: center; padding: 80px 0 40px; }
.err__code {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-size: clamp(3rem, 12vw, 5rem);
  line-height: 1;
  margin: 0 0 18px;
  color: var(--ink);
}
.err__msg { color: var(--ink-dim); font-size: 1.05rem; margin: 0 0 24px; }
.err__hint { margin: 0; color: var(--ink-dim); }
.err__hint a { color: var(--ink); text-decoration: underline; }
.err pre.err__stack {
  white-space: pre-wrap;
  text-align: left;
  font-size: 0.78rem;
  background: #141111;
  border: 1px solid var(--line);
  padding: 14px 16px;
  border-radius: 4px;
  max-height: 300px;
  overflow: auto;
  color: var(--ink-dim);
}

/* =================== footer =========================== */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 14px 16px 22px;
  display: flex;
  gap: 16px;
  justify-content: center;
  align-items: center;
  color: var(--ink-faint);
  font-size: 0.78rem;
  letter-spacing: 0.1em;
}
.site-footer span { border-right: 1px solid var(--line); padding-right: 16px; }
.site-footer span:last-child { border-right: 0; padding-right: 0; }
.site-footer__mark   { font-family: var(--font-display); letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-dim); }
.site-footer__env    { font-family: var(--font-mono); letter-spacing: 0.06em; }

.nav-add {
  display: grid;
  grid-template-columns: 1fr 2fr auto;
  gap: 12px;
  align-items: end;
  margin: 18px 0 8px;
  padding: 0 0 8px;
}
.nav-ord { display: inline; }
.inv--nav td.inv__act { white-space: nowrap; }

/* =================== mobile =========================== */
@media (max-width: 899px) {
  .nav-burger { display: inline-block; }
  .site-nav .nav-extra { display: none; }
  .sidenav {
    position: fixed;
    left: 0; top: 0;
    z-index: 40;
    transform: translateX(-105%);
    transition: transform 180ms ease;
    background: #131111;
    border-right: 1px solid var(--line);
    box-shadow: 8px 0 32px rgba(0,0,0,0.45);
  }
  .nav-toggle:checked ~ .shell .sidenav { transform: none; }
  .nav-toggle:checked ~ .nav-scrim {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 35;
    background: rgba(0,0,0,0.55);
  }
  .shell__main { border-left: 0; border-right: 0; }
  .shell-feed .shell__main { max-width: none; }
  .shell-wide .site-main { padding: 0 16px 48px; }
  body.shell-office .sidenav {
    position: sticky;
    top: 0;
    transform: none;
    width: 6.6rem;
    flex-basis: 6.6rem;
    height: 100%;
    max-height: 100vh;
    z-index: 5;
    box-shadow: none;
    padding-left: 0.35rem;
    padding-right: 0.35rem;
  }
  body.shell-office .sidenav__brand span,
  body.shell-office .sidenav__post { display: none; }
  body.shell-office .sidenav__item { font-size: 0.72rem; padding: 0.35rem 0.3rem; }
  body.shell-office .office {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
  }
  body.shell-office .office__rail {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.35rem;
    overflow-x: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 0.45rem 0.5rem;
  }
  body.shell-office .office__brand { margin: 0 0.35rem 0 0; white-space: nowrap; }
  body.shell-office .office__nav { display: flex; gap: 0.15rem; margin: 0; }
  body.shell-office .office__nav a { white-space: nowrap; }
  body.shell-office .office__rail h2,
  body.shell-office .office__channels { display: none; }
}
@media (min-width: 900px) {
  .nav-burger { display: none; }
}
@media (max-width: 640px) {
  .site-header { padding: 12px 16px; }
  .site-nav a { margin-left: 12px; font-size: 0.7rem; }
  .hero { padding: 44px 16px 28px; }
  .hero__logo { width: 168px; height: 168px; margin-bottom: 20px; }
  .inv th, .inv td { padding: 8px 10px; }
  .nav-add { grid-template-columns: 1fr; }
}
