/* Smugstack */

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("fonts/inter-latin-var.woff2") format("woff2");
}
@font-face {
  font-family: "Spectral";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/spectral-latin-400-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Spectral";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/spectral-latin-400-italic.woff2") format("woff2");
}
@font-face {
  font-family: "Spectral";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("fonts/spectral-latin-500-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Spectral";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("fonts/spectral-latin-700-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Spectral";
  font-style: italic;
  font-weight: 700;
  font-display: swap;
  src: url("fonts/spectral-latin-700-italic.woff2") format("woff2");
}

:root {
  --orange: #ff6719;
  --orange-hover: #f05a0f;
  /* Substack's orange, darkened just until small text passes WCAG AA: on white, and on peach */
  --orange-text: #c85114;
  --orange-deep: #b24811;
  --peach: #ffe5d6;
  --peach-hover: #ffd9c4;
  --ink: #363737; /* Substack sets titles and names in its body text color */
  --text: #363737;
  --dark: #161718;
  --muted: #6b6b6b; /* Substack's #777, darkened a step for contrast */
  --faint: #737373;
  --line: #e6e6e6;
  --warm-gray: #e7e6e3;
  --off-white: #fafaf9;
  --gray: #eeeeee;
  --gray-hover: #e3e3e3;
  --hover: #f5f5f5;
  --green: #2f6d5d;
  --font-ui: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-body: "Spectral", Georgia, "Times New Roman", serif;
  --radius: 8px;
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.12), 0 1px 3px rgba(0, 0, 0, 0.08);
  /* Substack's buttons: a highlight along the top edge and a shade along the bottom */
  --button-bevel: inset 0 1px 0 rgba(255, 255, 255, 0.2), inset 0 -1px 0 rgba(0, 0, 0, 0.1);
  color-scheme: light;
}

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

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

body {
  margin: 0;
  background: #fff;
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "cv11";
}

img,
svg {
  display: block;
}

[hidden] {
  display: none !important;
}

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

.layout-pub,
.layout-post,
.layout-plain {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.layout-pub > main,
.layout-post > main,
.layout-plain > main {
  flex: 1 0 auto;
}

button,
input,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  background: none;
  border: 0;
  padding: 0;
}

h1,
h2,
h3,
h4,
p {
  margin: 0;
}

:focus-visible {
  outline: 2px solid var(--orange);
  outline-offset: 2px;
}

.icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.icon {
  width: 20px;
  height: 20px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -48px;
  z-index: 100;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-weight: 600;
}

.skip-link:focus {
  top: 12px;
}

/* Buttons ---------------------------------------------------------------- */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  line-height: 20px;
  white-space: nowrap;
  transition: background-color 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}

.button .icon {
  width: 18px;
  height: 18px;
}

.button-primary {
  background: var(--orange);
  color: #fff;
  box-shadow: var(--button-bevel);
}

.button-primary:hover {
  background: var(--orange-hover);
}

.button-secondary {
  background: var(--gray);
  color: var(--ink);
}

.button-secondary:hover {
  background: var(--gray-hover);
}

/* "Sign in" beside Subscribe: just the words, as on Substack */
.button-ghost {
  background: transparent;
  color: var(--ink);
}

.button-ghost:hover {
  background: var(--hover);
}

.button-tint {
  background: var(--peach);
  color: var(--orange-deep);
}

.button-tint:hover {
  background: var(--peach-hover);
}

.button-dark {
  background: var(--dark);
  color: #fff;
  box-shadow: var(--button-bevel);
}

.button-dark:hover {
  background: #000;
}

.button-on-dark {
  color: #fff;
}

.button-on-dark:hover {
  background: rgba(255, 255, 255, 0.12);
}

.button-sm {
  height: 32px;
  padding: 0 12px;
  font-size: 13px;
}

.button-lg {
  height: 48px;
  font-size: 16px;
}

.button-block {
  display: flex;
  width: 100%;
}

.button-square {
  width: 40px;
  padding: 0;
  flex: none;
}

.button-see-all {
  margin-top: 24px;
  gap: 4px;
  padding: 0 12px 0 16px;
}

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  color: var(--text);
  flex: none;
}

.icon-button:hover {
  background: var(--hover);
}

.icon-button-sm {
  width: 32px;
  height: 32px;
}

.icon-button-sm .icon {
  width: 18px;
  height: 18px;
}

.text-button {
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 6px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  line-height: 20px;
  color: var(--orange-text);
}

.text-button:hover {
  background: rgba(255, 103, 25, 0.08);
}

/* Subscribe button states (Subscribe → Subscribing… → Subscribed ✓) */

[data-subscribe][data-state="loading"] {
  background: #f2f2f2;
  border-color: transparent;
  box-shadow: none;
  color: var(--muted);
  cursor: progress;
}

[data-subscribe][data-state="subscribed"] {
  background: var(--peach);
  border-color: transparent;
  box-shadow: none;
  color: var(--orange-deep);
}

[data-subscribe][data-state="subscribed"]:hover {
  background: var(--peach-hover);
}

.text-button[data-subscribe][data-state],
.text-button[data-subscribe][data-state]:hover {
  background: none;
  color: var(--muted);
}

.spinner {
  width: 16px;
  height: 16px;
  flex: none;
  border: 2px solid #c9c9c9;
  border-top-color: var(--muted);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Avatars, badges, small print ------------------------------------------- */

.avatar {
  border-radius: 50%;
  object-fit: cover;
  background: #dadada;
  flex: none;
}

.avatar-emoji {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--size);
  height: var(--size);
  background: var(--avatar-bg);
  font-size: calc(var(--size) * 0.56);
  line-height: 1;
}

.pub-logo {
  border-radius: 6px;
}

.badge {
  width: 16px;
  height: 16px;
  margin-left: 4px;
  flex: none;
  color: var(--orange);
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.meta {
  font-size: 11px;
  font-weight: 500;
  line-height: 20px;
  letter-spacing: 0.2px;
  text-transform: uppercase;
  color: var(--muted);
}

.meta a:hover {
  text-decoration: underline;
}

/* Reader layout: sidebar, feed, rail ------------------------------------- */

.app {
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr) 420px;
  min-height: 100vh;
}

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

.sidebar-logo {
  display: flex;
  align-items: center;
  align-self: flex-start;
  height: 32px;
  margin: 0 0 16px 12px;
}

.side-link {
  display: flex;
  align-items: center;
  gap: 16px;
  height: 48px;
  padding: 0 12px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 500;
  color: var(--muted);
}

.side-link .icon {
  width: 24px;
  height: 24px;
  stroke-width: 1.75;
}

.side-link:hover {
  background: var(--hover);
}

.side-link.is-active {
  color: var(--ink);
  font-weight: 600;
}

.side-create {
  margin-top: 12px;
}

.side-create .icon {
  display: none;
}

.app-main {
  min-width: 0;
  padding: 32px 24px 64px;
}

.app-main > * {
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.rail {
  position: sticky;
  top: 0;
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-height: 100vh;
  overflow-y: auto;
  padding: 24px 24px 32px;
}

.mobile-bar,
.tabbar,
.mobile-footer {
  display: none;
}

/* Substack's floating app button, bottom right on the reader pages */
.get-app {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 25;
  background: #fff;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  color: var(--ink);
}

.get-app:hover {
  background: var(--hover);
}

/* Promo banner */

.promo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 40px 16px;
  border-radius: 12px;
  background: var(--green);
  color: #fff;
  text-align: center;
}

.promo h1 {
  max-width: 480px;
  font-family: var(--font-body);
  font-size: 32px;
  font-weight: 500;
  line-height: 1.24;
  letter-spacing: -0.01em;
}

.promo-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

/* Feed */

.feed-toolbar {
  position: relative;
  padding: 24px 10px 4px;
}

.feed-filter {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 28px;
  padding: 0 6px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

.feed-filter:hover {
  background: var(--hover);
}

.feed-filter .icon {
  width: 16px;
  height: 16px;
}

.feed-item {
  display: flex;
  gap: 12px;
  padding: 20px 16px;
  border-bottom: 1px solid var(--line);
}

.feed-item:last-child {
  border-bottom: 0;
}

.feed-avatar .avatar {
  width: 36px;
  height: 36px;
}

.feed-main {
  flex: 1;
  min-width: 0;
}

.feed-head {
  display: flex;
  align-items: center;
  min-height: 24px;
  margin-bottom: 8px;
}

.feed-name {
  font-size: 15px;
  font-weight: 500;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.feed-name:hover {
  text-decoration: underline;
}

.feed-time {
  margin-left: 8px;
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
}

.feed-head-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  padding-left: 12px;
}

.feed-head-actions .icon-button {
  color: var(--muted);
}

.post-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  transition: box-shadow 0.15s ease;
}

.post-card:hover {
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.post-card.has-image {
  border-color: transparent;
  background: var(--card, #3a3f47);
  color: #fff;
}

.post-card-image {
  width: 100%;
  height: auto;
  aspect-ratio: 1.91 / 1;
  object-fit: cover;
  background: rgba(0, 0, 0, 0.2);
}

.post-card-body {
  padding: 14px 52px 16px 14px;
}

.post-card-pub {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 13px;
  color: var(--muted);
}

.post-card.has-image .post-card-pub {
  color: rgba(255, 255, 255, 0.75);
}

.post-card-pub .avatar {
  width: 20px;
  height: 20px;
}

.post-card-title {
  display: block;
  font-size: 17px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--ink);
}

.post-card.has-image .post-card-title {
  font-weight: 500;
  color: #fff;
}

.post-card-title::after {
  content: "";
  position: absolute;
  inset: 0;
}

.post-card-subtitle {
  margin-top: 4px;
  font-size: 15px;
  line-height: 20px;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-card.has-image .post-card-subtitle { color: rgba(255, 255, 255, 0.82); }

.post-card-save {
  position: absolute;
  right: 8px;
  bottom: 10px;
  z-index: 1;
  color: var(--muted);
}

.post-card.has-image .post-card-save {
  color: rgba(255, 255, 255, 0.85);
}

.post-card.has-image .post-card-save:hover {
  background: rgba(255, 255, 255, 0.14);
}

.post-card-save[aria-pressed="true"] .icon {
  fill: currentColor;
}

.feed-ufi {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 8px 0 0 -6px;
}

.ufi-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 6px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 400;
  color: var(--muted);
}

.ufi-button:hover {
  background: var(--hover);
}

/* Liked / restacked */

[data-like][aria-pressed="true"],
[data-like][aria-pressed="true"] .count {
  color: var(--orange-text);
}

[data-like][aria-pressed="true"] .icon {
  fill: var(--orange);
  stroke: var(--orange);
}

[data-restack][aria-pressed="true"] {
  color: #1d8a54;
}

/* Right rail */

.rail-search {
  position: relative;
  display: flex;
  align-items: center;
}

.rail-search > .icon {
  position: absolute;
  left: 13px;
  width: 18px;
  height: 18px;
  color: var(--muted);
  pointer-events: none;
}

.rail-search input,
.search-field input {
  width: 100%;
  height: 40px;
  padding: 0 20px 0 40px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 12px;
  background: #fff;
  font-size: 15px;
  outline: none;
}

.rail-search input:focus,
.search-field input:focus {
  border-color: rgba(0, 0, 0, 0.3);
}

.rail-search input::placeholder,
.search-field input::placeholder {
  color: var(--faint);
}

.card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  background: #fff;
}

.login-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 24px 16px 16px;
  text-align: center;
}

.login-card h2 {
  margin-top: 4px;
  font-size: 20px;
  font-weight: 800;
  line-height: 24px;
  color: var(--ink);
  letter-spacing: -0.01em;
}

.login-card p {
  margin: -8px 0 8px;
  font-size: 15px;
  line-height: 20px;
}

.card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 8px;
}

.card-head h2 {
  font-size: 17px;
  font-weight: 700;
  color: var(--ink);
}

.card-head a {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

.card-head a:hover {
  color: var(--ink);
}

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

.leaderboard li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
}

.rank {
  width: 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  text-align: center;
  flex: none;
}

.leader {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.leader-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.leader-name {
  display: flex;
  align-items: center;
  font-size: 15px;
  color: var(--ink);
}

.leader-name > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.leader:hover .leader-name > span {
  text-decoration: underline;
}

.leader-pub {
  font-size: 13px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rail-footer {
  padding: 4px 4px 0;
  font-size: 13px;
  line-height: 20px;
  color: var(--muted);
}

.rail-footer p + p {
  margin-top: 4px;
}

.rail-footer a {
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Explore */

.pills {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 0 0 16px;
  scrollbar-width: none;
}

.pills::-webkit-scrollbar {
  display: none;
}

.pill {
  flex: none;
  height: 32px;
  padding: 0 8px;
  border-radius: 8px;
  background: var(--gray);
  font-size: 13px;
  font-weight: 600;
  line-height: 20px;
  color: var(--muted);
}

.pill:hover {
  background: var(--gray-hover);
  color: var(--ink);
}

.pill[aria-pressed="true"] {
  background: var(--dark);
  color: #eee;
}

.explore-row {
  display: flex;
  gap: 16px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}

.explore-row[hidden] {
  display: none;
}

.explore-row-text {
  flex: 1;
  min-width: 0;
}

.explore-row-title {
  display: block;
  margin-top: 6px;
  font-size: 18px;
  font-weight: 700;
  line-height: 24px;
  color: var(--ink);
  letter-spacing: -0.01em;
}

.explore-row-title:hover {
  text-decoration: underline;
}

.explore-row-subtitle {
  margin-top: 4px;
  font-size: 15px;
  line-height: 20px;
  color: var(--muted);
}

.explore-row .meta {
  margin-top: 6px;
}

.explore-row-thumb img {
  width: 72px;
  height: 72px;
  border-radius: 8px;
  object-fit: cover;
}

/* Profile */

.layout-profile .app {
  grid-template-columns: 232px minmax(0, 1fr);
}

.layout-profile .app-main > * {
  max-width: 568px;
}

.layout-profile .sidebar {
  border-right: 1px solid var(--line);
}

.layout-profile .app-main {
  padding-top: 0;
}

/* The writer's publication, across the top of their profile */
.layout-profile .app-main > .profile-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: none;
  height: 64px;
  margin: 0 -24px 16px;
  padding: 0 24px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.profile-topbar a {
  overflow: hidden;
  font-size: 24px;
  font-weight: 700;
  line-height: 28px;
  color: var(--ink);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.profile-id {
  min-width: 0;
  padding-top: 20px;
}

.profile-name {
  display: flex;
  align-items: center;
  font-size: 20px;
  font-weight: 700;
  line-height: 24px;
  color: var(--ink);
  letter-spacing: -0.01em;
}

.profile-name .badge {
  width: 20px;
  height: 20px;
  margin-left: 6px;
}

.profile-handle {
  font-size: 15px;
  color: var(--muted);
}

.profile-avatar {
  width: 88px;
  height: 88px;
}

.profile-bio {
  margin-top: 16px;
  font-size: 15px;
  line-height: 20px;
}

.profile-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 28px;
  padding: 0 12px 0 4px;
  border-radius: 999px;
  background: var(--gray);
  font-size: 13px;
  font-weight: 400;
  color: var(--ink);
}

.chip .avatar {
  width: 20px;
  height: 20px;
  border-radius: 50%;
}

.chip:hover {
  background: var(--gray-hover);
}

.profile-stats {
  margin-top: 12px;
  font-size: 15px;
  color: var(--muted);
}

/* Substack leaves this unlined; the faint underline sets it apart for readers who can't tell the orange from the gray */
.profile-rank {
  color: var(--orange-text);
  text-decoration: underline;
  text-decoration-color: rgba(200, 81, 20, 0.35);
  text-underline-offset: 3px;
}

.profile-rank:hover {
  text-decoration-color: currentColor;
}

.profile-actions {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}

.profile-actions > .button:not(.button-square) {
  flex: 1;
}

.profile-tabs {
  display: flex;
  gap: 8px;
  margin-top: 20px;
  border-bottom: 1px solid var(--line);
}

.profile-tabs button {
  height: 44px;
  padding: 0 16px;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
}

.profile-tabs button[aria-selected="true"] {
  color: var(--ink);
  border-bottom-color: var(--ink);
}

.tab-panel .feed-item {
  padding: 20px 0;
}

.reply-item {
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
}

.reply-context {
  font-size: 13px;
  color: var(--muted);
}

.reply-context a {
  color: var(--ink);
  font-weight: 500;
}

.reply-context a:hover {
  text-decoration: underline;
}

.reply-quote {
  margin-top: 8px;
  padding-left: 12px;
  border-left: 2px solid var(--line);
  font-size: 15px;
  line-height: 21px;
  color: var(--muted);
}

.reply-text {
  margin-top: 8px;
  font-size: 15px;
  line-height: 21px;
  color: var(--text);
}

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

.pub-header {
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.pub-header-bar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  height: 72px;
  padding: 0 20px;
}

.pub-header-side {
  display: flex;
  align-items: center;
  min-width: 0;
}

.pub-header-side .pub-logo {
  width: 36px;
  height: 36px;
}

.pub-header-actions {
  justify-content: flex-end;
  gap: 8px;
}

.pub-header-name {
  font-size: 24px;
  font-weight: 700;
  line-height: 32px;
  color: var(--ink);
  letter-spacing: -0.015em;
  text-align: center;
  white-space: nowrap;
}

.pub-tabs {
  display: flex;
  justify-content: center;
  gap: 0;
  border-top: 1px solid var(--line);
  overflow-x: auto;
  scrollbar-width: none;
}

.pub-tabs a {
  display: flex;
  align-items: center;
  height: 48px;
  padding: 0 12px;
  border-bottom: 2px solid transparent;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.15px;
  color: var(--text);
}

.pub-tabs a:hover {
  color: var(--ink);
}

.pub-tabs a[aria-current="page"] {
  font-weight: 700;
  color: var(--ink);
  border-bottom-color: var(--ink);
}

/* Publication home and archive ---------------------------------------------- */

.pub-main {
  max-width: 948px;
  margin: 0 auto;
  padding: 24px 16px 64px;
}

.pub-hero {
  display: grid;
  gap: 32px;
  align-items: center;
  padding-bottom: 32px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--line);
  text-align: center;
}

.pub-hero.has-image {
  grid-template-columns: 1fr 1fr;
}

.pub-hero-image img {
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  border: 1px solid var(--line);
}

.pub-hero-title {
  display: block;
  font-size: 32px;
  font-weight: 700;
  line-height: 1.15;
  color: var(--ink);
  letter-spacing: -0.02em;
}

.pub-hero-title:hover {
  text-decoration: underline;
}

.pub-hero-subtitle {
  margin-top: 8px;
  font-size: 18px;
  line-height: 24px;
}

.pub-hero .meta {
  margin-top: 8px;
}

.pub-columns {
  display: grid;
  grid-template-columns: minmax(0, 600px) 284px;
  justify-content: center;
  gap: 48px;
}

.list-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 16px 0 8px;
}

.segmented {
  display: inline-flex;
  gap: 2px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.segmented button {
  height: 32px;
  padding: 0 10px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

.segmented button:hover {
  color: var(--ink);
}

.segmented button[aria-selected="true"] {
  background: var(--gray);
  color: var(--ink);
}

.post-preview {
  display: flex;
  gap: 24px;
  padding: 16px 0 24px;
  border-bottom: 1px solid var(--line);
}

.post-preview-content {
  flex: 1;
  min-width: 0;
}

.post-preview-pub {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
}

.post-preview-pub .avatar {
  width: 20px;
  height: 20px;
}

.post-preview-pub:hover span {
  text-decoration: underline;
}

.post-preview-title {
  display: block;
  font-size: 19px;
  font-weight: 700;
  line-height: 26px;
  color: var(--ink);
  letter-spacing: -0.01em;
}

.post-preview-title:hover {
  text-decoration: underline;
}

.post-preview-description {
  display: block;
  margin-top: 4px;
  font-size: 15px;
  line-height: 20px;
  color: var(--text);
}

.post-preview .meta {
  margin-top: 4px;
}

.post-preview-image img {
  width: 160px;
  height: 107px;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 4px;
}

.pub-sidebar {
  padding-top: 24px;
}

.pub-sidebar-name {
  font-size: 17px;
  font-weight: 700;
  color: var(--ink);
}

.pub-sidebar-description {
  margin: 4px 0 16px;
  font-size: 14px;
  line-height: 20px;
  color: var(--muted);
}

.pub-sidebar-heading {
  margin: 32px 0 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
  font-size: 17px;
  font-weight: 700;
  color: var(--ink);
}

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

.recommendations a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
}

.recommendations .pub-logo {
  width: 36px;
  height: 36px;
  border-radius: 8px;
}

.rec-name {
  display: block;
  font-size: 14px;
  font-weight: 700;
  line-height: 18px;
  color: var(--ink);
}

.recommendations a:hover .rec-name {
  text-decoration: underline;
}

.rec-author {
  display: block;
  font-size: 12px;
  color: var(--muted);
}

.archive {
  max-width: 640px;
  margin: 0 auto;
  padding: 24px 16px 64px;
}

.about {
  max-width: 640px;
  margin: 0 auto;
  padding: 48px 16px 64px;
}

.about-title {
  font-size: 32px;
  font-weight: 700;
  line-height: 1.15;
  color: var(--ink);
  letter-spacing: -0.02em;
}

.about-description {
  margin-top: 8px;
  font-size: 18px;
  line-height: 26px;
  color: var(--muted);
}

.about .subscribe-form {
  margin: 24px 0 0;
}

.about-heading {
  margin: 48px 0 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
  font-size: 20px;
  font-weight: 700;
  color: var(--ink);
}

.person {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.person .avatar {
  width: 48px;
  height: 48px;
}

.person-text {
  flex: 1;
  min-width: 0;
}

.person-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
}

.person-name:hover {
  text-decoration: underline;
}

.person-text .badge {
  display: inline-block;
  vertical-align: -2px;
}

.person-text p {
  margin-top: 2px;
  font-size: 15px;
  line-height: 20px;
  color: var(--muted);
}

/* Subscribe form ------------------------------------------------------------- */

/* Substack's email box: an input and a button joined into one 8px-cornered bar */
.subscribe-form {
  display: flex;
  max-width: 384px;
  width: 100%;
}

.subscribe-form input {
  flex: 1;
  min-width: 0;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--orange);
  border-right: 0;
  border-radius: 8px 0 0 8px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  font-size: 15px;
  line-height: 20px;
  outline: none;
}

.subscribe-form input:focus {
  box-shadow: 0 0 0 3px rgba(255, 103, 25, 0.2);
}

.subscribe-form input::placeholder {
  color: var(--faint);
}

.subscribe-form .button {
  height: 40px;
  padding: 0 20px;
  border: 1px solid var(--orange);
  border-radius: 0 8px 8px 0;
  box-shadow: none;
  font-size: 14px;
  font-weight: 500;
}

.subscribe-form-end {
  margin: 28px auto 0;
}

.subscribe-form-end input {
  background: var(--gray);
}

.subscribe-form-inverse input {
  border-color: #fff;
  background: transparent;
  box-shadow: none;
  color: #fff;
}

.subscribe-form-inverse input::placeholder {
  color: rgba(255, 255, 255, 0.85);
}

.subscribe-form-inverse input:focus {
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.3);
}

/* Substack outlines this one in white; filled, its orange text stays readable */
.subscribe-form-inverse .button-primary {
  border-color: #fff;
  background: #fff;
  color: var(--orange-text);
}

.subscribe-form-inverse .button-primary:hover {
  background: var(--peach);
}

/* Post ------------------------------------------------------------------------------ */

.post {
  max-width: 760px;
  margin: 0 auto;
  padding: 32px 16px 0;
}

.post-header {
  margin-bottom: 16px;
}

.post-title {
  font-size: 32px;
  font-weight: 700;
  line-height: 36px;
  color: var(--ink);
  letter-spacing: -0.02em;
  overflow-wrap: break-word;
}

.post-subtitle {
  margin-top: 12px;
  font-size: 18px;
  font-weight: 400;
  line-height: 24px;
  color: var(--muted);
}

.byline {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
}

.byline .avatar {
  width: 36px;
  height: 36px;
}

.byline-meta {
  display: flex;
  flex-direction: column;
  font-size: 11px;
  font-weight: 500;
  line-height: 20px;
  letter-spacing: 0.2px;
  text-transform: uppercase;
  color: var(--muted);
}

.byline-name {
  color: var(--text);
}

.byline-name:hover {
  text-decoration: underline;
}

.post-ufi {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 16px;
}

.post-ufi-left {
  display: flex;
  gap: 8px;
}

.pill-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 14px 0 12px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #fff;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.15px;
  color: var(--muted);
  transition: background-color 0.12s ease, border-color 0.12s ease;
}

.pill-button:hover {
  background: var(--hover);
}

.pill-button:last-child:not(:first-child),
.post-ufi > .pill-button {
  padding: 0 14px;
}

.body {
  font-family: var(--font-body);
  font-size: 19px;
  line-height: 1.6;
  color: var(--text);
  overflow-wrap: break-word;
}

.body p {
  margin: 0 0 20px;
}

.body h2,
.body h3,
.body h4 {
  margin: 1.4em 0 0.6em;
  font-family: var(--font-ui);
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.015em;
}

.body h2 {
  font-size: 1.625em;
  line-height: 1.16;
}

.body h3 {
  font-size: 1.375em;
  line-height: 1.2;
}

.body h4 {
  font-size: 1.125em;
  line-height: 1.3;
}

.body ul,
.body ol {
  margin: 0 0 20px;
  padding-left: 32px;
}

.body li {
  margin: 0 0 10px;
  padding-left: 4px;
}

.body li p {
  margin: 0;
}

.body li::marker {
  color: var(--text);
}

.body a {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.body strong {
  font-weight: 700;
  color: var(--ink);
}

.body blockquote {
  margin: 20px 0;
  padding-left: 20px;
  border-left: 4px solid var(--orange);
}

.body hr {
  height: 1px;
  margin: 32px 0;
  border: 0;
  background: var(--line);
}

.body-image {
  margin: 0 0 28px;
}

.body-image img {
  width: 100%;
  height: auto;
}

.body-image figcaption {
  margin-top: 8px;
  font-size: 14px;
  line-height: 20px;
  color: var(--muted);
  text-align: center;
}

.post-footer {
  margin-top: 32px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.post-footer .post-ufi {
  margin-top: 0;
  padding: 16px 0;
  border-top: 1px solid var(--line);
}

.facepile {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 0;
  font-size: 13px;
  color: var(--muted);
}

.faces {
  display: flex;
}

.faces .avatar {
  width: 32px;
  height: 32px;
  margin-right: -6px;
  box-shadow: 0 0 0 2px #fff;
  --size: 32px;
}

.faces > :last-child {
  margin-right: 0;
}

/* Comments */

.discussion {
  max-width: 760px;
  margin: 0 auto;
  padding: 40px 16px 0;
}

.discussion-title {
  font-size: 20px;
  font-weight: 700;
  line-height: 24px;
  color: var(--ink);
  letter-spacing: -0.01em;
}

.comment-composer {
  display: flex;
  gap: 12px;
  margin: 20px 0 24px;
}

.comment-composer .avatar {
  width: 32px;
  height: 32px;
}

.comment-composer span {
  flex: 1;
  min-height: 96px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 4px;
  font-size: 15px;
  line-height: 20px;
  color: var(--faint);
}

.comment-composer:hover span {
  border-color: #cfcfcf;
}

.comment {
  display: flex;
  gap: 12px;
  padding-bottom: 20px;
}

.comment .avatar {
  width: 32px;
  height: 32px;
  --size: 32px;
}

.comment-main {
  flex: 1;
  min-width: 0;
}

.comment-head {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 24px;
}

.comment-head .badge {
  margin-left: -4px;
}

.comment-name {
  font-size: 15px;
  font-weight: 500;
  color: var(--ink);
}

a.comment-name:hover {
  text-decoration: underline;
}

.comment-head time {
  font-size: 13px;
  color: var(--muted);
}

.comment-head .icon-button {
  margin-left: auto;
  color: var(--muted);
}

.liked-by {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 2px 0 4px;
  padding: 1px 6px;
  border: 1px solid rgba(255, 103, 25, 0.5);
  border-radius: 4px;
  background: #fff;
  font-size: 11px;
  font-weight: 500;
  line-height: 16px;
  color: var(--orange-text);
}

.liked-by .icon {
  width: 11px;
  height: 11px;
  fill: var(--orange);
  stroke: var(--orange);
}

.comment-body {
  font-size: 15px;
  line-height: 24px;
  color: var(--text);
  overflow-wrap: break-word;
}

.comment-body p + p {
  margin-top: 10px;
}

.comment-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 6px;
}

.comment-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.2px;
  text-transform: uppercase;
  color: var(--muted);
}

.comment-action .icon {
  width: 16px;
  height: 16px;
}

.comment-action:hover {
  color: var(--ink);
}

.comment-share {
  margin-left: auto;
}

/* Replies hang off a thread line, as on Substack */
.comment-replies {
  margin-top: 16px;
  padding-left: 16px;
  border-left: 1px solid var(--line);
}

.comment-replies .comment:last-child {
  padding-bottom: 0;
}

/* More posts and the end-of-post band */

.more-posts {
  max-width: 760px;
  margin: 0 auto;
  padding: 40px 16px 8px;
}

.ready {
  margin-top: 40px;
  padding: 48px 16px;
  background: var(--orange);
  color: #fff;
  text-align: center;
}

.ready h2 {
  margin-bottom: 20px;
  font-size: 24px;
  font-weight: 600;
  line-height: 28px;
}

.ready .subscribe-form {
  margin: 0 auto;
}

/* Footer ---------------------------------------------------------------------------- */

.site-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 32px 16px 40px;
  border-top: 1px solid var(--line);
  background: var(--gray);
  font-size: 14px;
  line-height: 20px;
  color: var(--muted);
  text-align: center;
}

.ready + .site-footer,
.layout-post .site-footer {
  border-top: 0;
}

.footer-legal a,
.footer-tagline a {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.footer-legal a:hover,
.footer-tagline a:hover {
  color: var(--ink);
}

.footer-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.button-footer {
  padding: 0 16px;
  background: #fff;
  border-color: var(--line);
  color: var(--muted);
  gap: 6px;
}

.button-footer:hover {
  background: var(--hover);
}

/* Sign in and plain pages -------------------------------------------------------------- */

.sign-in {
  position: relative;
  min-height: 100vh;
  padding: 72px 16px 48px;
}

.sign-in-back {
  position: absolute;
  top: 16px;
  left: 16px;
}

.sign-in-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 400px;
  width: 100%;
  gap: 24px;
  margin: 0 auto;
  text-align: center;
}

.sign-in-inner h1 {
  margin: 0;
  font-size: 30px;
  font-weight: 800;
  line-height: 36px;
  color: var(--ink);
  letter-spacing: -0.02em;
}

/* All authentication methods share one column and consistent control sizes. */
.sign-in-provider.button{width:100%;min-height:48px;border:1px solid #d5d5d5;background:#fff;color:var(--ink);box-shadow:none}
.sign-in-provider.button:hover{background:#f7f7f7;border-color:#aaa}
.sign-in-divider{display:flex;align-items:center;gap:16px;width:100%;color:var(--muted);font-size:13px;line-height:16px}
.sign-in-divider::before,.sign-in-divider::after{content:"";height:1px;flex:1;background:var(--line)}
.sign-in-field{display:grid;gap:8px;text-align:left;font-size:14px;font-weight:500;line-height:20px}
.sign-in-form .button{min-height:48px}
.sign-in-form .form-error{margin:0}
.sign-in-form .sign-in-switch{margin:4px 0 0}
.sign-in-form .sign-in-note{margin:0;overflow-wrap:anywhere}
.sign-in-inner:has([data-sign-in][hidden])>.sign-in-provider,.sign-in-inner:has([data-sign-in][hidden])>.sign-in-divider{display:none}
@media(max-width:480px){.sign-in{padding:64px 24px 40px}.sign-in-inner h1{font-size:27px;line-height:1.25}}

.sign-in-form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.sign-in-form input {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border: 1px solid #cfcfcf;
  border-radius: 8px;
  font-size: 16px;
  outline: none;
}

.sign-in-form input:focus {
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(255, 103, 31, 0.18);
}

.form-error {
  margin-top: -8px;
  font-size: 13px;
  color: #c62828;
  text-align: left;
}

.sign-in-switch {
  margin-top: -4px;
  font-size: 13px;
  line-height: 20px;
  color: var(--muted);
}

.sign-in-switch button {
  font-weight: 600;
  color: var(--orange-text);
}

.sign-in-switch button:hover {
  text-decoration: underline;
}

.plain-header {
  display: flex;
  justify-content: center;
  padding: 22px 16px;
  border-bottom: 1px solid var(--line);
}

.plain {
  max-width: 640px;
  min-height: 50vh;
  margin: 0 auto;
  padding: 48px 16px 80px;
  font-family: var(--font-body);
  font-size: 19px;
  line-height: 1.6;
}

.plain h1 {
  margin-bottom: 20px;
  font-family: var(--font-ui);
  font-size: 32px;
  font-weight: 700;
  line-height: 36px;
  color: var(--ink);
  letter-spacing: -0.02em;
}

.plain h2 {
  margin: 32px 0 8px;
  font-family: var(--font-ui);
  font-size: 20px;
  font-weight: 700;
  color: var(--ink);
}

.plain p + p {
  margin-top: 16px;
}

.plain a:not(.button) {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.plain .button {
  font-family: var(--font-ui);
}

/* About (modeled on substack.com/about) */

.about-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  padding: 96px 24px 104px;
  background: var(--orange);
  color: var(--dark); /* white on this orange is too faint to read comfortably */
  text-align: center;
}

.about-hero h1 {
  max-width: 880px;
  font-family: var(--font-body);
  font-size: clamp(40px, 6vw, 72px);
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -0.02em;
}

.about-hero p {
  max-width: 560px;
  font-size: 19px;
  line-height: 1.4;
}

.about-hero .button {
  margin-top: 8px;
}

.about-content {
  max-width: 760px;
  margin: 0 auto;
  padding: 64px 16px 80px;
}

.about-figure {
  margin: 0 auto 40px;
  max-width: 560px;
}

.about-figure img {
  width: 100%;
  height: auto;
}

.about-figure figcaption {
  margin-top: 10px;
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.4;
  color: var(--muted);
  text-align: center;
}

/* Search, menus, toast --------------------------------------------------------------- */

.search-dialog {
  width: min(560px, calc(100vw - 32px));
  max-height: min(560px, calc(100vh - 96px));
  margin: 12vh auto auto;
  padding: 0;
  border: 0;
  border-radius: 16px;
  box-shadow: var(--shadow);
  color: var(--text);
}

.search-dialog::backdrop {
  background: rgba(0, 0, 0, 0.35);
}

.search-dialog-inner {
  display: flex;
  flex-direction: column;
  max-height: inherit;
  padding: 12px;
}

.search-field {
  position: relative;
  display: flex;
  align-items: center;
  gap: 4px;
}

.search-field > .icon {
  position: absolute;
  left: 14px;
  width: 18px;
  height: 18px;
  color: var(--muted);
  pointer-events: none;
}

.search-results {
  overflow-y: auto;
}

.search-results:not(:empty) {
  margin-top: 8px;
}

.search-results-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 20;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: var(--shadow);
}

.search-result {
  display: block;
  padding: 10px 12px;
  border-radius: 10px;
}

.search-result:hover,
.search-result:focus-visible {
  background: var(--hover);
  outline: none;
}

.search-result-title {
  display: block;
  font-size: 15px;
  font-weight: 600;
  line-height: 20px;
  color: var(--ink);
}

.search-result-meta {
  display: block;
  margin-top: 2px;
  font-size: 13px;
  color: var(--muted);
}

.search-empty {
  padding: 12px;
  font-size: 14px;
  color: var(--muted);
}

.menu {
  position: absolute;
  z-index: 50;
  min-width: 180px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: var(--shadow);
}

.menu a,
.menu button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 10px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  text-align: left;
}

.menu a:hover,
.menu button:hover,
.menu a:focus-visible,
.menu button:focus-visible {
  background: var(--hover);
  outline: none;
}

.menu .icon {
  width: 18px;
  height: 18px;
  color: var(--muted);
}

.menu .menu-check {
  margin-left: auto;
  color: var(--orange);
}

.subscribe-dialog {
  width: min(420px, calc(100vw - 32px));
  margin: auto;
  padding: 36px 24px 28px;
  border: 0;
  border-radius: 16px;
  box-shadow: var(--shadow);
  color: var(--text);
  text-align: center;
}

.subscribe-dialog::backdrop {
  background: rgba(0, 0, 0, 0.35);
}

.subscribe-dialog:focus {
  outline: none;
}

.dialog-close {
  position: absolute;
  top: 10px;
  right: 10px;
  color: var(--muted);
}

.subscribe-dialog .pub-logo {
  width: 56px;
  height: 56px;
  margin: 0 auto 14px;
  border-radius: 12px;
}

.subscribe-dialog h2 {
  font-size: 20px;
  font-weight: 700;
  line-height: 26px;
  color: var(--ink);
  letter-spacing: -0.01em;
}

.subscribe-dialog .subscribe-form {
  margin: 20px auto 0;
}

.subscribe-dialog p {
  margin-top: 8px;
  font-size: 15px;
  line-height: 22px;
}

.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.account-button {
  display: inline-flex;
  flex: none;
  border-radius: 50%;
}

.account-button .avatar {
  width: 32px;
  height: 32px;
}

.menu-heading {
  padding: 8px 10px 10px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sign-in-note {
  font-size: 15px;
  line-height: 22px;
}

.text-link {
  align-self: center;
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.text-link:hover {
  color: var(--ink);
}

.spinner-lg {
  width: 28px;
  height: 28px;
  border-width: 3px;
}

.confirm-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.confirm-pending {
  padding: 48px 0;
}

.comment-composer.is-closed span {
  display: flex;
  align-items: center;
  min-height: 56px;
  background: var(--off-white);
  color: var(--muted);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 60;
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--ink);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translate(-50%, 8px);
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* Social card template (rendered to PNG by scripts/og-images.mjs) ------------------ */

.og-body {
  width: 1200px;
  height: 630px;
  overflow: hidden;
}

.og-card {
  display: flex;
  flex-direction: column;
  width: 1200px;
  height: 630px;
  padding: 64px 80px 56px;
  background: #fff;
}

.og-pub {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 28px;
  font-weight: 600;
  color: var(--muted);
}

.og-pub .avatar {
  width: 56px;
  height: 56px;
  border-radius: 12px;
}

.og-title {
  margin-top: 36px;
  font-size: 62px;
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.025em;
  color: var(--ink);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.og-subtitle {
  margin-top: 20px;
  font-size: 30px;
  line-height: 1.3;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.og-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
}

.og-author {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 24px;
  font-weight: 500;
  color: var(--text);
}

.og-author .avatar {
  width: 44px;
  height: 44px;
  --size: 44px;
}

/* Responsive ------------------------------------------------------------------------------ */

@media (max-width: 1239px) {
  .app {
    grid-template-columns: 76px minmax(0, 1fr) 360px;
  }

  .layout-profile .app {
    grid-template-columns: 76px minmax(0, 1fr);
  }

  .sidebar {
    align-items: center;
    padding: 24px 12px;
  }

  .sidebar-logo {
    align-self: center;
    margin: 0 0 16px;
  }

  .side-link {
    justify-content: center;
    width: 48px;
    padding: 0;
  }

  .side-link span,
  .side-create span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }

  .side-create {
    width: 48px;
    height: 48px;
    padding: 0;
  }

  .side-create .icon {
    display: block;
    width: 22px;
    height: 22px;
    stroke-width: 2.4;
  }

  .rail {
    padding: 24px 20px 32px 8px;
  }
}

@media (max-width: 1023px) {
  .app {
    grid-template-columns: 76px minmax(0, 1fr);
  }

  .rail {
    display: none;
  }

  .mobile-footer {
    display: block;
    margin-top: 32px;
  }

  .mobile-footer .rail-footer {
    text-align: center;
  }

  .pub-columns {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
  }

  .pub-sidebar {
    padding-top: 16px;
    border-top: 1px solid var(--line);
  }

  .pub-header-bar {
    display: flex;
    gap: 12px;
  }

  .pub-header-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: left;
  }
}

@media (max-width: 767px) {
  .app,
  .layout-profile .app {
    display: block;
    padding-bottom: calc(56px + env(safe-area-inset-bottom));
  }

  .sidebar,
  .get-app {
    display: none;
  }

  .mobile-bar {
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    gap: 8px;
    height: 56px;
    padding: 0 16px;
    background: #fff;
  }

  .mobile-bar-mark img {
    width: 22px;
    height: auto;
  }

  .mobile-bar-title {
    flex: 1;
    min-width: 0;
    margin-left: 6px;
    font-size: 20px;
    font-weight: 700;
    color: var(--ink);
    letter-spacing: -0.01em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .tabbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 30;
    display: flex;
    justify-content: space-around;
    height: calc(56px + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
    border-top: 1px solid var(--line);
    background: #fff;
  }

  .tabbar a {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    color: var(--ink);
  }

  .tabbar .icon {
    width: 24px;
    height: 24px;
    stroke-width: 1.75;
  }

  .app-main {
    padding: 4px 0 32px;
  }

  .layout-profile .app-main {
    padding: 8px 16px 32px;
  }

  /* Phones show the writer's name in the top bar instead */
  .layout-profile .app-main > .profile-topbar {
    display: none;
  }

  .promo {
    margin: 0 10px;
    padding: 32px 16px;
  }

  .promo h1 {
    font-size: 26px;
  }

  .feed-toolbar {
    padding: 16px 12px 0;
  }

  .feed-item {
    padding: 16px;
  }

  .pills {
    padding: 8px 16px 12px;
  }

  .explore-list {
    padding: 0 16px;
  }

  .mobile-footer {
    padding: 0 16px;
  }

  .pub-header-bar {
    display: flex;
    height: 56px;
    padding: 0 12px 0 16px;
    gap: 8px;
  }

  .pub-header-bar > .pub-header-side:first-child {
    display: none;
  }

  .pub-header-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 16px;
    line-height: 22px;
    text-align: left;
    letter-spacing: -0.01em;
  }

  .pub-header-actions {
    gap: 4px;
  }

  .hide-mobile {
    display: none;
  }

  .button-header {
    height: 32px;
    padding: 0 8px;
    font-size: 13px;
  }

  .pub-main {
    padding-top: 8px;
  }

  .pub-hero.has-image {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .pub-hero-title {
    font-size: 26px;
  }

  .post-preview {
    gap: 16px;
  }

  .post-preview-title {
    font-size: 17px;
    line-height: 23px;
  }

  .post-preview-image img {
    width: 96px;
    height: 64px;
  }

  .post {
    padding-top: 24px;
  }

  /* Substack sets the essay a size smaller on phones */
  .body {
    font-size: 17px;
  }

  .pill-button {
    padding: 0 12px 0 10px;
  }
}

@media (max-width: 380px) {
  .mobile-bar .button-secondary {
    display: none;
  }

  .post-ufi .pill-button {
    gap: 6px;
    padding: 0 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
    animation-duration: 0.01ms !important;
  }
}

/* "Discover more from…" ------------------------------------------------------ */

.discover-dialog {
  width: min(440px, calc(100vw - 32px));
  padding: 40px 28px 24px;
}

.discover-dialog .pub-logo {
  width: 64px;
  height: 64px;
}

.discover-dialog h2 {
  font-size: 22px;
  line-height: 28px;
}

.subscribe-dialog .discover-description {
  font-size: 16px;
  color: var(--text);
}

.subscribe-dialog .discover-count {
  margin-top: 6px;
  font-size: 14px;
  color: var(--muted);
}

.subscribe-dialog .discover-legal {
  max-width: 330px;
  margin: 14px auto 0;
  font-size: 12px;
  line-height: 17px;
  color: var(--muted);
}

.discover-legal a {
  color: inherit;
  text-decoration: underline;
}

.discover-continue {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  margin-top: 18px;
  padding: 6px 8px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 500;
  color: var(--muted);
}

.discover-continue:hover {
  color: var(--ink);
}

.discover-continue .icon {
  width: 16px;
  height: 16px;
}

/* A publication's welcome page (welcome.js decides who sees it) ------------------- */

.welcome {
  display: none;
}

.show-welcome body {
  overflow: hidden;
}

.show-welcome .welcome {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  overflow-y: auto;
  padding: 72px 16px 48px;
  background: #fff;
  text-align: center;
}

.welcome:focus {
  outline: none;
}

.welcome-close {
  position: absolute;
  top: 24px;
  right: 24px;
}

.welcome-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 440px;
  margin: auto;
}

.welcome-logo {
  width: 88px;
  height: 88px;
  margin-bottom: 24px;
  border-radius: 12px;
  object-fit: cover;
}

.welcome-name {
  font-size: 24px;
  font-weight: 700;
  line-height: 28px;
  color: var(--ink);
  text-wrap: balance;
}

.welcome-tagline {
  max-width: 384px;
  margin-top: 12px;
  font-size: 16px;
  line-height: 23px;
  color: var(--muted);
  text-wrap: balance;
}

.welcome-byline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0 4px;
  margin-top: 8px;
  font-size: 14px;
  font-weight: 600;
  line-height: 21px;
  color: var(--muted);
}

.welcome-byline .badge {
  margin-left: 0;
}

.welcome-byline a:hover {
  text-decoration: underline;
}

.welcome .subscribe-form {
  margin-top: 32px;
}

.welcome-legal {
  max-width: 384px;
  margin-top: 20px;
  font-size: 13px;
  line-height: 20px;
  color: var(--muted);
}

.welcome-legal a {
  text-decoration: underline;
}

.welcome-skip {
  gap: 4px;
  margin-top: 10px;
  color: var(--muted);
}

.welcome-skip:hover {
  background: var(--hover);
  color: var(--ink);
}

.welcome-skip .icon {
  width: 18px;
  height: 18px;
}

/* Notes ------------------------------------------------------------------------- */

.note-text {
  font-size: 15px;
  line-height: 22px;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.note-text p + p {
  margin-top: 10px;
}

.feed-note .feed-ufi {
  margin-top: 10px;
}

/* Paywall ------------------------------------------------------------------------ */

.paywall-teaser {
  max-height: 180px;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to bottom, #000 10%, transparent 95%);
  mask-image: linear-gradient(to bottom, #000 10%, transparent 95%);
  user-select: none;
}

/* A block of the publication's color, as on Substack. Its orange is the darker text orange,
   so the white type on it stays readable. */
.paywall-card {
  position: relative;
  margin: 8px 0 40px;
  padding: 48px 24px 44px;
  background: var(--orange-text);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  color: #fff;
  text-align: center;
}

.paywall-title {
  font-size: 22px;
  font-weight: 300;
  line-height: 29px;
  color: #fff;
}

.paywall-card .paywall-button {
  height: 44px;
  margin-top: 24px;
  padding: 0 20px;
  background: #fff;
  box-shadow: none;
  font-size: 16px;
  font-weight: 500;
  color: var(--orange-text);
}

.paywall-card .paywall-button:hover {
  background: var(--peach);
  color: var(--orange-deep);
}

.paywall-signin {
  margin-top: 16px;
  font-size: 13px;
  color: #fff;
}

.paywall-signin a {
  color: #fff;
  font-weight: 600;
}

.paywall-signin a:hover {
  text-decoration: underline;
}

/* The site's own accounts ----------------------------------------------------- */

.social-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2px;
  margin-top: 16px;
}

.social-links .icon-button {
  color: var(--muted);
}

.social-links .icon-button:hover {
  color: var(--ink);
}

.rail-footer .social-links {
  justify-content: flex-start;
  margin: 10px 0 0 -8px;
}

/* Profiles have no rail, so the footer that phones get shows at every width. */
.layout-profile .mobile-footer {
  display: block;
  margin-top: 32px;
}

.layout-profile .mobile-footer .rail-footer,
.mobile-footer .rail-footer {
  text-align: center;
}

.mobile-footer .rail-footer .social-links {
  justify-content: center;
  margin: 10px 0 0;
}

/* Article and author navigation stays available at every screen size. */
.layout-reading .app { grid-template-columns: 232px minmax(0, 1fr); }
.layout-reading .app-main { min-width: 0; padding-top: 56px; }
.layout-reading .sidebar { border-right: 1px solid var(--line); }
.layout-reading .sidebar-toggle { position: fixed; z-index: 45; top: 10px; left: 248px; font-size: 13px; }
.layout-post .app-main > * { max-width: none; }
.layout-reading.sidebar-collapsed .app { grid-template-columns: minmax(0, 1fr); }
.layout-reading.sidebar-collapsed .sidebar { display: none; }
.layout-reading.sidebar-collapsed .sidebar-toggle { left: 16px; }
@media (max-width: 1239px) and (min-width: 768px) {
  .layout-reading .app { grid-template-columns: 76px minmax(0, 1fr); }
  .layout-reading .sidebar-toggle { left: 92px; }
}
@media (max-width: 767px) {
  .layout-reading .app { display: block; }
  .layout-reading .mobile-bar { display: none; }
  .layout-reading .sidebar-toggle { left: 16px; }
  .layout-reading .sidebar { display: flex; position: fixed; z-index: 40; top: 0; left: 0; width: 232px; padding-top: 64px; background: #fff; box-shadow: 4px 0 20px #0002; overflow-y: auto; align-items: stretch; }
  .layout-reading .sidebar-logo { align-self: flex-start; }
  .layout-reading .side-link { width: auto; justify-content: flex-start; padding: 0 12px; }
  .layout-reading .side-link span, .layout-reading .side-create span { position: static; width: auto; height: auto; clip: auto; overflow: visible; }
  .layout-reading .side-create { width: auto; }
}
/* A quieter reader shell, with compact navigation that does not reserve a row. */
[hidden]{display:none!important}
.layout-reading .app-main{padding-top:0}
.layout-reading .sidebar-toggle{width:40px;height:40px;min-width:40px;padding:8px;top:12px;left:244px;border:1px solid #e9e6e1;background:#fffffff2;color:#5b5650;border-radius:50%;box-shadow:0 2px 8px #30281a0a}
.layout-reading.sidebar-collapsed .sidebar-toggle{left:14px}
.layout-reading .sidebar-toggle:hover{background:#f7f5f1;color:#1f1d1a}
.feed-toolbar{padding-top:24px;padding-bottom:16px;border-bottom:1px solid var(--line);margin-bottom:8px}
.post-card{border-color:#e7e4df;border-radius:12px;overflow:hidden;box-shadow:0 2px 7px #2b251c06}
.post-card-title{letter-spacing:-.025em;line-height:1.18}
.post-card:hover{border-color:#cec8bf;box-shadow:0 3px 12px #2b251c0a}
.feed-item{padding-top:24px;padding-bottom:24px}
.feed-name{letter-spacing:-.015em}
a:focus-visible,button:focus-visible{outline:2px solid var(--orange);outline-offset:4px}
@media(min-width:768px) and (max-width:1099px){.layout-reading .sidebar-toggle{left:88px}}
@media(max-width:767px){.layout-reading .sidebar-toggle{left:12px;top:10px}.layout-reading .pub-topbar,.layout-reading .profile-topbar{padding-left:62px;min-height:60px}.post-card{border-radius:9px}.feed-item{padding-top:20px;padding-bottom:20px}.layout-reading .app-main{padding-top:0}}
.reader-discussion{margin-top:32px;padding-top:24px;border-top:1px solid var(--line)}.reader-discussion h3{font-size:18px}.reader-discussion>p{color:var(--muted);font-size:14px}.reader-comment{padding:18px 0;border-bottom:1px solid var(--line);font-size:15px}.reader-comment>div:first-child{display:flex;align-items:center;flex-wrap:wrap;gap:10px}.reader-comment time,.reader-comment small{font-size:12px;color:#8b8175}.reader-comment p{line-height:1.65;overflow-wrap:anywhere}.reader-actions{display:flex;gap:14px;align-items:center;color:#827566;font-size:13px}.pending{color:#8d662b;font-size:12px}#reader-comment-form{margin-top:24px}#reader-comment-form textarea{width:100%;min-height:120px;border:1px solid #ddd6ca;border-radius:7px;padding:12px;font:inherit}#reader-account label{display:block;margin:16px 0;font-size:14px}#reader-account input,#reader-account textarea{display:block;width:100%;padding:12px;margin-top:6px;border:1px solid #ddd5c9;border-radius:6px;font:inherit}#reader-account textarea{min-height:100px}#reader-account details{margin-top:32px;font-size:14px}

.free-continuation{border-top:1px solid var(--line);padding:24px 0;margin-top:24px}.free-continuation summary{cursor:pointer;color:var(--orange);font:600 16px Inter,system-ui,sans-serif}.free-continuation[open] summary{margin-bottom:24px}

.layout-reading .pub-topbar,.layout-reading .profile-topbar{padding-left:68px}@media(max-width:767px){.layout-reading .pub-topbar,.layout-reading .profile-topbar{padding-left:62px}}

/* Keep the feed heading on the same 40px top row as navigation and search. */
@media(min-width:768px){.layout-home .app-main{padding-top:24px}.layout-home .feed-toolbar{height:40px;display:flex;align-items:center;padding:0 10px}}

.owner-badge{display:inline-block;border:1px solid #ccc;border-radius:3px;padding:1px 6px;color:#444;background:#f4f4f4;font:600 11px/1.5 var(--font-ui);white-space:nowrap}
