/* Polar: fixed-light pure monochrome override for BroadcastChannel Base. */
:root {
  --width: 760px;
  --body-padding-inline: 1.25rem;
  --font-main: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-secondary: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-scale: 1rem;
  --background-color: #fff;
  --heading-color: #000;
  --text-color: rgb(0 0 0 / 78%);
  --link-color: #000;
  --visited-color: rgb(0 0 0 / 64%);
  --feed-meta-visited-color: rgb(0 0 0 / 64%);
  --code-background-color: rgb(0 0 0 / 6%);
  --code-color: #000;
  --blockquote-color: rgb(0 0 0 / 78%);
  --accent-color: #000;
  --border-color: rgb(0 0 0 / 10%);
  --control-border: rgb(0 0 0 / 18%);
  --focus-color: #000;
  --link-hover-color: #000;
  --muted-color: rgb(0 0 0 / 60%);
  --surface-color: #fff;
  --code-muted-color: rgb(0 0 0 / 60%);
  --code-accent-color: #000;
  --code-alt-accent-color: rgb(0 0 0 / 78%);
  --reaction-paid-color: #6b5000;
  --reaction-paid-border-color: rgba(107, 80, 0, 0.34);
  --reaction-paid-background-color: #f3ead0;
  --shadow-soft: none;
  --radius-panel: 4px;
  --radius-chip: 2px;
  --radius-media: 6px;
  --box-margin: 0px;
  --back-to-top-offset: max(1rem, env(safe-area-inset-right));
  --icon-hover-filter: grayscale(1) opacity(0.8);
  --icon-secondary-filter: grayscale(1) opacity(0.5);
}

html {
  color-scheme: light;
  overflow-x: clip;
  background: var(--background-color);
}

body {
  padding: 0 var(--body-padding-inline) 1.5rem;
  background: var(--background-color);
  color: var(--text-color);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

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

h1,
h2,
h3,
h4,
h5,
h6 {
  color: var(--heading-color);
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.25;
}

a {
  text-decoration-thickness: 1px;
  text-underline-offset: 0.16em;
}

a:link {
  color: var(--link-color);
}

a:visited {
  color: var(--visited-color);
}

a:hover {
  color: var(--link-hover-color);
  text-decoration-thickness: 2px;
}

button,
input,
summary {
  font: inherit;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--focus-color);
  outline-offset: 3px;
}

hr {
  border: 0;
  border-top: 1px solid var(--border-color);
}

.skip-link,
.skip-link:visited {
  color: var(--background-color);
}

.site-header {
  gap: 1rem;
  padding-top: 1.5rem;
}

.channel-avatar {
  border-radius: 50%;
}

.site-header > .title,
.site-header > .title:visited {
  color: var(--heading-color);
  text-decoration: none;
}

.site-header > .title > h1 {
  overflow-wrap: anywhere;
  margin: 0;
  font-size: 1.35rem;
  line-height: 1.25;
}

.channel-description {
  margin-top: 0.25rem;
  color: var(--muted-color);
}

.social-links {
  gap: 0.25rem;
}

.social-links a,
.social-links a:visited {
  display: inline-flex;
  width: 2.25rem;
  height: 2.25rem;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-panel);
  color: var(--muted-color);
  transition:
    color 120ms ease,
    background-color 120ms ease;
}

.social-links svg {
  width: 1rem;
  height: 1rem;
}

.site-navigation {
  gap: 1rem;
  margin-top: 0.25rem;
  padding: 0.75rem 0;
  border-top: 1px solid var(--border-color);
}

.site-navigation > ul {
  gap: 0.25rem 0.75rem;
}

.site-navigation a,
.site-navigation a:visited {
  display: inline-flex;
  min-height: 2rem;
  align-items: center;
  color: var(--muted-color);
  text-decoration: none;
  transition: color 120ms ease;
}

.site-navigation a[aria-current='page'] {
  color: var(--heading-color);
  text-decoration: underline;
  text-underline-offset: 0.22em;
}

.desktop-search,
.mobile-search form {
  width: min(14rem, 100%);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-panel);
  background: var(--surface-color);
}

.desktop-search:focus-within,
.mobile-search form:focus-within {
  outline: 2px solid var(--focus-color);
  outline-offset: 2px;
}

.search-field {
  gap: 0.3rem;
  padding: 0.15rem 0.3rem;
}

.search-field svg {
  color: var(--muted-color);
}

.search-input {
  color: var(--text-color);
  caret-color: var(--focus-color);
  font-size: 0.875rem;
}

.search-input::placeholder {
  color: var(--muted-color);
  opacity: 1;
}

.search-input:focus-visible {
  outline: 0;
}

.search-submit {
  width: 2rem;
  height: 2rem;
  color: var(--muted-color);
  transition:
    color 120ms ease,
    background-color 120ms ease;
}

#main-content {
  padding: 2rem 0 1rem;
}

.posts-feed,
.posts-feed > li,
.post-entry,
.post-content {
  min-width: 0;
  max-width: 100%;
}

.post-entry {
  margin: 0 0 3rem;
  padding: 0 0 3rem;
  border: 0;
  border-bottom: 1px solid var(--border-color);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.posts-feed > li:last-child .post-entry {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: 0;
}

.post-meta {
  gap: 0.5rem;
  color: var(--muted-color);
  font-size: 0.8125rem;
  font-variant-numeric: tabular-nums;
  line-height: 1.4;
}

.post-meta p {
  margin: 0;
}

.post-meta a:link,
.post-meta a:visited {
  color: var(--muted-color);
  text-decoration: none;
  transition: color 120ms ease;
}

.post-content {
  padding-top: 1.25rem;
}

.post-reactions,
.post-tags,
.post-comments {
  padding-top: 1rem;
}

.post-comments {
  border: 0;
  background: transparent;
}

.post-reactions > ul {
  gap: 0.4rem;
}

.reaction {
  color: var(--muted-color);
  gap: 0.3rem;
}

.reaction-count {
  opacity: 1;
}

.reaction.reaction-paid {
  padding: 0.2rem 0.55rem;
  border: 1px solid var(--reaction-paid-border-color);
  border-radius: 999px;
  background: var(--reaction-paid-background-color);
  color: var(--reaction-paid-color);
}

.tags {
  gap: 0.5rem;
}

.tags a,
.tags a:visited {
  display: inline-block;
  color: var(--muted-color);
  text-decoration: underline;
  text-underline-offset: 0.18em;
  transition: color 120ms ease;
}

.pagination {
  gap: 1rem;
  margin-top: 2rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border-color);
}

.pagination a,
.pagination a:visited {
  width: 2.75rem;
  height: 2.75rem;
  border: 1px solid var(--control-border);
  border-radius: var(--radius-panel);
  background: var(--surface-color);
  color: var(--heading-color);
  text-decoration: none;
  transition:
    background-color 120ms ease,
    border-color 120ms ease;
}

.directory h1 {
  margin: 0;
  font-size: 1.3rem;
}

.directory-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 2rem;
  margin-top: 1.25rem;
  align-items: stretch;
}

.directory-list li {
  min-width: 0;
  border-bottom: 1px solid var(--border-color);
}

.directory-list a {
  display: flex;
  min-height: 2.75rem;
  align-items: center;
  border-bottom: 0;
  color: var(--muted-color);
  overflow-wrap: anywhere;
  text-decoration: none;
  transition: color 120ms ease;
}

.site-footer {
  margin-top: 2rem;
  padding: 1.5rem 0 0;
  border-top: 1px solid var(--border-color);
  color: var(--muted-color);
  font-size: 0.8125rem;
  text-align: left;
}

.site-footer a:link,
.site-footer a:visited {
  color: var(--muted-color);
  text-decoration: underline;
}

#back-to-top {
  border: 1px solid var(--control-border);
  border-radius: var(--radius-panel);
  background: var(--surface-color);
}

#back-to-top img {
  filter: var(--icon-secondary-filter);
}

.content {
  line-height: 1.65;
}

.content p,
.content ul,
.content ol {
  margin-block: 1em;
}

.content ul,
.content ol {
  padding-left: 1.5rem;
}

.content h1,
.content h2,
.content h3,
.content h4,
.content h5,
.content h6 {
  color: var(--heading-color);
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.25;
}

.content h1,
.content h2 {
  font-size: 1.3rem;
}

.content h3 {
  font-size: 1.15rem;
}

.content h4,
.content h5,
.content h6 {
  font-size: 1rem;
}

.content a:link,
.content a:visited {
  text-decoration-line: underline;
}

.content blockquote {
  margin: 1.25rem 0;
  padding: 0.25rem 0 0.25rem 1rem;
  border: 0;
  border-left: 3px solid var(--heading-color);
  border-radius: 0;
  background: transparent;
  color: var(--blockquote-color);
  font-style: normal;
}

.content pre,
.highlight,
.code {
  max-width: 100%;
  overflow-x: auto;
  white-space: pre;
  overflow-wrap: normal;
}

.content :not(pre) > code {
  padding: 0.15em 0.3em;
  border-radius: var(--radius-chip);
  background: var(--code-background-color);
  color: var(--code-color);
}

.content table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
}

.content table th,
.content table td {
  border-color: var(--border-color);
}

.content table th {
  background: rgb(0 0 0 / 5%);
  color: var(--heading-color);
  font-weight: 600;
}

.content img:not(.tg-emoji):not(.sticker):not(.link_preview_image):not(.modal-img),
.content > iframe,
.content video:not(.sticker) {
  max-width: 100%;
  border: 0;
  border-radius: var(--radius-media);
  background: transparent;
}

.content img:not(.tg-emoji):not(.sticker):not(.link_preview_image):not(.modal-img),
.content video:not(.sticker) {
  width: 100%;
  height: auto;
}

.content figcaption,
.content .tgme_widget_message_poll_option_percent {
  color: var(--muted-color);
  font-variant-numeric: tabular-nums;
}

.content .tg-expandable,
.content .tgme_widget_message_link_preview:has(.link_preview_site_name) {
  border-left-color: var(--heading-color);
  background: var(--surface-color);
}

.content .tgme_widget_message_link_preview:has(.link_preview_image) {
  overflow: hidden;
  border-radius: var(--radius-media);
}

.content .tg-expandable__toggle::after {
  filter: none;
}

.content .spoiler-button tg-spoiler {
  background-color: var(--code-background-color);
  background-image: none;
  color: transparent;
}

.content .spoiler-button input:checked + tg-spoiler {
  background: unset;
  color: unset;
}

.content .image-list-container {
  column-gap: 0.75rem;
}

.content .image-preview-button {
  max-width: 100%;
  border-radius: var(--radius-media);
}

.content .modal {
  background: rgb(0 0 0 / 88%);
}

.content .modal__close {
  border: 1px solid var(--control-border);
  border-radius: var(--radius-panel);
  background: var(--background-color);
  color: var(--heading-color);
}

.content .modal-img {
  border-radius: var(--radius-media);
  box-shadow: none;
}

@media (max-width: 37.5rem) {
  :root {
    --body-padding-inline: 1rem;
  }

  .site-header {
    gap: 0.75rem;
    padding-top: 1rem;
  }

  .channel-avatar {
    width: 2.5rem;
    height: 2.5rem;
  }

  .site-header > .title > h1 {
    font-size: 1.15rem;
  }

  .social-links a,
  .site-navigation a,
  .mobile-search summary,
  .search-submit {
    min-width: 2.75rem;
    min-height: 2.75rem;
  }

  .search-input {
    font-size: 16px;
  }

  .mobile-search summary {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-panel);
    background: var(--surface-color);
  }

  .mobile-search[open] {
    flex-basis: 100%;
  }

  #main-content {
    padding-top: 1.5rem;
  }

  .post-entry {
    margin-bottom: 2.5rem;
    padding-bottom: 2.5rem;
  }

  .directory-list {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }

  .directory-list a {
    min-height: 2.75rem;
  }

  .content ul,
  .content ol {
    padding-left: 1.5rem;
  }
}

@media (hover: hover) and (pointer: fine) {
  .social-links a:hover {
    background: rgb(0 0 0 / 5%);
    color: var(--heading-color);
  }

  .site-navigation a:hover {
    color: var(--heading-color);
    text-decoration: underline;
    text-underline-offset: 0.22em;
  }

  .search-submit:hover {
    background: rgb(0 0 0 / 5%);
    color: var(--heading-color);
  }

  .post-meta a:hover {
    color: var(--heading-color);
    text-decoration: underline;
    text-underline-offset: 0.2em;
  }

  .tags a:hover {
    color: var(--heading-color);
  }

  .pagination a:hover {
    background: rgb(0 0 0 / 5%);
    border-color: var(--control-border);
  }

  .directory-list a:hover {
    color: var(--heading-color);
  }

  .site-footer a:hover {
    color: var(--heading-color);
  }

  #back-to-top:hover {
    background: rgb(0 0 0 / 5%);
  }

  .content .modal__close:hover {
    background: var(--code-background-color);
  }
}

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

  *,
  *::before,
  *::after,
  ::view-transition-group(*),
  ::view-transition-old(*),
  ::view-transition-new(*) {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

@media print {
  @page {
    margin: 15mm;
  }

  :root {
    --background-color: #fff;
    --heading-color: #000;
    --text-color: #000;
    --link-color: #000;
    --visited-color: #000;
    --border-color: #777;
    --control-border: #555;
    --surface-color: #fff;
    --code-background-color: #f2f2f2;
    --code-color: #000;
    --blockquote-color: #000;
    --muted-color: #000;
  }

  html {
    color-scheme: light;
    background: #fff;
  }

  body {
    display: block;
    width: auto;
    max-width: none;
    min-height: auto;
    margin: 0;
    padding: 0;
    background: #fff;
    color: #000;
    overflow: visible;
  }

  .skip-link,
  .avatar-link,
  .social-links,
  .site-navigation,
  .post-reactions,
  .post-comments,
  .pagination,
  .site-footer,
  #back-to-top-wrapper,
  .content .modal,
  .content .tg-expandable__toggle {
    display: none !important;
  }

  .site-header {
    display: block;
    padding: 0 0 1rem;
    border-bottom: 1px solid #777;
  }

  #main-content {
    padding: 1.5rem 0 0;
  }

  .post-entry {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #aaa;
    break-inside: auto;
  }

  a:link,
  a:visited {
    color: #000;
    text-decoration: underline;
  }

  .content pre,
  .highlight,
  .code {
    overflow: visible;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
  }

  .content table {
    overflow: visible;
  }

  .content img,
  .content video,
  .content iframe,
  .content pre,
  .content table,
  .content blockquote {
    break-inside: avoid;
  }

  .content .tg-expandable__content {
    display: block;
    overflow: visible;
    padding-bottom: 0;
    line-clamp: unset;
    -webkit-line-clamp: unset;
    -webkit-box-orient: unset;
  }

  .content .spoiler-button tg-spoiler {
    background: transparent;
    color: #000;
  }
}
