/* === Reset & Base === */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #030303;
  --bg-elevated: #0c0c0f;
  --bg-card: #111116;
  --text: #f5f7fb;
  --text-secondary: #8f98ab;
  --border: rgba(255, 255, 255, 0.1);
  --border-strong: rgba(0, 153, 255, 0.2);
  --accent: #0099ff;
  --accent-soft: rgba(0, 153, 255, 0.14);
  --max-width: 1040px;
  --feed-width: 720px;
  --radius: 18px;
  --radius-pill: 999px;
  --shadow-soft: 0 24px 80px rgba(0, 0, 0, 0.35);
  --shadow-line: 0 0 0 1px rgba(0, 153, 255, 0.12);
  --pull-refresh-offset: 0px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  background: #030303;
  -webkit-font-smoothing: antialiased;
}

body.is-pull-refreshing {
  cursor: progress;
}

html {
  background: #050505;
}

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

a:hover {
  text-decoration: underline;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* === Layout === */
.site-wrapper {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.site-main {
  flex: 1;
}

.pull-refresh-indicator {
  position: fixed;
  top: 12px;
  left: 50%;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  background: rgba(8, 10, 16, 0.9);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.28);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
  transform: translate(-50%, calc(-100% + var(--pull-refresh-offset)));
  opacity: 0;
  pointer-events: none;
  transition: transform 180ms ease, opacity 140ms ease, color 140ms ease, border-color 140ms ease;
}

body.is-pulling-to-refresh .pull-refresh-indicator,
body.is-pull-refreshing .pull-refresh-indicator {
  opacity: 1;
}

body.is-pull-refresh-armed .pull-refresh-indicator,
body.is-pull-refreshing .pull-refresh-indicator {
  color: #dff1ff;
  border-color: rgba(0, 153, 255, 0.3);
}

/* === Header === */
.site-header {
  max-width: var(--feed-width);
  width: 100%;
  margin: 0 auto 24px;
  padding: 22px 0 18px;
  border-bottom: 1px solid var(--border);
}

.site-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.site-header-aside {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-left: auto;
}

.site-header-link {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  color: var(--text);
  text-decoration: none;
}

.site-header-link:hover {
  text-decoration: none;
}

.site-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: var(--shadow-line);
}

.site-title {
  font-size: 18px;
  font-weight: 600;
  line-height: 1.2;
}

.site-description {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.site-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.site-actions[hidden] {
  display: none;
}

.site-action-link {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(16px);
}

.site-action-link:hover {
  text-decoration: none;
  background: rgba(255, 255, 255, 0.08);
}

.site-action-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 8px 14px;
  border: 1px solid rgba(81, 209, 138, 0.24);
  border-radius: var(--radius-pill);
  background: rgba(81, 209, 138, 0.12);
  color: #51d18a;
  font-size: 13px;
  font-weight: 700;
  box-shadow: none;
  white-space: nowrap;
}

.site-action-status::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: none;
}

.site-action-status[hidden] {
  display: none;
}

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

.site-actions-status {
  margin-left: auto;
}

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

.site-action-toggle {
  position: relative;
  height: 38px;
  min-width: 38px;
  width: 38px;
  justify-content: center;
  padding: 0;
  color: var(--text-secondary);
}

.site-action-toggle[data-state="ready"],
.site-action-toggle[data-state="unsupported"],
.site-action-toggle[data-state="needs-install"],
.site-action-toggle[data-state="denied"] {
  width: auto;
  padding: 8px 14px;
  gap: 8px;
  color: #dff1ff;
  border-color: rgba(0, 153, 255, 0.24);
  background:
    linear-gradient(180deg, rgba(56, 180, 255, 0.18), rgba(0, 153, 255, 0.1)),
    rgba(255, 255, 255, 0.06);
  box-shadow: 0 10px 28px rgba(0, 153, 255, 0.12);
}

.site-action-toggle[hidden] {
  display: none;
}

.site-action-toggle-icon {
  appearance: none;
  -webkit-appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
}

.site-action-toggle-icon svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.site-action-toggle-text {
  display: none;
  white-space: nowrap;
}

.site-action-toggle-hint {
  position: absolute;
  top: 50%;
  right: calc(100% + 10px);
  width: auto;
  max-width: min(calc(100vw - 96px), 190px);
  padding: 7px 10px;
  border: 1px solid rgba(0, 153, 255, 0.24);
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(56, 180, 255, 0.18), rgba(0, 153, 255, 0.1)),
    rgba(12, 16, 24, 0.96);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.28);
  color: #dff1ff;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transform: translate3d(8px, -50%, 0);
  transition: opacity 180ms ease, transform 180ms ease;
}

.site-action-toggle-hint::after {
  content: "";
  position: absolute;
  top: 50%;
  right: -5px;
  width: 10px;
  height: 10px;
  border-top: 1px solid rgba(0, 153, 255, 0.24);
  border-right: 1px solid rgba(0, 153, 255, 0.24);
  background: rgba(10, 22, 36, 0.96);
  transform: translateY(-50%) rotate(45deg);
}

.site-action-toggle.is-hint-visible .site-action-toggle-hint {
  opacity: 1;
  transform: translate3d(0, -50%, 0);
}

.site-action-toggle[data-state="ready"] .site-action-toggle-text,
.site-action-toggle[data-state="unsupported"] .site-action-toggle-text,
.site-action-toggle[data-state="needs-install"] .site-action-toggle-text,
.site-action-toggle[data-state="denied"] .site-action-toggle-text {
  display: inline;
}

.site-action-toggle:hover {
  color: var(--text);
}

.site-action-toggle[data-state="subscribed"],
.site-action-toggle.is-active {
  border-color: rgba(0, 153, 255, 0.28);
  background:
    linear-gradient(180deg, rgba(56, 180, 255, 0.22), rgba(0, 153, 255, 0.14)),
    rgba(255, 255, 255, 0.06);
  color: #dff1ff;
  box-shadow: 0 12px 32px rgba(0, 153, 255, 0.18);
}

.site-action-toggle.is-loading {
  opacity: 0.7;
  pointer-events: none;
}

.site-action-toggle.is-disabled {
  opacity: 0.52;
  cursor: default;
}

.site-action-toggle.is-disabled:not([data-state="subscribed"]) {
  opacity: 0.9;
  color: #dff1ff;
  border-color: rgba(0, 153, 255, 0.24);
}

.site-action-toggle[data-state="unsupported"],
.site-action-toggle[data-state="needs-install"],
.site-action-toggle[data-state="denied"] {
  opacity: 0.9;
  cursor: default;
}

.site-action-toggle.is-disabled:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
}

.site-action-toggle.is-disabled:not([data-state="subscribed"]):hover {
  background:
    linear-gradient(180deg, rgba(56, 180, 255, 0.18), rgba(0, 153, 255, 0.1)),
    rgba(255, 255, 255, 0.06);
  color: #dff1ff;
}

/* === Homepage === */
.post-card,
.post-full,
.tag-header,
.author-header {
  position: relative;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.015)),
    var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 6px);
  box-shadow: var(--shadow-soft), var(--shadow-line);
}

.feed-section {
  max-width: var(--feed-width);
  margin: 0 auto 32px;
}

.feed-kicker {
  font-size: 11px;
  line-height: 1;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.feed-kicker {
  color: var(--accent);
  margin-bottom: 14px;
}

/* === Post Feed === */
.post-feed {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.post-card {
  padding: 18px 18px 16px;
}

.post-card-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin-top: 12px;
}

.post-reactions {
  display: none;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.post-reactions.is-ready {
  display: flex;
}

.post-reaction-button {
  appearance: none;
  -webkit-appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
  font: inherit;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.post-reaction-button:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.14);
  color: var(--text);
}

.post-reaction-button:active {
  transform: translateY(1px);
}

.post-reaction-button.is-selected {
  background: rgba(44, 156, 255, 0.16);
  border-color: rgba(44, 156, 255, 0.28);
  color: #dff1ff;
}

.post-reaction-button.is-busy {
  opacity: 0.7;
  pointer-events: none;
}

.post-reaction-emoji {
  font-size: 16px;
}

.post-reaction-count {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.post-reaction-count[hidden] {
  display: none;
}

.post-feed-load-more {
  display: flex;
  justify-content: center;
  margin-top: 18px;
  margin-bottom: 72px;
  position: relative;
  z-index: 2;
}

.post-feed-load-more-button {
  appearance: none;
  -webkit-appearance: none;
  min-height: 46px;
  min-width: 164px;
  padding: 0 22px;
  border: 1px solid rgba(0, 153, 255, 0.24);
  border-radius: var(--radius-pill);
  background:
    linear-gradient(180deg, rgba(56, 180, 255, 0.16), rgba(0, 153, 255, 0.08)),
    rgba(255, 255, 255, 0.05);
  color: #dff1ff;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.post-feed-load-more-button:hover {
  background:
    linear-gradient(180deg, rgba(56, 180, 255, 0.22), rgba(0, 153, 255, 0.12)),
    rgba(255, 255, 255, 0.07);
}

.post-feed-load-more-button:disabled {
  cursor: progress;
  opacity: 0.72;
}

.post-feed-load-more-button:active {
  transform: translateY(1px);
}

.post-feed-load-more-button[hidden] {
  display: none;
}

.post-date {
  font-size: 12px;
  color: var(--text-secondary);
}

.post-card-image {
  width: 100%;
  display: block;
  height: auto;
  border-radius: 16px;
  margin-bottom: 14px;
  background: #0a0a0a;
}

.post-card-content {
  margin-bottom: 12px;
  color: var(--text);
}

.post-card-content > * + * {
  margin-top: 0.95em;
}

.post-card-content p,
.post-card-content li,
.post-card-content blockquote {
  font-size: 15px;
  line-height: 1.7;
}

.post-card-content h2 {
  font-size: 22px;
  line-height: 1.1;
  letter-spacing: -0.04em;
  margin-top: 1.3em;
}

.post-card-content h3 {
  font-size: 18px;
  line-height: 1.2;
  margin-top: 1.2em;
}

.post-card-content ul,
.post-card-content ol {
  padding-left: 1.25rem;
}

.post-card-content blockquote {
  padding-left: 16px;
  border-left: 2px solid var(--accent);
  color: #d5d9e2;
}

.post-card-content a {
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.post-card-content .kg-bookmark-card,
.post-card-content .kg-video-card {
  margin-top: 1.1em;
  border-radius: 16px;
  overflow: hidden;
}

.post-card-content .kg-embed-card {
  margin-top: 0;
}

.post-card-content .kg-gallery-card {
  margin: 0;
  border-radius: 16px;
  overflow: hidden;
}

.post-card-content .kg-image-card img,
.post-card-content .kg-gallery-image img,
.post-card-content .kg-video-card video,
.post-card-content .kg-video-container,
.post-card-content .kg-embed-card iframe {
  border-radius: 16px;
}

.post-card-content .kg-embed-card,
.post-full-content .kg-embed-card {
  overflow: hidden;
  border-radius: 16px;
}

.post-card-content .kg-embed-card iframe,
.post-full-content .kg-embed-card iframe {
  display: block;
  max-width: 100%;
  height: auto;
  border: 0;
  background: #000;
  margin-left: auto;
  margin-right: auto;
}

.post-card-image,
.post-card-content .kg-image-card img,
.post-card-content .kg-gallery-image img,
.post-full-image img,
.post-full-content .kg-image-card img,
.post-full-content .kg-gallery-image img {
  cursor: pointer;
}

.post-card-content .kg-gallery-container,
.post-card-content .kg-gallery-row {
  border-radius: 16px;
  overflow: hidden;
}

.post-card-content .kg-gallery-container {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 0;
}

.post-card-content .kg-gallery-row {
  display: flex;
  gap: 4px;
  width: 100%;
}

.post-card-content .kg-gallery-image {
  flex: 1 1 0;
}

.post-card-content .kg-gallery-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* === Single Post === */
.post-full {
  padding: 22px 20px;
}

.post-full-image {
  margin: 0 0 16px 0;
}

.post-full-image img {
  width: 100%;
  border-radius: var(--radius);
}

.post-full-title {
  font-size: 34px;
  font-weight: 600;
  letter-spacing: -0.05em;
  line-height: 1.05;
  margin-bottom: 16px;
}

.post-full-content {
  font-size: 15px;
  line-height: 1.7;
}

.post-reactions-full {
  margin: 12px 0 4px;
}

.post-full-content p {
  margin-bottom: 1em;
}

.post-full-content h2 {
  font-size: 24px;
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.04em;
  margin: 1.5em 0 0.5em;
}

.post-full-content h3 {
  font-size: 18px;
  font-weight: 600;
  margin: 1.3em 0 0.4em;
}

.post-full-content ul,
.post-full-content ol {
  margin: 0 0 1em 1.5em;
}

.post-full-content li {
  margin-bottom: 0.3em;
}

.post-full-content blockquote {
  border-left: 3px solid var(--accent);
  padding-left: 16px;
  margin: 1em 0;
  color: var(--text-secondary);
}

.post-full-content pre {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 16px;
  overflow-x: auto;
  margin: 1em 0;
  font-size: 13px;
}

.post-full-content code {
  font-family: 'SF Mono', SFMono-Regular, Menlo, monospace;
  font-size: 0.9em;
}

.post-full-content img {
  border-radius: var(--radius);
  margin: 1em 0;
}

.post-full-content figure {
  margin: 1em 0;
}

.post-full-content figcaption {
  font-size: 13px;
  color: var(--text-secondary);
  text-align: center;
  margin-top: 8px;
}

.post-full-content a {
  color: var(--accent);
  text-decoration: underline;
}

.post-full-content hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2em 0;
}

.post-full-content .kg-image-card img,
.post-full-content .kg-gallery-image img {
  border-radius: var(--radius);
}

.post-full-content .kg-width-wide,
.post-full-content .kg-width-full {
  margin-left: -20px;
  margin-right: -20px;
}

.post-full-content .kg-bookmark-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin: 1em 0;
}

.post-full-content .kg-bookmark-container {
  display: flex;
  text-decoration: none;
  color: var(--text);
}

.post-full-content .kg-bookmark-content {
  padding: 12px 16px;
  flex: 1;
}

.post-full-content .kg-bookmark-title {
  font-weight: 600;
  font-size: 14px;
}

.post-full-content .kg-bookmark-description,
.post-full-content .kg-bookmark-metadata {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.post-full-content .kg-bookmark-author,
.post-full-content .kg-bookmark-publisher {
  color: var(--text-secondary);
}

.post-full-content .kg-bookmark-icon {
  width: 18px;
  height: 18px;
  margin-right: 6px;
  border-radius: 4px;
}

.post-full-content .kg-bookmark-thumbnail {
  width: 120px;
  min-height: 100%;
}

.post-full-content .kg-bookmark-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0;
}

.post-full-content .kg-video-card,
.post-full-content .kg-video-container {
  border-radius: var(--radius);
  overflow: hidden;
  margin: 1em 0;
}

.post-full-content video {
  width: 100%;
  border-radius: var(--radius);
}

.post-full-content .kg-embed-card {
  margin: 0 0 1em;
}

.post-full-content .kg-embed-card iframe {
  border-radius: var(--radius);
}

.post-full-content .kg-gallery-container {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 0;
}

.post-full-content .kg-gallery-row {
  display: flex;
  gap: 4px;
  width: 100%;
}

.post-full-content .kg-gallery-image {
  flex: 1 1 0;
}

.post-full-content .kg-gallery-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* === Post navigation === */
.post-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 32px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  gap: 16px;
}

.post-nav-link {
  font-size: 13px;
  color: var(--accent);
  max-width: 45%;
}

.post-nav-next {
  margin-left: auto;
  text-align: right;
}

/* === Tag page === */
.tag-header {
  padding: 20px;
  margin-bottom: 18px;
}

.tag-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--accent);
}

.tag-description {
  font-size: 14px;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* === Author page === */
.author-header {
  padding: 20px;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.author-header-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
}

.author-header-name {
  font-size: 20px;
  font-weight: 700;
}

.author-header-bio {
  font-size: 14px;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* === Pagination === */
.pagination {
  padding: 20px 0;
  text-align: center;
  font-size: 13px;
  color: var(--text-secondary);
}

.pagination a {
  color: var(--accent);
  font-weight: 500;
}

/* === Footer === */
.site-footer {
  padding: 20px 0;
  border-top: 1px solid var(--border);
  margin-top: 16px;
  font-size: 12px;
  color: var(--text-secondary);
  text-align: center;
}

/* === Error page === */
.error-page {
  text-align: center;
  padding: 60px 0;
}

.error-code {
  font-size: 72px;
  font-weight: 700;
  color: var(--text-secondary);
}

.error-message {
  font-size: 16px;
  color: var(--text-secondary);
  margin-top: 8px;
}

.error-link {
  margin-top: 20px;
  display: inline-block;
}

body.lightbox-open {
  overflow: hidden;
}

.lightbox-viewer {
  position: fixed;
  inset: 0;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 120ms ease;
}

.lightbox-viewer.is-open {
  opacity: 1;
  pointer-events: auto;
}

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 6, 10, 0.94);
  backdrop-filter: blur(6px);
}

.lightbox-shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) 64px;
  grid-template-rows: 1fr auto;
  align-items: center;
  width: 100%;
  height: 100%;
  padding: 24px;
}

.lightbox-stage {
  grid-column: 2;
  grid-row: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 0;
}

.lightbox-image {
  display: block;
  max-width: min(100%, 1100px);
  max-height: calc(100vh - 120px);
  width: auto;
  height: auto;
  border-radius: 18px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
  user-select: none;
  -webkit-user-drag: none;
  transition: opacity 95ms ease-out, transform 110ms ease-out;
}

.lightbox-image.is-leaving {
  opacity: 0;
}

.lightbox-image.is-entering {
  opacity: 0;
}

.lightbox-image.to-left {
  transform: translateX(-22px);
}

.lightbox-image.to-right {
  transform: translateX(22px);
}

.lightbox-close,
.lightbox-nav {
  appearance: none;
  border: 0;
  color: #fff;
  background: transparent;
  cursor: pointer;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.55);
}

.lightbox-close {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 2;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  font-size: 28px;
  line-height: 1;
}

.lightbox-nav {
  width: 44px;
  height: 64px;
  font-size: 42px;
  line-height: 1;
}

.lightbox-prev {
  grid-column: 1;
  grid-row: 1;
  justify-self: center;
}

.lightbox-next {
  grid-column: 3;
  grid-row: 1;
  justify-self: center;
}

.lightbox-hitbox {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 118px;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.lightbox-hitbox::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 120ms ease;
}

.lightbox-hitbox::after {
  content: none;
}

.lightbox-hitbox-prev {
  left: 0;
}

.lightbox-hitbox-prev::before {
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.06) 0%, rgba(255, 255, 255, 0.025) 28%, transparent 100%),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035), transparent 78%);
  box-shadow: inset 1px 0 0 rgba(255, 255, 255, 0.05);
}

.lightbox-hitbox-next {
  right: 0;
}

.lightbox-hitbox-next::before {
  background:
    linear-gradient(270deg, rgba(255, 255, 255, 0.06) 0%, rgba(255, 255, 255, 0.025) 28%, transparent 100%),
    linear-gradient(270deg, rgba(255, 255, 255, 0.035), transparent 78%);
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.05);
}

.lightbox-hitbox:hover::before,
.lightbox-hitbox:focus-visible::before {
  opacity: 1;
}

.lightbox-counter {
  grid-column: 2;
  grid-row: 2;
  justify-self: center;
  margin-top: 16px;
  padding: 8px 14px;
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(10px);
  font-size: 13px;
  letter-spacing: 0.04em;
}

@media (max-width: 900px) {
}

@media (max-width: 640px) {
  .pull-refresh-indicator {
    top: calc(env(safe-area-inset-top, 0px) + 10px);
    max-width: calc(100vw - 28px);
    text-align: center;
  }

  .site-wrapper {
    padding: 0 14px;
  }

  .site-header {
    padding-top: 18px;
    margin-bottom: 18px;
  }

  .site-header-top {
    align-items: center;
    flex-direction: row;
    gap: 10px;
  }

  .site-header-aside {
    flex-shrink: 0;
    justify-content: flex-end;
    margin-left: auto;
  }

  .site-header-link {
    gap: 10px;
  }

  .site-avatar {
    width: 38px;
    height: 38px;
  }

  .site-title {
    font-size: 15px;
  }

  .site-action-link,
  .site-action-status {
    min-height: 32px;
    padding: 5px 10px;
    font-size: 11px;
  }

  .site-action-toggle {
    height: 32px;
    min-width: 32px;
    width: 32px;
  }

  .site-action-toggle[data-state="ready"],
  .site-action-toggle[data-state="unsupported"],
  .site-action-toggle[data-state="needs-install"],
  .site-action-toggle[data-state="denied"] {
    width: auto;
    padding: 5px 10px;
  }

  .site-action-toggle-hint {
    max-width: min(calc(100vw - 82px), 176px);
    padding: 6px 9px;
    font-size: 10px;
  }

  .site-actions {
    flex-wrap: nowrap;
    gap: 6px;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  .site-actions::-webkit-scrollbar {
    display: none;
  }

  .site-actions-status {
    margin-left: 0;
  }

  .post-card,
  .post-full,
  .tag-header,
  .author-header {
    border-radius: 20px;
  }

  .post-card,
  .post-full,
  .tag-header,
  .author-header {
    padding-left: 16px;
    padding-right: 16px;
  }

  .post-full-title {
    font-size: 28px;
  }

  .post-full-content .kg-width-wide,
  .post-full-content .kg-width-full {
    margin-left: -16px;
    margin-right: -16px;
  }

  .lightbox-shell {
    grid-template-columns: 1fr;
    padding: 16px;
  }

  .lightbox-stage,
  .lightbox-counter {
    grid-column: 1;
  }

  .lightbox-prev,
  .lightbox-next,
  .lightbox-hitbox {
    display: none;
  }

  .lightbox-image {
    max-width: 100%;
    max-height: calc(100vh - 92px);
    border-radius: 14px;
  }

  .lightbox-close {
    top: 12px;
    right: 12px;
  }
}

@media (max-width: 400px) {
  .site-wrapper {
    padding: 0 10px;
  }

  .site-header-link {
    gap: 8px;
  }

  .site-avatar {
    width: 34px;
    height: 34px;
  }

  .site-title {
    font-size: 14px;
  }

  .site-header-aside {
    gap: 6px;
  }

  .site-action-link,
  .site-action-status {
    min-height: 32px;
    padding: 4px 8px;
    font-size: 10px;
  }

  .site-action-toggle {
    height: 32px;
    min-width: 32px;
    width: 32px;
  }

  .site-action-toggle[data-state="ready"],
  .site-action-toggle[data-state="unsupported"],
  .site-action-toggle[data-state="needs-install"],
  .site-action-toggle[data-state="denied"] {
    width: auto;
    padding: 4px 8px;
    gap: 6px;
  }

  .site-action-toggle-hint {
    max-width: min(calc(100vw - 72px), 154px);
    padding: 5px 8px;
    font-size: 10px;
  }

  .site-action-status::before {
    width: 7px;
    height: 7px;
  }
}
