/* ==========================================================================
   diskurso.ph - user app
   The three-column social layout: nav rail / feed / trends.
   ========================================================================== */

/* ==========================================================================
   SHELL
   ========================================================================== */

/* nav | feed | suggestions, centred as a block so the feed stays the
   visual centre of gravity instead of stretching across the window */
.shell {
  display: grid;
  grid-template-columns: 250px minmax(0, 700px) 280px;
  gap: 24px;
  justify-content: center;
  margin: 0 auto;
  align-items: start;
}

/* the debate room earns its width: article, side panels and two benches */
.shell-debate {
  grid-template-columns: 250px minmax(0, 1fr) 360px;
  justify-content: stretch;
  max-width: 1400px;
}

.rail:empty { display: none; }

/* ---------- left nav ---------- */

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 10px 10px 16px;
  gap: 4px;
}

.sidebar .brand {
  padding: 8px 10px 14px;
  font-size: 17px;
  color: var(--text);
}
.sidebar .brand span { line-height: 1.1; }
.sidebar .brand small {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-faint);
  letter-spacing: .08em;
  text-transform: uppercase;
}

.navlink {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 11px 14px;
  border-radius: var(--radius-pill);
  color: var(--text);
  font-size: 17px;
  font-weight: 500;
  transition: background .15s;
}
.navlink:hover { background: var(--surface-hover); text-decoration: none; }
.navlink svg { width: 23px; height: 23px; flex: none; }
.navlink.active { font-weight: 800; }
.navlink.active svg { color: var(--brand); }
.navlink .badge {
  margin-left: auto;
  font-size: 11px;
  font-weight: 800;
  color: var(--gold);
}

.sidebar-foot { margin-top: auto; display: grid; gap: 6px; }

.me-wrap { position: relative; }

.me-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px;
  border: 0;
  border-radius: var(--radius-pill);
  background: transparent;
  cursor: pointer;
  text-align: left;
  color: var(--text);
  transition: background .15s;
}
.me-chip:hover { background: var(--surface-hover); }
.me-chip-text { min-width: 0; flex: 1; }
.me-chip-text b { display: block; font-size: 14px; }
.me-chip-text span { font-size: 13px; color: var(--text-dim); }

.me-photo {
  border-radius: 50%;
  object-fit: cover;
}

.me-popup {
  display: none;
  position: absolute;
  bottom: calc(100% + 8px);
  left: 4px;
  right: 4px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px;
  box-shadow: var(--shadow);
  z-index: 50;
}
.me-popup.open { display: grid; gap: 2px; }

.me-popup-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: background .12s;
}
.me-popup-item svg { width: 18px; height: 18px; flex: none; }
.me-popup-item:hover { background: var(--surface-hover); text-decoration: none; }
.me-popup-danger { color: var(--danger); }
.me-popup-danger:hover { background: var(--danger-soft); }

/* ---------- centre column ---------- */

.main {
  min-height: 100vh;
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 54px;
  padding: 10px 16px;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.topbar h1 { font-size: 19px; font-weight: 800; }
.topbar .sub { font-size: 13px; color: var(--text-dim); }

/* just the back button, on pages that carry their own headline */
.topbar-slim { min-height: 0; padding: 6px 12px; }

.back-btn {
  display: grid;
  place-items: center;
  width: 36px; height: 36px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--text);
  cursor: pointer;
}
.back-btn:hover { background: var(--surface-hover); }
.back-btn svg { width: 19px; height: 19px; }

/* tabs under the top bar */
.tabs { display: flex; border-bottom: 1px solid var(--border); }
.tab {
  flex: 1;
  padding: 15px 8px;
  border: 0;
  background: transparent;
  color: var(--text-dim);
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  position: relative;
}
.tab:hover { background: var(--surface-hover); }
.tab.active { color: var(--text); }
.tab.active::after {
  content: "";
  position: absolute;
  left: 50%; bottom: 0;
  transform: translateX(-50%);
  width: 58px; height: 4px;
  border-radius: 4px;
  background: var(--brand);
}

/* ---------- right rail ---------- */

.rail {
  position: sticky;
  top: 0;
  max-height: 100vh;
  overflow-y: auto;
  padding: 16px 0 32px;
  display: grid;
  gap: 14px;
}
.rail .card { padding: 14px 16px; }
.rail-link { display: block; margin-top: 10px; font-size: 13px; font-weight: 700; }

/* ---------- Suggested Topics ---------- */

.suggested-head {
  padding: 0 2px 10px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.sg {
  display: grid;
  gap: 4px;
  padding: 12px 2px;
  border-top: 1px solid var(--border);
  color: var(--text);
}
.sg:hover { text-decoration: none; }
.sg:hover .sg-q { text-decoration: underline; }

.sg-cat {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--brand);
}
.sg-q { font-size: 14px; font-weight: 600; line-height: 1.4; }
.sg-meta { font-size: 12px; color: var(--text-faint); }

.suggested-empty {
  padding: 12px 2px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-dim);
}

.suggested-more {
  display: block;
  margin-top: 8px;
  padding: 12px 2px 0;
  border-top: 1px solid var(--border);
  font-size: 13px;
  font-weight: 700;
}

/* ---------- mobile tab bar ---------- */

.tabbar {
  display: none;
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 30;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
}
.tabbar-inner { display: flex; justify-content: space-around; }
.tabbar a {
  display: grid;
  place-items: center;
  gap: 2px;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  font-size: 10px;
  font-weight: 700;
}
.tabbar a.active { color: var(--brand); }
.tabbar svg { width: 23px; height: 23px; }

/* ==========================================================================
   FEED - topic cards
   ========================================================================== */

.feed-intro {
  padding: 18px 16px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(135deg, var(--side-a-soft), var(--side-b-soft));
}
.feed-intro h2 { font-size: 20px; margin-bottom: 4px; }

.topic-card {
  display: block;
  padding: 20px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  transition: background .12s;
}
.topic-card:hover { background: var(--surface-hover); text-decoration: none; }

.topic-question {
  font-size: 17px;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 8px;
}
.topic-context {
  font-size: 14px;
  color: var(--text-dim);
  line-height: 1.5;
  margin-bottom: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ---------- search bar ---------- */

.search-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(12px);
}
.search-bar svg {
  width: 20px;
  height: 20px;
  flex: none;
  color: var(--text-faint);
}
.search-bar input {
  flex: 1;
  border: 0;
  background: transparent;
  color: var(--text);
  font-size: 15px;
  padding: 6px 0;
  outline: none;
}
.search-bar input::placeholder { color: var(--text-faint); }

.topic-image {
  margin-bottom: 16px;
  border-radius: var(--radius-sm);
  overflow: hidden;
}

/* photo beside the headline, so the card stays short and nothing is stranded */
.card-top {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}
.card-top .topic-image { margin: 0; }
.card-text .topic-question { margin-bottom: 6px; }
.card-text .topic-context { -webkit-line-clamp: 3; }
.topic-image img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  /* faces sit above the middle of most news photos */
  object-position: center 35%;
}

.side-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }

.vote-bar {
  display: flex;
  height: 7px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--border);
  margin-bottom: 7px;
}
.vote-bar i { display: block; transition: width .4s ease; }
.vote-bar .va { background: var(--side-a); }
.vote-bar .vb { background: var(--side-b); }
.vote-legend {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 700;
}
.vote-legend .la { color: var(--side-a); }
.vote-legend .lb { color: var(--side-b); }

.topic-split {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-top: 24px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.45;
}
/* keep the two side labels from running into each other mid-card */
.topic-split .split-label { max-width: 47%; }
.topic-split .split-b { text-align: right; }
.split-a { color: var(--side-a); }
.split-b { color: var(--side-b); }

.split-bar {
  height: 4px;
  border-radius: 4px;
  background: var(--side-b);
  margin: 8px 0 0;
  overflow: hidden;
}
.split-bar i {
  display: block;
  height: 100%;
  background: var(--side-a);
  border-radius: 4px;
}

.topic-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 16px;
  font-size: 13px;
  color: var(--text-faint);
}
.topic-foot span { display: inline-flex; align-items: center; }
.topic-foot span + span::before { content: "·"; margin: 0 4px; }
.topic-closed-tag { font-weight: 600; }

/* ==========================================================================
   DEBATE ROOM
   ========================================================================== */

.debate-head {
  padding: 0;
  border-bottom: 1px solid var(--border);
}

/* masthead strip: category on the left, issue date on the right */
.article-masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 28px;
  border-bottom: 1px solid var(--border);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.debate-head .topic-question {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 34px;
  line-height: 1.12;
  font-weight: 900;
  letter-spacing: -0.015em;
  text-transform: uppercase;
  padding: 26px 28px 0;
  margin: 0;
}

.article-byline {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  padding: 14px 28px 16px;
  border-bottom: 3px solid var(--text);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.article-byline span + span::before { content: "·"; margin: 0 7px; }
.article-closed { color: var(--danger); }

.debate-head .topic-image {
  margin: 0;
  border-radius: 0;
}

/* the photo sits in the opening paragraphs and the text wraps past it */
.article-body .topic-image {
  float: left;
  width: 300px;
  max-width: 40%;
  margin: 4px 22px 14px 0;
}
/* contain the float so the vote box never rides up beside it */
.article-body::after { content: ""; display: block; clear: both; }
.debate-head .topic-image img {
  width: 100%;
  height: auto;
  max-height: 420px;
}

/* body text, opened by a drop cap. Deliberately a single column: CSS
   multicol and a floated photo do not reflow together reliably. */
.article-body { padding: 24px 28px 18px; }
.debate-head .topic-context {
  display: block;
  -webkit-line-clamp: unset;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 17px;
  line-height: 1.75;
  color: var(--text);
  /* Left-aligned on purpose. Justifying a column this narrow forces
     hyphenation and opens rivers of white space between words. */
  text-align: left;
  hyphens: manual;
  margin: 0;
}
/* drop cap opens the article; later paragraphs are indented, not spaced.
   first-of-type, not first-child - the photo is the first child. */
.debate-head .topic-context:first-of-type::first-letter {
  float: left;
  font-size: 3.1em;
  line-height: .82;
  font-weight: 900;
  padding: 6px 10px 0 0;
}
/* Space between paragraphs rather than a print-style first-line indent.
   On screen the indent reads as cramped once the text is left-aligned. */
.debate-head .topic-context + .topic-context { margin-top: 1.05em; }

/* boxed poll, like a newspaper fact box */
.poll-box {
  margin: 22px 28px 24px;
  padding: 13px 16px 14px;
  border: 1px solid var(--border-strong);
}
.poll-box h3 {
  margin-bottom: 10px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--text-faint);
}

/* ---------- the debate side panels, parked in the right rail ---------- */


.rail-debate { align-content: start; gap: 12px; padding: 16px 0 32px; }

.rail-debate .poll-box,
.rail-debate .stance-box,
.rail-debate .composer,
.rail-debate .locked-note {
  margin: 0;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-elevated);
}

.rail-debate .stance-options { grid-template-columns: 1fr; }

/* too narrow for an avatar beside the textarea */
.rail-debate .composer { display: block; }
.rail-debate .composer > .avatar { display: none; }


/* side picker */
.stance-box {
  padding: 14px 28px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.stance-box h3 { font-size: 14px; margin-bottom: 2px; }
.stance-options { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }

.stance-btn {
  padding: 10px 14px;
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--bg-elevated);
  color: var(--text);
  font-weight: 800;
  font-size: 14px;
  cursor: pointer;
  text-align: left;
  transition: border-color .15s, background .15s, transform .08s;
}
.stance-btn small {
  display: block;
  margin-top: 2px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.stance-btn:hover { transform: translateY(-1px); }
.stance-btn[data-side="A"]:hover, .stance-btn[data-side="A"].picked {
  border-color: var(--side-a); background: var(--side-a-soft);
}
.stance-btn[data-side="B"]:hover, .stance-btn[data-side="B"].picked {
  border-color: var(--side-b); background: var(--side-b-soft);
}
.stance-btn.picked::after { content: " ✓"; }

/* two-bench layout */
.benches {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-top: 1px solid var(--border);
}
.bench { min-width: 0; }
.bench + .bench { border-left: 1px solid var(--border); }

.bench-head {
  position: sticky;
  top: 48px;
  z-index: 10;
  padding: 12px 18px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.bench-head .label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-weight: 800;
  font-size: 14px;
}
.bench-head .count { font-size: 12px; font-weight: 700; color: var(--text-dim); }
.bench-a .bench-head { border-top: 3px solid var(--side-a); }
.bench-b .bench-head { border-top: 3px solid var(--side-b); }
.bench-a .bench-head .label { color: var(--side-a); }
.bench-b .bench-head .label { color: var(--side-b); }

/* mobile bench switcher */
.bench-switch { display: none; }

/* ==========================================================================
   ARGUMENT (comment) CARD
   ========================================================================== */

.argument {
  display: flex;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
  transition: background .12s;
}
.argument:hover { background: var(--surface-hover); }
.argument.is-reply {
  padding-left: 34px;
  background: color-mix(in srgb, var(--surface) 60%, transparent);
}
.argument.is-mine { box-shadow: inset 3px 0 0 var(--brand); }
.argument.flash { animation: flash .9s ease-out; }
@keyframes flash {
  from { background: var(--brand-soft); }
  to { background: transparent; }
}

.arg-body { min-width: 0; flex: 1; }

.arg-head {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 14px;
  margin-bottom: 4px;
}
.arg-head .name { font-weight: 700; color: var(--text); }
.arg-head .name:hover { text-decoration: underline; }
.arg-head .handle, .arg-head .dot, .arg-head .when { color: var(--text-dim); font-size: 13px; }
.arg-head .rank-badge {
  font-size: 11px;
  font-weight: 800;
  color: var(--gold);
}

.arg-reply-to {
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 4px;
}
.arg-reply-to .cross {
  color: var(--gold);
  font-weight: 700;
}

.arg-text {
  font-size: 14.5px;
  line-height: 1.55;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  margin-top: 2px;
  letter-spacing: 0.01em;
}
.arg-text .mention { font-weight: 600; }
.arg-removed { color: var(--text-faint); font-style: italic; font-size: 14px; }

.arg-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 10px;
  margin-left: -7px;
}

.act {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  border: 0;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--text-dim);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: color .15s, background .15s;
}
.act svg { width: 17px; height: 17px; }
.act:hover { color: var(--brand); background: var(--brand-soft); }
.act-like:hover { color: var(--side-b); background: var(--side-b-soft); }
.act-like.liked { color: var(--side-b); }
.act-like.liked svg { fill: var(--side-b); }
.act-del:hover { color: var(--danger); background: var(--danger-soft); }
.act:disabled { opacity: .4; cursor: not-allowed; }
.act.bump svg { animation: bump .32s ease-out; }
@keyframes bump {
  0% { transform: scale(1); }
  45% { transform: scale(1.35); }
  100% { transform: scale(1); }
}

/* ==========================================================================
   COMPOSER
   ========================================================================== */

.composer {
  display: flex;
  gap: 12px;
  padding: 14px 28px;
  border-bottom: 1px solid var(--border);
}
.composer-body { flex: 1; min-width: 0; }

.composer-input {
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--text);
  font-size: 16px;
  line-height: 1.5;
  resize: none;
  overflow: hidden;
  min-height: 52px;
  padding: 6px 0 0;
}
.composer-input:focus { outline: none; }
.composer-input::placeholder { color: var(--text-faint); }

.composer-side {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
  font-size: 13px;
  font-weight: 700;
}

.composer-foot {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  margin-top: 6px;
}
.composer-foot .grow { flex: 1; }

/* circular word counter */
.counter { position: relative; width: 26px; height: 26px; flex: none; }
.counter i {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(var(--brand) calc(var(--pct) * 1%), var(--border) 0);
  mask: radial-gradient(circle, transparent 60%, #000 62%);
  -webkit-mask: radial-gradient(circle, transparent 60%, #000 62%);
}
.counter b {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 10px;
  font-weight: 800;
  color: var(--text-dim);
}
.counter.warn i { background: conic-gradient(var(--gold) calc(var(--pct) * 1%), var(--border) 0); }
.counter.over i { background: conic-gradient(var(--danger) calc(var(--pct) * 1%), var(--border) 0); }
.counter.over b { color: var(--danger); }

.filter-warn {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  background: var(--danger-soft);
  border: 1px solid var(--danger);
  color: var(--text);
  font-size: 13px;
}

/* reply-to banner inside the composer */
.replying {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  margin-bottom: 8px;
  border-radius: var(--radius-sm);
  background: var(--brand-soft);
  font-size: 13px;
}
.replying button {
  margin-left: auto;
  border: 0;
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
}

.locked-note {
  padding: 14px 28px;
  border-bottom: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 14px;
  text-align: center;
}

/* ==========================================================================
   LEADERBOARD
   ========================================================================== */

.rank-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  transition: background .12s;
}
.rank-row:hover { background: var(--surface-hover); text-decoration: none; }

.rank-no {
  flex: none;
  width: 34px;
  font-size: 17px;
  font-weight: 900;
  color: var(--text-faint);
  text-align: center;
}
.rank-row.top1 .rank-no { color: var(--gold); font-size: 21px; }
.rank-row.top2 .rank-no, .rank-row.top3 .rank-no { color: var(--text-dim); font-size: 19px; }
.rank-row.top1 { background: linear-gradient(90deg, rgba(245,181,68,.10), transparent); }

.rank-main { flex: 1; min-width: 0; }
.rank-main b { display: block; font-size: 15px; }
.rank-main span { font-size: 13px; color: var(--text-dim); }

.rank-score { text-align: right; flex: none; }
.rank-score b { display: block; font-size: 17px; font-weight: 900; color: var(--gold); }
.rank-score span { font-size: 11px; color: var(--text-dim); text-transform: uppercase; letter-spacing: .06em; }

/* compact rail version */
.rail .rank-row { padding: 9px 0; border: 0; }
.rail .rank-no { width: 22px; font-size: 14px; }
.rail .rank-main b { font-size: 14px; }
.rail .rank-score b { font-size: 14px; }

/* ==========================================================================
   PROFILE
   ========================================================================== */

.profile-head { padding: 18px 16px; border-bottom: 1px solid var(--border); }
.profile-cover {
  height: 112px;
  border-radius: var(--radius);
  background: linear-gradient(120deg, var(--side-a), var(--side-b));
  margin-bottom: -44px;
}
.profile-avatar-wrap { padding-left: 4px; }
.profile-head .avatar-lg { border: 4px solid var(--bg); box-shadow: 0 0 0 1px var(--border); }
.profile-name { font-size: 22px; font-weight: 900; margin-top: 10px; }
.profile-handle { color: var(--text-dim); font-size: 15px; }
.profile-bio { margin-top: 10px; font-size: 15px; white-space: pre-wrap; }

.stat-strip {
  display: flex;
  gap: 22px;
  margin-top: 14px;
  flex-wrap: wrap;
}
.stat-strip div { font-size: 14px; color: var(--text-dim); }
.stat-strip b { color: var(--text); font-weight: 800; }

.influence-card {
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--gold);
  background: rgba(245, 181, 68, .08);
}
.influence-card .big {
  font-size: 30px;
  font-weight: 900;
  color: var(--gold);
  line-height: 1;
}

/* ==========================================================================
   RULES PAGE
   ========================================================================== */

.rule-item {
  display: flex;
  gap: 14px;
  padding: 16px;
  border-bottom: 1px solid var(--border);
}
.rule-no {
  flex: none;
  display: grid;
  place-items: center;
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand);
  font-weight: 900;
  font-size: 14px;
}
.rule-item h3 { font-size: 16px; margin-bottom: 4px; }
.rule-item p { margin: 0; font-size: 14px; color: var(--text-dim); line-height: 1.55; }

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

/* 250 + 700 + 280 plus two 24px gaps needs ~1280px. Below that the
   suggestions go first - the feed and nav matter more. */
@media (max-width: 1300px) {
  .shell { grid-template-columns: 250px minmax(0, 700px); }
  .shell-debate { grid-template-columns: 250px minmax(0, 1fr) 340px; }
  .rail:not(.rail-debate) { display: none; }
}

@media (max-width: 1040px) {
  .shell { grid-template-columns: 80px minmax(0, 700px); }
  .shell-debate { grid-template-columns: 80px minmax(0, 1fr) 320px; }
  .sidebar .brand small, .navlink span, .me-chip-text { display: none; }
  .sidebar .brand { justify-content: center; padding: 8px 0 14px; }
  .navlink { justify-content: center; padding: 12px; }
  .me-chip { justify-content: center; }
}

@media (max-width: 900px) {
  .shell, .shell-debate { grid-template-columns: 88px minmax(0, 1fr); }
  .rail { display: none; }
}

@media (max-width: 700px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { display: none; }
  .main { border: 0; padding-bottom: 76px; }
  .tabbar { display: block; }

  /* one bench at a time, switched by buttons */
  .benches { grid-template-columns: minmax(0, 1fr); }
  .bench + .bench { border-left: 0; }
  .bench.off { display: none; }
  .bench-switch {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 48px;
    z-index: 15;
    background: color-mix(in srgb, var(--bg) 92%, transparent);
    backdrop-filter: blur(10px);
  }
  .bench-switch button {
    padding: 9px;
    border-radius: var(--radius-pill);
    border: 1.5px solid var(--border-strong);
    background: transparent;
    color: var(--text-dim);
    font-weight: 800;
    font-size: 13px;
    cursor: pointer;
  }
  .bench-switch button.on[data-side="A"] { color: var(--side-a); border-color: var(--side-a); background: var(--side-a-soft); }
  .bench-switch button.on[data-side="B"] { color: var(--side-b); border-color: var(--side-b); background: var(--side-b-soft); }
  .bench-head { top: 106px; }
  .topic-question { font-size: 16px; }
  .card-top { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .article-masthead { padding: 10px 16px; letter-spacing: .12em; }
  .debate-head .topic-question { font-size: 27px; padding: 18px 16px 0; }
  .article-byline { padding: 12px 16px 13px; }
  .article-body { padding: 18px 16px 22px; }
  /* too narrow to wrap text beside a photo */
  .article-body .topic-image { float: none; width: 100%; max-width: none; margin: 0 0 16px; }
  .debate-head .topic-context { font-size: 15.5px; text-align: left; }
  .poll-box { margin: 18px 16px 20px; }
  .stance-box { padding: 14px 16px; }
  .composer { padding: 14px 16px; }
  .stance-options { grid-template-columns: 1fr; }
  .argument.is-reply { padding-left: 28px; }
}

/* ---------- feed interest filter ---------- */

.filter-bar {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  scrollbar-width: none;
}
.filter-bar::-webkit-scrollbar { display: none; }
.filter-bar:empty { display: none; }
.filter-bar .chip { white-space: nowrap; flex: none; }

/* interests on a profile */
.profile-head .chips { margin-top: 12px; }

/* ---------- signed-out invitation in the sidebar ---------- */

.join-card {
  padding: 16px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
}
.join-card h3 { font-size: 16px; margin-bottom: 6px; }
.join-card p {
  margin: 0 0 14px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-dim);
}
.join-card .btn-google { width: 100%; margin-bottom: 8px; }
.join-card .btn { margin-bottom: 10px; }

.join-login {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  text-align: center;
  color: var(--text-dim);
}
.join-login:hover { color: var(--brand); }

/* the collapsed icon rail has no room for the pitch */
@media (max-width: 1040px) {
  .join-card h3, .join-card p, .join-login { display: none; }
  .join-card { padding: 8px; border: 0; background: transparent; }
}

/* a flag sits quieter than the like and reply actions */
.act-report:hover { color: var(--gold); background: rgba(245, 181, 68, .12); }

/* ---------- legal links in the rail (AdSense wants these reachable) ---------- */

.rail-legal {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  padding: 4px 2px;
  font-size: 12.5px;
  color: var(--text-faint);
}
.rail-legal a { color: var(--text-faint); }
.rail-legal a:hover { color: var(--brand); }
.rail-legal span { width: 100%; margin-top: 2px; }

/* the same links at the foot of the centre column, for when the rail is gone */
.main-legal {
  display: none;
  flex-wrap: wrap;
  gap: 8px 16px;
  padding: 22px 18px 28px;
  border-top: 1px solid var(--border);
  font-size: 12.5px;
  color: var(--text-faint);
}
.main-legal a { color: var(--text-faint); }
.main-legal a:hover { color: var(--brand); }
.main-legal span { width: 100%; }

@media (max-width: 1300px) {
  .main-legal { display: flex; }
}

/* subheadings inside the article body */
.article-sub {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 19px;
  font-weight: 900;
  line-height: 1.3;
  letter-spacing: -.01em;
  margin: 1.5em 0 .5em;
  color: var(--text);
}
.article-sub:first-of-type { margin-top: .6em; }

/* bold and italic the author set */
.debate-head .topic-context strong { font-weight: 700; color: var(--text); }
.debate-head .topic-context em { font-style: italic; }

/* ==========================================================================
   INFLUENCE BOARD
   ========================================================================== */

.lb-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}
.lb-row:hover { background: var(--surface-hover); text-decoration: none; }

.lb-place {
  flex: none;
  width: 22px;
  font-size: 14px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--text-faint);
  text-align: right;
}
.lb-top .lb-place { color: var(--text); }

.lb-who { flex: 1; min-width: 0; }
.lb-who b { display: block; font-size: 15px; font-weight: 700; }
.lb-who span { font-size: 13px; color: var(--text-dim); }

.lb-you {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: .08em;
}

.lb-score { flex: none; text-align: right; }
.lb-score b {
  display: block;
  font-size: 19px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
}

.lb-me b { color: var(--brand); }
