:root {
  --page-bg: #ffffff;
  --page-fg: #1f2328;
  --muted-fg: #6e7781;
  --subtle-fg: #8c959f;
  --border: #d0d7de;
  --button-bg: #ffffff;
  --button-bg-active: #f6f8fa;
  --button-fg: #24292f;
  --focus: #0969da;
  --audio-accent-rgb: 9 105 218;
  --danger-fg: #cf222e;
  --switch-on: #1f883d;
  --switch-off: #8c959f;
  --shadow: 0 8px 24px rgb(140 149 159 / 20%);
  color-scheme: light;
}

:root[data-theme="dark"] {
  --page-bg: #0d1117;
  --page-fg: #e6edf3;
  --muted-fg: #8b949e;
  --subtle-fg: #6e7681;
  --border: #30363d;
  --button-bg: #0d1117;
  --button-bg-active: #21262d;
  --button-fg: #e6edf3;
  --focus: #2f81f7;
  --audio-accent-rgb: 88 166 255;
  --danger-fg: #f85149;
  --switch-on: #3fb950;
  --switch-off: #6e7681;
  --shadow: 0 8px 24px rgb(1 4 9 / 45%);
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  overflow-x: clip;
  background: var(--page-bg);
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: clip;
  background: var(--page-bg);
  color: var(--page-fg);
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial,
    sans-serif;
}

a {
  color: inherit;
}

button {
  font: inherit;
}

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

.page-shell {
  width: min(100%, 1040px);
  margin: 0 auto;
  padding: 14px 32px 32px;
}

.page-shell-wide {
  width: min(100%, 1280px);
}

.page-shell-wide .page-header {
  width: min(100%, 976px);
  margin-right: auto;
  margin-left: auto;
}

.page-shell-wide .gist-files {
  width: min(100%, 976px);
  margin-right: auto;
  margin-left: auto;
}

.page-shell-wide .gist-single-file {
  width: min(100%, 976px);
  margin-right: auto;
  margin-left: auto;
}

.auth-shell {
  width: min(100%, 760px);
  margin: 0 auto;
  padding: 18px 32px 32px;
}

.auth-login {
  min-height: calc(100vh - 44px);
  display: grid;
  align-content: center;
  gap: 10px;
}

.home-shell {
  width: min(100%, 760px);
  min-height: calc(100vh - 44px);
  margin: 0 auto;
  padding: 32px 32px 64px;
  display: grid;
  gap: 32px;
  align-content: start;
}

.home-shell-authenticated {
  padding-top: 38px;
}

.home-intro {
  margin-top: clamp(24px, 6vh, 56px);
  display: grid;
  justify-items: center;
  gap: 8px;
  text-align: center;
}

.home-intro p {
  margin: 0;
  color: var(--muted-fg);
  font-size: 14px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.home-intro .empty-state-lead {
  max-width: 460px;
  color: var(--page-fg);
  font-size: 16px;
  font-weight: 600;
}

.home-gist-history {
  margin-top: 8px;
  text-align: left;
}

.home-shell-authenticated .home-gist-history {
  margin-top: 0;
}

.app-header {
  min-height: 44px;
  border-bottom: 1px solid var(--border);
  background: var(--page-bg);
}

.app-header-inner {
  width: min(100%, 1040px);
  min-height: 44px;
  margin: 0 auto;
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.app-brand {
  min-width: 0;
  display: inline-flex;
  align-items: baseline;
  color: var(--page-fg);
  font-size: 17px;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
}

.app-brand:hover,
.app-brand:focus-visible {
  color: var(--page-fg);
}

.app-nav {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.app-offline-status {
  color: var(--muted-fg);
  font-size: 11px;
  line-height: 1.4;
  white-space: nowrap;
}

.app-link {
  border: 0;
  background: transparent;
  color: var(--muted-fg);
  padding: 0;
  font: inherit;
  font-size: 13px;
  line-height: 1.4;
  text-decoration: none;
  white-space: nowrap;
}

.inline-link {
  color: var(--page-fg);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.app-link:hover,
.app-link:focus-visible {
  color: var(--page-fg);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.app-link:focus-visible,
.theme-toggle-button:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.app-identity {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted-fg);
  font-size: 13px;
  line-height: 1.4;
  text-decoration: none;
}

.app-identity-link:hover .app-name,
.app-identity-link:focus-visible .app-name {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.app-identity-link:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.app-avatar {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  border-radius: 50%;
}

.app-name {
  max-width: 160px;
  overflow: hidden;
  color: var(--page-fg);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.icon-button.standalone-share-button {
  display: none;
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  border: 0;
  background: transparent;
  color: var(--muted-fg);
}

.standalone-share-button:hover {
  background: var(--button-bg-active);
  color: var(--page-fg);
}

.standalone-app {
  overscroll-behavior-y: none;
}

.standalone-app .icon-button.standalone-share-button {
  display: inline-grid;
}

@media (display-mode: standalone) {
  .icon-button.standalone-share-button {
    display: inline-grid;
  }
}

.pull-refresh-indicator {
  --pull-refresh-distance: 0px;
  --pull-refresh-opacity: 0;
  --pull-refresh-rotation: 0deg;
  --pull-refresh-scale: 0.84;
  position: fixed;
  z-index: 100;
  top: calc(env(safe-area-inset-top, 0px) + 8px);
  left: 50%;
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--button-bg);
  box-shadow: 0 3px 12px rgb(31 35 40 / 18%);
  color: var(--muted-fg);
  opacity: var(--pull-refresh-opacity);
  pointer-events: none;
  transform: translate3d(
      -50%,
      calc(var(--pull-refresh-distance) - 48px),
      0
    )
    scale(var(--pull-refresh-scale));
  will-change: opacity, transform;
}

:root[data-theme="dark"] .pull-refresh-indicator {
  box-shadow: 0 3px 12px rgb(1 4 9 / 50%);
}

.pull-refresh-indicator[data-state="pulling"],
.pull-refresh-indicator[data-state="ready"] {
  transition: none;
}

.pull-refresh-indicator[data-state="ready"],
.pull-refresh-indicator[data-state="refreshing"] {
  border-color: var(--focus);
  color: var(--focus);
}

.pull-refresh-indicator[data-state="settling"] {
  transition:
    opacity 150ms ease-out,
    transform 220ms cubic-bezier(0.22, 0.8, 0.3, 1);
}

.pull-refresh-indicator[data-state="refreshing"] {
  opacity: 1;
  transition:
    border-color 100ms ease,
    color 100ms ease,
    transform 120ms ease-out;
}

.pull-refresh-indicator svg {
  transform: rotate(var(--pull-refresh-rotation));
  will-change: transform;
}

.pull-refresh-indicator[data-state="refreshing"] svg {
  animation: pull-refresh-spin 650ms linear infinite;
}

.standalone-action-notice {
  position: fixed;
  z-index: 100;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 18px);
  left: 50%;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--button-bg);
  box-shadow: var(--shadow);
  color: var(--page-fg);
  padding: 7px 12px;
  font-size: 12px;
  line-height: 1.2;
  pointer-events: none;
  transform: translateX(-50%);
  white-space: nowrap;
  animation: standalone-notice-in 140ms ease-out;
}

@keyframes pull-refresh-spin {
  to {
    transform: rotate(calc(var(--pull-refresh-rotation) + 360deg));
  }
}

@keyframes standalone-notice-in {
  from {
    opacity: 0;
    transform: translate(-50%, 4px);
  }
}

.theme-toggle-button {
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
}

.login-form {
  display: flex;
  gap: 8px;
  align-items: center;
}

.login-form input {
  min-width: 0;
  flex: 1;
  height: 38px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--page-bg);
  color: var(--page-fg);
  padding: 0 10px;
  font: inherit;
}

.login-form button {
  height: 38px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--button-bg);
  color: var(--button-fg);
  padding: 0 13px;
  cursor: pointer;
}

.login-form button:hover,
.login-form input:focus,
.login-form button:focus-visible {
  background: var(--button-bg-active);
}

.login-form input:focus,
.login-form button:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.auth-error,
.empty-list {
  margin: 0;
  color: var(--muted-fg);
  font-size: 13px;
  line-height: 1.45;
}

.settings-shell {
  display: grid;
  gap: 18px;
}

.settings-page-header {
  min-width: 0;
}

.account-profile {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.account-identity {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.account-avatar {
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  border-radius: 50%;
}

.account-name {
  min-width: 0;
  overflow: hidden;
  color: var(--page-fg);
  font-size: 17px;
  font-weight: 600;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-actions {
  min-width: 0;
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px 8px;
  padding-left: 36px;
}

.account-logout-form {
  display: inline-flex;
  align-items: baseline;
  margin: 0;
}

.account-logout-button {
  display: inline-flex;
  align-items: baseline;
  border: 0;
  background: transparent;
  color: var(--muted-fg);
  padding: 0;
  font: inherit;
  font-size: 12px;
  line-height: 1.4;
  cursor: pointer;
}

.account-logout-button:hover,
.account-logout-button:focus-visible {
  color: var(--page-fg);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.account-logout-button:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.account-action-separator {
  color: var(--border);
  font-size: 12px;
  line-height: 1.4;
}

.api-key-copy-action {
  min-width: 74px;
  display: inline-flex;
  align-items: baseline;
  border: 0;
  background: transparent;
  color: var(--muted-fg);
  padding: 0;
  font: inherit;
  font-size: 12px;
  line-height: 1.4;
  cursor: pointer;
  text-align: left;
}

.api-key-copy-action:hover {
  color: var(--page-fg);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.api-key-copy-action[data-copied="true"] {
  color: var(--page-fg);
}

.api-key-copy-action:focus-visible {
  color: var(--page-fg);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.api-key-copy-action:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.alert-settings {
  display: grid;
  gap: 0;
  color: var(--muted-fg);
  font-size: 12px;
  line-height: 1.45;
}

.offline-settings {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
  color: var(--muted-fg);
  font-size: 12px;
  line-height: 1.45;
}

.offline-settings-heading {
  min-width: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.offline-settings-copy {
  min-width: 0;
}

.offline-settings h1,
.offline-settings p {
  margin: 0;
}

.offline-settings h1 {
  color: var(--page-fg);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
}

.offline-settings-copy p {
  margin-top: 2px;
  overflow-wrap: anywhere;
}

.offline-settings-status {
  min-height: 17px;
}

.offline-storage-summary {
  display: grid;
  gap: 5px;
}

.offline-storage-label {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted-fg);
  font-size: 11px;
}

.offline-storage-meter {
  width: 100%;
  height: 4px;
  overflow: hidden;
  border: 0;
  border-radius: 999px;
  background: var(--button-bg-active);
  color: var(--switch-on);
  appearance: none;
}

.offline-storage-meter::-webkit-progress-bar {
  border-radius: 999px;
  background: var(--button-bg-active);
}

.offline-storage-meter::-webkit-progress-value {
  border-radius: 999px;
  background: var(--switch-on);
}

.offline-storage-meter::-moz-progress-bar {
  border-radius: 999px;
  background: var(--switch-on);
}

.offline-settings-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 14px;
}

.offline-limit-control {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.offline-limit-control select {
  min-height: 28px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--button-bg);
  color: var(--button-fg);
  padding: 2px 24px 2px 7px;
  font: inherit;
}

.offline-limit-control select:focus-visible,
.offline-clear-button:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.offline-clear-button {
  border: 0;
  background: transparent;
  color: var(--muted-fg);
  padding: 0;
  font: inherit;
  cursor: pointer;
}

.offline-clear-button:hover:not(:disabled),
.offline-clear-button:focus-visible {
  color: var(--danger-fg);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.offline-clear-button:disabled,
.offline-limit-control select:disabled {
  cursor: default;
  opacity: 0.55;
}

.alert-settings-heading {
  min-width: 0;
  padding-bottom: 8px;
}

.alert-settings h1 {
  margin: 0;
  color: var(--page-fg);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
}

.alert-browser-row,
.alert-preference-row {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 0;
}

.alert-preference-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.alert-preference-label {
  color: var(--page-fg);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
}

.alert-preference-description {
  color: var(--muted-fg);
  font-size: 12px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.alert-enrollment {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
}

.alert-enrollment-button {
  min-height: 28px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--button-bg);
  color: var(--button-fg);
  padding: 3px 8px;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}

.alert-enrollment-button:hover:not(:disabled),
.alert-enrollment-button:focus-visible {
  background: var(--button-bg-active);
}

.alert-enrollment-button:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.alert-enrollment-button:disabled {
  cursor: default;
  opacity: 0.65;
}

.alert-preferences {
  display: grid;
  margin-top: 7px;
  padding-left: 12px;
}

.alert-preferences-title {
  margin: 0 0 2px;
  color: var(--muted-fg);
  font-size: 11px;
  line-height: 1.4;
}

.alert-preferences .alert-preference-row {
  padding: 5px 0;
}

.settings-switch {
  position: relative;
  width: 36px;
  height: 20px;
  flex: 0 0 auto;
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--switch-off);
  padding: 0;
  cursor: pointer;
  transition:
    background-color 140ms ease,
    opacity 140ms ease;
}

.settings-switch[aria-checked="true"] {
  background: var(--switch-on);
}

.settings-switch-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1px 2px rgb(31 35 40 / 30%);
  transition: transform 140ms ease;
}

.settings-switch[aria-checked="true"] .settings-switch-thumb {
  transform: translateX(16px);
}

.settings-switch:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.settings-switch:disabled {
  cursor: default;
  opacity: 0.55;
}

.settings-switch[aria-busy="true"] {
  opacity: 0.7;
}

.alert-status,
.alert-message {
  margin: 0;
}

.alert-message {
  margin-top: 8px;
  overflow-wrap: anywhere;
}

.account-sections {
  display: grid;
  gap: 4px;
}

.account-section-summary {
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--page-fg);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
  cursor: pointer;
  list-style: none;
}

.account-section-summary::-webkit-details-marker {
  display: none;
}

.account-section-summary::after {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-right: 1px solid currentcolor;
  border-bottom: 1px solid currentcolor;
  color: var(--muted-fg);
  content: "";
  transform: rotate(45deg) translate(-2px, 2px);
  transition: transform 140ms ease;
}

.account-section[open] .account-section-summary::after {
  transform: rotate(225deg) translate(-1px, 1px);
}

.account-section-summary:hover,
.account-section-summary:focus-visible {
  color: var(--page-fg);
}

.account-section-summary:focus-visible {
  border-radius: 4px;
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.account-section-body {
  margin: 0 0 12px;
  padding: 2px 0 1px 12px;
}

.account-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
}

.account-stat {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.account-stat dt {
  color: var(--muted-fg);
  font-size: 11px;
  line-height: 1.4;
}

.account-stat dd {
  margin: 0;
  color: var(--page-fg);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.account-export {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 14px;
}

.account-export p {
  margin: 0;
  color: var(--muted-fg);
  font-size: 12px;
  line-height: 1.45;
}

.account-export-button {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--button-bg);
  color: var(--button-fg);
  padding: 3px 8px;
  font-size: 12px;
  line-height: 1.4;
  text-decoration: none;
}

.account-export-button:hover,
.account-export-button:focus-visible {
  background: var(--button-bg-active);
}

.account-export-button:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.me-tabs-section {
  display: grid;
  gap: 12px;
}

.gist-mine-panel {
  display: grid;
  gap: 10px;
}

.gist-search {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.gist-search-input {
  width: 100%;
  min-height: 34px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--page-bg);
  color: var(--page-fg);
  padding: 5px 9px;
  font: inherit;
  font-size: 13px;
  line-height: 1.4;
}

.gist-search-input::placeholder {
  color: var(--subtle-fg);
}

.gist-search-input:focus {
  border-color: var(--focus);
  outline: 2px solid var(--focus);
  outline-offset: 1px;
}

.gist-search-status {
  min-width: 70px;
  color: var(--muted-fg);
  font-size: 11px;
  line-height: 1.4;
  text-align: right;
}

.me-tabs-header {
  display: grid;
  grid-template-columns: minmax(28px, 1fr) auto minmax(28px, 1fr);
  align-items: center;
}

.me-tabs {
  grid-column: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  color: var(--muted-fg);
}

.gist-sort-control {
  grid-column: 1;
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted-fg);
}

.gist-sort-button {
  border: 0;
  background: transparent;
  color: var(--subtle-fg);
  padding: 0;
  font: inherit;
  font-size: 10px;
  font-weight: 600;
  line-height: 1.4;
  cursor: pointer;
}

.gist-sort-button:hover,
.gist-sort-button:focus-visible,
.gist-sort-button[aria-pressed="true"] {
  color: var(--page-fg);
}

.gist-sort-button:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.gist-sort-separator {
  color: var(--border);
  font-size: 10px;
  line-height: 1.4;
}

.me-tab-button {
  border: 0;
  background: transparent;
  color: var(--muted-fg);
  padding: 0;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0;
  cursor: pointer;
}

.me-tab-button:hover,
.me-tab-button:focus-visible,
.me-tab-button[aria-selected="true"] {
  color: var(--page-fg);
}

.me-tab-button:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.me-tab-separator {
  color: var(--border);
  font-size: 12px;
  line-height: 1.4;
}

.gist-list {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--border);
}

.gist-list-item {
  border-bottom: 1px solid var(--border);
}

.gist-list-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.gist-list-content {
  min-width: 0;
  flex: 1;
  display: grid;
  gap: 3px;
  padding: 12px 0;
}

.gist-list-title-link {
  color: var(--page-fg);
  text-decoration: none;
}

.gist-list-title-link:hover .gist-list-title,
.gist-list-title-link:focus-visible .gist-list-title,
.gist-list-meta-link:hover,
.gist-list-meta-link:focus-visible {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.gist-list-title-link:focus-visible,
.gist-list-meta-link:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

.gist-list-title {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;
}

.gist-list-meta {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--muted-fg);
  font-size: 12px;
  line-height: 1.4;
}

.gist-list-author {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  vertical-align: -3px;
}

.gist-list-avatar {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  border-radius: 50%;
}

.gist-list-avatar-placeholder {
  display: inline-grid;
  place-items: center;
  background: var(--button-bg-active);
  color: var(--muted-fg);
  font-size: 9px;
  font-weight: 600;
  line-height: 1;
}

.gist-list-author-name {
  min-width: 0;
  overflow-wrap: anywhere;
}

.gist-list-meta-link {
  color: var(--page-fg);
  text-decoration: none;
}

.gist-list-action {
  flex: 0 0 auto;
}

.gist-pagination {
  min-height: 28px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  color: var(--muted-fg);
  font-size: 12px;
  line-height: 1.4;
}

.gist-pagination-button {
  border: 0;
  background: transparent;
  color: var(--muted-fg);
  padding: 0;
  font: inherit;
  font-size: 12px;
  line-height: 1.4;
  cursor: pointer;
}

.gist-pagination-button:hover:not(:disabled),
.gist-pagination-button:focus-visible {
  color: var(--page-fg);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.gist-pagination-button:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.gist-pagination-button:disabled {
  cursor: default;
  opacity: 0.45;
}

.gist-pagination-status {
  min-width: 72px;
  text-align: center;
}

.gist-delete-button {
  width: 32px;
  height: 32px;
  color: var(--muted-fg);
}

.gist-delete-button:hover {
  color: #cf222e;
}

:root[data-theme="dark"] .gist-delete-button:hover {
  color: #ff7b72;
}

.confirm-modal-backdrop {
  position: fixed;
  z-index: 50;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgb(13 17 23 / 52%);
  padding: 20px;
}

.confirm-modal {
  width: min(100%, 340px);
  display: grid;
  gap: 13px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--page-bg);
  box-shadow: var(--shadow);
  padding: 14px;
}

.confirm-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.confirm-modal-title {
  margin: 0;
  color: var(--page-fg);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;
}

.confirm-modal-close {
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
}

.confirm-modal-body {
  min-width: 0;
  color: var(--muted-fg);
  font-size: 13px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.confirm-modal-body p,
.confirm-modal-error {
  margin: 0;
}

.confirm-modal-error {
  color: #cf222e;
  font-size: 12px;
  line-height: 1.4;
}

:root[data-theme="dark"] .confirm-modal-error {
  color: #ff7b72;
}

.confirm-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.confirm-modal-button {
  height: 32px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--button-bg);
  color: var(--button-fg);
  padding: 0 11px;
  font: inherit;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
}

.confirm-modal-button:hover:not(:disabled),
.confirm-modal-button:focus-visible {
  background: var(--button-bg-active);
}

.confirm-modal-button:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.confirm-modal-button:disabled {
  cursor: default;
  opacity: 0.65;
}

.confirm-modal-confirm-danger {
  border-color: rgb(207 34 46 / 55%);
  color: #cf222e;
}

.confirm-modal-confirm-danger:hover:not(:disabled),
.confirm-modal-confirm-danger:focus-visible {
  background: rgb(255 235 233);
}

:root[data-theme="dark"] .confirm-modal-confirm-danger {
  border-color: rgb(255 123 114 / 45%);
  color: #ff7b72;
}

:root[data-theme="dark"] .confirm-modal-confirm-danger:hover:not(:disabled),
:root[data-theme="dark"] .confirm-modal-confirm-danger:focus-visible {
  background: rgb(73 21 23);
}

.page-header {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px 16px;
  align-items: center;
  margin-bottom: 16px;
}

.brand-mark {
  min-width: 0;
  max-width: 220px;
  display: inline-flex;
  align-items: baseline;
  color: var(--page-fg);
  font-size: 28px;
  line-height: 1;
  letter-spacing: 0;
  white-space: nowrap;
}

.brand-mark-strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 760;
}

.brand-mark-light {
  font-weight: 220;
}

.gist-title {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--page-fg);
  font-size: 24px;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: 0;
}

.gist-heading {
  grid-column: 2;
  min-width: 0;
  display: grid;
  gap: 5px;
}

.gist-meta {
  display: grid;
  min-width: 0;
  gap: 2px;
  color: var(--muted-fg);
  font-size: 13px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.gist-date-line {
  min-width: 0;
}

.gist-date-mobile {
  display: none;
}

.gist-date-label {
  color: var(--subtle-fg);
}

.gist-date-line-with-tooltip {
  position: relative;
  display: inline-block;
}

.gist-date-tooltip {
  position: absolute;
  z-index: 20;
  top: 50%;
  left: calc(100% + 8px);
  display: grid;
  gap: 2px;
  width: max-content;
  max-width: min(320px, calc(100vw - 32px));
  padding: 5px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--button-bg);
  box-shadow: var(--shadow);
  color: var(--page-fg);
  font-size: 12px;
  line-height: 1.35;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-50%);
  transition:
    opacity 120ms ease,
    transform 120ms ease;
  white-space: nowrap;
}

.gist-date-tooltip-row {
  display: block;
}

.gist-date-line-with-tooltip:hover .gist-date-tooltip {
  opacity: 1;
}

.gist-author-row {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  column-gap: 10px;
  row-gap: 3px;
  align-items: center;
}

.gist-author-name {
  color: var(--page-fg);
}

.gist-author-line {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.gist-author-avatar {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  border-radius: 50%;
}

.gist-author-avatar-placeholder {
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--border);
  background:
    linear-gradient(135deg, rgb(68 147 248 / 18%), transparent 55%),
    var(--button-bg-active);
  color: var(--muted-fg);
  font-size: 10px;
  font-weight: 650;
  line-height: 1;
}

.toolbar {
  grid-column: 3;
  justify-self: end;
  display: flex;
  gap: 8px;
  align-items: center;
  min-width: max-content;
}

.article-audio-toolbar-group {
  position: relative;
  grid-column: 3;
  justify-self: end;
  min-width: max-content;
}

.article-audio-toolbar-group .toolbar {
  grid-column: auto;
}

.article-audio-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgb(var(--audio-accent-rgb));
  border-right-color: transparent;
  border-radius: 50%;
  animation: article-audio-spin 700ms linear infinite;
}

.article-audio-button-ready {
  border-color: rgb(var(--audio-accent-rgb) / 45%);
  box-shadow:
    0 0 0 1px rgb(var(--audio-accent-rgb) / 8%),
    0 0 8px rgb(var(--audio-accent-rgb) / 16%);
}

:root[data-theme="dark"] .article-audio-button-ready {
  border-color: rgb(var(--audio-accent-rgb) / 55%);
  box-shadow:
    0 0 0 1px rgb(var(--audio-accent-rgb) / 10%),
    0 0 8px rgb(var(--audio-accent-rgb) / 20%);
}

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

@media (prefers-reduced-motion: reduce) {
  .article-audio-spinner {
    animation: none;
  }
}

.article-audio-engine {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.article-audio-dock-sentinel {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}

.article-audio-dock-top-probe {
  position: fixed;
  top: calc(env(safe-area-inset-top, 0px) + 10px);
  left: 0;
  width: 1px;
  height: 1px;
  visibility: hidden;
  pointer-events: none;
}

.article-audio-overlay {
  position: absolute;
  z-index: 20;
  top: calc(100% + 6px);
  right: 0;
  width: min(300px, calc(100vw - 32px));
  min-width: 0;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 38px;
  align-items: center;
  gap: 1px 6px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--page-bg);
  background: color-mix(in srgb, var(--page-bg) 94%, transparent);
  box-shadow: 0 5px 18px rgb(31 35 40 / 14%);
  padding: 5px 6px 6px;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  transition: box-shadow 140ms ease;
  animation: article-audio-reveal 130ms ease-out;
}

:root[data-theme="dark"] .article-audio-overlay {
  box-shadow: 0 5px 20px rgb(1 4 9 / 48%);
}

.article-audio-preparing-overlay {
  width: min(230px, calc(100vw - 32px));
  min-height: 42px;
  grid-template-columns: minmax(0, 1fr);
  color: var(--muted-fg);
  padding: 8px 11px;
  font-size: 12px;
  line-height: 1.35;
}

.article-audio-overlay-docked {
  position: fixed;
  top: calc(env(safe-area-inset-top, 0px) + 10px);
  right: max(32px, calc((100vw - 1040px) / 2 + 32px));
  width: min(300px, calc(100vw - 64px));
  box-shadow: 0 7px 22px rgb(31 35 40 / 18%);
}

.article-audio-preparing-overlay.article-audio-overlay-docked {
  width: min(230px, calc(100vw - 64px));
}

:root[data-theme="dark"] .article-audio-overlay-docked {
  box-shadow: 0 7px 24px rgb(1 4 9 / 55%);
}

.article-audio-play-button,
.article-audio-skip-button,
.article-audio-speed-button {
  display: inline-grid;
  height: 26px;
  place-items: center;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--button-fg);
  padding: 0;
  cursor: pointer;
}

.article-audio-play-button {
  width: 28px;
}

.article-audio-transport {
  grid-column: 2;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
}

.article-audio-skip-button {
  position: relative;
  width: 28px;
}

.article-audio-skip-label {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding-top: 1px;
  font-size: 7px;
  font-weight: 700;
  line-height: 1;
  pointer-events: none;
}

.article-audio-play-button:hover,
.article-audio-skip-button:hover,
.article-audio-speed-button:hover,
.article-audio-speed-button[aria-expanded="true"] {
  background: var(--button-bg-active);
}

.article-audio-play-button:focus-visible,
.article-audio-skip-button:focus-visible,
.article-audio-speed-button:focus-visible,
.article-audio-speed-option:focus-visible,
.article-audio-seek:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 1px;
}

.article-audio-skip-button:disabled {
  cursor: default;
  opacity: 0.45;
}

.article-audio-skip-button:disabled:hover {
  background: transparent;
}

.article-audio-timeline {
  grid-column: 1 / -1;
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(52px, 1fr) auto;
  align-items: center;
  gap: 6px;
}

.article-audio-time {
  min-width: 2.7em;
  color: var(--muted-fg);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  white-space: nowrap;
}

.article-audio-duration {
  text-align: right;
}

.article-audio-seek {
  width: 100%;
  min-width: 0;
  height: 14px;
  margin: 0;
  appearance: none;
  border-radius: 999px;
  background:
    linear-gradient(
        to right,
        var(--focus) 0 var(--audio-progress),
        var(--border) var(--audio-progress) 100%
      )
      center / 100% 3px no-repeat;
  cursor: pointer;
}

.article-audio-seek:disabled {
  cursor: default;
  opacity: 0.6;
}

.article-audio-seek::-webkit-slider-runnable-track {
  height: 3px;
  border-radius: 999px;
  background: transparent;
}

.article-audio-seek::-webkit-slider-thumb {
  width: 11px;
  height: 11px;
  margin-top: -4px;
  appearance: none;
  border: 2px solid var(--page-bg);
  border-radius: 50%;
  background: var(--focus);
  box-shadow: 0 0 0 1px rgb(9 105 218 / 18%);
}

.article-audio-seek::-moz-range-track {
  height: 3px;
  border: 0;
  border-radius: 999px;
  background: var(--border);
}

.article-audio-seek::-moz-range-progress {
  height: 3px;
  border-radius: 999px;
  background: var(--focus);
}

.article-audio-seek::-moz-range-thumb {
  width: 8px;
  height: 8px;
  border: 2px solid var(--page-bg);
  border-radius: 50%;
  background: var(--focus);
  box-shadow: 0 0 0 1px rgb(9 105 218 / 18%);
}

.article-audio-speed-control {
  grid-column: 3;
  position: relative;
  justify-self: end;
}

.article-audio-speed-button {
  min-width: 38px;
  padding: 0 5px;
  color: var(--muted-fg);
  font-size: 11px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.article-audio-speed-menu {
  position: absolute;
  z-index: 2;
  top: calc(100% + 7px);
  right: -2px;
  width: 92px;
  display: grid;
  gap: 1px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--page-bg);
  box-shadow: var(--shadow);
  padding: 4px;
}

.article-audio-speed-option {
  width: 100%;
  min-height: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--page-fg);
  padding: 4px 6px;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}

.article-audio-speed-option:hover,
.article-audio-speed-option[aria-pressed="true"] {
  background: var(--button-bg-active);
}

.article-audio-playback-error {
  grid-column: 1 / -1;
  color: var(--muted-fg);
  font-size: 11px;
  line-height: 1.35;
  padding: 0 2px 1px;
}

@keyframes article-audio-reveal {
  from {
    opacity: 0;
    transform: translateY(-3px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .article-audio-overlay {
    transition: none;
    animation: none;
  }
}

.article-audio-row {
  grid-column: 1 / -1;
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 8px 12px;
}

.article-audio-message {
  color: var(--muted-fg);
  font-size: 13px;
  line-height: 1.4;
}

.page-header-no-brand {
  grid-template-columns: minmax(0, 1fr) auto;
}

.page-header-no-brand .gist-heading {
  grid-column: 1;
}

.page-header-no-brand .toolbar {
  grid-column: 2;
}

.page-header-no-brand .article-audio-toolbar-group {
  grid-column: 2;
}

.icon-button {
  display: inline-grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--button-bg);
  color: var(--button-fg);
  cursor: pointer;
}

.icon-button:hover,
.icon-button[aria-pressed="true"] {
  background: var(--button-bg-active);
}

.icon-button:disabled {
  cursor: default;
  opacity: 0.45;
}

.icon-button[aria-busy="true"]:disabled {
  cursor: progress;
  opacity: 1;
}

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

.icon-button:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.history-control {
  position: relative;
}

.history-menu {
  position: absolute;
  z-index: 10;
  top: calc(100% + 8px);
  right: 0;
  width: min(320px, calc(100vw - 32px));
  max-height: 320px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--page-bg);
  box-shadow: var(--shadow);
}

.history-item-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
}

.history-item-row + .history-item-row {
  border-top: 1px solid var(--border);
}

.history-item {
  min-width: 0;
  display: grid;
  gap: 2px;
  padding: 9px 10px;
  color: var(--page-fg);
  text-decoration: none;
}

.history-item:hover,
.history-item:focus-visible,
.history-item[aria-current="page"],
.history-diff-link:hover,
.history-diff-link:focus-visible,
.history-diff-link[aria-current="page"] {
  background: var(--button-bg-active);
}

.history-item:focus-visible,
.history-diff-link:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: -2px;
}

.history-diff-link {
  width: 44px;
  min-height: 100%;
  display: inline-grid;
  place-items: center;
  border-left: 1px solid var(--border);
  background: var(--button-bg-active);
  color: var(--button-fg);
  text-decoration: none;
}

.history-diff-link svg {
  opacity: 0.82;
}

.history-diff-link:hover svg,
.history-diff-link:focus-visible svg,
.history-diff-link[aria-current="page"] svg {
  opacity: 1;
}

.history-item-title {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
}

.history-item-meta {
  color: var(--muted-fg);
  font-size: 12px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.history-item-date,
.history-item-latest {
  color: var(--subtle-fg);
}

.history-item-availability {
  color: var(--subtle-fg);
}

.history-item[aria-disabled="true"],
.history-diff-link[aria-disabled="true"] {
  cursor: default;
  opacity: 0.55;
}

.history-item[aria-disabled="true"]:hover,
.history-item[aria-disabled="true"]:focus-visible {
  background: transparent;
}

.markdown-body {
  color-scheme: light;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  background: transparent;
  overflow-wrap: anywhere;
}

:root[data-theme="dark"] .markdown-body {
  color-scheme: dark;
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4,
.markdown-body h5,
.markdown-body h6,
.markdown-body p,
.markdown-body li {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.markdown-body pre,
.markdown-body table {
  max-width: 100%;
  overflow-x: auto;
}

.markdown-body .math-render-output {
  display: none;
}

.markdown-body .math-render[data-math-state="rendered"]
  > .math-render-fallback {
  display: none;
}

.markdown-body .math-render[data-math-state="rendered"]
  > .math-render-output {
  display: inline;
}

.markdown-body .math-display {
  display: block;
  max-width: 100%;
  margin: 16px 0;
  overflow-x: auto;
  overflow-y: hidden;
  text-align: center;
}

.markdown-body .math-display > .math-render-fallback {
  white-space: pre-wrap;
}

.markdown-body .math-display[data-math-state="rendered"]
  > .math-render-output {
  display: block;
}

.markdown-body .math-display .katex-display {
  margin: 0;
}

.markdown-body .mermaid-render {
  max-width: 100%;
  margin: 16px 0;
  text-align: center;
}

.markdown-body .mermaid-render-fallback {
  text-align: left;
}

:root[data-js="enabled"]
  .markdown-body
  .mermaid-render:not([data-mermaid-state="error"])
  .mermaid-render-fallback {
  display: none;
}

.markdown-body .mermaid-render-output,
.markdown-body .mermaid-render-error {
  display: none;
}

.markdown-body .mermaid-render-output svg {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
}

.markdown-body .mermaid-panzoom {
  position: relative;
  width: 100%;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--page-bg);
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.markdown-body .mermaid-panzoom:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.markdown-body .mermaid-panzoom[data-panzoom-state="dragging"] {
  cursor: grabbing;
}

.markdown-body .mermaid-panzoom[data-panzoom-layout="compact"] {
  height: var(--mermaid-compact-height);
}

.markdown-body .mermaid-panzoom-canvas {
  width: 100%;
}

.markdown-body .mermaid-panzoom[data-panzoom-layout="compact"] .mermaid-panzoom-canvas {
  height: 100%;
}

.markdown-body .mermaid-panzoom-canvas svg {
  display: block;
  width: 100% !important;
  max-width: none !important;
  height: auto !important;
  margin: 0;
}

.markdown-body .mermaid-panzoom[data-panzoom-layout="compact"] .mermaid-panzoom-canvas svg {
  height: 100% !important;
}

.markdown-body .mermaid-panzoom-controls {
  position: absolute;
  z-index: 1;
  top: 8px;
  right: 8px;
  display: flex;
  gap: 4px;
  align-items: center;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--page-bg);
  background: color-mix(in srgb, var(--page-bg) 88%, transparent);
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-2px);
  transition:
    opacity 120ms ease,
    transform 120ms ease;
}

.markdown-body .mermaid-panzoom:hover .mermaid-panzoom-controls,
.markdown-body .mermaid-panzoom:focus-within .mermaid-panzoom-controls,
.markdown-body .mermaid-panzoom[data-panzoom-controls="visible"] .mermaid-panzoom-controls {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.markdown-body .mermaid-panzoom-button {
  display: inline-grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 5px;
  background: transparent;
  color: var(--button-fg);
  cursor: pointer;
}

.markdown-body .mermaid-panzoom-button:hover {
  border-color: var(--border);
  background: var(--button-bg-active);
}

.markdown-body .mermaid-panzoom-button:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 1px;
}

.markdown-body .mermaid-panzoom-button svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.markdown-body .mermaid-render-error {
  margin-top: 8px;
  color: var(--fgColor-danger);
  font-size: 12px;
  text-align: left;
}

.markdown-body .mermaid-render[data-mermaid-state="rendered"] .mermaid-render-fallback {
  display: none;
}

.markdown-body .mermaid-render[data-mermaid-state="loading"] .mermaid-render-output,
.markdown-body .mermaid-render[data-mermaid-state="rendered"] .mermaid-render-output {
  display: block;
}

.markdown-body .mermaid-render[data-mermaid-state="error"] .mermaid-render-error {
  display: block;
}

.markdown-body table {
  display: block;
  width: 100%;
  min-width: 0;
  overflow-y: hidden;
  table-layout: auto;
}

.markdown-body th,
.markdown-body td {
  min-width: 0;
  overflow-wrap: break-word;
  word-break: normal;
}

.markdown-body th {
  white-space: normal;
}

.markdown-body th:last-child,
.markdown-body td:last-child {
  min-width: 0;
  max-width: 90ch;
  overflow-wrap: break-word;
  white-space: normal;
}

.markdown-body table code {
  overflow-wrap: anywhere;
  white-space: normal;
  word-break: break-word;
}

.markdown-body table a,
.markdown-body table .eth-entity {
  white-space: nowrap;
}

.gist-files {
  display: grid;
  width: 100%;
  max-width: 100%;
  gap: 12px;
  min-width: 0;
}

.gist-file-panel {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--page-bg);
}

.gist-file-header {
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  border-bottom: 1px solid var(--border);
  background: transparent;
  padding: 3px 6px 3px 7px;
}

.gist-file-panel[data-collapsed="true"] .gist-file-header {
  border-bottom-color: transparent;
}

.gist-file-disclosure {
  min-width: 0;
  min-height: 28px;
  display: inline-flex;
  flex: 1 1 auto;
  align-items: center;
  gap: 6px;
  overflow: hidden;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: inherit;
  padding: 3px 5px;
  text-align: left;
  cursor: pointer;
}

.gist-file-disclosure:hover,
.gist-file-disclosure:focus-visible {
  background: var(--button-bg-active);
}

.gist-file-disclosure:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 1px;
}

.gist-file-chevron {
  flex: 0 0 auto;
  color: var(--muted-fg);
  transition: transform 120ms ease;
}

.gist-file-panel[data-collapsed="true"] .gist-file-chevron {
  transform: rotate(-90deg);
}

.gist-file-identity {
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.gist-file-name {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  color: var(--page-fg);
  font-family:
    ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono,
    monospace;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gist-file-meta {
  flex: 0 0 auto;
  color: var(--subtle-fg);
  font-size: 11px;
  line-height: 1.35;
}

.gist-file-actions {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 2px;
}

.gist-file-action {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  color: var(--muted-fg);
  padding: 4px 6px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
  text-decoration: none;
}

button.gist-file-action {
  cursor: pointer;
}

.gist-file-action:hover,
.gist-file-action:focus-visible {
  border-color: var(--border);
  background: var(--button-bg-active);
  color: var(--page-fg);
}

.gist-file-action:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 1px;
}

.gist-file-body {
  min-width: 0;
  max-width: 100%;
}

.gist-file-markdown {
  padding: 20px 24px 24px;
}

.gist-file-markdown > :first-child {
  margin-top: 0;
}

.gist-file-markdown > :last-child {
  margin-bottom: 0;
}

.gist-code-view {
  width: 100%;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-inline: contain;
  contain: inline-size;
  background: var(--page-bg);
}

.gist-line-numbers,
.gist-code-content,
.gist-code-content pre {
  margin: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  font-family:
    ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono,
    monospace;
  font-size: 13px;
  line-height: 1.55;
  white-space: pre;
}

.gist-line-numbers {
  position: sticky;
  z-index: 1;
  left: 0;
  min-width: calc(2ch + 6px);
  background: var(--page-bg);
  color: var(--subtle-fg);
  padding: 12px 4px 12px 2px;
  text-align: right;
  user-select: none;
}

.gist-code-content {
  width: max-content;
  min-width: 100%;
  overflow: visible;
  padding: 12px 10px;
  color: var(--page-fg);
}

.markdown-body.gist-code-content .highlight,
.markdown-body.gist-code-content .highlight pre {
  max-width: none;
  overflow: visible;
  background: transparent;
}

.markdown-body.gist-code-content .highlight {
  margin: 0;
}

.markdown-body.gist-code-content .highlight pre {
  margin: 0;
  padding: 0;
  border-radius: 0;
  font: inherit;
}

.raw-viewer {
  position: relative;
}

.gist-file-raw {
  border: 0;
  border-radius: 0;
  padding: 16px;
}

.raw-markdown {
  min-width: 0;
  max-width: 100%;
  margin: 0;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--button-bg-active);
  color: var(--page-fg);
  padding: 42px 16px 16px;
  font-family:
    ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono,
    monospace;
  font-size: 13px;
  line-height: 1.5;
  white-space: pre;
}

.raw-copy-button {
  position: absolute;
  z-index: 1;
  top: 8px;
  right: 8px;
  opacity: 0;
  transition: opacity 120ms ease;
}

.raw-viewer:hover .raw-copy-button,
.raw-viewer:focus-within .raw-copy-button {
  opacity: 1;
}

.diff-viewer {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--page-bg);
}

.diff-viewer-header {
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--border);
  background: var(--button-bg-active);
  padding: 8px 12px;
}

.diff-viewer-title {
  margin: 0;
  color: var(--page-fg);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
}

.diff-viewer-stats {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 6px;
  font-family:
    ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono,
    monospace;
  font-size: 12px;
  line-height: 1.2;
}

.diff-metadata-change {
  display: grid;
  grid-template-columns: minmax(72px, auto) minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  border-bottom: 1px solid var(--border);
  padding: 9px 12px;
  font-size: 12.5px;
  line-height: 1.4;
}

.diff-metadata-label {
  color: var(--muted-fg);
  font-weight: 600;
}

.diff-metadata-change del,
.diff-metadata-change ins {
  min-width: 0;
  overflow-wrap: anywhere;
  text-decoration: none;
}

.diff-metadata-change del {
  color: #82071e;
}

.diff-metadata-change ins {
  color: #116329;
}

:root[data-theme="dark"] .diff-metadata-change del {
  color: #ffa198;
}

:root[data-theme="dark"] .diff-metadata-change ins {
  color: #7ee787;
}

.diff-empty {
  padding: 18px 12px;
  color: var(--muted-fg);
  font-size: 13px;
}

.diff-file + .diff-file {
  border-top: 1px solid var(--border);
}

.diff-file-header {
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--border);
  background: var(--button-bg-active);
  padding: 6px 10px 6px 12px;
}

.diff-file-header h3 {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  font-family:
    ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono,
    monospace;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.diff-file-summary {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 6px;
  color: var(--muted-fg);
  font-size: 11px;
}

.diff-stat {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px 7px;
  background: var(--page-bg);
}

.diff-stat-added {
  color: #116329;
}

.diff-stat-removed {
  color: #82071e;
}

:root[data-theme="dark"] .diff-stat-added {
  color: #7ee787;
}

:root[data-theme="dark"] .diff-stat-removed {
  color: #ffa198;
}

.diff-table-scroll {
  max-width: 100%;
  overflow-x: auto;
}

.diff-table {
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
  table-layout: auto;
  font-family:
    ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono,
    monospace;
  font-size: 12.5px;
  line-height: 1.55;
}

.diff-row {
  background: var(--page-bg);
}

.diff-row-added {
  background: #dafbe1;
}

.diff-row-removed {
  background: #ffebe9;
}

:root[data-theme="dark"] .diff-row-added {
  background: #0f2f1d;
}

:root[data-theme="dark"] .diff-row-removed {
  background: #3d171a;
}

.diff-line-number {
  width: 48px;
  min-width: 48px;
  border-right: 1px solid var(--border);
  background: var(--button-bg-active);
  color: var(--muted-fg);
  padding: 0 8px;
  text-align: right;
  user-select: none;
  vertical-align: top;
  white-space: nowrap;
}

.diff-marker {
  width: 28px;
  min-width: 28px;
  color: var(--muted-fg);
  padding: 0 8px;
  text-align: center;
  user-select: none;
  vertical-align: top;
  white-space: nowrap;
}

.diff-code {
  min-width: 72ch;
  padding: 0 14px 0 0;
  color: var(--page-fg);
  tab-size: 2;
  vertical-align: top;
  white-space: pre;
}

.diff-hunk {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--button-bg-active);
  color: var(--muted-fg);
  padding: 6px 12px;
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial,
    sans-serif;
  font-size: 12px;
  line-height: 1.35;
}

.diff-word {
  border-radius: 2px;
}

.diff-word-added {
  background: #aceebb;
}

.diff-word-removed {
  background: #ffcecb;
}

:root[data-theme="dark"] .diff-word-added {
  background: #2ea04380;
}

:root[data-theme="dark"] .diff-word-removed {
  background: #f8514980;
}

.not-found,
.error-state {
  min-height: calc(100vh - 44px);
  display: grid;
  place-content: center;
  gap: 6px;
  padding: 32px;
  text-align: center;
}

.not-found h1,
.not-found p,
.error-state h1,
.error-state p {
  margin: 0;
}

.not-found h1,
.error-state h1 {
  color: var(--page-fg);
  font-size: 22px;
  font-weight: 600;
  line-height: 1.3;
}

.not-found p,
.error-state p {
  color: var(--muted-fg);
  font-size: 14px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.not-found .empty-state-lead {
  max-width: 420px;
  color: var(--page-fg);
  font-size: 16px;
  font-weight: 500;
}

@media (hover: none) {
  .raw-copy-button {
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .gist-file-chevron,
  .pull-refresh-indicator,
  .standalone-action-notice {
    transition: none;
    animation: none;
  }

  .pull-refresh-indicator[data-state="refreshing"] svg {
    animation: none;
  }
}

@media (max-width: 640px) {
  .app-header-inner {
    min-height: auto;
    padding: 8px 16px;
    align-items: center;
    gap: 12px;
  }

  .app-nav {
    justify-content: flex-end;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .app-name {
    max-width: 96px;
  }

  .page-shell {
    padding: 10px 16px 20px;
  }

  :is(.page-shell-gist, .page-shell-wide) .gist-files {
    width: auto;
    max-width: none;
    margin-right: -16px;
    margin-left: -16px;
  }

  .gist-file-panel {
    border-right: 0;
    border-left: 0;
    border-radius: 0;
  }

  .gist-file-header {
    min-height: 38px;
    padding: 4px 8px;
  }

  .gist-file-markdown {
    padding: 18px 16px 22px;
  }

  .gist-code-view {
    grid-template-columns: minmax(0, 1fr);
  }

  .gist-line-numbers {
    display: none;
  }

  .gist-code-content {
    grid-column: 1;
    padding: 10px;
    font-size: 14px;
  }

  .auth-shell {
    padding: 14px 16px 24px;
  }

  .home-shell {
    gap: 24px;
    padding: 28px 16px 36px;
  }

  .home-intro {
    margin-top: 20px;
  }

  .home-gist-history {
    margin-top: 0;
  }

  .gist-sort-control {
    grid-column: 1 / -1;
    grid-row: 2;
    margin-top: 8px;
  }

  .account-actions {
    padding-left: 36px;
  }

  .account-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .login-form {
    align-items: stretch;
    flex-direction: column;
  }

  .page-header {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px 12px;
  }

  .brand-mark {
    grid-column: 1;
    max-width: 50vw;
    font-size: 24px;
  }

  .gist-heading {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .toolbar {
    grid-column: 2;
    justify-content: flex-end;
  }

  .article-audio-toolbar-group {
    grid-column: 2;
  }

  .page-header-no-brand .gist-heading {
    display: contents;
  }

  .page-header-no-brand .gist-meta {
    grid-column: 1;
    grid-row: 1;
    align-self: center;
  }

  .page-header-no-brand .gist-title {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .page-header-no-brand .article-audio-toolbar-group {
    grid-row: 1;
    align-self: center;
  }

  .gist-date-desktop {
    display: none;
  }

  .gist-date-mobile {
    display: inline;
  }

  .article-audio-overlay-docked {
    right: 16px;
    width: min(300px, calc(100vw - 32px));
  }

  .article-audio-preparing-overlay.article-audio-overlay-docked {
    width: min(230px, calc(100vw - 32px));
  }
}

@media (max-width: 480px) {
  .gist-file-meta {
    display: none;
  }

  .gist-file-copy {
    width: 28px;
    justify-content: center;
    padding-right: 4px;
    padding-left: 4px;
  }

  .gist-file-copy span {
    display: none;
  }
}
