/*
 * Lurker — a modern, self-contained reddont theme.
 * Replace desktop.css or load after styles.css / desktop.css / mobile.css.
 * Supports light, dark, RES and system themes without remote fonts or assets.
 * Existing markup, JavaScript hooks and compact/card views are preserved.
 * Rem sizing respects browser font preferences; 1rem = 10px at defaults.
 */

/* ---------- design tokens ---------- */

body,
body[data-theme],
body:not([data-theme]) {

  color-scheme: light;
  --ui-page: #f4f6f8;
  --ui-surface: #ffffff;
  --ui-subtle: #f0f3f6;
  --ui-hover: #e8eef2;
  --ui-border: #dce3e9;
  --ui-border-strong: #b9c7d2;
  --ui-text: #263544;
  --ui-heading: #142534;
  --ui-muted: #5e7182;
  --ui-accent: #087f75;
  --ui-accent-strong: #06675f;
  --ui-accent-soft: #e6f4ef;
  --ui-visited: #697b8b;
  --ui-danger: #bb394b;
  --ui-success: #18754b;
  --ui-gold: #8a6418;
  --ui-shadow: 0 2px 8px rgb(23 43 61 / 3%);
  --ui-shadow-menu: 0 12px 40px rgb(23 43 61 / 13%);
  --o-font: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --ui-radius: 1.4rem;
  --ui-gutter: clamp(1.6rem, 3vw, 4rem);
  --o-md-box-padding: 1.6rem 1.8rem;
  --o-drop-scheme: normal;
  --o-page: var(--ui-page);
  --o-text: var(--ui-text);
  --o-text-strong: var(--ui-heading);
  --o-muted: var(--ui-muted);
  --o-rank: var(--ui-muted);
  --o-score: var(--ui-text);
  --o-link: var(--ui-accent);
  --o-tagline-link: var(--ui-muted);
  --o-title: var(--ui-heading);
  --o-title-visited: var(--ui-visited);
  --o-title-sticky: var(--ui-accent);
  --o-buttons: var(--ui-muted);
  --o-srbar-bg: var(--ui-surface);
  --o-srbar-text: var(--ui-muted);
  --o-srbar-sep: var(--ui-border-strong);
  --o-srbar-border: var(--ui-border);
  --o-selected: var(--ui-accent);
  --o-header-bg: var(--ui-surface);
  --o-header-border: var(--ui-border);
  --o-tab-bg: var(--ui-surface);
  --o-tab-text: var(--ui-muted);
  --o-tab-selected: var(--ui-accent);
  --o-pagename: var(--ui-heading);
  --o-logo: var(--ui-heading);
  --o-userbar-bg: var(--ui-surface);
  --o-userbar-sep: var(--ui-border);
  --o-drop-bg: var(--ui-surface);
  --o-drop-border: var(--ui-border);
  --o-drop-hover: var(--ui-subtle);
  --o-drop-rule: var(--ui-border);
  --o-flair-bg: var(--ui-subtle);
  --o-flair-text: var(--ui-muted);
  --o-flair-border: var(--ui-border);
  --o-md-text: var(--ui-text);
  --o-md-visited: var(--ui-visited);
  --o-md-box-bg: var(--ui-subtle);
  --o-md-box-border: var(--ui-border);
  --o-quote-border: var(--ui-accent);
  --o-quote-text: var(--ui-muted);
  --o-code-bg: var(--ui-subtle);
  --o-code-border: var(--ui-border);
  --o-rule: var(--ui-border);
  --o-dotted: var(--ui-border);
  --o-active-bg: var(--ui-accent-soft);
  --o-comment-bg: var(--ui-surface);
  --o-comment-alt-bg: var(--ui-surface);
  --o-comment-border: var(--ui-border);
  --o-comment-author: var(--ui-heading);
  --o-points: var(--ui-muted);
  --o-more: var(--ui-accent);
  --o-morelink-bg: var(--ui-surface);
  --o-morelink-border: var(--ui-border);
  --o-morelink-text: var(--ui-text);
  --o-box-bg: var(--ui-surface);
  --o-box-border: var(--ui-border);
  --o-input-bg: var(--ui-surface);
  --o-input-border: var(--ui-border-strong);
  --o-input-text: var(--ui-text);
  --o-btn-bg: var(--ui-subtle);
  --o-btn-border: var(--ui-border);
  --o-btn-text: var(--ui-text);
  --o-nextprev-bg: var(--ui-surface);
  --o-nextprev-border: var(--ui-border);
  --o-op-bg: var(--ui-accent);
  --o-mod: var(--ui-success);
  --o-admin: var(--ui-danger);
  --o-join-bg: var(--ui-accent);
  --o-leave-bg: var(--ui-subtle);
  --o-expando-bg: var(--ui-accent);
  --o-thumb-bg: var(--ui-subtle);
  --o-thumb-icon: var(--ui-muted);
  --o-gallery-arrows: var(--ui-accent);
  --o-gold: var(--ui-gold);
  --o-nsfw: var(--ui-danger);
  --bg-color: var(--ui-surface);
  --page-bg: var(--ui-page);
  --surface-color: var(--ui-surface);
  --bg-color-muted: var(--ui-subtle);
  --border-color: var(--ui-border);
  --text-color: var(--ui-text);
  --text-color-muted: var(--ui-muted);
  --link-color: var(--ui-accent);
  --link-visited-color: var(--ui-visited);
  --accent: var(--ui-accent);
  --error-text-color: var(--ui-danger);
  --blockquote-color: var(--ui-accent);
  --sticky-color: var(--ui-accent-soft);
  --gilded: var(--ui-gold);
  --o-arrow-up: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 15 14'%3E%3Cpath d='M7.5 2 13 7.5H9.7V12H5.3V7.5H2Z' fill='none' stroke='%238292a0' stroke-width='1.3' stroke-linejoin='round'/%3E%3C/svg%3E");
  --o-arrow-down: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 15 14'%3E%3Cpath d='M7.5 12 13 6.5H9.7V2H5.3V6.5H2Z' fill='none' stroke='%238292a0' stroke-width='1.3' stroke-linejoin='round'/%3E%3C/svg%3E");
}

body[data-theme="dark"],
body[data-theme="res"] {

  color-scheme: dark;
  --ui-page: #10171e;
  --ui-surface: #18222c;
  --ui-subtle: #1e2b37;
  --ui-hover: #263643;
  --ui-border: #2c3c49;
  --ui-border-strong: #52697a;
  --ui-text: #d6e1e9;
  --ui-heading: #eef4f8;
  --ui-muted: #9badbc;
  --ui-accent: #72d6c2;
  --ui-accent-strong: #a1e8da;
  --ui-accent-soft: #203c3b;
  --ui-visited: #a3b2c0;
  --ui-danger: #ff9baa;
  --ui-success: #7fdbad;
  --ui-gold: #e3c172;
  --ui-shadow: 0 2px 8px rgb(0 0 0 / 8%);
  --ui-shadow-menu: 0 12px 40px rgb(0 0 0 / 28%);
}

@media (prefers-color-scheme: dark) {
  body[data-theme="auto"],
  body:not([data-theme]) {
    color-scheme: dark;
    --ui-page: #10171e;
    --ui-surface: #18222c;
    --ui-subtle: #1e2b37;
    --ui-hover: #263643;
    --ui-border: #2c3c49;
    --ui-border-strong: #52697a;
    --ui-text: #d6e1e9;
    --ui-heading: #eef4f8;
    --ui-muted: #9badbc;
    --ui-accent: #72d6c2;
    --ui-accent-strong: #a1e8da;
    --ui-accent-soft: #203c3b;
    --ui-visited: #a3b2c0;
    --ui-danger: #ff9baa;
    --ui-success: #7fdbad;
    --ui-gold: #e3c172;
    --ui-shadow: 0 2px 8px rgb(0 0 0 / 8%);
    --ui-shadow-menu: 0 12px 40px rgb(0 0 0 / 28%);
  }
}

@media not all and (max-width: 767px) {

/* ---------- base ---------- */

html {
  font-size: 62.5%;
  scroll-padding-top: 2.4rem;
}

html,
body {
  background: var(--o-page);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--o-text);
  font: 1.4rem/1.5 var(--o-font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  accent-color: var(--ui-accent);
}

:root {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a,
a:visited {
  color: var(--o-link);
  text-decoration: none;
}

a:hover {
  color: var(--o-link);
  text-decoration: underline;
}

button,
input,
select,
textarea {
  font-family: var(--o-font);
}

.m-only {
  display: none !important;
}

summary {
  display: block;
  list-style: none;
  cursor: pointer;
}

summary::-webkit-details-marker {
  display: none;
}

summary::before,
details[open] summary::before,
details:not([open]) summary::before {
  content: none;
  display: none;
}

.icon {
  display: block;
  flex: none;
}

/* ---------- page grid: header, content, sidebar ---------- */

main#content {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 96rem) 30rem minmax(0, 1fr);
  gap: 0 2.4rem;
  align-content: start;
  align-items: start;
  width: 100%;
  min-height: 100vh;
}

main#content > * {
  grid-column: 1 / -1;
  min-width: 0;
}

main#content > .page-content {
  grid-column: 2;
  padding: 2.8rem 0 4rem;
}

main#content > .side {
  grid-column: 3;
  grid-row: 2;
}

/* ---------- header ---------- */

.header {
  position: relative;
  z-index: 50;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.2rem 1.6rem;
  width: 100%;
  height: auto;
  min-height: 0;
  margin: 0;
  padding: 0 var(--ui-gutter) 1.6rem;
  border: 0;
  border-bottom: 1px solid var(--o-header-border);
  background: var(--o-header-bg);
  box-shadow: var(--ui-shadow);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

#sr-header-area {
  position: relative;
  display: flex;
  flex: 0 0 100%;
  align-items: center;
  gap: 1.6rem;
  min-width: 0;
  height: 4rem;
  padding: 0;
  border-bottom: 1px solid var(--o-srbar-border);
  background: var(--o-srbar-bg);
  color: var(--o-srbar-text);
  font-size: 1.2rem;
  font-weight: 500;
  line-height: 1.5;
  text-transform: none;
  white-space: nowrap;
}

#sr-header-area a,
#sr-header-area summary {
  color: var(--o-srbar-text);
}

#sr-header-area a.selected {
  color: var(--o-selected);
}

.sr-bar {
  display: flex;
  flex: none;
  gap: 1.6rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.sr-bar::before,
.sr-bar li + li::before {
  content: none;
}

.sr-bar-subs {
  flex: 1 1 auto;
  min-width: 0;
  padding-left: 1.6rem;
  overflow: hidden;
  border-left: 1px solid var(--ui-border);
}

.sr-bar.sr-bar-subs::before {
  content: none;
}

#sr-more-link {
  flex: none;
  margin-left: auto;
  padding: 0.8rem 0;
  font-weight: 600;
}

.dropdown {
  position: relative;
  display: inline-block;
}

.dropdown > summary {
  display: inline;
}

.drop-choices {
  position: absolute;
  top: calc(100% + 0.8rem);
  left: 0;
  z-index: 100;
  min-width: 18rem;
  max-width: calc(100vw - 3.2rem);
  max-height: 60vh;
  overflow: auto;
  padding: 0.6rem;
  border: 1px solid var(--o-drop-border);
  border-radius: 1.2rem;
  background: var(--o-drop-bg);
  box-shadow: var(--ui-shadow-menu);
  line-height: 1.5;
  text-transform: none;
  white-space: nowrap;
}

.drop-choices a.choice,
.drop-choices a.choice:visited {
  display: block;
  padding: 0.8rem 1rem;
  border-radius: 0.6rem;
  color: var(--o-text);
  font-size: 1.3rem;
  white-space: nowrap;
}

.drop-choices a.choice:hover {
  background: var(--o-drop-hover);
  text-decoration: none;
}

.drop-choices a.selected {
  font-weight: bold;
}

.drop-choices.sr-list {
  width: 32rem;
  padding: 1.2rem;
  color: var(--o-text);
  font-size: 1.3rem;
}

.sr-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.2rem;
}

.sr-list .sr-list-filter {
  width: 20rem;
  min-width: 0;
  height: 3.6rem;
  margin: 0;
  padding: 0 1rem;
  border: 1px solid var(--o-input-border);
  border-radius: 0.7rem;
  background: var(--o-input-bg);
  color: var(--o-input-text);
  font: inherit;
}

.sr-list .sr-list-filter::placeholder {
  color: var(--o-muted);
  opacity: 1;
}

#sr-header-area .sr-list a,
#sr-header-area .sr-list a:visited {
  color: var(--o-link);
}

.sr-list-all {
  margin: 0;
  white-space: nowrap;
}

.sr-list-table {
  width: 100%;
  border-collapse: collapse;
  line-height: 1.6;
}

.sr-list-table th {
  padding: 0.4rem 0.8rem;
  color: var(--o-muted);
  font-size: 1.1rem;
  font-weight: 600;
  text-align: left;
}

.sr-list-table th:first-child {
  width: 14.6rem;
}

.sr-list-table th button {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.sr-list-table th[aria-sort] button::after {
  margin-left: 0.3em;
  font-size: 0.7em;
  vertical-align: 0.15em;
}

.sr-list-table th[aria-sort="ascending"] button::after {
  content: "\25B2";
}

.sr-list-table th[aria-sort="descending"] button::after {
  content: "\25BC";
}

.sr-list-table td {
  padding: 0.8rem;
  border-bottom: 1px solid var(--o-drop-rule);
}

.sr-list-table tbody tr:hover {
  background: var(--o-drop-hover);
}

.sr-visited.is-never,
.sr-list-empty {
  color: var(--o-muted);
}

.brand,
.brand:visited,
.brand:hover {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 0.8rem;
  height: 4rem;
  margin: 0 0.8rem 0 0;
  color: var(--o-logo);
  text-decoration: none;
}

.brand-mark {
  display: block;
  width: 3.2rem;
  height: 3.2rem;
}

.brand-name {
  color: var(--o-logo);
  font: 750 2.6rem/1 var(--o-font);
  letter-spacing: -0.06em;
}

.pagename {
  flex: 0 1 auto;
  min-width: 0;
  margin: 0;
  padding-left: 2rem;
  border-left: 1px solid var(--ui-border);
  font-size: 1.5rem;
  font-weight: 650;
  line-height: 2.4rem;
  text-transform: none;
}

.pagename a,
.pagename a:visited {
  display: block;
  max-width: 20rem;
  overflow: hidden;
  color: var(--o-pagename);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tabmenu {
  display: flex;
  flex: 0 1 auto;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  white-space: nowrap;
}

.tabmenu li {
  margin: 0;
  font-size: 1.3rem;
  font-weight: 600;
}

.tabmenu li a,
.tabmenu li a:visited {
  display: block;
  padding: 0.9rem 1.2rem;
  border: 1px solid transparent;
  border-radius: 0.8rem;
  background: transparent;
  color: var(--o-tab-text);
  line-height: 1.6rem;
}

.tabmenu li a:hover {
  background: var(--ui-subtle);
  color: var(--o-text-strong);
  text-decoration: none;
}

.tabmenu li.selected a,
.tabmenu li.selected a:visited {
  margin: 0;
  padding: 0.9rem 1.2rem;
  border: 1px solid transparent;
  background: var(--ui-accent-soft);
  color: var(--o-tab-selected);
}

.header .account-nav {
  position: static;
  display: flex;
  flex: none;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.8rem;
  margin: 0 0 0 auto;
  padding: 0;
  border-radius: 0;
  background: none;
  color: var(--o-userbar-sep);
  font-size: 1.2rem;
  line-height: 1.5;
  white-space: nowrap;
}

.header .account-nav a,
.header .account-nav a:visited,
.header .account-nav .account-link,
.header .account-nav .logout-link {
  display: inline-flex;
  align-items: center;
  max-width: 16rem;
  min-height: 3.6rem;
  padding: 0.6rem 0.4rem;
  border-radius: 0.6rem;
  background: none;
  color: var(--o-muted);
  font-size: 1.2rem;
  font-weight: 500;
  overflow-wrap: anywhere;
}

.header .account-nav a:hover {
  background: none;
  text-decoration: underline;
}

.header .account-nav .separator {
  display: none;
}

/* ---------- listing ---------- */

.hero.feed-hero {
  display: none;
}

#posts-container {
  display: block;
  width: auto;
  margin: 0;
  padding: 0;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: none;
}

.post {
  width: auto;
  margin: 0 0 1.2rem;
  padding: 0;
  background: none;
  font-size: 1.3rem;
}

.post-container,
.post-container.compact,
.post-container.card,
.post-container.sticky,
.post-container:target {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: auto auto auto auto minmax(0, 1fr);
  grid-template-rows: auto auto auto auto 1fr;
  grid-template-areas:
    "rank midcol thumb title   title"
    "rank midcol thumb exbtn   tagline"
    "rank midcol thumb exbtn   buttons"
    "rank midcol thumb preview preview"
    "rank midcol thumb expando expando";
  align-items: start;
  gap: 0.4rem 0;
  margin: 0;
  padding: 2rem;
  border: 1px solid var(--ui-border);
  border-radius: var(--ui-radius);
  outline: 0;
  background: var(--ui-surface);
  box-shadow: var(--ui-shadow);
}

.post-info,
.post-text,
.post-text.card,
.post-text.compact {
  display: contents;
}

.post-actions,
.post-container > details summary,
.close-media,
.self-post-expando,
.post-container > details.link-details {
  display: none;
}

.rank {
  grid-area: rank;
  align-self: start;
  min-width: calc(var(--rank-digits, 2) * 1.1ex);
  margin: 2.8rem 0.8rem 0 0;
  color: var(--o-rank);
  font: 500 1.1rem/1.5 var(--o-font);
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}

.midcol {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  color: var(--o-score);
  font: 650 1.2rem/1.5 var(--o-font);
  font-variant-numeric: tabular-nums;
}

.post-container > .midcol {
  grid-area: midcol;
  width: max(3.2rem, calc(var(--score-chars, 3) * 0.75rem));
  margin: 0.4rem 1.6rem 0 0;
}

.arrow {
  display: block;
  flex: none;
  width: 1.7rem;
  height: 1.6rem;
  margin: 0;
  background: center / contain no-repeat;
}

.arrow.up {
  background-image: var(--o-arrow-up);
}

.arrow.down {
  background-image: var(--o-arrow-down);
}

.midcol .score {
  line-height: 1.8rem;
  white-space: nowrap;
}

.media-preview,
.media-preview.self-post-preview,
.media-preview.no-thumb {
  grid-area: thumb;
  display: block;
  flex: none;
  width: 9.6rem;
  height: 8rem;
  margin: 0 1.8rem 0 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--ui-border);
  border-radius: 1rem;
  background: var(--ui-subtle);
}

.media-preview img,
.media-preview video {
  display: block;
  width: 100%;
  height: 8rem;
  max-height: none;
  border-radius: 0;
  object-fit: cover;
  cursor: pointer;
}

.media-preview a {
  display: block;
  width: auto;
  height: auto;
  padding: 0;
  font-size: inherit;
}

.self-post-link,
.media-preview .self-post-link {
  display: grid;
  width: 100%;
  height: 100%;
  min-height: 7.8rem;
  margin: 0;
  padding: 0;
  place-items: center;
  border-radius: 0;
  background: var(--o-thumb-bg);
  color: var(--o-thumb-icon);
}

.media-preview .self-post-link:hover {
  background: var(--o-thumb-bg);
}

.self-post-icon {
  width: 3rem;
  height: 3rem;
  fill: var(--o-thumb-icon);
  stroke: none;
}

.self-post-icon-lines {
  fill: none;
  stroke: var(--o-thumb-bg);
  stroke-linecap: round;
  stroke-width: 1.5;
}

.link-preview,
.media-preview .link-preview {
  display: grid;
  width: 100%;
  height: 100%;
  min-height: 7.8rem;
  place-items: center;
  border-radius: 0;
  background: var(--o-thumb-bg);
  color: var(--o-thumb-icon);
}

.media-preview .link-preview:hover,
.media-preview .link-preview:focus-visible {
  background: var(--o-thumb-bg);
  color: var(--o-thumb-icon);
}

.link-preview .icon {
  width: 2.6rem;
  height: 2.6rem;
  stroke-width: 1.6;
}

.title-container,
.title-container.card,
.title-container.compact {
  grid-area: title;
  margin: 0 0 0.4rem;
  font-size: 1.7rem;
  line-height: 1.45;
}

.title-container > a,
.title-container > a.card,
.title-container > a.compact,
.title-container > a:visited {
  display: inline;
  margin-right: 0.4em;
  color: var(--o-title);
  font-size: inherit;
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: inherit;
  text-wrap: pretty;
  overflow-wrap: anywhere;
}

.title-container > a:visited {
  color: var(--o-title-visited);
}

.post-container.sticky .title-container > a {
  color: var(--o-title-sticky);
  font-weight: bold;
}

.linkflairlabel {
  display: inline-block;
  max-width: 20em;
  margin: 0 0.5em 0 0;
  padding: 0.2rem 0.7rem;
  overflow: hidden;
  border: 1px solid var(--flair-color, var(--o-flair-border));
  border-radius: 0.5rem;
  background: var(--o-flair-bg);
  color: var(--o-flair-text);
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.5rem;
  text-overflow: ellipsis;
  vertical-align: middle;
  white-space: nowrap;
}

.domain,
.title-container .domain {
  display: inline;
  max-width: none;
  margin: 0;
  overflow: visible;
  color: var(--o-muted);
  font-size: 1.1rem;
  font-weight: 400;
  line-height: 1.5;
  overflow-wrap: anywhere;
  white-space: normal;
}

.domain a,
.domain a:visited {
  color: var(--o-muted);
}

.tagline,
.post-meta {
  margin: 0;
  color: var(--o-muted);
  font-size: 1.2rem;
  font-weight: 400;
  line-height: 1.7;
}

.post-container > .post-info .post-meta {
  grid-area: tagline;
  display: block;
  order: 0;
}

.tagline a,
.tagline a:visited {
  color: var(--o-tagline-link);
  font-weight: normal;
}

.tagline .edited-timestamp {
  font-size: 1.1rem;
}

.tagline .userattrs {
  color: var(--o-muted);
}

.tagline .userattrs .submitter {
  color: var(--o-tagline-link);
}

.tagline .moderator,
.tagline .userattrs .moderator,
.stickied-tagline {
  color: var(--o-mod);
}

.tagline .admin,
.tagline .userattrs .admin {
  color: var(--o-admin);
}

.buttons {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.2rem 0.6rem;
  margin: 0;
  padding: 0.2rem 0 0;
  list-style: none;
  font-size: 1.15rem;
  line-height: 1.6;
}

.post-container > .post-info .buttons {
  grid-area: buttons;
}

.buttons li {
  margin: 0;
}

.buttons a,
.buttons a:visited,
.buttons button {
  display: inline-flex;
  align-items: center;
  min-height: 2.8rem;
  margin: 0;
  padding: 0.3rem 0.6rem;
  border: 0;
  border-radius: 0.6rem;
  background: none;
  color: var(--o-buttons);
  font: 550 1.15rem/1.6 var(--o-font);
  cursor: pointer;
}

.buttons a:hover,
.buttons button:hover {
  background: var(--ui-subtle);
  color: var(--ui-accent);
  text-decoration: none;
}

.buttons button.is-copied::after {
  content: " — link copied";
  font-weight: normal;
}

.stamp {
  display: inline-block;
  padding: 0.1rem 0.5rem;
  border: 1px solid currentColor;
  border-radius: 0.4rem;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.5;
}

.nsfw-stamp {
  color: var(--o-nsfw);
}

.spoiler-stamp {
  color: var(--o-muted);
}

.gilded-stamp {
  color: var(--o-gold);
  font-weight: bold;
}

.expando-button {
  grid-area: exbtn;
  align-self: center;
  width: 2.8rem;
  height: 2.8rem;
  min-height: 0;
  margin: 0 0.8rem 0 0;
  padding: 0;
  border: 0;
  border-radius: 0.7rem;
  background: #087f75 var(--expando-icon) center / 100% 100% no-repeat;
  cursor: pointer;
}

.expando-button.image {
  --expando-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 23 23' fill='white'%3E%3Cpath fill-rule='evenodd' d='M5 7.5h2.6l1-1.6h4.3l1 1.6H16c.6 0 1 .4 1 1v6.2c0 .6-.4 1-1 1H5c-.6 0-1-.4-1-1V8.5c0-.6.4-1 1-1Zm5.5 1.6a2.4 2.4 0 1 0 0 4.8 2.4 2.4 0 0 0 0-4.8Z'/%3E%3Cpath d='M17 15.5h1.6v1.9h1.9V19h-1.9v1.9H17V19h-1.9v-1.6H17Z'/%3E%3C/svg%3E");
}

.expando-button.gallery {
  --expando-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 23 23' fill='white'%3E%3Cpath fill-rule='evenodd' d='M4 5h11v9H4Zm1.4 1.4v6.2h8.2V6.4Z'/%3E%3Ccircle cx='7' cy='8' r='1'/%3E%3Cpath d='M5.4 12.6 8 9.8l1.7 1.7 1.6-1.4 2.3 2.5ZM16 7h1v9H6v-1h10Z'/%3E%3Cpath d='M17 15.5h1.6v1.9h1.9V19h-1.9v1.9H17V19h-1.9v-1.6H17Z'/%3E%3C/svg%3E");
}

.expando-button.video {
  --expando-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 23 23' fill='white'%3E%3Cpath d='M7.5 5.8v9.4l7.6-4.7Z'/%3E%3Cpath d='M17 15.5h1.6v1.9h1.9V19h-1.9v1.9H17V19h-1.9v-1.6H17Z'/%3E%3C/svg%3E");
}

.expando-button.selftext {
  --expando-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 23 23' fill='white'%3E%3Crect x='4.5' y='6' width='10' height='1.7' rx='.85'/%3E%3Crect x='4.5' y='9.4' width='10' height='1.7' rx='.85'/%3E%3Crect x='4.5' y='12.8' width='5.4' height='1.7' rx='.85'/%3E%3Cpath d='M17 15.5h1.6v1.9h1.9V19h-1.9v1.9H17V19h-1.9v-1.6H17Z'/%3E%3C/svg%3E");
}

.expando-button[aria-expanded="true"] {
  border-radius: 0.7rem;
  --expando-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 23 23'%3E%3Cpath d='m8 8 7 7m0-7-7 7' stroke='white' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E");
}

.expando-button:hover {
  filter: brightness(1.06);
}

.post-container > details,
.post-container > details.card,
.post-container > details.compact {
  grid-area: expando;
  width: auto;
  min-width: 0;
  margin: 0;
  padding: 0;
}

.post-container > details[open],
.post-container > details.card[open] {
  margin: 1.2rem 0 0;
  padding: 0;
}

.image-viewer,
.post-container details .image-viewer {
  position: relative;
  display: block;
  width: auto;
  max-width: 100%;
  overflow: hidden;
  border-radius: 1rem;
  background: none;
  aspect-ratio: auto;
}

.image-viewer::before {
  content: none;
}

.image-viewer > a,
.image-viewer .gallery-item > a {
  display: inline-block;
  max-width: 100%;
}

.image-viewer img,
.image-viewer video,
.post-container details .image-viewer img,
.post-container details .image-viewer video {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 75vh;
  margin: 0;
  border-radius: 1rem;
  object-fit: contain;
  cursor: pointer;
}

.image-viewer video {
  background: #000000;
}

.gallery-controls {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  margin: 0 0 1rem;
  color: var(--o-muted);
  font-size: 1.2rem;
}

.gallery-step {
  display: grid;
  width: 3.6rem;
  height: 3.6rem;
  min-height: 0;
  padding: 0;
  place-items: center;
  border: 1px solid var(--ui-border);
  border-radius: 0.8rem;
  background: var(--ui-subtle);
  color: var(--o-gallery-arrows);
  font: 400 2.4rem/1 var(--o-font);
  cursor: pointer;
}

.image-viewer .gallery,
.post-container details .gallery {
  display: block;
  width: auto;
  height: auto;
  margin: 0;
  padding: 0;
  overflow: visible;
  scroll-snap-type: none;
}

.image-viewer .gallery-item,
.post-container details .gallery-item {
  display: none;
  width: auto;
  max-width: 100%;
  height: auto;
  margin: 0;
}

.image-viewer .gallery-item.is-current {
  display: block;
}

.gallery-item-idx {
  display: none;
}

.spoiler {
  border-radius: 0;
}

.self-post-body,
.post-container .self-post-body {
  position: static;
  width: auto;
  max-width: 72ch;
  max-height: none;
  margin: 0;
  padding: var(--o-md-box-padding);
  overflow: visible;
  border: 1px solid var(--o-md-box-border);
  border-radius: 1rem;
  background: var(--o-md-box-bg);
  color: var(--o-md-text);
  font-size: 1.5rem;
  line-height: 1.75;
  overflow-wrap: anywhere;
}

.self-text-overflow.card {
  grid-area: preview;
  max-width: 72ch;
  max-height: none;
  margin: 0.6rem 0 0;
  padding: 0;
  overflow: hidden;
  color: var(--o-md-text);
  font-size: 1.4rem;
  line-height: 1.7;
}

.post-container:has(> details[open]) .self-text-overflow {
  display: none;
}

.self-text.card {
  -webkit-line-clamp: 3;
  line-clamp: 3;
}

.self-text.card > * {
  margin: 0;
}

.self-text-spoiler,
.self-text-spoiler.card {
  display: inline-block;
  width: auto;
  min-height: 0;
  margin: 0 0 0.5rem;
  padding: 0.2rem 0.8rem;
  border: 1px solid var(--o-btn-border);
  border-radius: 0.3rem;
  background: var(--o-btn-bg);
  color: var(--o-btn-text);
  font-size: 1.1rem;
  font-weight: bold;
}

.self-text-spoiler:hover,
.self-text-spoiler[aria-expanded="true"] {
  border-color: var(--o-btn-border);
  background: var(--o-btn-bg);
}

.menuarea {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin: 0 0 1.6rem;
  padding: 0 0 1.6rem;
  border-bottom: 1px solid var(--o-rule);
  color: var(--o-muted);
  font-size: 1.3rem;
}

.lightdrop > summary {
  color: var(--o-link);
  text-decoration: underline;
}

.lightdrop > summary::after {
  content: " ▾";
  text-decoration: none;
}

.footer {
  display: block;
  width: auto;
  margin: 2.4rem 0 0;
  padding: 0;
  border: 0;
  color: var(--o-muted);
  font-size: 1.3rem;
}

.footer-item {
  margin: 0;
}

.footer-item a,
.footer-item a:visited {
  display: inline-flex;
  align-items: center;
  min-height: 4rem;
  margin-left: 0.8rem;
  padding: 0.8rem 1.6rem;
  border: 1px solid var(--o-nextprev-border);
  border-radius: 0.8rem;
  background: var(--o-nextprev-bg);
  color: var(--o-link);
  font-size: 1.3rem;
  font-weight: 600;
}

.page-divider {
  margin: 1.2rem 0;
  padding: 0;
  border: 0;
  border-top: 1px solid var(--o-rule);
  background: none;
  color: transparent;
  font-size: 0;
  line-height: 0;
  opacity: 1;
}

.page-divider[data-page] {
  margin: 2rem 0;
  padding: 1rem;
  border: 1px solid var(--ui-border);
  border-radius: 0.8rem;
  background: var(--ui-subtle);
  text-align: center;
}

.page-divider[data-page]::after {
  content: "Page " attr(data-page);
  color: var(--o-muted);
  font-size: 1.2rem;
  line-height: 2rem;
}

#loading-indicator {
  padding: 1.6rem;
  color: var(--o-muted);
  font-size: 1.3rem;
  text-align: center;
}

/* ---------- rich text ---------- */

.self-text,
.comment-body,
.usertext-body {
  color: var(--o-md-text);
  overflow-wrap: break-word;
}

:is(.self-text, .comment-body, .usertext-body) p {
  margin: 0 0 0.9em;
}

:is(.self-text, .comment-body, .usertext-body) .md > :last-child,
:is(.self-text, .comment-body, .usertext-body) > :last-child {
  margin-bottom: 0;
}

:is(.self-text, .comment-body, .usertext-body) a,
:is(.self-text, .comment-body, .usertext-body) a:visited {
  color: var(--o-link);
}

:is(.self-text, .comment-body) a:visited {
  color: var(--o-md-visited);
}

:is(.self-text, .comment-body, .usertext-body) blockquote {
  margin: 1em 0;
  padding: 0.2em 1em;
  border-left: 3px solid var(--o-quote-border);
  color: var(--o-quote-text);
}

:is(.self-text, .comment-body, .usertext-body) pre {
  width: auto;
  margin: 1em 0;
  padding: 1.2rem 1.6rem;
  overflow: auto;
  border: 1px solid var(--o-code-border);
  border-radius: 0.8rem;
  background: var(--o-code-bg);
}

:is(.self-text, .comment-body, .usertext-body) code {
  padding: 0.1em 0.35em;
  border: 1px solid var(--o-code-border);
  border-radius: 0.4rem;
  background: var(--o-code-bg);
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 0.9em;
}

:is(.self-text, .comment-body, .usertext-body) pre code {
  padding: 0;
  border: 0;
  background: none;
}

:is(.self-text, .comment-body, .usertext-body) ul,
:is(.self-text, .comment-body, .usertext-body) ol {
  margin: 0 0 0.5em;
  padding-left: 2em;
}

:is(.self-text, .comment-body, .usertext-body) li {
  margin: 0.2em 0;
}

:is(.self-text, .comment-body, .usertext-body) hr {
  height: 0;
  margin: 0.8em 0;
  border: 0;
  border-top: 2px solid var(--o-rule);
}

:is(.self-text, .comment-body, .usertext-body) :is(h1, h2, h3, h4, h5, h6) {
  margin: 0.6em 0 0.4em;
  color: var(--o-text-strong);
  font-weight: bold;
  line-height: 1.25;
}

:is(.self-text, .comment-body, .usertext-body) h1,
:is(.self-text, .comment-body, .usertext-body) h2 {
  font-size: 1.5em;
}

:is(.self-text, .comment-body, .usertext-body) h3 {
  font-size: 1.3em;
}

:is(.self-text, .comment-body, .usertext-body) h4 {
  font-size: 1.15em;
}

:is(.self-text, .comment-body, .usertext-body) h5,
:is(.self-text, .comment-body, .usertext-body) h6 {
  font-size: 1em;
}

:is(.self-text, .comment-body, .usertext-body) table {
  display: block;
  max-width: 100%;
  margin: 1em 0;
  overflow-x: auto;
  border-collapse: collapse;
}

:is(.self-text, .comment-body, .usertext-body) :is(th, td) {
  padding: 0.6em 0.9em;
  border: 1px solid var(--o-rule);
}

:is(.self-text, .comment-body, .usertext-body) img {
  max-width: 100%;
  height: auto;
  border-radius: 0.8rem;
}

.md-spoiler-text {
  border-radius: 0.2rem;
  background: var(--o-text);
  color: transparent;
}

.md-spoiler-text:hover {
  background: none;
  color: inherit;
}

/* ---------- comments page ---------- */

.post-hero,
.hero.post-hero {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: auto auto auto minmax(0, 1fr);
  grid-template-rows: auto auto auto auto 1fr;
  grid-template-areas:
    "midcol thumb title title"
    "midcol thumb exbtn tagline"
    "midcol thumb exbtn buttons"
    "midcol thumb media media"
    "midcol thumb body  body";
  align-items: start;
  gap: 0.6rem 0;
  width: auto;
  margin: 0;
  padding: 2.4rem;
  border: 1px solid var(--ui-border);
  border-radius: var(--ui-radius);
  background: var(--ui-surface);
  box-shadow: var(--ui-shadow);
  color: var(--o-text);
  font-size: 1.4rem;
}

.post-hero > hr {
  display: none;
}

.post-hero > .midcol {
  grid-area: midcol;
  width: max(3.2rem, calc(var(--score-chars, 3) * 0.75rem));
  margin: 0.4rem 1.6rem 0 0;
}

.post-hero > .thumbnail {
  grid-area: thumb;
  width: 9.6rem;
  min-height: 8rem;
  margin: 0 1.8rem 0 0;
  overflow: hidden;
  border: 1px solid var(--ui-border);
  border-radius: 1rem;
  background: var(--ui-subtle);
}

.post-hero > .thumbnail img {
  display: block;
  width: 100%;
  height: 8rem;
  object-fit: cover;
}

.post-hero > .expando-button {
  grid-area: exbtn;
}

.post-hero .post-title {
  grid-area: title;
  margin: 0 0 0.4rem;
  color: var(--o-text-strong);
  font-size: clamp(2rem, 2vw, 2.6rem);
  font-weight: 650;
  letter-spacing: -0.025em;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.post-hero .post-title .domain,
.post-hero .post-title .title-text + .linkflairlabel {
  margin-left: 0.4em;
}

.post-hero > .tagline {
  grid-area: tagline;
}

.post-hero > .buttons {
  grid-area: buttons;
}

.post-hero > .image-viewer.main-content {
  grid-area: media;
  margin: 0.6rem 0 0.4rem;
}

.post-hero > .image-viewer.main-content[hidden] {
  display: none;
}

.post-hero > .image-viewer.main-content:empty {
  display: none;
}

.post-hero .post-media,
.image-viewer.main-content img,
.image-viewer.main-content video {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 80vh;
  margin: 0;
  padding: 0;
}

.post-hero > .self-text {
  grid-area: body;
  max-width: 72ch;
  margin: 1.2rem 0 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  font-size: 1.6rem;
  line-height: 1.8;
}

.comments-container {
  width: auto;
  margin: 2.4rem 0 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  color: var(--o-text);
  font-size: 1.3rem;
}

main#content > .comments-container {
  grid-column: 2 / 4;
  padding: 2.8rem 0 4rem;
}

main#content > .comments-container > a {
  display: inline-block;
  margin: 0 0 1rem;
  font-size: 1.2rem;
}

.panestack-title {
  margin: 0 0 1.6rem;
  padding: 0 0 1.2rem;
  border-bottom: 1px solid var(--o-rule);
}

.panestack-title .title {
  color: var(--o-text-strong);
  font-size: 1.6rem;
  font-weight: 650;
}

.comment,
.comment.first,
.comment.sticky {
  position: relative;
  width: auto;
  margin: 0 0 1.2rem;
  padding: 1.8rem 1.8rem 1rem 4.6rem;
  border: 1px solid var(--o-comment-border);
  border-radius: 1.2rem;
  background: var(--o-comment-bg);
}

.comment.alt {
  background: var(--o-comment-alt-bg);
}

.comment > details > summary {
  display: block;
  padding: 0;
}

.comment > details > summary .midcol {
  position: absolute;
  top: 1.8rem;
  left: 1.4rem;
  gap: 0.8rem;
}

.comment > details:not([open]) > summary .midcol {
  display: none;
}

.comment-info-container {
  display: block;
  margin: 0;
  font-size: 1.2rem;
}

.comment .tagline {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.3rem 0.8rem;
  line-height: 1.7;
}

.comment .tagline .expand {
  color: var(--o-tagline-link);
}

.comment > details[open] > summary .expand::before {
  content: "[–]";
}

.comment > details:not([open]) > summary .expand::before {
  content: "[+]";
}

.comment .tagline .author,
.comment .tagline .author:visited {
  color: var(--o-comment-author);
  font-weight: bold;
}

.tagline .author.submitter,
.tagline .author.moderator,
.tagline .author.admin {
  padding: 0 0.2rem;
  border-radius: 0.3rem;
  color: #ffffff;
}

.tagline .author.submitter {
  background: var(--o-op-bg);
}

.tagline .author.moderator {
  background: var(--o-mod);
}

.tagline .author.admin {
  background: var(--o-admin);
}

.tagline .author.submitter:visited,
.tagline .author.moderator:visited,
.tagline .author.admin:visited {
  color: #ffffff;
}

.comment .tagline .score {
  color: var(--o-points);
  font-weight: bold;
}

.comment .tagline .score.score-hidden {
  color: var(--o-muted);
  font-weight: normal;
}

.tagline .flair {
  display: inline-block;
  max-width: 20em;
  padding: 0 0.2rem;
  overflow: hidden;
  border: 1px solid var(--o-flair-border);
  border-radius: 0.2rem;
  background: var(--o-flair-bg);
  color: var(--o-flair-text);
  font-size: 0.9rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.comment > details[open] > summary .numchildren {
  display: none;
}

.comment > details:not([open]) > summary .tagline,
.comment > details:not([open]) > summary .tagline .author {
  font-style: italic;
}

.comment > details:not([open]) > summary .tagline .author:not(.submitter, .moderator, .admin) {
  color: var(--o-muted);
}

.comment-content {
  position: static;
}

.comment-body {
  display: block;
  max-width: none;
  padding: 0.8rem 0;
  color: var(--o-md-text);
  font-size: 1.5rem;
  line-height: 1.75;
  text-align: left;
}

.comment-body img {
  max-width: 100%;
}

.comment-body > .md {
  max-width: 72ch;
}

.comment-content > .buttons {
  padding: 0.1rem 0 0.4rem;
}

.replies {
  margin: 1.2rem 0 0;
  padding: 0 0 0 1.2rem;
  border-left: 1px solid var(--ui-border-strong);
}

.replies > .comment {
  margin: 0 0 0.8rem;
  padding: 1.2rem 0 0.4rem 3rem;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.more,
.more.first {
  width: auto;
  margin: 0.2rem 0 0.8rem;
  padding: 0;
  border: 0;
}

.comments-container > .more {
  margin-left: 1.5rem;
}

.more a,
.more a:visited,
.more button {
  display: inline-flex;
  align-items: center;
  min-height: 3.6rem;
  padding: 0.6rem 1rem;
  border: 0;
  border-radius: 0.7rem;
  background: var(--ui-accent-soft);
  color: var(--o-more);
  font-size: 1.2rem;
  font-weight: 600;
}

.more .more-count {
  color: var(--o-muted);
  font-weight: normal;
}

.more button:disabled {
  cursor: wait;
}

.more-status {
  color: var(--o-muted);
}

/* ---------- sidebar ---------- */

.side {
  width: 30rem;
  margin: 2.8rem 0 4rem;
  color: var(--o-text);
  font-size: 1.3rem;
}

.side > * + * {
  margin-top: 1.6rem;
}

.search-box {
  position: relative;
  display: block;
  width: auto;
  max-width: none;
  margin: 0;
}

.search-box input[type="search"] {
  display: block;
  width: 100%;
  height: 4.4rem;
  margin: 0;
  padding: 0 4.4rem 0 1.4rem;
  border: 1px solid var(--ui-border);
  border-radius: 1rem;
  background: var(--o-input-bg);
  color: var(--o-input-text);
  font-size: 1.4rem;
}

.search-box input[type="search"]::placeholder {
  color: var(--o-muted);
}

.search-box button {
  position: absolute;
  top: 0;
  right: 0;
  display: grid;
  width: 4.4rem;
  height: 4.4rem;
  min-height: 0;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 1rem;
  background: none;
  color: var(--o-muted);
}

.search-box .icon {
  width: 1.8rem;
  height: 1.8rem;
}

.search-expando {
  display: none;
  margin-top: 0.8rem;
  padding: 1.4rem;
  border: 1px solid var(--ui-border);
  border-radius: 1rem;
  background: var(--o-box-bg);
  box-shadow: var(--ui-shadow);
}

.search-box:focus-within .search-expando {
  display: block;
}

.search-advanced {
  margin: 0.8rem 0 0;
  color: var(--o-muted);
}

.morelink,
.morelink:visited {
  display: block;
  padding: 1.2rem 1.6rem;
  border: 1px solid var(--o-morelink-border);
  border-radius: 1rem;
  background: var(--o-morelink-bg);
  color: var(--o-morelink-text);
  font-size: 1.3rem;
  font-weight: 600;
  letter-spacing: 0;
  line-height: 2rem;
  text-align: left;
}

.morelink:hover {
  border-color: var(--o-link);
  color: var(--o-morelink-text);
  text-decoration: none;
}

.titlebox {
  margin-top: 1.6rem;
  padding: 2rem;
  border: 1px solid var(--ui-border);
  border-radius: var(--ui-radius);
  background: var(--ui-surface);
  box-shadow: var(--ui-shadow);
}

.side > .titlebox {
  margin-top: 1.6rem;
}

.titlebox-name {
  margin: 0 0 1.6rem;
  font-size: 1.9rem;
  font-weight: 650;
  letter-spacing: -0.025em;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.titlebox-name a,
.titlebox-name a:visited {
  color: var(--o-text-strong);
}

.subscribe-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3.6rem;
  margin: 0 0 1.2rem;
  padding: 0.6rem 1.6rem;
  border: 1px solid transparent;
  border-radius: 0.8rem;
  background: #087f75;
  color: #ffffff;
  font: 600 1.3rem/1.5 var(--o-font);
  cursor: pointer;
}

.subscribe-button.is-joined {
  border-color: var(--ui-border);
  background: var(--ui-subtle);
  color: var(--ui-text);
}

.subscribe-button:disabled {
  opacity: 0.6;
}

.titlebox-counts {
  margin: 0 0 1.6rem;
  color: var(--o-muted);
  font-size: 1.2rem;
  line-height: 1.9;
}

.titlebox-counts .number {
  color: var(--o-text-strong);
  font-weight: bold;
}

.titlebox .usertext-body {
  padding-top: 1.6rem;
  border-top: 1px solid var(--o-rule);
  font-size: 1.3rem;
  line-height: 1.75;
}

.titlebox .usertext-body :is(h1, h2) {
  margin: 0.2em 0 0.4em;
}

.titlebox-age {
  margin: 1.6rem 0 0;
  padding-top: 1.2rem;
  border-top: 1px solid var(--o-rule);
  color: var(--o-muted);
  font-size: 1.15rem;
}

.linkinfo {
  padding: 1.8rem 2rem;
  border: 1px solid var(--o-box-border);
  border-radius: var(--ui-radius);
  background: var(--o-box-bg);
  color: var(--o-text);
}

.linkinfo p {
  margin: 0;
}

.linkinfo .date {
  font-size: 1.2rem;
}

.linkinfo .score {
  margin: 0.8rem 0 1.2rem;
  font-size: 1.2rem;
}

.linkinfo .score .number {
  font-size: 2rem;
  font-weight: bold;
}

.linkinfo .score .word {
  font-size: 1.6rem;
  font-weight: bold;
}

.linkinfo .shortlink {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.6rem;
  width: auto;
  margin: 0;
  font-size: 1.2rem;
}

.linkinfo .shortlink input {
  flex: 1;
  width: 100%;
  min-width: 0;
  margin: 0;
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--o-code-border);
  border-radius: 0.6rem;
  background: var(--o-input-bg);
  color: var(--o-input-text);
  font: 1.2rem/1.5 ui-monospace, monospace;
}

/* ---------- RES keyboard selection ---------- */

.post-container.res-selected::before,
.post-hero.res-selected::before {
  content: none;
}

.post-container.res-selected::before {
  grid-column: 4 / -1;
}

.post-hero.res-selected::before {
  grid-column: 3 / -1;
}

.comment.res-selected > details > summary,
.comment.res-selected > details > .comment-content > .comment-body,
.comment.res-selected > details > .comment-content > .buttons {
  background: var(--o-active-bg);
}

/* ---------- utility pages ---------- */

main#content > .hero {
  grid-column: 2 / 4;
  justify-self: start;
  width: 100%;
  max-width: 96rem;
  margin: 2.8rem 0 4rem;
  padding: 2.8rem;
  border: 1px solid var(--ui-border);
  border-radius: var(--ui-radius);
  background: var(--ui-surface);
  color: var(--o-text);
  font-size: 1.4rem;
  line-height: 1.7;
}

main#content > .hero h1 {
  margin: 0 0 2rem;
  color: var(--o-text-strong);
  font-size: 2.6rem;
  font-weight: 650;
  letter-spacing: -0.03em;
  line-height: 1.3;
}

main#content > .hero h2 {
  margin: 2.8rem 0 1.2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--o-rule);
  color: var(--o-text-strong);
  font-size: 1.8rem;
  font-weight: 600;
}

main#content > .hero hr {
  margin: 1.5rem 0;
  border: 0;
  border-top: 1px dotted var(--o-dotted);
}

main#content > .hero form,
main#content > .hero .search-bar {
  width: auto;
  max-width: 60rem;
  align-items: stretch;
}

main#content > .hero form:not(.search-bar) > button[type="submit"] {
  align-self: flex-start;
}

main#content > .hero code {
  padding: 0 0.3em;
  border: 1px solid var(--o-code-border);
  background: var(--o-code-bg);
  font-size: 0.93em;
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="search"],
select,
textarea,
#subs-filter,
#bulk-input,
.api-key-input,
.dashboard-fieldset select {
  max-width: 100%;
  min-height: 4rem;
  margin: 0.6rem 0;
  padding: 0.9rem 1.2rem;
  border: 1px solid var(--o-input-border);
  border-radius: 0.8rem;
  background: var(--o-input-bg);
  color: var(--o-input-text);
  font-size: 1.4rem;
  line-height: 1.5;
}

button,
form input[type="submit"],
.submit-button button,
.search-button,
.danger-btn,
.add-bulk-btn,
.bulk-actions button,
#bulk-add-btn,
#bulk-clear-btn {
  min-height: 3.6rem;
  padding: 0.8rem 1.4rem;
  border: 1px solid var(--o-btn-border);
  border-radius: 0.8rem;
  background: var(--o-btn-bg);
  color: var(--o-btn-text);
  font-size: 1.3rem;
  font-weight: 600;
  line-height: 1.5;
  cursor: pointer;
}

.danger-btn {
  border-color: var(--ui-danger);
  background: transparent;
  color: var(--ui-danger);
}

.search-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  width: auto;
}

.search-input {
  flex: 1;
  min-width: 0;
}

.search-button {
  flex: none;
  margin: 0.6rem 0;
}

.search-results {
  gap: 1.2rem;
  margin-top: 1rem;
}

.search-options {
  display: grid;
  justify-items: start;
  gap: 1rem;
  margin: 0.8rem 0 0;
  color: var(--o-text);
  font-size: 1.3rem;
}

.search-options label {
  display: inline-flex;
  flex-basis: auto;
  align-items: center;
  gap: 0.4rem;
  width: auto;
  margin: 0;
}

.search-selects {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1.5rem;
}

.search-options select {
  min-height: 3.6rem;
  margin: 0;
  padding: 0.5rem 0.8rem;
  font-size: 1.3rem;
}

.search-community {
  margin: 0 0 1.2rem;
}

main#content > .hero .search-community-name {
  margin: 0;
  font-size: 1.6rem;
  font-weight: normal;
}

.search-community-meta,
.search-more {
  margin: 0.2rem 0;
  color: var(--o-muted);
  font-size: 1.1rem;
}

.search-community-meta .subscribe-button {
  margin: 0 0.6rem 0 0;
}

.search-community-description {
  margin: 0.2rem 0;
}

main#content > .hero .search-menus {
  margin: 2rem 0 1rem;
  padding: 0 0 0.3rem;
}

main#content > .hero .search-menus h2 {
  margin: 0 auto 0 0;
  padding: 0;
  border: 0;
  color: var(--o-muted);
  font-size: 1.6rem;
}

main#content > .hero .sub-title {
  display: flex;
  align-items: center;
  gap: 1rem;
}

main#content > .hero .sub-title :is(h3, h4) {
  margin: 0.4rem 0;
  font-size: 1.4rem;
}

#subs-list .sub-title {
  padding: 0.2rem 0;
  border-bottom: 1px dotted var(--o-rule);
}

#button-container {
  margin: 0;
}

.subs-header {
  margin-bottom: 1rem;
}

.subs-controls {
  margin-bottom: 1rem;
}

#bulk-add-container,
.dashboard-fieldset {
  min-width: 0;
  margin: 1.6rem 0;
  padding: 1.6rem;
  border: 1px solid var(--o-box-border);
  border-radius: 1rem;
  background: var(--ui-subtle);
}

.dashboard-fieldset legend,
.dashboard-help,
.bulk-add-label,
.empty-state {
  color: var(--o-muted);
}

.invite-table th,
.invite-table td {
  padding: 0.3rem 1rem 0.3rem 0;
}

.offline-container {
  max-width: 60rem;
  margin: 3rem auto;
}

main#content:not(:has(> .header)) {
  display: block;
  width: calc(100% - 3.2rem);
  max-width: 44rem;
  min-height: 0;
  margin: clamp(3.2rem, 12vh, 12rem) auto;
  padding: 3.2rem;
  border: 1px solid var(--o-box-border);
  border-radius: 1.8rem;
  background: var(--o-box-bg);
  box-shadow: var(--ui-shadow-menu);
  font-size: 1.4rem;
}

main#content:not(:has(> .header)) h1 {
  margin: 0 0 1.6rem;
  color: var(--o-text-strong);
  font-size: 2.8rem;
  letter-spacing: -0.03em;
}

main#content:not(:has(> .header)) form {
  width: 100%;
  max-width: none;
  align-items: stretch;
}

main#content:not(:has(> .header)) form label {
  color: var(--o-text);
}

/* ---------- interaction and accessibility ---------- */

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

[hidden] {
  display: none !important;
}

:focus-visible {
  outline: 3px solid var(--ui-accent);
  outline-offset: 3px;
}

input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  border-color: var(--ui-accent);
  outline-width: 2px;
  outline-offset: 2px;
}

::selection {
  background: var(--ui-accent-soft);
  color: var(--ui-heading);
}

button:disabled,
input:disabled,
select:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

textarea {
  resize: vertical;
}

a,
button,
input,
select,
textarea,
summary,
.post-container {
  transition: background-color 140ms ease, color 140ms ease,
    border-color 140ms ease, box-shadow 140ms ease;
}

.header .account-nav .account-link {
  padding-inline: 1.2rem;
  border: 1px solid var(--ui-border);
  color: var(--ui-heading);
  font-weight: 600;
}

.header .account-nav a:hover {
  color: var(--ui-accent);
  text-decoration: none;
}

.sr-dropdown > summary::after {
  content: "⌄";
  margin-left: 0.6rem;
}

.sr-list-table th button {
  min-height: 2.8rem;
}

.post-container.sticky {
  border-left: 3px solid var(--ui-accent);
}

.post-container.res-selected,
.post-hero.res-selected,
.comment.res-selected {
  border-color: var(--ui-accent);
  box-shadow: 0 0 0 2px var(--ui-accent-soft);
}

.post-container:target,
.comment:target {
  border-color: var(--ui-accent);
  scroll-margin-top: 2.4rem;
}

.title-container > a:hover {
  color: var(--ui-accent);
  text-decoration: none;
}

body[data-theme] .linkflairlabel:is(.is-light, .is-dark),
body:not([data-theme]) .linkflairlabel:is(.is-light, .is-dark) {
  background: var(--ui-subtle);
  color: var(--ui-text);
}

.buttons a.comments {
  background: var(--ui-subtle);
  color: var(--ui-text);
}

.replies .comment > details > summary .midcol {
  top: 1.2rem;
  left: 0;
}

.comment > details > summary:hover .expand {
  color: var(--ui-accent);
}

.tagline .author:is(.submitter, .moderator, .admin) {
  padding: 0.1rem 0.5rem;
  background: var(--ui-accent-soft);
  color: var(--ui-accent);
}

.comment .tagline .author:is(.submitter, .moderator, .admin):visited {
  color: var(--ui-accent);
}

.tagline .flair {
  padding: 0.1rem 0.5rem;
  border-radius: 0.4rem;
  font-size: 1.05rem;
}

.side .usertext-body :is(ul, ol) {
  padding-left: 1.4em;
}

.subscribe-button:hover {
  background: #06675f;
  color: white;
}

.subscribe-button.is-joined:hover {
  border-color: var(--ui-border-strong);
  background: var(--ui-hover);
  color: var(--ui-text);
}

.morelink:hover,
.footer-item a:hover,
.gallery-step:hover {
  border-color: var(--ui-accent);
  background: var(--ui-accent-soft);
  text-decoration: none;
}

main#content > #posts-container,
main#content > .footer {
  grid-column: 2 / 4;
  justify-self: start;
  width: 100%;
  max-width: 96rem;
  margin: 0 0 2.4rem;
}

main#content > .hero form,
main#content:not(:has(> .header)) form {
  gap: 1.2rem;
}

main#content > .hero form > button[type="submit"],
main#content:not(:has(> .header)) .submit-button button,
.search-button {
  border-color: transparent;
  background: #087f75;
  color: #fff;
}

main#content > .hero form > button[type="submit"]:hover,
main#content:not(:has(> .header)) .submit-button button:hover,
.search-button:hover {
  background: #06675f;
}

main#content:not(:has(> .header)) .input-text {
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

main#content:not(:has(> .header)) .input-text input,
main#content:not(:has(> .header)) .submit-button button {
  width: 100%;
  min-height: 4.4rem;
}

.empty-state,
.search-message {
  padding: 2.4rem;
  border: 1px dashed var(--ui-border-strong);
  border-radius: 1rem;
  color: var(--ui-muted);
  font-size: 1.4rem;
}

/* ---------- responsive layout ---------- */

@media (max-width: 1199px) {
  .header .tabmenu {
    order: 5;
    flex: 0 0 100%;
  }

  .header .account-nav {
    margin-left: auto;
  }

  .post-container,
  .post-container.compact,
  .post-container.card,
  .post-container.sticky {
    padding: 1.6rem;
  }

  .rank {
    display: none;
  }
}

@media (max-width: 999px) {
  main#content {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }

  main#content > .page-content,
  main#content > .comments-container {
    grid-column: 1;
    padding: 2rem var(--ui-gutter) 3.2rem;
  }

  main#content > .side {
    grid-column: 1;
    grid-row: auto;
    width: auto;
    max-width: none;
    margin: 0 var(--ui-gutter) 3.2rem;
  }

  main#content > #posts-container,
  main#content > .footer,
  main#content > .hero {
    grid-column: 1;
    width: calc(100% - 2 * var(--ui-gutter));
    max-width: none;
    margin: 2rem var(--ui-gutter) 3.2rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
  }
}

}

/* ---------- native mobile refinements ---------- */
/* Keep reddont's mobile navigation and media behavior, with matching colors. */
@media (max-width: 767px) {
  body,
  body[data-theme] {
    --r-bg: var(--ui-surface);
    --r-text-strong: var(--ui-heading);
    --r-text: var(--ui-text);
    --r-text-weak: var(--ui-muted);
    --r-icon: var(--ui-text);
    --r-pill: var(--ui-subtle);
    --r-pill-hover: var(--ui-hover);
    --r-pill-text: var(--ui-text);
    --r-tab-selected: var(--ui-accent-soft);
    --r-border-weak: var(--ui-border);
    --r-border: var(--ui-border);
    --r-thread: var(--ui-border-strong);
    --r-link: var(--ui-accent);
    --r-link-visited: var(--ui-visited);
    --r-join-bg: #087f75;
    --r-join-text: #ffffff;
    --r-menu-bg: var(--ui-surface);
    --r-menu-hover: var(--ui-subtle);
    --r-menu-shadow: var(--ui-shadow-menu);
    --r-op: var(--ui-accent);
    --r-mod: var(--ui-success);
    --r-flair: var(--ui-subtle);
    --r-flair-text: var(--ui-text);
    --r-brand: var(--ui-accent);
  }

  body,
  main#content,
  #posts-container {
    background: var(--ui-page);
  }

  .header {
    border-color: var(--ui-border);
    box-shadow: var(--ui-shadow);
  }

  .post-container,
  .post-container.compact,
  .post-container.card,
  .post-container.sticky {
    margin: 10px 12px;
    padding: 16px;
    border: 1px solid var(--ui-border);
    border-radius: 14px;
    background: var(--ui-surface);
    box-shadow: var(--ui-shadow);
  }

  .post-container.sticky {
    border-left: 3px solid var(--ui-accent);
  }

  .title-container > a {
    font-weight: 600;
    letter-spacing: -0.015em;
    line-height: 1.45;
  }

  .m-flair.is-light,
  .m-flair.is-dark {
    padding: 2px 6px;
    border: 1px solid var(--ui-border);
    border-radius: 4px;
    background: var(--ui-subtle) !important;
    color: var(--ui-text) !important;
    font-size: 11px;
    line-height: 1.5;
  }

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

  @media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { transition: none !important; animation: none !important; }
  }
}
