:root {
  color-scheme: dark;
  color: #f7f7f7;
  background: #010c1a;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at top, rgba(96, 165, 250, 0.08), transparent 28%),
    linear-gradient(180deg, rgba(1, 12, 26, 1) 0%, rgba(1, 12, 26, 1) 100%);
}

body::before {
  content: none;
}

.page-shell {
  position: relative;
  z-index: 1;
  max-width: 1300px;
  margin: 0 auto;
  padding: 1.5rem;
}

.hero {
  background: none;
  border: none;
  border-radius: 0;
  padding: 3.5rem 0 2.5rem;
  margin-bottom: 0.5rem;
}

.hero--tight-bottom {
  padding-bottom: 0;
  margin-bottom: 0;
}

.hero--compact {
  padding-top: 1.5rem;
}

.hero--tight-bottom {
  padding-bottom: 1.25rem;
  margin-bottom: 0.25rem;
}

.hero-content {
  display: grid;
  grid-template-columns: 55fr 45fr;
  align-items: stretch;
  gap: 1rem;
}

.hero-text h1 {
  font-size: clamp(3rem, 5.5vw, 5.5rem);
  font-weight: 800;
  line-height: 1.08;
  color: #f1f5f9;
}

.hero-accent {
  background-image:
    radial-gradient(ellipse at 18% 25%, rgba(240, 220, 255, 0.6) 0%, transparent 52%),
    radial-gradient(ellipse at 70% 70%, rgba(109, 40, 217, 0.55) 0%, transparent 48%),
    radial-gradient(ellipse at 85% 20%, rgba(167, 139, 250, 0.4) 0%, transparent 40%),
    linear-gradient(155deg, #c084fc 0%, #a855f7 30%, #8b5cf6 55%, #7c3aed 75%, #6d28d9 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-pi {
  font-style: italic;
  font-family: "Cambria Math", "STIX Two Math", Cambria, Georgia, serif;
}

.hero-subtext {
  color: #94a3b8;
  font-size: 1rem;
  margin-top: 1.25rem;
  line-height: 1.7;
}

.hero-visual {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
}

.galaxy-pi-img {
  width: 100%;
  max-width: 520px;
  height: auto;
  display: block;
  -webkit-mask-image: radial-gradient(ellipse 75% 75% at center, black 45%, transparent 80%);
  mask-image: radial-gradient(ellipse 75% 75% at center, black 45%, transparent 80%);
}

@media (max-width: 700px) {
  .hero-content {
    grid-template-columns: 1fr;
  }
  .hero-visual {
    display: none;
  }
  .trial-promo-box--mobile-only {
    display: flex;
    margin-inline: auto;
  }
}

.explanation {
  width: min(100%, 46rem);
  padding-inline: 2rem;
}

h1 {
  margin: 0;
  font-size: clamp(2.4rem, 3.5vw, 4rem);
  line-height: 1.05;
}

p {
  margin: 1rem 0 0;
  line-height: 1.8;
  color: #cbd5e1;
}

.explanation {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1rem;
  align-items: flex-start;
}

.legend {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  width: 100%;
  margin-top: 1.5rem;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 0.95rem;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 600;
}

.chip-for-sale {
  background-image:
    radial-gradient(ellipse at 22% 38%, rgba(219, 234, 254, 0.38) 0%, transparent 58%),
    linear-gradient(130deg, rgba(96, 165, 250, 0.88) 0%, rgba(59, 130, 246, 0.78) 55%, rgba(79, 70, 229, 0.82) 100%);
  color: #bfdbfe;
}
.chip-owned {
  background-image:
    radial-gradient(ellipse at 22% 38%, rgba(209, 250, 229, 0.38) 0%, transparent 58%),
    linear-gradient(130deg, rgba(52, 211, 153, 0.88) 0%, rgba(16, 185, 129, 0.78) 55%, rgba(13, 148, 136, 0.82) 100%);
  color: #a7f3d0;
}
.chip-owned-for-sale {
  background-image:
    radial-gradient(ellipse at 22% 38%, rgba(250, 215, 255, 0.38) 0%, transparent 58%),
    linear-gradient(130deg, rgba(217, 70, 239, 0.92) 0%, rgba(168, 85, 247, 0.82) 55%, rgba(124, 58, 237, 0.88) 100%);
  color: #f5d0fe;
}
.grid-and-leaderboard {
  display: flex;
  align-items: flex-start;
  gap: 1.5rem;
}

.grid-and-leaderboard--stacked {
  flex-direction: column;
}

.pi-grid-column {
  display: flex;
  flex-direction: column;
}

.grid-captions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem 1.75rem;
  margin-top: 0.85rem;
}

.grid-caption {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #64748b;
  font-size: 0.85rem;
}

.grid-caption svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.leaderboard {
  flex: 1;
  min-width: 0;
  background: rgba(1, 12, 26, 0.84);
  border: 1px solid rgba(148, 163, 184, 0.10);
  border-radius: 24px;
  padding: 1.25rem 1.5rem;
}

.leaderboard-title {
  margin: 0 0 1rem;
  font-size: 1rem;
  font-weight: 700;
  color: #f7f7f7;
}

.leaderboard-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.leaderboard-entry {
  display: grid;
  grid-template-columns: 1.5rem 1fr auto;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.75rem;
  border-radius: 10px;
  background: rgba(148, 163, 184, 0.05);
}

.leaderboard-entry:first-child {
  background: rgba(52, 211, 153, 0.1);
}

.leaderboard-place {
  font-size: 0.8rem;
  font-weight: 700;
  color: #64748b;
  text-align: center;
}

.leaderboard-entry:first-child .leaderboard-place {
  color: #34d399;
}

.leaderboard-name {
  font-size: 0.9rem;
  color: #e2e8f0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.leaderboard-total {
  font-size: 0.85rem;
  font-weight: 600;
  color: #94a3b8;
  white-space: nowrap;
}

.info-page .leaderboard-list--full {
  max-width: 28rem;
  padding-left: 0;
  color: inherit;
  line-height: normal;
}

.stream-sort-wrap {
  position: relative;
  display: inline-block;
  margin: 0 0 1.5rem;
}

.stream-sort-trigger {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(34, 211, 238, 0.06);
  border: 1px solid rgba(148, 163, 184, 0.25);
  color: #94a3b8;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  padding: 0.5rem 0.9rem;
  border-radius: 10px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.stream-sort-trigger:hover,
.stream-sort-trigger[aria-expanded="true"] {
  color: #f7f7f7;
  border-color: rgba(34, 211, 238, 0.55);
  background: rgba(34, 211, 238, 0.12);
}

.stream-sort-chevron {
  width: 0.7rem;
  height: 0.7rem;
  flex-shrink: 0;
  transition: transform 0.15s;
}

.stream-sort-trigger[aria-expanded="true"] .stream-sort-chevron {
  transform: rotate(180deg);
}

.stream-sort-dropdown {
  position: absolute;
  top: calc(100% + 0.5rem);
  left: 0;
  z-index: 200;
  min-width: 12rem;
  background: rgba(1, 12, 26, 0.97);
  border: 1px solid rgba(34, 211, 238, 0.25);
  border-radius: 10px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  overflow: hidden;
}

.stream-sort-item {
  display: block;
  padding: 0.65rem 1rem;
  color: #f7f7f7;
  font-size: 0.9rem;
  text-decoration: none;
  transition: background 0.12s;
}

.stream-sort-item:hover,
.stream-sort-item--active {
  background: rgba(34, 211, 238, 0.08);
}

.stream-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.stream-item {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.15);
}
.stream-item:last-child { border-bottom: none; padding-bottom: 0; }

.stream-item-avatar {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(148, 163, 184, 0.25);
  flex-shrink: 0;
  margin-top: 0.15rem;
}

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

.stream-item-title {
  display: block;
  font-size: 1.1rem;
  font-weight: 700;
  color: #f1f5f9;
  text-decoration: none;
}
.stream-item-title:hover { color: #60a5fa; }

.stream-item-meta {
  margin: 0.3rem 0 0.6rem;
  font-size: 0.85rem;
  color: #64748b;
}
.stream-item-meta a { color: #93c5fd; text-decoration: none; }
.stream-item-meta a:hover { text-decoration: underline; }

.stream-item-excerpt {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.6;
  color: #cbd5e1;
}

.leaderboard-load-more {
  display: block;
  width: fit-content;
  margin: 1.25rem auto 0;
}

.leaderboard-view-full {
  display: block;
  margin-top: 0.75rem;
  padding: 0.55rem;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  text-align: center;
  font-size: 0.85rem;
  font-weight: 500;
  color: #94a3b8;
  text-decoration: none;
  transition: color 0.1s ease, border-color 0.1s ease, background 0.1s ease;
}

.leaderboard-view-full:hover {
  color: #f1f5f9;
  border-color: rgba(148, 163, 184, 0.3);
  background: rgba(148, 163, 184, 0.06);
}

.leaderboard-about {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(148, 163, 184, 0.12);
}

.leaderboard-about-title {
  margin: 0 0 0.55rem;
  font-size: 1rem;
  font-weight: 700;
  color: #f1f5f9;
}

.leaderboard-about-text {
  margin: 0 0 0.75rem;
  font-size: 0.875rem;
  color: #94a3b8;
  line-height: 1.65;
}

.leaderboard-about-link {
  font-size: 0.875rem;
  font-weight: 500;
  color: #60a5fa;
  text-decoration: none;
}

.leaderboard-about-link:hover {
  text-decoration: underline;
}

.site-stats {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(148, 163, 184, 0.12);
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.site-stat {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.site-stat-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: #94a3b8;
}

.site-stat-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  padding: 3px;
  border-radius: 6px;
  box-sizing: content-box;
}

.site-stat-icon--digits {
  color: #cbd5e1;
  background: rgba(148, 163, 184, 0.15);
}

.site-stat-icon--owned {
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.15);
}

.site-stat-icon--owners {
  color: #34d399;
  background: rgba(52, 211, 153, 0.15);
}

.site-stat-icon--transactions {
  color: #a78bfa;
  background: rgba(167, 139, 250, 0.15);
}

.site-stat-value {
  font-size: 0.85rem;
  font-weight: 600;
  color: #e2e8f0;
  white-space: nowrap;
}

/* --- features strip --- */
.features-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
  margin-top: 2rem;
  padding: 2.5rem 2rem;
  border-radius: 24px;
  background: rgba(1, 12, 26, 0.84);
  border: 1px solid rgba(148, 163, 184, 0.10);
}

.feature {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.65rem;
}

.feature-icon {
  width: 2.5rem;
  height: 2.5rem;
  color: #818cf8;
  flex-shrink: 0;
}

.feature-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: #f1f5f9;
}

.feature-desc {
  margin: 0;
  font-size: 0.85rem;
  color: #64748b;
  line-height: 1.65;
}

@media (max-width: 640px) {
  .features-strip {
    grid-template-columns: repeat(2, 1fr);
  }
}

.pi-grid {
  display: grid;
  grid-template-columns: repeat(40, 1.2rem);
  gap: 0.08rem;
  padding: 1rem;
  border-radius: 24px;
  background: rgba(1, 12, 26, 0.84);
  border: 1px solid rgba(148, 163, 184, 0.10);
  touch-action: none;
  user-select: none;
  position: relative;
  overflow: hidden;
  justify-content: center;
}

.pi-grid::before {
  content: "π";
  position: absolute;
  inset: 0;
  font-size: min(55rem, 90vw);
  font-style: italic;
  font-family: "Cambria Math", "STIX Two Math", Cambria, Georgia, serif;
  line-height: 1;
  color: rgba(148, 163, 184, 0.30);
  display: flex;
  align-items: center;
  justify-content: center;
  transform: translate(-3%, -2%);
  pointer-events: none;
}

.digit {
  display: inline-flex;
  touch-action: none;
  align-items: center;
  justify-content: center;
  min-height: auto;
  width: 1.2rem;
  padding: 0.1rem 0.1rem;
  border-radius: 4px;
  font-size: 1rem;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: background-color 0.16s ease, color 0.16s ease, transform 0.16s ease;
  border: none;
  background: transparent;
}

.digit:hover,
.digit.selected {
  transform: none;
  box-shadow: none;
}

.digit[data-state="for-sale"] {
  background: linear-gradient(135deg, rgba(96, 165, 250, 0.24) 0%, rgba(79, 70, 229, 0.18) 100%);
  color: #93c5fd;
}

.digit[data-state="owned"] {
  background: linear-gradient(135deg, rgba(52, 211, 153, 0.28) 0%, rgba(34, 211, 238, 0.22) 100%);
  color: #6ee7b7;
}

.digit[data-state="owned-for-sale"] {
  background-image:
    radial-gradient(ellipse at 22% 38%, rgba(250, 215, 255, 0.4) 0%, transparent 58%),
    linear-gradient(130deg, rgba(217, 70, 239, 0.9) 0%, rgba(124, 58, 237, 0.72) 100%);
  color: #f5d0fe;
}

/* Lets adjacent purchases be told apart at a glance, without hovering:
   alternating between the pill's two emerald/teal tones, plus a seam
   at each group's first digit. */
.digit[data-state="owned"].shade-a {
  background-image:
    radial-gradient(ellipse at 22% 38%, rgba(209, 250, 229, 0.4) 0%, transparent 58%),
    linear-gradient(130deg, rgba(52, 211, 153, 0.9) 0%, rgba(16, 185, 129, 0.72) 100%);
  color: #a7f3d0;
}

.digit[data-state="owned"].shade-b {
  background-image:
    radial-gradient(ellipse at 22% 38%, rgba(209, 250, 229, 0.4) 0%, transparent 58%),
    linear-gradient(130deg, rgba(13, 148, 136, 0.9) 0%, rgba(8, 100, 122, 0.72) 100%);
  color: #a7f3d0;
}

.digit[data-state="owned-for-sale"].shade-a,
.digit[data-state="owned-for-sale"].shade-b {
  filter: none;
}

.digit.mine {
  outline: 1px solid rgba(229, 231, 235, 0.8);
  outline-offset: -1px;
  position: relative;
  z-index: 1;
}

.digit.group-start {
  box-shadow: inset 1px 0 0 0 rgba(255, 255, 255, 0.18);
}

.digit.owner-hover {
  filter: brightness(1.25) saturate(1.4);
  outline: 1px solid rgba(255, 255, 255, 0.4);
  position: relative;
  z-index: 1;
  border-radius: 2px;
}

.digit[data-state="owned-for-sale"].owner-hover {
  filter: saturate(1.6);
  background: rgba(217, 70, 239, 0.55);
}

.digit[data-state="for-sale"].owner-hover {
  filter: saturate(1.6);
  background: rgba(96, 165, 250, 0.55);
}

.digit.selected {
  background: rgba(96, 165, 250, 0.75);
  color: #ffffff;
  outline: 2px solid hsla(64, 83%, 84%, 0.454);
  border-color: rgba(255, 255, 255, 0.30);
}

.digit.search-match {
  background: rgba(250, 204, 21, 0.2);
  color: #fde68a;
}

.digit.search-match-active {
  background: #facc15;
  color: #422006;
  outline: 2px solid #facc15;
  outline-offset: 1px;
  position: relative;
  z-index: 1;
}

.digit-search {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1rem;
}

.digit-search input[type="text"] {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 6px;
  color: #e2e8f0;
  font-size: 0.9rem;
  font-family: monospace;
  padding: 0.35rem 0.7rem;
  outline: none;
  width: 160px;
}

.digit-search input[type="text"]:focus {
  border-color: #60a5fa;
}

.digit-search-count {
  font-size: 0.82rem;
  color: #64748b;
  min-width: 7ch;
}

.digit-search-nav,
.digit-search-clear {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 4px;
  color: #94a3b8;
  cursor: pointer;
  font-size: 0.85rem;
  padding: 0.25rem 0.5rem;
  line-height: 1;
}

.digit-search-nav:hover,
.digit-search-clear:hover {
  border-color: #60a5fa;
  color: #e2e8f0;
}

.selection-banner {
  margin-bottom: 1rem;
  padding: 1rem 1.25rem;
  border-radius: 18px;
  background: rgba(1, 12, 26, 0.95);
  border: 1px solid rgba(148, 163, 184, 0.18);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.selection-banner p {
  margin: 0;
  font-size: 1rem;
}

.price-balloon {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 2;
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  background: rgba(96, 165, 250, 0.95);
  color: #0f172a;
  font-size: 0.92rem;
  font-weight: 700;
  white-space: nowrap;
  box-shadow: 0 12px 28px rgba(1, 12, 26, 0.28);
  transform: translate(-50%, -120%);
  cursor: pointer;
}

.price-balloon:hover {
  background: rgba(96, 165, 250, 1);
  text-decoration: none;
}

.balloon-cta {
  opacity: 0.7;
  font-weight: 500;
}

.owner-balloon {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 2;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  background: rgba(1, 12, 26, 0.92);
  color: #f7f7f7;
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
  border: 1px solid rgba(148, 163, 184, 0.25);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  transform: translate(-50%, -120%);
  pointer-events: none;
}

.owner-balloon[hidden] {
  display: none;
}

.price-balloon[hidden] {
  display: none;
}

.button[hidden] {
  display: none !important;
}

[hidden] {
  display: none;
}

.button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 1.15rem;
  border-radius: 999px;
  background: #60a5fa;
  color: #0f172a;
  text-decoration: none;
  font-weight: 700;
}

.owner-page {
  padding-top: 1rem;
}

.page-bg-custom {
  position: fixed;
  inset: 0;
  z-index: 0;
  background-size: cover;
  background-position: top center;
  opacity: 0.08;
  pointer-events: none;
}

.owner-page.has-custom-bg::before {
  display: none;
}

.owner-page::before {
  content: "π";
  position: fixed;
  inset: 0;
  z-index: 2;
  font-size: clamp(36rem, 96vw, 100rem);
  font-style: italic;
  font-family: "Cambria Math", "STIX Two Math", Cambria, Georgia, serif;
  line-height: 1;
  color: rgba(148, 163, 184, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  transform: translate(-3%, -2%);
  pointer-events: none;
}

.owner-hero {
  margin-bottom: 1rem;
}

.hero-digits {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.9rem;
  color: #94a3b8;
  margin-top: 0.4rem;
  letter-spacing: 0.04em;
  word-break: break-all;
}

.owner-details {
  background: transparent;
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: 24px;
  padding: 1.75rem;
}

.digits-lead-in {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: #94a3b8;
}

.owner-digits {
  margin-top: 1rem;
  padding: 1rem;
  border-radius: 18px;
  background: rgba(1, 12, 26, 1);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 1rem;
  line-height: 1.6;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
}

.sale-note {
  margin-top: 1rem;
  padding: 1rem;
  border-radius: 18px;
  background: rgba(96, 165, 250, 0.08);
  color: #cbd5e1;
}

.policy-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.policy-badges-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: #94a3b8;
}

.policy-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(34, 211, 238, 0.06);
  border: 1px solid rgba(148, 163, 184, 0.25);
  color: #94a3b8;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.4rem 0.75rem;
  border-radius: 10px;
}

.policy-badge-icon {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: 24rem;
}

.auth-form label {
  font-size: 0.95rem;
  color: #cbd5e1;
}

.auth-input {
  padding: 0.75rem 1rem;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: transparent;
  color: #f7f7f7;
  font-size: 1rem;
  width: 100%;
}

.auth-input:focus {
  outline: 2px solid #60a5fa;
  outline-offset: 1px;
}

.profile-header {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.profile-image {
  width: 5rem;
  height: 5rem;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(148, 163, 184, 0.25);
  flex-shrink: 0;
}

.section-heading {
  margin: 0 0 1rem;
  font-size: 1rem;
  font-weight: 600;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.slice-section {
  margin-bottom: 1rem;
}

.bio-text,
.blog-body {
  margin: 0;
  font-size: 1.3125rem;
  line-height: 1.8;
  color: #cbd5e1;
}

.trix-editor-bio,
.trix-editor-blogbody {
  font-size: 1.3125rem;
  line-height: 1.8;
}

/* Caption entry is hidden for now (not removed - see _rich_text_attr_filter
   and hydrate_captions in app.py, which still fully support it) since Trix
   doesn't reliably redisplay an existing caption after a page reload. */
.trix-editor-bio figcaption,
.trix-editor-blogbody figcaption {
  display: none;
}

.bio-text p, .bio-text li,
.blog-body p, .blog-body li { margin: 0 0 0.4em; }

.bio-text .katex-display,
.blog-body .katex-display,
.comment-body .katex-display { margin: 0.2em 0; }
.bio-text ul, .bio-text ol,
.blog-body ul, .blog-body ol { padding-left: 1.4em; margin: 0 0 0.4em; }
.bio-text ol, .blog-body ol                                        { list-style-type: decimal; }
.bio-text ol ol, .blog-body ol ol                                  { list-style-type: lower-alpha; }
.bio-text ol ol ol, .blog-body ol ol ol                            { list-style-type: lower-roman; }
.bio-text ol ol ol ol, .blog-body ol ol ol ol                      { list-style-type: upper-alpha; }
.bio-text ol ol ol ol ol, .blog-body ol ol ol ol ol                { list-style-type: upper-roman; }
.bio-text ol ol ol ol ol ol, .blog-body ol ol ol ol ol ol          { list-style-type: decimal; }
.bio-text ol ol ol ol ol ol ol, .blog-body ol ol ol ol ol ol ol    { list-style-type: lower-alpha; }
.bio-text ol ol ol ol ol ol ol ol, .blog-body ol ol ol ol ol ol ol ol { list-style-type: lower-roman; }
.bio-text ol ol ol ol ol ol ol ol ol, .blog-body ol ol ol ol ol ol ol ol ol { list-style-type: upper-alpha; }
.bio-text ol ol ol ol ol ol ol ol ol ol, .blog-body ol ol ol ol ol ol ol ol ol ol { list-style-type: upper-roman; }
.bio-text a, .blog-body a { color: #60a5fa; }
.bio-text strong, .blog-body strong { color: #f1f5f9; }
.bio-text blockquote,
.blog-body blockquote { border-left: 3px solid #3a6a9a; margin: 0.5em 0; padding: 0.2em 0 0.2em 0.9em; color: #94a3b8; }

.comment-body p { margin: 0 0 0.3em; }
.comment-body p:last-child { margin-bottom: 0; }
.comment-body ul, .comment-body ol { padding-left: 1.4em; margin: 0 0 0.3em; }
.comment-body ol                                    { list-style-type: decimal; }
.comment-body ol ol                                 { list-style-type: lower-alpha; }
.comment-body ol ol ol                              { list-style-type: lower-roman; }
.comment-body ol ol ol ol                           { list-style-type: upper-alpha; }
.comment-body ol ol ol ol ol                        { list-style-type: upper-roman; }
.comment-body ol ol ol ol ol ol                     { list-style-type: decimal; }
.comment-body ol ol ol ol ol ol ol                  { list-style-type: lower-alpha; }
.comment-body ol ol ol ol ol ol ol ol               { list-style-type: lower-roman; }
.comment-body ol ol ol ol ol ol ol ol ol            { list-style-type: upper-alpha; }
.comment-body ol ol ol ol ol ol ol ol ol ol         { list-style-type: upper-roman; }
.comment-body a { color: #60a5fa; }
.comment-body blockquote { border-left: 3px solid #3a6a9a; margin: 0.3em 0; padding: 0.2em 0 0.2em 0.9em; color: #94a3b8; }

.bio-text img,
.blog-body img,
trix-editor img {
  max-width: min(1024px, 100%);
  max-height: 1024px;
  height: auto;
  border-radius: 0.375rem;
  display: block;
  margin: 0.5em 0;
}
.bio-text figcaption:empty,
.blog-body figcaption:empty { display: none; }

/* ── Blog ─────────────────────────────────────────────────────────────── */
.blog-latest-title {
  display: block;
  font-size: 1.1rem;
  font-weight: 600;
  color: #f1f5f9;
  margin-bottom: 0.4rem;
}
.blog-latest-title:hover { color: #60a5fa; }

.blog-all-link {
  margin: 0;
  font-size: 0.9rem;
}

.blog-index {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.blog-index-item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.15);
}
.blog-index-item:last-child { border-bottom: none; }

.blog-index-title {
  font-size: 1rem;
  font-weight: 600;
  color: #f1f5f9;
}
.blog-index-title:hover { color: #60a5fa; }

.blog-index-date {
  font-size: 0.85rem;
  color: #64748b;
  white-space: nowrap;
}

/* ── Trix editor dark-theme overrides ───────────────────────────────────── */
trix-toolbar {
  background: #162032;
  border: 1px solid rgba(96, 165, 250, 0.22);
  border-bottom: 1px solid rgba(96, 165, 250, 0.1);
  border-radius: 0.5rem 0.5rem 0 0;
  padding: 0.35rem 0.5rem;
}

trix-toolbar.trix-toolbar--bottom {
  border-radius: 0 0 0.5rem 0.5rem;
  border-top: 1px solid rgba(96, 165, 250, 0.1);
  border-bottom: 1px solid rgba(96, 165, 250, 0.22);
  position: sticky;
  bottom: 4.5rem;
  z-index: 50;
}

trix-toolbar .trix-button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem;
  align-items: center;
  /* trix.css sets overflow-x: auto (for its own nowrap layout, which we
     override to wrap above) — left alone, that also forces overflow-y: auto
     per the CSS overflow interop rule, clipping the dropdown popovers below. */
  overflow: visible;
  /* Containing block for the video-insert dialog (.trix-video-dialog),
     which spans this row's full width rather than anchoring to its own
     narrow trigger button — see the comment in page-edit.js for why. */
  position: relative;
}

/* Trix buttons: blue chip background. Filter goes on ::before (the SVG icon)
   NOT the button itself — filter on the button would also grey out the background. */
trix-toolbar .trix-button {
  background: rgba(96, 165, 250, 0.18);
  border: none;
  border-radius: 0.3rem;
  padding: 0.3rem 0.5rem;
  cursor: pointer;
  transition: background 0.12s ease, box-shadow 0.12s ease;
  min-width: 1.9rem;
  min-height: 1.9rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #93c5fd;
}

trix-toolbar .trix-button:hover {
  background: rgba(96, 165, 250, 0.32);
  color: #bfdbfe;
}

trix-toolbar .trix-button.trix-active {
  background: rgba(96, 165, 250, 0.42);
  color: #60a5fa;
  box-shadow: inset 0 -2px 0 #60a5fa;
}

/* Code button hidden until the exit-code-block UX is fixed */
trix-toolbar .trix-button--icon-code { display: none; }

/* text-indent can't hide text inside a flex container; color:transparent does */
trix-toolbar .trix-button--icon,
trix-toolbar .trix-button--icon:hover,
trix-toolbar .trix-button--icon.trix-active,
trix-toolbar .trix-button--icon:disabled {
  color: transparent;
}

/* Convert black SVG icons to white on the icon pseudo-element only */
trix-toolbar .trix-button--icon::before {
  filter: brightness(0) invert(1);
  opacity: 0.65;
}

trix-toolbar .trix-button--icon:hover::before {
  opacity: 0.92;
}

trix-toolbar .trix-button--icon.trix-active::before {
  filter: brightness(0) invert(1);
  opacity: 1;
}

trix-toolbar .trix-button--icon:disabled::before {
  filter: brightness(0) invert(1);
  opacity: 0.25;
}

trix-toolbar .trix-button-group {
  display: flex;
  gap: 0.2rem;
  border: none;
  background: none;
  padding: 0;
}

trix-toolbar .trix-button-group + .trix-button-group {
  margin-left: 0.4rem;
}

.trix-colour-swatch {
  display: block;
  width: 0.8rem;
  height: 0.8rem;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ── Font/colour dropdowns ────────────────────────────────────────────────
   Trigger buttons live in the toolbar row; each opens a popover anchored to
   it. Open direction (--upward/--downward) is decided once at setup time in
   trix-custom-attrs.js, based on whether the toolbar is the sticky-bottom
   comment variant — see trix-toolbar--bottom above. */
trix-toolbar .trix-dropdown {
  position: relative;
}

trix-toolbar .trix-dropdown-trigger--font {
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0 0.4rem;
  min-width: 2.1rem;
  letter-spacing: -0.01em;
}

trix-toolbar .trix-dropdown-trigger--colour {
  padding: 0;
}

.trix-colour-swatch--trigger {
  width: 0.9rem;
  height: 0.9rem;
  border: 1px solid rgba(226, 232, 240, 0.35);
}

trix-toolbar .trix-dropdown-popover {
  position: absolute;
  z-index: 60;
  background: #1e293b;
  border: 1px solid rgba(96, 165, 250, 0.3);
  border-radius: 0.4rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
  padding: 0.35rem;
}

trix-toolbar .trix-dropdown-popover--downward {
  top: calc(100% + 0.3rem);
}

trix-toolbar .trix-dropdown-popover--upward {
  bottom: calc(100% + 0.3rem);
}

/* Font popover: vertical list, each row previewed in its own font. Capped
   height (~4 rows) with scroll so a longer font list never pushes a
   sticky-bottom comment toolbar's popover off-screen. Anchored left:0 — the
   font trigger sits near the start of the row, so it grows rightward. */
trix-toolbar .trix-dropdown-popover--font {
  left: 0;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 8rem;
  max-height: 9.5rem;
  overflow-y: auto;
}

trix-toolbar .trix-dropdown-item--font {
  background: none;
  border: none;
  border-radius: 0.3rem;
  padding: 0.35rem 0.5rem;
  text-align: left;
  cursor: pointer;
  color: #e2e8f0;
  font-size: 0.88rem;
}

trix-toolbar .trix-dropdown-item--font:hover,
trix-toolbar .trix-dropdown-item--font.trix-active {
  background: rgba(96, 165, 250, 0.22);
}

/* Colour popover: fixed 4-column grid — width stays constant as more
   colours are added; rows grow instead (see design.md). Anchored right:0 —
   the colour trigger sits at the end of the row, so it grows leftward. */
trix-toolbar .trix-dropdown-popover--colour {
  right: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.3rem;
}

trix-toolbar .trix-dropdown-item--colour {
  background: none;
  border: none;
  border-radius: 0.3rem;
  padding: 0.35rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

trix-toolbar .trix-dropdown-item--colour:hover,
trix-toolbar .trix-dropdown-item--colour.trix-active {
  background: rgba(96, 165, 250, 0.22);
}

/* "Default" option: a labeled row spanning the grid's full width, above the
   swatches — same idea as Word's "Automatic"/Notion's "Default" text entry,
   rather than a marked swatch competing with the colour grid below it. */
trix-toolbar .trix-dropdown-item--default {
  grid-column: 1 / -1;
  display: block;
  width: 100%;
  box-sizing: border-box;
  text-align: left;
  background: none;
  border: none;
  border-bottom: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 0;
  padding: 0.3rem 0.4rem 0.5rem;
  margin-bottom: 0.2rem;
  color: #e2e8f0;
  font-size: 0.88rem;
  cursor: pointer;
}

trix-toolbar .trix-dropdown-item--default:hover,
trix-toolbar .trix-dropdown-item--default.trix-active {
  background: rgba(96, 165, 250, 0.22);
}

/* Dialog buttons are input[type="button"] — don't apply icon button styles to them */
trix-toolbar .trix-button--dialog {
  display: inline-block;
  background: rgba(96, 165, 250, 0.15);
  color: #e2e8f0;
  border: 1px solid rgba(96, 165, 250, 0.3);
  border-radius: 0.25rem;
  padding: 0.3rem 0.7rem;
  font-size: 0.8rem;
  cursor: pointer;
  min-width: auto;
  min-height: auto;
}

trix-toolbar .trix-button--dialog:hover {
  background: rgba(96, 165, 250, 0.28);
}

/* Dark-theme link dialog */
trix-toolbar .trix-dialog {
  background: #1e293b;
  border-top: 2px solid #60a5fa;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
  /* trix.css sets z-index: 5 — lower than the fixed Save/Cancel pill bar
     (.owner-toolbar, z-index: 100), so on a bottom-anchored toolbar the
     dialog could lose the stacking fight even after being repositioned
     upward below. Bumped to match our other toolbar overlays. */
  z-index: 60;
}

/* Trix's own link dialog always opens downward (top: 0, per trix.css) from
   the button row, with no awareness of where the toolbar sits on screen.
   Every toolbar in this app is the bottom-anchored variant (see
   trix-toolbar--bottom below), so opening downward pushed the dialog into
   the fixed Save/Cancel bar's territory, where it could get visually
   buried. Flip it upward the same way the font/colour dropdowns and video
   dialog already are. */
trix-toolbar.trix-toolbar--bottom .trix-dialog {
  top: auto;
  bottom: 100%;
}

trix-toolbar .trix-input--dialog {
  background: #010c1a;
  color: #e2e8f0;
  border: 1px solid rgba(96, 165, 250, 0.35);
  border-radius: 0.25rem;
}

/* Video-insert dialog — reuses the .trix-dialog/.trix-input--dialog look
   above, appended to the toolbar's button row (not the narrow trigger
   button), so trix.css's own left:0;right:0 base rule already spans the
   full row width — same sizing behaviour as Trix's native link dialog,
   and immune to where flex-wrap happens to place the trigger button.
   Only the vertical anchor needs overriding: upward when the toolbar is
   the sticky-bottom variant (matching the font/colour dropdowns in
   trix-custom-attrs.js), downward otherwise. */
trix-toolbar .trix-video-dialog {
  z-index: 60;
}

trix-toolbar .trix-video-dialog--downward {
  top: calc(100% + 0.3rem);
}

trix-toolbar .trix-video-dialog--upward {
  top: auto;
  bottom: calc(100% + 0.3rem);
}

.trix-video-dialog-error {
  margin: 0.5rem 0 0;
  font-size: 0.8rem;
  color: #fca5a5;
}

trix-toolbar .trix-button--icon-insert-video::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='2' y='5' width='15' height='14' rx='2'/%3E%3Cpath d='M22 8.5l-5 3.5 5 3.5v-7Z'/%3E%3C/svg%3E");
}

/* Video placeholder card — shown while editing (inside a Trix attachment)
   and as the fallback on the published page if a stored placeholder ever
   fails render-time validation (see render_video_embeds in app.py). */
.bio-text figure[data-video-provider] img,
.blog-body figure[data-video-provider] img,
trix-editor figure[data-video-provider] img {
  border-radius: 8px;
  max-width: 100%;
}

.bio-text figure[data-video-provider] figcaption,
.blog-body figure[data-video-provider] figcaption,
trix-editor figure[data-video-provider] figcaption {
  font-size: 0.85rem;
  color: #93c5fd;
  margin-top: 0.35rem;
}

/* Real embedded player on the published page (render_video_embeds output).
   The 16:9 aspect-ratio box (.video-embed-frame) is a separate inner
   element from the outer <figure> so an optional caption below it isn't
   clipped by the frame's own overflow:hidden or fighting its fixed ratio. */
.video-embed {
  width: 100%;
  max-width: 640px;
  margin: 0.75em 0;
}

.video-embed-frame {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  overflow: hidden;
  background: #010c1a;
}

.video-embed-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
}

.video-embed-caption {
  margin: 0.4rem 0 0;
  font-size: 0.85rem;
  color: #93c5fd;
}

trix-editor {
  background: #1e293b;
  color: #e2e8f0;
  border: 1px solid rgba(96, 165, 250, 0.22);
  border-top: none;
  border-radius: 0 0 0.5rem 0.5rem;
  padding: 0.75rem;
  min-height: 6rem;
  font-size: 0.95rem;
  line-height: 1.7;
}

trix-editor:focus {
  outline: none;
  border-color: rgba(96, 165, 250, 0.55);
}

trix-editor blockquote { border-left: 3px solid #3a6a9a; margin: 0.5em 0; padding: 0.2em 0 0.2em 0.9em; color: #94a3b8; }
trix-editor ol                                      { list-style-type: decimal; }
trix-editor ol ol                                   { list-style-type: lower-alpha; }
trix-editor ol ol ol                                { list-style-type: lower-roman; }
trix-editor ol ol ol ol                             { list-style-type: upper-alpha; }
trix-editor ol ol ol ol ol                          { list-style-type: upper-roman; }
trix-editor ol ol ol ol ol ol                       { list-style-type: decimal; }
trix-editor ol ol ol ol ol ol ol                    { list-style-type: lower-alpha; }
trix-editor ol ol ol ol ol ol ol ol                 { list-style-type: lower-roman; }
trix-editor ol ol ol ol ol ol ol ol ol              { list-style-type: upper-alpha; }
trix-editor ol ol ol ol ol ol ol ol ol ol           { list-style-type: upper-roman; }

.trix-editor-bio {
  min-height: 10rem;
}

trix-toolbar .trix-button-group--file-tools { display: none; }

trix-toolbar .trix-button--icon-insert-image::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='3' width='18' height='18' rx='2'/%3E%3Ccircle cx='8.5' cy='8.5' r='1.5'/%3E%3Cpolyline points='21 15 16 10 5 21'/%3E%3C/svg%3E");
}

.page-links {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.page-link {
  display: flex;
  flex-direction: column;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  background: rgba(148, 163, 184, 0.06);
  border: 1px solid rgba(148, 163, 184, 0.12);
  text-decoration: none;
  transition: background 0.15s ease;
}

.page-link:hover {
  background: rgba(148, 163, 184, 0.12);
}

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

.page-link-desc {
  font-weight: 600;
  color: #f7f7f7;
}

.page-link-url {
  font-size: 0.82rem;
  color: #64748b;
  margin-top: 0.15rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Platform-styled links ───────────────────────────────────── */
.page-link-icon {
  flex-shrink: 0;
  width: 2.4rem;
  height: 2.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.page-link-icon svg,
.page-link-icon img {
  width: 2.4rem;
  height: 2.4rem;
  object-fit: contain;
}

.page-link--wordpress {
  flex-direction: row;
  align-items: center;
  gap: 0.85rem;
  background: #0073aa;
  border-color: transparent;
  color: #fff;
}

.page-link--wordpress:hover {
  background: #005d8c;
}

.page-link--wordpress .page-link-desc {
  color: #fff;
}

.page-link--wordpress .page-link-url {
  color: rgba(255, 255, 255, 0.65);
}

.page-link--github {
  flex-direction: row;
  align-items: center;
  gap: 0.85rem;
  background: #24292f;
  border-color: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.page-link--github:hover {
  background: #32383f;
}

.page-link--github .page-link-desc {
  color: #fff;
}

.page-link--github .page-link-url {
  color: rgba(255, 255, 255, 0.55);
}

.page-link--github .page-link-icon img {
  filter: brightness(0) invert(1);
}

.page-link--youtube {
  flex-direction: row;
  align-items: center;
  gap: 0.85rem;
  background: #282828;
  border-color: transparent;
  color: #fff;
}

.page-link--youtube:hover {
  background: #3a3a3a;
}

.page-link--youtube .page-link-desc { color: #fff; }
.page-link--youtube .page-link-url  { color: rgba(255, 255, 255, 0.65); }

.page-link--facebook {
  flex-direction: row;
  align-items: center;
  gap: 0.85rem;
  background: #0d1b2e;
  border-color: transparent;
  color: #fff;
}

.page-link--facebook:hover {
  background: #1a2d45;
}

.page-link--facebook .page-link-desc { color: #fff; }
.page-link--facebook .page-link-url  { color: rgba(255, 255, 255, 0.65); }

.page-link--instagram {
  flex-direction: row;
  align-items: center;
  gap: 0.85rem;
  background: linear-gradient(135deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
  border-color: transparent;
  color: #fff;
}

.page-link--instagram:hover {
  filter: brightness(1.1);
}

.page-link--instagram .page-link-desc { color: #fff; }
.page-link--instagram .page-link-url  { color: rgba(255, 255, 255, 0.65); }
.page-link--instagram .page-link-icon img { filter: brightness(0) invert(1); }

.page-link--amazon {
  flex-direction: row;
  align-items: center;
  gap: 0.85rem;
  background: #232f3e;
  border-color: transparent;
  color: #fff;
}

.page-link--amazon:hover {
  background: #2e3d52;
}

.page-link--amazon .page-link-desc { color: #fff; }
.page-link--amazon .page-link-url  { color: rgba(255, 255, 255, 0.65); }
.page-link--amazon .page-link-icon img { filter: brightness(0) invert(1); }

.page-link--linkedin {
  flex-direction: row;
  align-items: center;
  gap: 0.85rem;
  background: #0077b5;
  border-color: transparent;
  color: #fff;
}

.page-link--linkedin:hover {
  background: #005e93;
}

.page-link--linkedin .page-link-desc { color: #fff; }
.page-link--linkedin .page-link-url  { color: rgba(255, 255, 255, 0.65); }
.page-link--linkedin .page-link-icon { width: 5rem; }
.page-link--linkedin .page-link-icon img { filter: brightness(0) invert(1); width: 5rem; height: auto; }

.page-link--500px {
  flex-direction: row;
  align-items: center;
  gap: 0.85rem;
  background: #14181c;
  border-color: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.page-link--500px:hover {
  background: #1e252e;
}

.page-link--500px .page-link-desc { color: #fff; }
.page-link--500px .page-link-url  { color: rgba(255, 255, 255, 0.55); }
.page-link--500px .page-link-icon img { filter: brightness(0) invert(1); }

.page-link--reddit {
  flex-direction: row;
  align-items: center;
  gap: 0.85rem;
  background: #1a1a1b;
  border-color: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.page-link--reddit:hover {
  background: #272729;
}

.page-link--reddit .page-link-desc { color: #fff; }
.page-link--reddit .page-link-url  { color: rgba(255, 255, 255, 0.55); }

.page-link--x {
  flex-direction: row;
  align-items: center;
  gap: 0.85rem;
  background: #000;
  border-color: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.page-link--x:hover {
  background: #111;
}

.page-link--x .page-link-desc { color: #fff; }
.page-link--x .page-link-url  { color: rgba(255, 255, 255, 0.55); }

.page-link--stackoverflow {
  flex-direction: row;
  align-items: center;
  gap: 0.85rem;
  background: #242424;
  border-color: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.page-link--stackoverflow:hover {
  background: #2e2e2e;
}

.page-link--stackoverflow .page-link-desc { color: #fff; }
.page-link--stackoverflow .page-link-url  { color: rgba(255, 255, 255, 0.55); }

.page-link--spotify {
  flex-direction: row;
  align-items: center;
  gap: 0.85rem;
  background: #121212;
  border-color: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.page-link--spotify:hover {
  background: #1e1e1e;
}

.page-link--spotify .page-link-desc { color: #fff; }
.page-link--spotify .page-link-url  { color: rgba(255, 255, 255, 0.55); }
.page-link--spotify .page-link-icon img { filter: brightness(0) invert(1); }

.page-link--bluesky {
  flex-direction: row;
  align-items: center;
  gap: 0.85rem;
  background: #0085ff;
  border-color: transparent;
  color: #fff;
}

.page-link--bluesky:hover {
  background: #006edb;
}

.page-link--bluesky .page-link-desc { color: #fff; }
.page-link--bluesky .page-link-url  { color: rgba(255, 255, 255, 0.75); }
.page-link--bluesky .page-link-icon img { filter: brightness(0) invert(1); }

.page-link--pinterest {
  flex-direction: row;
  align-items: center;
  gap: 0.85rem;
  background: #e60023;
  border-color: transparent;
  color: #fff;
}

.page-link--pinterest:hover {
  background: #c4001d;
}

.page-link--pinterest .page-link-desc { color: #fff; }
.page-link--pinterest .page-link-url  { color: rgba(255, 255, 255, 0.75); }

.button--secondary {
  background: rgba(96, 165, 250, 0.15);
  color: #60a5fa;
  border: 1px solid rgba(96, 165, 250, 0.35);
}

.button--secondary:hover {
  background: rgba(96, 165, 250, 0.25);
}

.button--ghost {
  background: transparent;
  color: #94a3b8;
  border: 1px solid rgba(148, 163, 184, 0.25);
}

.button--ghost:hover {
  background: rgba(148, 163, 184, 0.08);
}

.button--danger {
  background: #ef4444;
  color: #fff5f5;
}

.button--danger:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.button:disabled,
.button--secondary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.edit-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.edit-section {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 0;
}

.edit-errors {
  padding: 1rem 1.25rem;
  border-radius: 14px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
}

.edit-errors p {
  margin: 0;
  color: #fca5a5;
  line-height: 1.6;
}

.edit-errors p + p {
  margin-top: 0.4rem;
}

.edit-hint {
  margin: 0;
  font-size: 0.82rem;
  color: #64748b;
  line-height: 1.4;
}

.image-upload-area {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.image-upload-controls {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.profile-image--large {
  width: 6rem;
  height: 6rem;
}

.edit-textarea {
  padding: 0.75rem 1rem;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: transparent;
  color: #f7f7f7;
  font-size: 1rem;
  font-family: inherit;
  line-height: 1.7;
  width: 100%;
  resize: none;
  min-height: 8rem;
  overflow: hidden;
}

.edit-textarea:focus {
  outline: 2px solid #60a5fa;
  outline-offset: 1px;
}

.link-card {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.9rem 1rem;
  border-radius: 14px;
  background: rgba(148, 163, 184, 0.06);
  border: 1px solid rgba(148, 163, 184, 0.14);
  margin-bottom: 0.6rem;
}

.link-card-fields {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
  min-width: 0;
}

.link-remove {
  flex-shrink: 0;
  background: none;
  border: none;
  color: #64748b;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.2rem 0.4rem;
  border-radius: 6px;
  margin-top: 0.15rem;
}

.link-remove:hover {
  color: #fca5a5;
  background: rgba(239, 68, 68, 0.1);
}

.edit-actions {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding-top: 0.5rem;
}

.edit-cancel {
  color: #64748b;
  text-decoration: none;
  font-size: 0.95rem;
}

.edit-cancel:hover {
  color: #94a3b8;
}

.purchase-button {
  margin-top: 1.25rem;
  display: inline-flex;
}

.purchase-button--locked {
  opacity: 0.4;
  pointer-events: none;
}

.purchase-actions {
  margin-top: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.purchase-actions .purchase-button {
  margin-top: 0;
}

/* --- site nav --- */
.site-nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 0.75rem 1.25rem;
  margin-bottom: 1rem;
  border-radius: 16px;
  background: rgba(1, 12, 26, 0.92);
  border: 1px solid rgba(148, 163, 184, 0.12);
}

.nav-logo {
  font-weight: 700;
  font-size: 1rem;
  color: #f7f7f7;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.nav-logo:hover {
  color: #60a5fa;
}

.nav-pi-icon {
  font-size: 1.8rem;
  background: linear-gradient(135deg, #a855f7, #22d3ee);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  display: inline-block;
  line-height: 1;
  flex-shrink: 0;
}

.site-nav--home {
  background: transparent;
  border-color: transparent;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
  flex: 1;
}

.nav-links a {
  color: #94a3b8;
  text-decoration: none;
  font-size: 0.95rem;
  padding: 0.35rem 0.75rem;
  border-radius: 8px;
  transition: color 0.15s, background 0.15s;
}

.nav-links a:hover,
.nav-links a.nav-link-active {
  color: #f7f7f7;
  background: rgba(148, 163, 184, 0.1);
}

.nav-auth {
  flex-shrink: 0;
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-user {
  font-size: 0.88rem;
  color: #64748b;
  font-weight: 500;
}

.nav-auth-divider {
  color: #334155;
  font-size: 0.8rem;
  user-select: none;
}

.nav-auth-btn {
  padding: 0.4rem 0.9rem;
  font-size: 0.9rem;
}

.nav-auth .button--ghost {
  color: #e2e8f0;
  border-color: rgba(255, 255, 255, 0.28);
}

.nav-auth .button--ghost:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.45);
}

/* --- community nav dropdown ---
   Deliberately styled unlike the plain About/FAQ text links: About/FAQ are
   pages the site itself wrote, while Community is a portal to content made
   by people on the site, so it gets a bordered pill (like a small control,
   not a bare link), a divider to break it out of the About/FAQ group, and a
   tint of the same cyan used in the π logo mark to tie it to the brand. */
.nav-community {
  position: relative;
  display: flex;
  align-items: center;
  margin-left: 0.5rem;
  padding-left: 0.85rem;
  border-left: 1px solid rgba(148, 163, 184, 0.18);
}

.community-trigger {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(34, 211, 238, 0.06);
  border: 1px solid rgba(148, 163, 184, 0.25);
  color: #94a3b8;
  font: inherit;
  font-size: 0.95rem;
  padding: 0.32rem 0.7rem 0.32rem 0.65rem;
  border-radius: 999px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.community-trigger:hover,
.community-trigger[aria-expanded="true"],
.community-trigger.nav-link-active {
  color: #f7f7f7;
  border-color: rgba(34, 211, 238, 0.55);
  background: rgba(34, 211, 238, 0.12);
}

.community-icon {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
}

.community-chevron {
  width: 0.7rem;
  height: 0.7rem;
  flex-shrink: 0;
  transition: transform 0.15s;
}

.community-trigger[aria-expanded="true"] .community-chevron {
  transform: rotate(180deg);
}

.community-dropdown {
  position: absolute;
  top: calc(100% + 0.5rem);
  left: 0;
  z-index: 200;
  min-width: 15rem;
  background: rgba(1, 12, 26, 0.97);
  border: 1px solid rgba(34, 211, 238, 0.25);
  border-radius: 14px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  overflow: hidden;
}

.community-item {
  display: block;
  padding: 0.75rem 1rem;
  text-decoration: none;
  transition: background 0.12s;
}

.community-item:hover,
.community-item.nav-link-active {
  background: rgba(34, 211, 238, 0.08);
}

.community-item-title {
  display: block;
  color: #f7f7f7;
  font-size: 0.92rem;
  font-weight: 600;
}

.community-item-sub {
  display: block;
  color: #64748b;
  font-size: 0.78rem;
  margin-top: 0.15rem;
}

/* --- notification bell --- */
.notif-bell-wrapper {
  position: relative;
  flex-shrink: 0;
  margin-left: auto;
}

.notif-bell {
  background: none;
  border: none;
  cursor: pointer;
  position: relative;
  padding: 0.35rem;
  border-radius: 8px;
  display: flex;
  align-items: center;
  color: #94a3b8;
  transition: background 0.15s, color 0.15s;
}

.notif-bell:hover {
  background: rgba(148, 163, 184, 0.1);
  color: #e2e8f0;
}

.notif-bell-icon {
  width: 1.25rem;
  height: 1.25rem;
}

.notif-badge {
  position: absolute;
  top: 0;
  right: 0;
  transform: translate(30%, -30%);
  background: #f43f5e;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  min-width: 1.1rem;
  height: 1.1rem;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 0.25rem;
  line-height: 1;
}

.notif-dropdown {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  z-index: 200;
  min-width: 16rem;
  max-width: 22rem;
  background: rgba(1, 12, 26, 0.97);
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 14px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  overflow: hidden;
}

.notif-item {
  display: block;
  padding: 0.7rem 1rem;
  color: #e2e8f0;
  text-decoration: none;
  font-size: 0.88rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.08);
  transition: background 0.12s;
}

.notif-item:last-child {
  border-bottom: none;
}

.notif-item:hover {
  background: rgba(96, 165, 250, 0.08);
}

/* --- site footer --- */
.site-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 1.5rem 1rem;
  margin-top: 2rem;
  font-size: 0.82rem;
  color: #475569;
}

.site-footer a {
  color: #475569;
  text-decoration: none;
  transition: color 0.15s;
}

.site-footer a:hover,
.site-footer a.nav-link-active {
  color: #94a3b8;
}

.site-footer-sep {
  color: #334155;
}

/* --- info pages (about, terms, privacy) --- */
.info-page {
  max-width: 48rem;
  padding: 1.75rem;
  background: rgba(1, 12, 26, 0.92);
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: 24px;
}

.info-page h2 {
  margin: 1.75rem 0 0.5rem;
  font-size: 1.1rem;
  color: #e2e8f0;
}

.info-page ol {
  padding-left: 1.5rem;
  color: #cbd5e1;
  line-height: 1.8;
}

.info-page a {
  color: #93c5fd;
  text-decoration: none;
}

.info-page a:hover {
  text-decoration: underline;
}

.info-page-notice {
  padding: 0.85rem 1rem;
  border-radius: 12px;
  background: rgba(52, 211, 153, 0.08);
  border: 1px solid rgba(52, 211, 153, 0.25);
  color: #34d399;
  font-size: 0.9rem;
  margin-top: 0 !important;
}

/* --- Pi Facts --- */
.pi-fact-article {
  font-size: 1.25rem;
}

.pi-fact-equation-display {
  font-size: 1.4rem;
  text-align: center;
  margin: 0.5rem 0 1.25rem;
}

.pi-fact-svg-wrap {
  margin: 1.25rem 0;
}

.pi-fact-svg {
  width: 100%;
  max-width: 220px;
  height: auto;
  display: block;
}

.pi-fact-svg-wrap figcaption {
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: #94a3b8;
}

.pi-fact-diagram-wrap {
  margin: 1.25rem auto;
  max-width: 420px;
  text-align: center;
}

.pi-fact-diagram {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 12px;
  background: #f8fafc;
  padding: 0.75rem;
}

.pi-fact-diagram-wrap figcaption {
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: #94a3b8;
}

.pi-fact-hero-image-wrap {
  margin: 1.5rem auto;
  max-width: 640px;
  text-align: center;
}

.pi-fact-hero-image {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 16px;
}

.pi-fact-hero-image-wrap figcaption {
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: #94a3b8;
}

.pi-fact-video-embed {
  position: relative;
  width: 100%;
  max-width: 640px;
  aspect-ratio: 16 / 9;
  margin: 1.25rem auto;
  border-radius: 12px;
  overflow: hidden;
}

.pi-fact-video-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.pi-fact-technical {
  margin-top: 1.75rem;
  padding: 1rem 1.25rem;
  border-radius: 16px;
  background: rgba(96, 165, 250, 0.06);
  border: 1px solid rgba(148, 163, 184, 0.15);
}

.pi-fact-technical summary {
  cursor: pointer;
  font-weight: 600;
  color: #93c5fd;
}

.pi-fact-technical-body {
  margin-top: 1rem;
}

.pi-fact-technical .katex-display {
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0.25rem 0;
}

.pi-fact-constants-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.25rem 0;
  font-size: 0.95rem;
}

.pi-fact-constants-table th,
.pi-fact-constants-table td {
  padding: 0.6rem 0.75rem;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid rgba(148, 163, 184, 0.15);
}

.pi-fact-constants-table th {
  color: #93c5fd;
  font-weight: 600;
  white-space: nowrap;
}

.pi-fact-constants-table td:first-child {
  font-weight: 600;
  white-space: nowrap;
}

.pi-fact-constants-table td {
  color: #cbd5e1;
}

.pi-fact-learn-more {
  padding-left: 1.5rem;
  color: #cbd5e1;
  line-height: 1.8;
}

.pi-fact-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 1.5rem;
}

.pi-fact-nav [aria-disabled="true"] {
  opacity: 0.4;
  cursor: default;
  pointer-events: none;
}

.pi-fact-permalink {
  color: #94a3b8;
  font-size: 0.85rem;
  text-decoration: none;
}

.pi-fact-permalink:hover {
  text-decoration: underline;
}

.pi-fact-archive-link {
  margin-top: 0.75rem;
  font-size: 0.9rem;
}

.pi-fact-archive-link a {
  color: #93c5fd;
  text-decoration: none;
}

.pi-fact-archive-link a:hover {
  text-decoration: underline;
}

/* --- legal confirm checkbox --- */
.legal-confirm {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  margin-top: 1.25rem;
  font-size: 0.9rem;
  color: #94a3b8;
  cursor: pointer;
  line-height: 1.5;
}

.legal-confirm input[type="checkbox"] {
  flex-shrink: 0;
  margin-top: 0.15rem;
  accent-color: #60a5fa;
  width: 1rem;
  height: 1rem;
  cursor: pointer;
}

.legal-confirm a {
  color: #93c5fd;
  text-decoration: none;
}

.legal-confirm a:hover {
  text-decoration: underline;
}

.display-name-prompt {
  margin-top: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.display-name-prompt label {
  font-size: 0.9rem;
  color: #94a3b8;
}

.display-name-required {
  color: #64748b;
  font-size: 0.8rem;
}

.display-name-prompt input[type="text"] {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 6px;
  color: #e2e8f0;
  font-size: 0.95rem;
  padding: 0.5rem 0.75rem;
  outline: none;
  width: 100%;
  max-width: 320px;
  box-sizing: border-box;
}

.display-name-prompt input[type="text"]:focus {
  border-color: #60a5fa;
}

.view-counter {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  background: rgba(1, 12, 26, 0.92);
  border: 1px solid rgba(148, 163, 184, 0.2);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  font-size: 0.82rem;
  font-weight: 600;
  color: #94a3b8;
  pointer-events: none;
}

.view-counter-icon {
  width: 0.95rem;
  height: 0.95rem;
  flex-shrink: 0;
}

.page-valuation,
.upvote-counter {
  bottom: 4rem;
}

.owner-toolbar {
  position: fixed;
  bottom: 1.5rem;
  left: 1.5rem;
  z-index: 100;
  display: flex;
  align-items: center;
  padding: 0.35rem 0.4rem;
  gap: 0.05rem;
  border-radius: 999px;
  background: rgba(1, 12, 26, 0.96);
  border: 1px solid rgba(96, 165, 250, 0.35);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(96, 165, 250, 0.07), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  overflow: hidden;
}

.owner-toolbar-btn {
  background: none;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  padding: 0.35rem 0.7rem;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.025em;
  text-decoration: none;
  transition: color 0.1s ease, background 0.1s ease;
  white-space: nowrap;
  border-radius: 999px;
}

.owner-toolbar-btn:hover {
  color: #f1f5f9;
  background: rgba(96, 165, 250, 0.12);
}

.owner-toolbar-btn:active {
  background: rgba(96, 165, 250, 0.22);
  color: #fff;
}

@keyframes owner-toolbar-btn-flash {
  0%, 100% {
    background: none;
    box-shadow: none;
    color: #94a3b8;
    transform: scale(1);
  }
  50% {
    background: rgba(96, 165, 250, 0.45);
    box-shadow: 0 0 0 6px rgba(96, 165, 250, 0.35), 0 0 24px 6px rgba(96, 165, 250, 0.55);
    color: #fff;
    transform: scale(1.1);
  }
}

.owner-toolbar-btn--flash {
  animation: owner-toolbar-btn-flash 0.7s ease-in-out 3;
}

.owner-toolbar-divider {
  width: 1px;
  height: 0.8rem;
  background: rgba(96, 165, 250, 0.2);
  flex-shrink: 0;
  margin: 0 0.1rem;
}

.back-link {
  margin-top: 1rem;
}

.main-clears-toolbar {
  padding-bottom: 5.5rem;
}

.back-link a {
  color: #93c5fd;
  text-decoration: none;
}

@media (max-width: 800px) {
  .pi-grid {
    grid-template-columns: repeat(12, minmax(1.6rem, 1fr));
  }
}

@media (max-width: 580px) {
  .pi-grid {
    grid-template-columns: repeat(8, minmax(1.4rem, 1fr));
  }
}

/* --- resale listing --- */
.resale-tag {
  font-size: 0.88rem;
  color: #c4b5fd;
  font-weight: 600;
  margin: 0.25rem 0 0;
}

.resale-price-breakdown {
  margin-bottom: 1.25rem;
  padding: 1rem;
  border-radius: 14px;
  background: rgba(148, 163, 184, 0.06);
  border: 1px solid rgba(148, 163, 184, 0.12);
}

.resale-price-row {
  display: flex;
  justify-content: space-between;
  padding: 0.35rem 0;
  font-size: 0.95rem;
  color: #cbd5e1;
}

.resale-price-total {
  border-top: 1px solid rgba(148, 163, 184, 0.15);
  margin-top: 0.35rem;
  padding-top: 0.6rem;
  font-weight: 700;
  color: #f7f7f7;
  font-size: 1.05rem;
}

.list-edge-options {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.25rem;
}

.list-edge-option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.92rem;
  color: #cbd5e1;
  cursor: pointer;
}

.list-edge-option input[type="radio"] {
  accent-color: #60a5fa;
}

.list-preview-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem;
  padding: 0.75rem;
  border-radius: 12px;
  background: rgba(1, 12, 26, 1);
  border: 1px solid rgba(148, 163, 184, 0.1);
}

.list-preview-digit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.4rem;
  height: 1.4rem;
  font-size: 1rem;
  font-variant-numeric: tabular-nums;
  border-radius: 3px;
  transition: background-color 0.15s, color 0.15s;
}

.list-preview-kept {
  background: rgba(52, 211, 153, 0.18);
  color: #34d399;
}

.list-preview-for-sale {
  background: rgba(139, 92, 246, 0.22);
  color: #c4b5fd;
}

/* --- owner actions (edit + share) --- */
.owner-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

.share-form-container {
  margin-top: 1rem;
  padding: 1.5rem;
  border-radius: 18px;
  background: rgba(1, 12, 26, 0.92);
  border: 1px solid rgba(148, 163, 184, 0.15);
}

.share-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.share-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.share-field label {
  font-size: 0.9rem;
  font-weight: 600;
  color: #94a3b8;
}

.share-optional {
  font-weight: 400;
  color: #475569;
}

.share-textarea {
  min-height: 5rem;
}

.share-form-actions {
  display: flex;
  gap: 0.75rem;
}

.share-form-actions .button {
  font-size: 0.88rem;
  padding: 0.5rem 1rem;
}

.share-success {
  margin-top: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  background: rgba(52, 211, 153, 0.1);
  border: 1px solid rgba(52, 211, 153, 0.3);
  color: #34d399;
  font-size: 0.9rem;
  font-weight: 600;
}

.share-error-msg {
  margin-top: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
  font-size: 0.9rem;
  font-weight: 600;
}

.gift-pending-banner {
  margin-top: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  background: rgba(251, 191, 36, 0.1);
  border: 1px solid rgba(251, 191, 36, 0.3);
  color: #fbbf24;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.gift-pending-banner p {
  margin: 0;
  font-weight: 600;
}

.gift-cancel-form {
  flex-shrink: 0;
}

.trial-purchase-cta {
  margin-bottom: 1rem;
}

.admin-kill-trial {
  margin-bottom: 1rem;
}

.owner-name-row {
  display: flex;
  align-items: center;
  gap: 2rem;
  flex-wrap: wrap;
}

.trial-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 700;
  white-space: nowrap;
  background-image:
    radial-gradient(ellipse at 22% 38%, rgba(255, 251, 235, 0.5) 0%, transparent 58%),
    linear-gradient(130deg, rgba(251, 191, 36, 0.92) 0%, rgba(245, 158, 11, 0.85) 55%, rgba(217, 119, 6, 0.88) 100%);
  color: #451a03;
}

.trial-promo-box {
  margin-top: 1rem;
  max-width: 200px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  text-align: center;
  padding: 0.425rem 1.25rem;
  border-radius: 16px;
  background-image:
    radial-gradient(ellipse at 22% 38%, rgba(255, 251, 235, 0.5) 0%, transparent 58%),
    linear-gradient(130deg, rgba(251, 191, 36, 0.92) 0%, rgba(245, 158, 11, 0.85) 55%, rgba(217, 119, 6, 0.88) 100%);
  color: #451a03;
}

.trial-promo-box--mobile-only {
  display: none;
}

.trial-promo-box-title {
  margin: 0;
  color: inherit;
  font-size: 1.15rem;
  font-weight: 800;
}

.trial-promo-box-sub {
  margin: 0;
  color: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.4;
}

.owner-toolbar-btn--disabled {
  color: #475569;
  cursor: not-allowed;
  pointer-events: none;
}

.upvote-toolbar-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.upvote-icon {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
}

.upvote-icon--active {
  color: #fbbf24;
}

/* --- comments --- */
.comments-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.comments-header .section-heading {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.your-page-tag {
  font-size: 0.38em;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: #60a5fa;
  vertical-align: middle;
  margin-left: 0.6em;
  opacity: 0.75;
}

.pending-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: none;
  background: rgba(251, 146, 60, 0.18);
  border: 1px solid rgba(251, 146, 60, 0.35);
  color: #fb923c;
}

.comment-post-btn {
  font-size: 0.88rem;
  padding: 0.5rem 1rem;
}

.comment-limit-note {
  font-size: 0.88rem;
  color: #64748b;
  margin: 0 0 1rem;
  padding: 0.6rem 1rem;
  border-radius: 10px;
  background: rgba(148, 163, 184, 0.06);
  border: 1px solid rgba(148, 163, 184, 0.12);
}

.no-comments {
  color: #475569;
  margin: 0;
}

.comment-list {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.comment {
  padding: 0.9rem 0 0.6rem;
  border-top: 1px solid rgba(148, 163, 184, 0.1);
}

.comment--reply {
  border-top: none;
  padding-top: 0.6rem;
}

.comment-header {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  margin-bottom: 0.45rem;
  flex-wrap: wrap;
}

.comment-author {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.comment-author-link {
  font-weight: 600;
  color: #93c5fd;
  text-decoration: none;
  font-size: 0.92rem;
}

.comment-author-link:hover {
  text-decoration: underline;
}

.comment-author-name {
  font-weight: 600;
  color: #e2e8f0;
  font-size: 0.92rem;
}

.visitor-tag {
  display: inline-flex;
  align-items: center;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: rgba(100, 116, 139, 0.18);
  border: 1px solid rgba(100, 116, 139, 0.3);
  color: #64748b;
  vertical-align: middle;
}

.comment-time {
  font-size: 0.78rem;
  color: #475569;
}

.comment-review-banner {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.45rem 0.75rem;
  border-radius: 10px;
  background: rgba(251, 146, 60, 0.08);
  border: 1px solid rgba(251, 146, 60, 0.22);
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
}

.comment-review-banner--refused {
  background: rgba(239, 68, 68, 0.07);
  border-color: rgba(239, 68, 68, 0.22);
}

.review-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: #fb923c;
  flex: 1;
  min-width: 0;
}

.comment-review-banner--refused .review-label {
  color: #f87171;
}

.comment-action-form {
  display: inline;
}

.comment-action-btn {
  padding: 0.25rem 0.7rem;
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.3);
  background: rgba(148, 163, 184, 0.1);
  color: #cbd5e1;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}

.comment-action-btn:hover {
  background: rgba(148, 163, 184, 0.2);
}

.comment-action-btn--approve {
  background: rgba(52, 211, 153, 0.12);
  border-color: rgba(52, 211, 153, 0.3);
  color: #34d399;
}

.comment-action-btn--approve:hover {
  background: rgba(52, 211, 153, 0.22);
}

.comment-action-btn--refuse {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.3);
  color: #f87171;
}

.comment-action-btn--refuse:hover {
  background: rgba(239, 68, 68, 0.2);
}

.comment-status-note {
  font-size: 0.78rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
  padding: 0.25rem 0.6rem;
  border-radius: 8px;
  display: inline-block;
}

.comment-status-note--pending {
  background: rgba(251, 146, 60, 0.1);
  color: #fb923c;
}

.comment-status-note--refused {
  background: rgba(239, 68, 68, 0.08);
  color: #f87171;
}

.comment-body {
  color: #cbd5e1;
  font-size: 1rem;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
}

.comment-footer {
  margin-top: 0.4rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.comment-reply-btn {
  background: none;
  border: none;
  color: #475569;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0.15rem 0;
  letter-spacing: 0.02em;
}

.comment-reply-btn:hover {
  color: #94a3b8;
}

.comment-reply-form {
  margin-top: 0.6rem;
}

.comment-textarea {
  min-height: 5rem;
}

.comment-char-counter {
  font-size: 0.75rem;
  color: #475569;
  text-align: right;
  margin-top: 0.3rem;
}

.comment-form-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.6rem;
}

.comment-form-actions .button {
  font-size: 0.88rem;
  padding: 0.5rem 1rem;
}

/* --- graffiti purchase overlay --- */
.graffiti-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.82);
  cursor: pointer;
  animation: graffiti-in 0.4s ease-out both;
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.graffiti-overlay--gone {
  opacity: 0;
  pointer-events: none;
}

@keyframes graffiti-in {
  from { opacity: 0; transform: scale(1.06); }
  to   { opacity: 1; transform: scale(1); }
}

#graffitiCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.graffiti-text {
  position: relative;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  animation: graffiti-stamp 0.5s cubic-bezier(0.22, 1, 0.36, 1) 0.15s both;
}

@keyframes graffiti-stamp {
  from { transform: scale(2.5) rotate(-6deg); opacity: 0; }
  to   { transform: scale(1) rotate(-3deg); opacity: 1; }
}

.graffiti-line1 {
  font-size: clamp(5rem, 18vw, 11rem);
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1;
  color: #facc15;
  text-shadow:
    4px 4px 0 #b45309,
    -2px -2px 0 #000,
    6px 6px 12px rgba(0,0,0,0.8),
    0 0 40px rgba(250, 204, 21, 0.5);
  transform: rotate(-3deg);
  display: block;
}

.graffiti-line2 {
  font-size: clamp(1.2rem, 4vw, 2.2rem);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #f7f7f7;
  text-shadow: 2px 2px 0 #000, 0 0 20px rgba(255,255,255,0.3);
  display: block;
}

.graffiti-dismiss {
  position: absolute;
  bottom: 2rem;
  font-size: 0.85rem;
  color: rgba(255,255,255,0.4);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 0;
  animation: graffiti-blink 1.5s ease-in-out 1s infinite;
}

@keyframes graffiti-blink {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 0.9; }
}

/* --- background image picker (page edit) --- */
.bg-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.bg-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
}

.bg-option input[type="radio"] {
  display: none;
}

.bg-option-preview {
  width: 5rem;
  height: 5rem;
  border-radius: 10px;
  border: 2px solid rgba(148, 163, 184, 0.2);
  background-size: cover;
  background-position: top center;
  background-color: rgba(1, 12, 26, 0.8);
  transition: border-color 0.15s;
}

.bg-option-preview--none {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: rgba(148, 163, 184, 0.4);
}

.bg-option--selected .bg-option-preview,
.bg-option:hover .bg-option-preview {
  border-color: #60a5fa;
}

.bg-option-label {
  font-size: 0.75rem;
  color: #94a3b8;
  text-align: center;
  max-width: 5rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bg-option--selected .bg-option-label {
  color: #60a5fa;
}

/* --- profile image cropper --- */
.crop-overlay[hidden] {
  display: none;
}

.crop-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.82);
  padding: 1.5rem;
}

.crop-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.1rem;
  background: rgba(1, 12, 26, 0.96);
  border: 1px solid rgba(148, 163, 184, 0.15);
  border-radius: 24px;
  padding: 1.75rem;
  max-width: 22rem;
  width: 100%;
}

.crop-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: #f1f5f9;
}

.crop-viewport {
  position: relative;
  width: 260px;
  height: 260px;
  max-width: 100%;
  border-radius: 50%;
  overflow: hidden;
  background: #000;
  border: 2px solid rgba(148, 163, 184, 0.25);
  cursor: grab;
  touch-action: none;
}

.crop-viewport--dragging {
  cursor: grabbing;
}

.crop-image {
  position: absolute;
  left: 0;
  top: 0;
  transform-origin: top left;
  user-select: none;
  pointer-events: none;
}

.crop-zoom {
  width: 100%;
  max-width: 260px;
}

.crop-hint {
  margin: -0.4rem 0 0;
  font-size: 0.8rem;
  color: #64748b;
  text-align: center;
}

.crop-actions {
  display: flex;
  gap: 0.6rem;
}
