html {
  font-size: 9pt;
}

:root {
  color-scheme: light dark;
  --bg: #faf8f1;
  --fg: #151515;
  --muted: #67645d;
  --ascii-note-chrome: #59544b;
  --border: #b8b0a0;
  --panel: #fffdf7;
  --link: #003f8c;
  --danger: #8f1d1d;
  --page-max: 1180px;
  --body-max: 1280px;
  /* Extra scroll room below the last note/reply so the feed does not end flush with the viewport. */
  --feed-scroll-pad: max(3rem, 22vh);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101010;
    --fg: #efeee8;
    --muted: #aaa69a;
    --ascii-note-chrome: #9f9a8d;
    --border: #47433c;
    --panel: #171717;
    --link: #8ab4ff;
    --danger: #ff8c8c;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0 auto;
  max-width: min(var(--body-max), 100vw);
  padding: 0 1rem;
  background: var(--bg);
  color: var(--fg);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: inherit;
  line-height: 1.25;
}

main {
  margin: 0 auto;
  max-width: min(var(--page-max), 100%);
}

body.feed-shell {
  max-width: min(1500px, 100vw);
  padding: 0 0.75rem;
}

body.feed-shell main {
  max-width: 100%;
}

.mobile-bar {
  display: none;
}

.app-shell {
  align-items: start;
  display: grid;
  grid-template-columns: 240px minmax(0, 640px) 340px;
  justify-content: center;
  gap: 0;
  min-height: 100vh;
}

.left-rail,
.feed-column,
.right-rail {
  min-height: 100vh;
  padding: 0.75rem 1rem;
}

.left-rail {
  border-right: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  height: 100dvh;
  min-height: 100dvh;
  overflow-y: auto;
  position: sticky;
  top: 0;
}

.rail-brand {
  font-weight: 700;
}

.rail-nav {
  align-items: stretch;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.rail-nav a {
  align-items: center;
  border: 0;
  display: inline-flex;
  gap: 0.55rem;
  min-height: 2rem;
  padding: 0.2rem 0.4rem;
}

.rail-nav a[aria-current="page"] {
  text-decoration: underline;
}

.rail-icon {
  display: inline-flex;
  justify-content: center;
  width: 1.4rem;
}

.rail-post {
  margin: 0.6rem 0;
  text-align: left;
  width: 100%;
}

.rail-user {
  align-items: center;
  border-top: 0;
  display: flex;
  gap: 0.6rem;
  margin-top: auto;
  padding-top: 0.6rem;
}

.rail-user[data-logged-in="1"],
.mobile-menu-header[data-logged-in="1"] {
  cursor: pointer;
}

.rail-user img,
.mobile-menu-header img,
.mobile-menu-trigger img {
  border: 0;
  border-radius: 50%;
  height: 2rem;
  object-fit: cover;
  width: 2rem;
}

.rail-avatar-fallback,
.mobile-trigger-fallback {
  align-items: center;
  border: 0;
  border-radius: 50%;
  display: inline-flex;
  height: 2rem;
  justify-content: center;
  width: 2rem;
}

.rail-user-copy {
  display: grid;
  gap: 0.1rem;
}

.feed-column {
  border-right: 0;
  margin: 0 auto;
  width: 100%;
  padding-bottom: var(--feed-scroll-pad);
}

.feed-column .page-heading {
  margin-top: 0;
}

.feed-heading-top {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  width: 100%;
}

.feed-heading-title-row {
  align-items: center;
  display: flex;
  flex-wrap: nowrap;
  gap: 0.5rem 0.75rem;
  justify-content: space-between;
  width: 100%;
}

.feed-heading-title-row h1 {
  flex: 1 1 auto;
  line-height: 1.2;
  margin: 0;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.feed-heading-sort-row {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
  width: 100%;
}

.feed-heading-post {
  flex-shrink: 0;
  margin: 0;
  width: auto;
}

.feed-heading-sort-row .feed-sort-label {
  margin-left: auto;
}

@media (min-width: 701px) {
  .feed-heading-post {
    display: none;
  }
}

.feed-sort-label {
  align-items: center;
  display: inline-flex;
  flex-shrink: 0;
  font-size: 0;
  gap: 0.35rem;
  margin-top: 0;
}

.feed-sort-label select {
  appearance: auto;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 0.4rem;
  color: var(--fg);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.85rem;
  line-height: 1.2;
  max-width: 100%;
  min-width: 9.5rem;
  padding: 0.35rem 0.5rem;
}

.feed-new-notes {
  margin: 0 0 0.5rem;
  position: sticky;
  top: 0.25rem;
  z-index: 2;
}

.feed-new-notes,
.load-more {
  cursor: pointer;
  position: relative;
  transition: transform 0.08s ease-out, filter 0.08s ease-out;
}

.feed-new-notes:not(:disabled):active,
.feed-new-notes.is-pressed,
.load-more:not(:disabled):active,
.load-more.is-pressed {
  filter: brightness(0.95);
  transform: translateY(1px);
}

.feed-new-notes[data-loading="1"],
.load-more[data-loading="1"] {
  color: transparent;
}

.feed-new-notes[data-loading="1"]::after,
.load-more[data-loading="1"]::after {
  animation: button-spinner 0.7s linear infinite;
  border: 2px solid var(--muted);
  border-radius: 50%;
  border-top-color: var(--fg);
  content: "";
  height: 0.9rem;
  left: 50%;
  margin-left: -0.45rem;
  margin-top: -0.45rem;
  position: absolute;
  top: 50%;
  width: 0.9rem;
}

.right-rail {
  align-content: start;
  display: grid;
  gap: 0.9rem;
  height: 100dvh;
  min-height: 100dvh;
  overflow-y: auto;
  position: sticky;
  top: 0;
}

.rail-search input {
  width: 100%;
  min-width: 0;
}

.trending-panel {
  border: 0;
  padding: 0.7rem;
}

.trending-panel h2 {
  margin-top: 0;
}

.trending-filter {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.65rem;
  width: 100%;
  min-width: 0;
}

.trending-filter select {
  flex: 0 0 auto;
  max-width: 9rem;
}

.trending-list {
  display: grid;
  gap: 0.55rem;
  list-style: decimal;
  margin: 0;
  padding-left: 1.2rem;
}

.trending-list a {
  display: grid;
  gap: 0.2rem;
}

.trending-list span {
  color: var(--muted);
  display: -webkit-box;
  line-clamp: 2;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.trending-list em {
  color: var(--muted);
  font-style: normal;
}

.thread-people-panel {
  border: 0;
  padding: 0.7rem;
}

.thread-people-panel h2 {
  margin-top: 0;
}

.thread-people {
  display: grid;
  gap: 0.75rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.thread-person {
  align-items: flex-start;
  display: flex;
  gap: 0.55rem;
}

.thread-person img {
  border: 0;
  border-radius: 0;
  flex-shrink: 0;
  height: 2.25rem;
  object-fit: cover;
  width: 2.25rem;
}

.thread-person:not(:has(> img))::before {
  align-items: center;
  background: var(--panel);
  border: 1px solid var(--border);
  box-sizing: border-box;
  content: "@";
  display: inline-flex;
  flex-shrink: 0;
  font-weight: 700;
  height: 2.25rem;
  justify-content: center;
  line-height: 1;
  width: 2.25rem;
}

.thread-person-meta {
  display: grid;
  gap: 0.2rem;
  min-width: 0;
}

.thread-person-about {
  display: -webkit-box;
  line-clamp: 2;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.composer-dialog {
  border: 0;
  max-height: 90vh;
  max-width: min(96vw, 46rem);
  padding: 1rem;
  width: min(96vw, 46rem);
}

.composer-dialog::backdrop {
  background: rgb(0 0 0 / 35%);
}

.composer-close-row {
  display: flex;
  justify-content: flex-end;
  margin: 0 0 0.5rem;
}

.composer-close-button {
  min-width: 2.1rem;
  padding: 0.25rem 0.45rem;
}

.composer-form {
  display: grid;
  gap: 0.55rem;
}

.composer-label {
  font-size: 0.95rem;
}

.composer-form textarea {
  min-height: 12rem;
  resize: vertical;
  width: 100%;
}

@media (min-width: 1100px) {
  .composer-dialog {
    max-width: min(92vw, 58rem);
    width: min(92vw, 58rem);
  }

  .composer-form textarea {
    min-height: 16rem;
  }
}

.settings-profile-panel {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.settings-card {
  border: 0;
  padding: 0.25rem 0;
}

.settings-form {
  display: grid;
  gap: 0.75rem;
  max-width: 42rem;
}

.settings-grid {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
}

.settings-form label {
  display: grid;
  gap: 0.3rem;
}

.settings-form textarea,
.settings-form input {
  width: 100%;
}

.settings-preferences h2 {
  font-size: 1rem;
  margin: 0;
}

.settings-toggle {
  align-items: start;
  display: flex !important;
  gap: 0.75rem;
  justify-content: space-between;
}

.settings-toggle input[type="checkbox"] {
  margin-top: 0.2rem;
  width: auto;
}

.settings-toggle strong {
  display: block;
}

.settings-toggle small {
  display: block;
}

.mobile-menu {
  display: none;
  inset: 0;
  position: fixed;
  z-index: 20;
}

.mobile-menu.is-open {
  display: block;
}

.mobile-menu-backdrop {
  background: rgb(0 0 0 / 35%);
  inset: 0;
  position: absolute;
}

.mobile-menu-panel {
  background: var(--bg);
  border: 0;
  box-sizing: border-box;
  height: 100vh;
  margin: 0;
  max-width: none;
  padding: 1rem;
  position: relative;
  width: min(100vw, 26rem);
}

body.mobile-menu-open {
  overflow: hidden;
}

.mobile-menu-header {
  align-items: center;
  border-bottom: 0;
  display: flex;
  gap: 0.65rem;
  margin-bottom: 0.75rem;
  padding-bottom: 0.75rem;
}

.mobile-menu-header p {
  margin: 0.2rem 0 0;
}

.mobile-menu-nav {
  align-items: stretch;
  display: grid;
  gap: 0.3rem;
  margin-bottom: 0.9rem;
}

.mobile-menu-close {
  margin-top: 0.6rem;
  width: 100%;
}

.mobile-menu-trigger {
  background: transparent;
  border: 0;
  padding: 0;
}

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

a:hover {
  text-decoration: underline;
}

h1,
h2 {
  font-size: 1rem;
  margin: 1rem 0 0.5rem;
}

button,
input {
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--fg);
  font: inherit;
  padding: 0.35rem 0.5rem;
}

input {
  min-width: min(100%, 28rem);
}

pre,
code,
.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

#ptxt-relay-info-popover.relay-detail-popover {
  box-sizing: border-box;
  max-width: min(22.5rem, 90vw);
  max-height: min(50vh, 22rem);
  overflow: auto;
  margin: 0;
  padding: 0.65rem 0.8rem;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--fg);
  font: inherit;
  line-height: 1.45;
  white-space: pre-wrap;
  box-shadow: 0 0.4rem 1.2rem rgba(0, 0, 0, 0.22);
}

.relay-list li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
}

code.relay-url-popover {
  cursor: pointer;
}
code.relay-url-popover:hover,
code.relay-url-popover:focus-visible {
  color: var(--link);
  text-decoration: underline;
  text-underline-offset: 0.12em;
  outline: none;
}

.site-header,
.site-footer,
nav,
.note-meta,
.toolbar,
.stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.site-header,
.site-footer {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin: 1rem 0;
  margin-left: auto;
  margin-right: auto;
  max-width: min(var(--page-max), 100%);
  padding: 0.5rem 0;
}

.site-header {
  justify-content: space-between;
  width: 100%;
}

.site-header .brand {
  flex-shrink: 0;
}

.brand {
  font-weight: 700;
}

[aria-current="page"] {
  font-weight: 700;
}

.page-heading,
.note,
.profile,
.cards article,
.session-panel {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  margin: 0.75rem 0;
  outline: 0 !important;
  padding: 0;
}

.note[data-ascii-select-href],
.comment[data-ascii-select-href] {
  cursor: pointer;
}

.feed,
.feed > .note,
article.note {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  outline: 0 !important;
}

.muted {
  color: var(--muted);
}

.text-skeleton {
  color: var(--muted);
  display: inline-block;
  white-space: pre;
}

.text-skeleton-block {
  display: block;
  line-height: 1.25;
  margin: 0;
}

.text-skeleton-stack {
  display: grid;
  gap: 0.2rem;
}

.text-skeleton-note {
  color: var(--muted);
  margin: 0;
  pointer-events: none;
  user-select: none;
}

.profile-skeleton-avatar {
  border: 1px solid var(--border);
  border-radius: 0.35rem;
  color: var(--muted);
}

.profile-skeleton-display-name {
  display: block;
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-feed-skeleton {
  display: grid;
  gap: 0.75rem;
  min-height: 17rem;
}

.profile-right-panel-skeleton {
  min-height: 10rem;
}

.thread-focus-skeleton {
  min-height: 8.5rem;
}

.thread-replies-skeleton {
  min-height: 3rem;
}

.thread-person-avatar-skeleton {
  align-items: center;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 0;
  display: inline-flex;
  flex-shrink: 0;
  font-weight: 700;
  height: 2.25rem;
  justify-content: center;
  line-height: 1;
  width: 2.25rem;
}

.error,
.danger h2 {
  color: var(--danger);
}

.note-meta {
  color: var(--muted);
  font-size: 8pt;
}

.thread-header {
  margin: 1rem 0;
}

.thread-summary {
  margin: 1rem 0;
}

.thread-summary p {
  margin: 0.25rem 0;
}

.thread-summary-desktop {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.thread-summary-mobile {
  display: none;
}

.thread-focus {
  margin: 0.5rem 0 1rem;
}

.thread-focus-parent {
  margin: 0 0 0.25rem;
}

.thread-focus-selected {
  /* Top margin reserves room for the avatar's top half which overflows
     above the first text line of the selected note. */
  margin: 1.4rem 0 0.5rem 0;
}

.thread-hidden-toggle {
  margin: 0.5rem 0;
}

.thread-tree {
  --thread-tree-column-gap: 0.55rem;
  --thread-tree-row-gap: 0.55rem;
  --thread-tree-gutter-width: 1.8rem;
  --thread-tree-spine-x: 0.95rem;
  --thread-tree-elbow-top: 1.05rem;
  --thread-tree-elbow-height: 0.95rem;
  display: grid;
  gap: 0;
  margin: 0.85rem 0 0 0.2rem;
}

.thread-tree-item {
  align-items: stretch;
  cursor: pointer;
  display: grid;
  gap: var(--thread-tree-column-gap);
  grid-template-columns: var(--thread-tree-gutter-width) minmax(0, 1fr);
  padding-bottom: var(--thread-tree-row-gap);
  position: relative;
}

.thread-tree-item:last-child {
  padding-bottom: 0;
}

.thread-tree-item.is-selected .thread-tree-meta strong {
  text-decoration: underline;
}

.thread-tree-gutter {
  align-self: stretch;
  min-height: 3.4rem;
  position: relative;
}

.thread-tree-gutter.has-parent::before {
  border-left: 1px solid var(--fg);
  content: "";
  left: var(--thread-tree-spine-x);
  position: absolute;
  top: 0;
  height: var(--thread-tree-elbow-top);
}

.thread-tree-elbow {
  border-bottom: 1px solid var(--fg);
  border-left: 1px solid var(--fg);
  height: var(--thread-tree-elbow-height);
  left: var(--thread-tree-spine-x);
  position: absolute;
  top: var(--thread-tree-elbow-top);
  width: calc(var(--thread-tree-gutter-width) - var(--thread-tree-spine-x));
}

.thread-tree-tail {
  border-left: 1px solid var(--fg);
  bottom: calc(var(--thread-tree-row-gap) * -1);
  left: var(--thread-tree-spine-x);
  position: absolute;
  top: calc(var(--thread-tree-elbow-top) + var(--thread-tree-elbow-height));
}

.thread-tree-card {
  min-width: 0;
  padding-left: 0.35rem;
}

.thread-tree-row {
  align-items: start;
  display: grid;
  gap: 0.65rem;
  grid-template-columns: 2.35rem minmax(0, 1fr);
}

.thread-tree-avatar,
.thread-tree-avatar-fallback {
  background: var(--panel);
  border: 1px solid var(--border);
  flex-shrink: 0;
  height: 2.35rem;
  object-fit: cover;
  width: 2.35rem;
}

.thread-tree-avatar {
  display: block;
}

.thread-tree-avatar-fallback {
  align-items: center;
  display: flex;
  font-weight: 700;
  justify-content: center;
}

.thread-tree-main {
  min-width: 0;
}

.thread-tree-meta {
  margin: 0;
}

.thread-tree-text {
  display: grid;
  gap: 0.1rem;
  margin-top: 0.18rem;
  min-width: 0;
}

.thread-tree-text-line {
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

@media (max-width: 700px) {
  .thread-tree {
    --thread-tree-column-gap: 0.45rem;
    --thread-tree-row-gap: 0.4rem;
    --thread-tree-gutter-width: 1.2rem;
    --thread-tree-spine-x: 0.58rem;
    --thread-tree-elbow-top: 0.8rem;
    --thread-tree-elbow-height: 0.75rem;
    margin-left: 0;
  }

  .thread-tree-item {
    gap: var(--thread-tree-column-gap);
  }

  .thread-tree-row {
    gap: 0.5rem;
    grid-template-columns: 1.9rem minmax(0, 1fr);
  }

  .thread-tree-avatar,
  .thread-tree-avatar-fallback {
    height: 1.9rem;
    width: 1.9rem;
  }

  .thread-tree-card {
    padding-left: 0.15rem;
  }
}

.note-content p,
.note-body p {
  margin: 0.45rem 0;
  overflow-wrap: anywhere;
}

.note-content,
.reply-content {
  display: inline;
}

.ascii-note-content {
  display: block;
  width: 100%;
}

.note-content.is-collapsed {
  max-height: 8.7rem;
  overflow: hidden;
  position: relative;
}

.note-content.is-collapsed::after {
  background: linear-gradient(transparent, var(--bg));
  bottom: 0;
  content: "";
  height: 2.6rem;
  left: 0;
  pointer-events: none;
  position: absolute;
  right: 0;
}

.view-more {
  margin: 0.25rem 0 0.45rem;
}

.ascii-border {
  display: none;
}

.ascii-card,
.ascii-reply {
  background: transparent;
  border: 0;
  color: var(--fg);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: inherit;
  line-height: inherit;
  margin: 0;
  max-width: 100%;
  overflow-x: hidden;
  /* clip overrides hidden: hidden+x forces overflow-y:auto and traps abspos menus */
  overflow-x: clip;
  padding: 0;
  white-space: pre;
}

.ascii-source {
  display: none;
}

.ascii-card a,
.ascii-reply a,
.ascii-card button,
.ascii-reply button {
  color: var(--link);
}

.note-image-toggle {
  color: var(--link);
  display: inline-block;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: underline;
  text-decoration-style: dashed;
  text-underline-offset: 2px;
  word-break: break-all;
}

.note-image-preview {
  margin: 0;
  width: 100%;
}

.note-media-drawer {
  display: grid;
  gap: 0.5rem;
  margin: 0.45rem 0 0;
}

.ascii-inline-media {
  display: block;
  margin: 0.2rem 0;
  width: 100%;
}

.ascii-line.note-image-boxed-row {
  align-items: start;
  box-sizing: border-box;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  white-space: normal;
  width: var(--ascii-box-row-width, 100%);
  max-width: 100%;
}

.ascii-line.note-image-boxed-row > .ascii-note-chrome:first-child,
.ascii-line.note-image-boxed-row > .ascii-note-chrome:last-child {
  white-space: pre;
}

.ascii-line.note-image-boxed-row > .ascii-inline-media,
.ascii-line.note-image-boxed-row > .note-image-toggle {
  min-width: 0;
}

.ascii-line.note-image-boxed-row > .note-image-toggle {
  display: block;
  padding-right: 0.4rem;
}

.note-footer-media-link {
  padding: 0;
}

.note-image-preview img {
  border: 1px solid var(--border);
  border-radius: 0.35rem;
  display: block;
  max-height: min(60vh, 28rem);
  max-width: min(100%, 36rem);
}

.note-image-preview img.is-clickable {
  cursor: zoom-in;
}

.note-image-preview img.is-collapsible {
  cursor: pointer;
}

.image-viewer-dialog {
  background: transparent;
  border: 0;
  max-height: 100vh;
  max-width: 100vw;
  padding: 0;
  width: 100vw;
}

.image-viewer-dialog::backdrop {
  background: rgb(0 0 0 / 82%);
}

.image-viewer-close-row {
  display: flex;
  justify-content: flex-end;
  left: 0;
  margin: 0;
  padding: 1rem;
  position: fixed;
  right: 0;
  top: 0;
  z-index: 1;
}

.image-viewer-close-button {
  min-width: 2.25rem;
  padding: 0.25rem 0.5rem;
}

.image-viewer-body {
  align-items: center;
  box-sizing: border-box;
  display: flex;
  justify-content: center;
  min-height: 100vh;
  padding: 3.5rem 1rem 1rem;
  width: 100vw;
}

.image-viewer-body img {
  display: block;
  max-height: calc(100vh - 4.5rem);
  max-width: min(96vw, 96rem);
  object-fit: contain;
}

.ascii-line {
  display: inline;
  margin: 0;
}

.ascii-note-chrome {
  color: var(--ascii-note-chrome);
}

.ascii-row {
  display: grid;
  gap: 0;
  grid-template-columns: 1ch minmax(0, calc(100% - 2ch)) 1ch;
  margin-left: auto;
  margin-right: auto;
  width: min(var(--page-max), 100%);
}

.ascii-edge {
  color: var(--border);
  user-select: none;
}

.ascii-content {
  min-width: 0;
  overflow-wrap: anywhere;
  white-space: normal;
}

.cards {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.login-intro {
  margin: 0.55rem 0;
}

.login-intro p {
  margin: 0;
}

.login-tabs {
  margin-top: 0.35rem;
}

.login-tabs .user-tab-nav {
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.75rem;
  padding-bottom: 0.45rem;
}

.login-tab-panel {
  border: 1px solid var(--border);
  padding: 0.75rem;
}

.login-tab-panel h2 {
  margin-top: 0;
}

.login-tab-panel p {
  margin-top: 0;
}

.login-tab-panel form {
  display: grid;
  gap: 0.45rem;
  justify-items: start;
  margin-top: 0.5rem;
}

.login-tab-panel input {
  width: min(100%, 34rem);
}

.login-tab-actions {
  margin: 0.55rem 0 0;
}

.login-tab-actions button + button {
  margin-left: 0.2rem;
}

.login-tab-panel-danger {
  border-color: var(--danger);
}

.login-tab-panel-danger h2 {
  color: var(--danger);
}

.login-help-panel {
  display: grid;
  gap: 0.5rem;
}

.login-help-panel p {
  margin: 0;
}

.login-help-list {
  display: grid;
  gap: 0.45rem;
  margin: 0;
  padding-left: 1.2rem;
}

.login-help-list li {
  line-height: 1.3;
}

.profile-content {
  display: flex;
  gap: 1rem;
}

.user-profile-column {
  max-width: 640px;
}

.profile-modern {
  margin-top: 0;
}

.profile-back {
  white-space: nowrap;
}

.profile-main {
  margin-top: 0;
  padding: 0 0.75rem;
}

.profile-hero {
  column-gap: 1rem;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-rows: auto auto auto;
  padding: 0 0.75rem;
  row-gap: 0.35rem;
}

.profile-hero .profile-back {
  grid-column: 1 / -1;
  grid-row: 1;
  justify-self: start;
}

.profile-avatar-wrap {
  align-self: center;
  grid-column: 1;
  grid-row: 2 / span 2;
}

.profile-hero .profile-display-name {
  align-self: end;
  grid-column: 2;
  grid-row: 2;
  margin: 0;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-display-name {
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.25;
}

.profile-hero .profile-actions {
  align-self: start;
  grid-column: 2;
  grid-row: 3;
  justify-self: start;
}

.profile-avatar {
  background: var(--panel);
  border: 3px solid var(--bg);
  border-radius: 50%;
  height: 96px;
  object-fit: cover;
  width: 96px;
}

.profile-modern .profile-avatar,
.profile-modern .profile-avatar-fallback {
  border: 1px solid var(--border);
  border-radius: 0.35rem;
  height: 96px;
  width: 96px;
}

.profile-avatar-fallback {
  align-items: center;
  display: inline-flex;
  font-weight: 700;
  justify-content: center;
}

.profile-action-link {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: inherit;
  cursor: pointer;
  display: inline-block;
  font: inherit;
  padding: 0.25rem 0.85rem;
  white-space: nowrap;
}

.profile-action-link[aria-pressed="true"] {
  background: var(--panel);
}

.profile-ident {
  margin-top: 0.65rem;
}

.profile-ident p {
  margin: 0.2rem 0;
}

.profile img,
.profile-content img {
  width: 72px;
  height: 72px;
  object-fit: cover;
}

.profile-ascii-avatar-fallback {
  align-items: center;
  background: var(--panel);
  border: 1px solid var(--border);
  box-sizing: border-box;
  display: inline-flex;
  flex-shrink: 0;
  font-weight: 700;
  height: 72px;
  justify-content: center;
  width: 72px;
}

.columns {
  columns: 2;
}

.thread-replies {
  min-width: 0;
}

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

/* Comment layout for threaded replies. The pre itself is full-width with a
   `|` rail at column 0; the avatar is absolutely positioned over the rail
   column so the rail glyphs above and below visually flow into and out of
   it like a single vertical thread. Each depth level adds 1ch of left
   margin so a child's rail column lines up under its parent's rail
   column. */
.comment {
  --avatar-left: -0.4ch;
  --avatar-size: 2.4em;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  margin-left: calc((var(--depth) - 1) * 1ch);
  /* Top margin keeps the absolutely-positioned avatar (which overflows
     above the first text row by ~half its height) from colliding with
     the parent's last reply line above. */
  margin-top: 0.9em;
  padding-left: 1ch;
  position: relative;
}

.comments > .comment:first-child {
  margin-top: 0.4em;
}

.comment-avatar {
  /* Sit just to the right of the rail column so the rail `|` glyph at
     pre col 0 (centered at 0.5ch from the padding edge) remains visible
     to the left of the avatar, with the avatar starting at ~1.2ch from
     the padding edge. Centered vertically on the first text line
     (line-height 1.25em → center at 0.625em from pre top). */
  position: absolute;
  left: var(--avatar-left);
  top: calc(0.625em - var(--avatar-size) / 2);
  width: var(--avatar-size);
  height: var(--avatar-size);
  border-radius: 0;
  overflow: hidden;
  z-index: 2;
  text-decoration: none;
  background: var(--panel);
}

.comment-avatar img {
  display: block;
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.comment-avatar:not(:has(img)) {
  align-items: center;
  border: 1px solid var(--border);
  display: flex;
  font-weight: 700;
  justify-content: center;
}

.comment-avatar:not(:has(img))::before {
  content: "@";
  line-height: 1;
}

/* Header line of the reply pre: indent past the avatar so the username
   text starts to the right of the avatar's right edge with a small gap.
   Avatar left edge is at 1.2ch from the padding edge; right edge is at
   1.2ch + avatar-size. Add 0.6ch gap before the username starts. */
.ascii-reply > .ascii-line:first-child {
  padding-left: calc(1ch + var(--avatar-size));
}

.note.thread-focus-selected {
  --avatar-size: 2.4em;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  /* No padding-left: the selected note's content (and reply link) sits
     flush with the comment's outer-left edge so it visually flows in the
     column directly under the avatar. The header line is still pushed
     past the avatar via padding-left on its first :ascii-line. */
  position: relative;
}

.note-avatar {
  /* Sit flush with the left edge of the selected note. The header line
     is pushed past the avatar's right edge via padding-left on the
     first :ascii-line; subsequent content lines wrap under the avatar. */
  position: absolute;
  left: 0;
  top: calc(0.625em - var(--avatar-size) / 2);
  width: var(--avatar-size);
  height: var(--avatar-size);
  border-radius: 0;
  overflow: hidden;
  z-index: 2;
  text-decoration: none;
  background: var(--panel);
}

.note-avatar img {
  display: block;
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.note-avatar:not(:has(img)) {
  align-items: center;
  border: 1px solid var(--border);
  display: flex;
  font-weight: 700;
  justify-content: center;
}

.note-avatar:not(:has(img))::before {
  content: "@";
  line-height: 1;
}

.note.thread-focus-selected .ascii-reply > .ascii-line:first-child {
  /* Push the header (username + age + actions) past the avatar's right
     edge with a small gap. Avatar is at left: 0, width var(--avatar-size). */
  padding-left: calc(var(--avatar-size) + 0.8ch);
}

.note.thread-focus-selected .note-content {
  /* Push the first content line below the avatar's bottom edge. The
     avatar is centered on the header row (line-height 1.25em → center at
     0.625em from pre top), so its bottom edge is at
     0.625em + avatar-size / 2. Subtract the natural top of the next line
     (1.25em) and add a little gap. */
  display: block;
  margin-top: calc(var(--avatar-size) / 2 - 0.4em);
}

/* Reserve a full connector row above the first visible reply and center a
   double `|` connector over that reply's avatar. This gives focused thread
   replies a clearer visual bridge back to the selected parent reply. */
#thread-replies > .comment:first-child {
  margin-top: 2.5em;
}

#thread-replies > .comment:first-child::before {
  color: var(--fg);
  content: "|\A|";
  left: calc(var(--avatar-left) + var(--avatar-size) / 2 - 0.5ch);
  line-height: 1.25em;
  pointer-events: none;
  position: absolute;
  top: -2.5em;
  white-space: pre;
}

.thread-back,
.continue-thread {
  margin: 0.5rem 0;
}

.thread-back-secondary {
  color: var(--muted);
}

.continue-thread {
  white-space: pre;
}

.continue-thread {
  display: none;
}

.comment[data-depth="5"] > .continue-thread-desktop {
  display: block;
}

.comment[data-depth="5"] > .comments {
  display: none;
}

.link-button {
  border: 0;
  background: transparent;
  color: var(--link);
  padding: 0;
  cursor: pointer;
}

.ascii-action-menu {
  display: inline;
  position: relative;
}

.ascii-action-menu-list {
  background: var(--panel);
  border: 1px solid var(--border);
  display: none;
  left: auto;
  min-width: 24ch;
  padding: 0.35rem 0.5rem;
  position: absolute;
  right: 0;
  top: 1.4em;
  z-index: 10;
}

.ascii-action-menu.is-open .ascii-action-menu-list {
  display: grid;
  gap: 0.2rem;
}

.ascii-action-menu-list a,
.ascii-action-menu-list button {
  text-align: left;
  white-space: nowrap;
}

.load-more {
  display: block;
  margin: 1rem auto;
}

@keyframes button-spinner {
  to {
    transform: rotate(360deg);
  }
}

/* User profile: tab strip + one visible panel (radio inputs use clip-only hiding). */
.user-tabs {
  margin-left: auto;
  margin-right: auto;
  margin-top: 0.75rem;
  width: min(var(--page-max), 100%);
}

.profile-tabs {
  border-top: 1px solid var(--border);
  padding-top: 0.5rem;
}

.user-tab-nav {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem 0.35rem;
  margin-bottom: 0.65rem;
}

.user-tab-sep {
  color: var(--muted);
  user-select: none;
}

.user-tab-label {
  color: var(--link);
  cursor: pointer;
}

.user-tab-label:hover {
  text-decoration: underline;
}

.user-tab-state {
  border: 0;
  clip: rect(0, 0, 0, 0);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

.user-tab-panel {
  display: none;
}

.user-tab-state:checked + .user-tab-panel {
  display: block;
}

.user-tab-panel-heading {
  margin-top: 0;
}

.user-tabs:has(#user-tab-posts:checked) .user-tab-nav label[for="user-tab-posts"],
.user-tabs:has(#user-tab-replies:checked) .user-tab-nav label[for="user-tab-replies"],
.user-tabs:has(#user-tab-media:checked) .user-tab-nav label[for="user-tab-media"],
.user-tabs:has(#user-tab-following:checked) .user-tab-nav label[for="user-tab-following"],
.user-tabs:has(#user-tab-followers:checked) .user-tab-nav label[for="user-tab-followers"],
.user-tabs:has(#user-tab-identifiers:checked) .user-tab-nav label[for="user-tab-identifiers"],
.user-tabs:has(#user-tab-relays:checked) .user-tab-nav label[for="user-tab-relays"],
.login-tabs:has(#login-tab-readonly:checked) .user-tab-nav label[for="login-tab-readonly"],
.login-tabs:has(#login-tab-nip07:checked) .user-tab-nav label[for="login-tab-nip07"],
.login-tabs:has(#login-tab-yolo:checked) .user-tab-nav label[for="login-tab-yolo"],
.login-tabs:has(#login-tab-ephemeral:checked) .user-tab-nav label[for="login-tab-ephemeral"] {
  color: var(--fg);
  font-weight: 600;
  text-decoration: none;
}

.profile-stats-row {
  border-bottom: 1px solid var(--border);
  margin: 0.4rem 0;
  padding-bottom: 0.5rem;
}

.profile-stat-link {
  color: var(--link);
}

.profile-card {
  border: none;
  border-radius: 0;
  padding: 0.75rem;
}

#user-right-identifiers {
  border-bottom: 1px dashed var(--border);
}

.profile-card .ascii-row {
  width: 100%;
}

.profile-card .ascii-content {
  padding-left: 0;
  padding-right: 0;
}

.profile-card .ascii-edge {
  display: none;
}

.profile-right-rail {
  align-content: start;
  gap: 0.8rem;
}

.profile-right-panel {
  margin-top: 0;
  min-width: 0;
  width: 100%;
}

.profile-right-panel .ascii-row {
  display: block;
  width: 100%;
}

.profile-right-panel .ascii-content {
  max-width: 100%;
  overflow-wrap: break-word;
  padding: 0;
  white-space: normal;
  word-break: normal;
}

.profile-right-panel .ascii-content p,
.profile-right-panel .ascii-content h2,
.profile-right-panel .ascii-content span {
  overflow-wrap: break-word;
  white-space: normal;
}

.profile-right-panel .mono {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.profile-right-panel .ascii-edge,
.profile-right-panel .ascii-border {
  display: none;
}

.profile-mobile-only-tab {
  display: none;
}

.profile-mobile-only-panel {
  display: none;
}

@media (min-width: 701px) {
  .user-tab-state#user-tab-identifiers:checked + .profile-mobile-only-panel,
  .user-tab-state#user-tab-relays:checked + .profile-mobile-only-panel {
    display: none;
  }
}

@media (max-width: 1199px) {
  .app-shell {
    grid-template-columns: 74px minmax(0, 640px) 320px;
  }

  .left-rail {
    align-items: center;
    padding-left: 0.4rem;
    padding-right: 0.4rem;
  }

  .left-rail .rail-brand,
  .left-rail .rail-label,
  .left-rail .rail-user-copy {
    display: none;
  }

  .left-rail .rail-nav a {
    justify-content: center;
    padding: 0.3rem;
  }

  .left-rail .rail-user {
    justify-content: center;
  }
}

@media (max-width: 1023px) {
  .app-shell {
    grid-template-columns: 74px minmax(0, 700px);
  }

  .right-rail {
    display: none;
  }

  .feed-column {
    border-right: 0;
  }

}

[hidden] {
  display: none !important;
}

@media (max-width: 700px) {
  body.feed-shell {
    padding: 0;
  }

  body.feed-shell main {
    margin: 0;
    max-width: 100%;
  }

  .mobile-bar {
    align-items: center;
    background: var(--bg);
    border-bottom: 0;
    display: flex;
    gap: 0.75rem;
    padding: 0.65rem 0.7rem;
    position: sticky;
    top: 0;
    z-index: 5;
  }

  /* Keep the bar (and the ≡ / × control) above the full-screen menu overlay. */
  body.mobile-menu-open .mobile-bar {
    z-index: 25;
  }

  .mobile-bar .mobile-brand {
    flex: 1 1 auto;
    min-width: 0;
    text-align: center;
  }

  .mobile-menu-bar-glyph {
    flex-shrink: 0;
  }

  .mobile-menu-bar-icon {
    align-items: center;
    display: inline-flex;
    font-size: 1.35rem;
    font-weight: 500;
    height: 2rem;
    justify-content: center;
    line-height: 1;
    width: 2rem;
  }

  /* Same tap target as ≡: show × when the overlay is open. */
  body.mobile-menu-open .mobile-menu-bar-glyph .mobile-menu-bar-icon {
    color: transparent;
    font-size: 0;
    line-height: 0;
    position: relative;
  }

  body.mobile-menu-open .mobile-menu-bar-glyph .mobile-menu-bar-icon::after {
    align-items: center;
    color: var(--fg);
    content: "×";
    display: flex;
    font-size: 1.45rem;
    font-weight: 500;
    height: 2rem;
    justify-content: center;
    left: 0;
    line-height: 1;
    position: absolute;
    top: 0;
    width: 2rem;
  }

  .mobile-brand {
    font-weight: 700;
  }

  .app-shell {
    display: block;
    min-height: 0;
  }

  .left-rail,
  .right-rail {
    display: none;
  }

  .feed-column {
    border: 0;
    min-height: 0;
    padding: 0.55rem 0.75rem;
    padding-bottom: var(--feed-scroll-pad);
  }

  .profile-main {
    margin-top: 0;
    padding: 0 0.3rem;
  }

  .profile-hero {
    column-gap: 0.65rem;
    padding: 0 0.3rem;
  }

  .profile-modern .profile-avatar,
  .profile-modern .profile-avatar-fallback {
    height: 72px;
    width: 72px;
  }

  .profile-display-name {
    font-size: 1.1rem;
  }

  .profile-ident {
    margin-top: 0.5rem;
  }

  .profile-mobile-only-tab {
    display: inline-flex;
  }

  .user-tab-state#user-tab-identifiers:checked + .profile-mobile-only-panel,
  .user-tab-state#user-tab-relays:checked + .profile-mobile-only-panel {
    display: block;
  }

  .mobile-menu-panel {
    border: 0;
    border-radius: 0;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    height: 100dvh;
    margin: 0;
    max-height: 100dvh;
    max-width: 100vw;
    min-height: 100dvh;
    padding: max(0.75rem, env(safe-area-inset-top, 0px))
      max(0.75rem, env(safe-area-inset-right, 0px))
      max(0.75rem, env(safe-area-inset-bottom, 0px))
      max(0.75rem, env(safe-area-inset-left, 0px));
    width: 100vw;
  }

  .mobile-menu-header {
    flex-shrink: 0;
    margin-bottom: 0.5rem;
    padding-bottom: 0.5rem;
  }

  .mobile-menu-nav {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 0.4rem;
    margin-bottom: 0.5rem;
    min-height: 0;
    overflow-y: auto;
  }

  .mobile-menu-nav a {
    align-items: center;
    border: 0;
    border-bottom: 1px dashed var(--border);
    border-radius: 0;
    box-sizing: border-box;
    display: flex;
    flex: 1 1 0;
    font-size: clamp(1.4rem, 4.5vw, 1.85rem);
    font-weight: 600;
    justify-content: center;
    min-height: 3.5rem;
    padding: 0.7rem 1rem;
    text-align: center;
    text-decoration: none;
    width: 100%;
  }

  .mobile-menu-nav a:last-child {
    border-bottom: 0;
  }

  .mobile-menu-nav a:hover {
    text-decoration: none;
  }

  .mobile-menu-close {
    flex-shrink: 0;
    font-size: clamp(1.15rem, 3.5vw, 1.45rem);
    margin-top: 0.35rem;
    min-height: 3.25rem;
    padding: 0.7rem 1rem;
  }

  .mobile-menu-backdrop {
    background: var(--bg);
  }

  body {
    padding: 0 0.65rem;
  }

  .thread-summary-desktop {
    display: none;
  }

  .thread-summary-mobile {
    display: block;
  }

  .comment {
    margin-left: calc(var(--depth) * 0.25rem);
    padding-left: 0.95rem;
  }

  .ascii-enhanced .comment {
    margin-left: calc((var(--depth) - 1) * 1ch);
    padding-left: 1ch;
  }

  .comment[data-depth="3"] > .continue-thread-mobile {
    display: block;
  }

  .comment[data-depth="3"] > .continue-thread-desktop,
  .comment[data-depth="5"] > .continue-thread-desktop {
    display: none;
  }

  .comment[data-depth="3"] > .comments {
    display: none;
  }

  .columns {
    columns: 1;
  }

  .feed-heading-title-row .feed-sort-label select {
    max-width: min(100%, 12rem);
    min-width: 7.5rem;
    width: auto;
  }
}

.reads-column {
  max-width: 640px;
}

.app-shell.reads-shell {
  grid-template-columns: 240px minmax(0, 640px) 340px;
}

.reads-list {
  display: grid;
  gap: 1.25rem;
}

.read-article {
  border: 0;
  border-radius: 0;
  padding: 0.8rem 0;
  background: var(--bg);
  position: relative;
}

.read-article h2 {
  margin: 0 0 0.25rem;
  font-size: 1.8rem;
  line-height: 1.35;
}

.read-meta {
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
}

.read-ascii-row {
  align-items: stretch;
}

.read-article .ascii-border {
  color: var(--fg);
  display: block;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  margin: 0 auto;
  user-select: none;
  white-space: pre;
  width: min(100%, 80ch);
}

.read-ascii-row .ascii-edge {
  color: transparent;
  display: block;
  position: relative;
  user-select: none;
}

.read-ascii-row .ascii-edge::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 50%;
  width: 1px;
  transform: translateX(-50%);
  background: repeating-linear-gradient(
    to bottom,
    var(--fg) 0 8px,
    transparent 8px 14px
  );
}

.read-ascii-row {
  width: min(100%, 80ch);
  margin-left: auto;
  margin-right: auto;
}

.read-ascii-content {
  width: 100%;
  min-width: 0;
  padding: 0.75rem 0.9rem;
}

.read-meta-copy {
  min-width: 0;
}

.read-meta p {
  margin: 0.1rem 0 0.5rem;
}

.read-summary {
  color: var(--muted);
  margin: 0.2rem 0 0.2rem;
}

.read-thumb {
  display: block;
  width: 220px;
}

.read-thumb img {
  border-radius: 0.45rem;
  display: block;
  object-fit: cover;
  width: 100%;
  aspect-ratio: 16 / 9;
}

.read-body {
  line-height: 1.45;
  margin-top: 0.35rem;
  max-height: 8.5rem;
  overflow: hidden;
  position: relative;
  overflow-wrap: anywhere;
}

.read-body::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 2.2rem;
  background: linear-gradient(to bottom, transparent, var(--bg));
}

.read-body > :first-child {
  margin-top: 0;
}

.read-body > :last-child {
  margin-bottom: 0;
}

.read-body h1,
.read-body h2,
.read-body h3,
.read-body h4 {
  margin: 1rem 0 0.35rem;
  font-size: 1rem;
}

.read-body p,
.read-body ul,
.read-body ol,
.read-body blockquote,
.read-body pre,
.read-body table,
.read-body hr {
  margin: 0.65rem 0;
}

.read-body ul,
.read-body ol {
  padding-left: 1.2rem;
}

.read-body li + li {
  margin-top: 0.2rem;
}

.read-body ul ul,
.read-body ul ol,
.read-body ol ul,
.read-body ol ol {
  margin: 0.3rem 0 0.2rem;
}

.read-body blockquote {
  margin-left: 0;
  padding-left: 0.75rem;
  border-left: 2px solid var(--border);
  color: var(--muted);
}

.read-body a {
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  overflow-wrap: anywhere;
}

.read-body code,
.read-body pre {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.95em;
}

.read-body p code,
.read-body li code,
.read-body blockquote code,
.read-body td code,
.read-body th code {
  border: 1px solid var(--border);
  border-radius: 0.2rem;
  padding: 0.02rem 0.25rem;
}

.read-body pre {
  border: 1px solid var(--border);
  padding: 0.5rem 0.65rem;
  overflow-x: auto;
}

.read-body table {
  border-collapse: collapse;
  width: 100%;
  min-width: 0;
  font-size: 0.96em;
}

.read-body table th,
.read-body table td {
  border: 1px solid var(--border);
  padding: 0.32rem 0.45rem;
  vertical-align: top;
  text-align: left;
}

.read-body table th {
  font-weight: 700;
}

.read-body hr {
  border: 0;
  border-top: 1px dashed var(--border);
}

.read-body img {
  border: 1px solid var(--border);
  border-radius: 0.35rem;
  display: block;
  height: auto;
  max-width: 100%;
}

.read-body input[type="checkbox"] {
  accent-color: var(--fg);
}

.read-body img {
  display: none;
}

.read-article.is-full .read-body {
  margin-top: 0.65rem;
  max-height: none;
  overflow: visible;
}

.read-article.is-full .read-meta {
  display: block;
}

.read-article.is-full .read-meta-copy {
  width: 100%;
}

.read-article.is-full .read-body::after {
  display: none;
}

.read-article.is-full .read-body img {
  display: block;
  max-width: 100%;
  height: auto;
}

.read-detail-column .read-title {
  font-size: 2.2rem;
  line-height: 1.2;
  margin: 0 0 0.4rem;
}

.read-thumb-full {
  width: 100%;
  margin-top: 0.55rem;
}

.read-thumb-full img {
  aspect-ratio: auto;
  max-height: 520px;
  object-fit: contain;
}

.reads-actions {
  margin: 0.55rem 0 0;
}

.reads-more {
  margin: 0.2rem 0 0;
}

@media (max-width: 1023px) {
  .app-shell.reads-shell {
    grid-template-columns: 74px minmax(0, 700px);
  }

  .read-article h2 {
    font-size: 1.45rem;
  }

  .read-thumb {
    width: 190px;
  }

  .read-detail-column .read-title {
    font-size: 1.8rem;
  }
}

/* Reads / single read: must follow base .read-* rules or mobile overrides lose. */
@media (max-width: 700px) {
  .reads-column .page-heading .ascii-border,
  .read-article .ascii-border,
  .read-ascii-row .ascii-edge {
    display: none;
  }

  .reads-column .page-heading .ascii-content {
    padding-left: 0;
    padding-right: 0;
  }

  .reads-column .feed-heading-title-row .feed-sort-label {
    flex-shrink: 0;
    margin-left: auto;
    width: auto;
  }

  .reads-column .feed-heading-title-row .feed-sort-label select {
    max-width: min(100%, 12rem);
    min-width: 7.5rem;
    width: auto;
  }

  .reads-column .feed-heading-sort-row {
    align-items: stretch;
  }

  .reads-column .feed-heading-sort-row .feed-sort-label {
    margin-left: 0;
    width: 100%;
  }

  .reads-column .feed-heading-sort-row .feed-sort-label select {
    width: 100%;
  }

  .reads-list .read-article {
    border-bottom: 1px dashed var(--border);
    padding: 0 0 1rem;
  }

  .reads-column .read-ascii-row {
    display: block;
    margin: 0;
    width: 100%;
  }

  .reads-column .read-ascii-content {
    padding: 0;
  }

  .reads-list .read-article:last-child {
    border-bottom: 0;
    padding-bottom: 0;
  }

  .reads-column .read-meta {
    grid-template-columns: 1fr;
  }

  .reads-column .read-thumb {
    width: 100%;
    max-width: 100%;
  }

  .read-detail-column .read-title {
    font-size: 1.55rem;
  }

  .reads-list .read-body {
    max-height: 10rem;
  }

  .reads-column .read-body table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}
