/* EmlogStudio article reader enhancements: local, lightweight and progressive. */
.article-reader {
  --article-text: #c7d2cc;
  --article-muted: #8f9c95;
  --article-surface: #0a100d;
  --article-surface-raised: #101713;
  --article-border: rgba(214, 238, 225, .13);
  --article-accent-soft: rgba(var(--accent-rgb), .1);
  --article-accent-line: rgba(var(--accent-rgb), .34);
}

.article-reader .article-hero {
  min-height: 196px;
  align-items: center;
  padding: clamp(18px, 2.4vw, 28px);
  gap: clamp(16px, 2.2vw, 26px);
}

.article-reader .article-heading h1 {
  font-size: clamp(26px, 2.55vw, 36px);
  line-height: 1.14;
}

.article-reader .article-heading > p {
  margin-top: 9px;
  font-size: 14px;
  line-height: 1.6;
}

.article-reader .article-meta {
  margin-top: 12px;
}

.article-reader .article-cover {
  height: clamp(132px, 14vw, 176px);
  min-height: 0;
  max-height: none;
  align-self: center;
}

.article-reader .article-cover img {
  height: 100%;
  min-height: 0;
  max-height: none;
}

.article-reader .article-cover {
  transform: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .07), 0 12px 28px rgba(0, 0, 0, .24);
}

.article-breadcrumb {
  display: flex;
  min-width: 0;
  min-height: 42px;
  align-items: center;
  margin: 0 0 12px;
  padding: 0 15px;
  gap: 9px;
  overflow: hidden;
  border: 1px solid var(--article-border);
  border-radius: 13px;
  background: #09100c;
  color: #75827b;
  font-size: 13px;
  line-height: 1.4;
}

.article-breadcrumb a {
  flex: 0 0 auto;
  color: #a5b1aa;
  text-decoration: none;
}

.article-breadcrumb a:hover,
.article-breadcrumb a:focus-visible {
  color: var(--green-bright);
}

.article-breadcrumb [aria-current="page"] {
  min-width: 0;
  overflow: hidden;
  color: #dce6e0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.article-reader .article-heading > p {
  max-width: 760px;
  color: #a6b2ab;
  font-size: 14px;
  line-height: 1.6;
}

.article-reader .article-meta {
  color: #99a59e;
  font-size: 13px;
}

.article-reader .article-meta > a,
.article-reader .article-meta > span {
  min-height: 28px;
}

.article-reader .article-meta .article-author {
  gap: 8px;
  color: #c7d2cc;
}

.article-reader .article-meta .article-author img {
  display: block;
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #131c17;
  object-fit: cover;
}

.article-toolbelt {
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 48px;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
  padding: 4px 8px 4px 12px;
  gap: 10px;
  border: 0;
  border-radius: 16px;
  background: transparent;
  box-shadow: none;
}

.article-reading-signals,
.article-tool-actions {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 6px;
}

.article-reading-signals {
  flex-wrap: wrap;
  color: #85928b;
  font-size: 12px;
}

.article-reading-signals > span {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  padding: 0 9px;
  border: 1px solid rgba(255, 255, 255, .07);
  border-radius: 999px;
  background: rgba(255, 255, 255, .025);
}

.article-online {
  gap: 7px;
}

.article-online i {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #eab95c;
}

.article-online.is-online i {
  background: var(--green-bright);
}

.article-online.is-offline i {
  background: #ff7d73;
}

.article-tool-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.article-tool-action {
  -webkit-appearance: none;
  appearance: none;
  display: inline-flex;
  min-width: 0;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  padding: 0 9px;
  gap: 6px;
  border: 0;
  border-radius: 11px;
  outline-offset: 2px;
  background: transparent;
  box-shadow: none;
  color: #b9c5be;
  font: inherit;
  font-size: 13px;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .16s ease, color .16s ease, transform .16s ease;
}

.article-tool-action svg {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.article-tool-action b {
  min-width: 1ch;
  color: #7f8c85;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.article-tool-action:hover,
.article-tool-action:focus-visible {
  background: rgba(var(--accent-rgb), .055);
  color: #e7fff1;
  transform: translateY(-1px);
}

.article-tool-action:focus-visible {
  outline: 2px solid var(--green-bright);
}

.article-tool-action.is-active,
.article-tool-action[aria-pressed="true"] {
  background: transparent;
  color: #8ff2b9;
}

.article-tool-action.is-active b,
.article-tool-action[aria-pressed="true"] b {
  color: #bdf8d4;
}

.article-tool-action:disabled {
  cursor: not-allowed;
  opacity: .58;
  transform: none;
}

.article-tool-icon {
  width: 40px;
  padding: 0;
}

.article-tool-status {
  position: absolute;
  right: 14px;
  bottom: -21px;
  z-index: 3;
  margin: 0;
  color: #99a69f;
  font-size: 12px;
}

.article-tool-status:empty {
  display: none;
}

.article-reading-layout {
  grid-template-columns: minmax(0, 1fr) minmax(245px, 285px);
  gap: 16px;
  margin-top: 16px;
}

.article-reading-layout.is-toc-empty {
  grid-template-columns: minmax(0, 1fr);
}

.article-reader .article-main {
  padding: clamp(26px, 4vw, 56px);
  overflow: hidden;
}

.article-document-bar {
  display: flex;
  min-height: 38px;
  align-items: center;
  justify-content: space-between;
  margin: calc(clamp(26px, 4vw, 56px) * -1) calc(clamp(26px, 4vw, 56px) * -1) 34px;
  padding: 0 18px;
  gap: 14px;
  border-bottom: 1px solid var(--article-border);
  background: #0d1410;
  color: #718078;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .04em;
}

.article-reader .article-content {
  color: var(--article-text);
  font-size: clamp(17px, 1.08vw, 18px);
  line-height: 1.92;
  word-break: break-word;
}

.article-reader .article-content > :first-child {
  margin-top: 0;
}

.article-reader .article-content > :last-child {
  margin-bottom: 0;
}

.article-reader .article-content :where(p, ul, ol, dl, blockquote, table, pre, figure, details) {
  margin-block: 1.15em;
}

.article-reader .article-content :where(h1, h2, h3, h4, h5, h6) {
  position: relative;
  scroll-margin-top: 22px;
  margin: 1.75em 0 .72em;
  color: #f0f6f2;
  font-family: var(--font-display);
  font-weight: 650;
  letter-spacing: -.025em;
  line-height: 1.35;
}

.article-reader .article-content h2 {
  padding-bottom: .48em;
  border-bottom: 1px solid var(--article-border);
  font-size: clamp(25px, 2.2vw, 32px);
}

.article-reader .article-content h2::before {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin: 0 10px 4px 0;
  border: 1px solid var(--green-bright);
  border-radius: 2px;
  background: var(--article-accent-soft);
  content: "";
}

.article-reader .article-content h3 {
  font-size: clamp(21px, 1.65vw, 25px);
}

.article-reader .article-content h4 {
  color: #dce8e1;
  font-size: 19px;
}

.article-reader .article-content :where(a) {
  color: #6ee7a2;
  text-decoration-color: rgba(110, 231, 162, .36);
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

.article-reader .article-content a:hover,
.article-reader .article-content a:focus-visible {
  color: #b4f5cf;
  text-decoration-color: currentColor;
}

.article-reader .article-content :where(ul, ol) {
  padding-left: 1.45em;
}

.article-reader .article-content li {
  margin: .4em 0;
  padding-left: .25em;
}

.article-reader .article-content li::marker {
  color: #59d890;
}

.article-reader .article-content blockquote {
  padding: 16px 20px;
  border: 1px solid rgba(79, 214, 137, .18);
  border-left: 3px solid #35cf7b;
  border-radius: 0 12px 12px 0;
  background: rgba(28, 111, 63, .09);
  color: #b1beb7;
}

.article-reader .article-content blockquote > :first-child { margin-top: 0; }
.article-reader .article-content blockquote > :last-child { margin-bottom: 0; }

.article-reader .article-content :where(code, kbd, samp) {
  border: 1px solid rgba(118, 231, 168, .14);
  border-radius: 5px;
  background: #101914;
  color: #a9efc6;
  font-family: var(--font-mono);
  font-size: .88em;
}

.article-reader .article-content :not(pre) > code {
  padding: .16em .42em;
}

.article-reader .article-content pre {
  position: relative;
  max-width: 100%;
  padding: 20px;
  overflow: auto;
  border: 1px solid rgba(140, 210, 170, .14);
  border-radius: 13px;
  background: #050a07;
  color: #d8e5dd;
  line-height: 1.7;
  tab-size: 2;
}

.article-reader .article-content pre code {
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font-size: 13px;
}

.article-reader .article-content hr {
  height: 1px;
  margin: 2.2em 0;
  border: 0;
  background: var(--article-border);
}

.article-reader .article-content :where(img, video) {
  max-width: 100%;
  height: auto;
  border-radius: 13px;
}

.article-reader .article-content img {
  display: block;
  margin-inline: auto;
  border: 1px solid var(--article-border);
}

.article-reader .article-content figure {
  text-align: center;
}

.article-reader .article-content figcaption {
  margin-top: 9px;
  color: #7f8c85;
  font-size: 13px;
}

.article-reader .article-content :where(iframe, embed) {
  width: 100%;
  max-width: 100%;
  border: 1px solid var(--article-border);
  border-radius: 12px;
}

.article-reader .article-content .article-table-scroll {
  max-width: 100%;
  margin-block: 1.3em;
  overflow-x: auto;
  border: 1px solid var(--article-border);
  border-radius: 12px;
}

.article-reader .article-content table {
  width: 100%;
  min-width: 0;
  margin: 0;
  overflow-x: auto;
  border-collapse: collapse;
  color: #bdc9c2;
  font-size: 14px;
}

.article-reader .article-content :where(th, td) {
  padding: 11px 13px;
  border: 1px solid rgba(255, 255, 255, .07);
  text-align: left;
  vertical-align: top;
}

.article-reader .article-content th {
  background: #111914;
  color: #e1ebe5;
  font-weight: 650;
}

.article-reader .article-content tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, .018);
}

.article-reader .article-content details {
  padding: 14px 16px;
  border: 1px solid var(--article-border);
  border-radius: 11px;
  background: rgba(255, 255, 255, .02);
}

.article-reader .article-content summary {
  color: #d9e4de;
  font-weight: 650;
  cursor: pointer;
}

.article-reader .article-footer {
  margin-top: 48px;
}

.article-reader .article-tags a {
  min-height: 29px;
  padding: 5px 9px;
  color: #8fdcb0;
  font-size: 12px;
}

.article-comment-jump {
  color: #a6b2ab;
  font-size: 13px;
  text-decoration: none;
}

.article-comment-jump:hover,
.article-comment-jump:focus-visible {
  color: var(--green-bright);
}

.article-reader .article-toc {
  position: sticky;
  top: 14px;
  align-self: start;
  display: block;
  height: auto;
  max-height: calc(100dvh - 28px);
  padding: 17px;
  overflow: auto;
  overscroll-behavior: contain;
}

.article-reader .article-toc[hidden] {
  display: none;
}

.article-toc > header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  margin-bottom: 14px;
  gap: 2px 10px;
}

.article-toc > header .eyebrow {
  grid-column: 1 / -1;
}

.article-reader .article-toc h2 {
  font-size: 19px;
}

.article-toc > header button {
  min-height: 30px;
  padding: 0 8px;
  border: 1px solid rgba(255, 255, 255, .09);
  border-radius: 8px;
  background: #111713;
  color: #8d9992;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}

.article-toc nav {
  display: grid;
  gap: 3px;
}

.article-reader .article-toc nav a {
  position: relative;
  display: block;
  min-height: 0;
  padding: 8px 9px 8px 18px;
  border-radius: 8px;
  color: #89968f;
  font-size: 13px;
  line-height: 1.5;
  text-decoration: none;
}

.article-reader .article-toc nav a::before {
  position: absolute;
  top: 15px;
  left: 7px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #536159;
  content: "";
}

.article-reader .article-toc nav a::after {
  content: none;
}

.article-reader .article-toc nav a[data-level="3"] { padding-left: 29px; font-size: 12px; }
.article-reader .article-toc nav a[data-level="4"] { padding-left: 40px; font-size: 12px; }

.article-reader .article-toc nav a:hover,
.article-reader .article-toc nav a:focus-visible,
.article-reader .article-toc nav a.is-active {
  background: rgba(30, 158, 86, .12);
  color: #c8f5da;
}

.article-reader .article-toc nav a.is-active::before {
  background: var(--green-bright);
}

.article-toc.is-collapsed nav,
.article-toc.is-collapsed .article-toc-progress,
.article-toc.is-collapsed .article-toc-back {
  display: none;
}

.article-toc-progress {
  height: 3px;
  margin: 16px 0 13px;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(255, 255, 255, .07);
}

.article-toc-progress i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--green-bright);
}

.article-reader .article-toc .article-toc-back {
  justify-content: space-between;
  font-size: 12px;
}

.article-neighbors {
  position: relative;
  z-index: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
  clear: both;
  isolation: isolate;
}

.article-neighbor-card {
  position: relative;
  display: flex;
  min-height: 132px;
  min-width: 0;
  justify-content: flex-end;
  flex-direction: column;
  padding: 16px 18px;
  gap: 6px;
  overflow: hidden;
  border: 1px solid var(--article-border);
  border-radius: 18px;
  background: linear-gradient(135deg, #111a14, #080d0a);
  color: #eef6f1;
  text-decoration: none;
  isolation: isolate;
  transition: border-color .18s ease, transform .18s ease;
}

.article-neighbor-card:only-child {
  grid-column: 1 / -1;
}

.article-neighbor-card > img,
.article-neighbor-shade {
  position: absolute;
  z-index: -2;
  inset: 0;
  width: 100%;
  height: 100%;
}

.article-neighbor-card > img {
  object-fit: cover;
  opacity: .48;
}

.article-neighbor-shade {
  z-index: -1;
  background: linear-gradient(180deg, rgba(4, 8, 6, .16), rgba(4, 9, 6, .93));
}

.article-neighbor-direction {
  color: #82e8ad;
  font-size: 11px;
  letter-spacing: .05em;
}

.article-neighbor-card strong {
  max-width: 650px;
  color: #f0f6f2;
  font-size: clamp(15px, 1.18vw, 18px);
  line-height: 1.38;
}

.article-neighbor-card.next {
  align-items: flex-end;
  text-align: right;
}

.article-neighbor-card:hover,
.article-neighbor-card:focus-visible {
  border-color: var(--article-accent-line);
  transform: translateY(-2px);
}

.article-recommended {
  position: relative;
  z-index: 1;
  margin-top: clamp(16px, 1.5vw, 20px);
  padding: 14px;
  clear: both;
  overflow: visible;
  border-radius: 18px;
  isolation: isolate;
  scroll-margin-block-start: 24px;
}

.article-recommended-head {
  position: relative;
  z-index: 2;
  display: flex;
  min-width: 0;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 10px;
  gap: 16px;
}

.article-recommended-head > div {
  min-width: 0;
}

.article-recommended-head h2 {
  margin: 1px 0 0;
  color: #e8f0eb;
  font-family: var(--font-display);
  font-size: 20px;
}

.article-recommended-head > span {
  color: #84918a;
  font-size: 12px;
}

.article-recommended-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.article-recommended-card {
  position: relative;
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 14px;
  outline-offset: 3px;
  background: #0d1410;
  color: #dbe6df;
  text-decoration: none;
  transition: border-color .18s ease, background-color .18s ease, transform .18s ease;
}

.article-recommended-media {
  position: relative;
  display: block;
  aspect-ratio: 16 / 7;
  overflow: hidden;
  background: linear-gradient(145deg, rgba(var(--accent-rgb), .13), #0a100d 64%);
}

.article-recommended-media > img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: .76;
  transition: opacity .18s ease, transform .24s ease;
}

.article-recommended-placeholder {
  display: flex;
  height: 100%;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  color: rgba(var(--accent-rgb), .72);
  font-family: var(--font-mono);
}

.article-recommended-placeholder strong {
  font-size: 20px;
  font-weight: 650;
}

.article-recommended-placeholder small {
  color: #718078;
  font-size: 10px;
  letter-spacing: .08em;
}

.article-recommended-body {
  position: relative;
  display: grid;
  min-height: 70px;
  align-content: start;
  padding: 10px 29px 10px 11px;
  gap: 4px;
}

.article-recommended-body small {
  color: #79877f;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: .04em;
}

.article-recommended-body strong {
  display: -webkit-box;
  overflow: hidden;
  color: #dfe8e3;
  font-size: 14px;
  font-weight: 650;
  line-height: 1.48;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.article-recommended-body i {
  position: absolute;
  right: 11px;
  bottom: 10px;
  color: #75dd9f;
  font-size: 15px;
  font-style: normal;
}

.article-recommended-card:hover,
.article-recommended-card:focus-visible {
  border-color: var(--article-accent-line);
  background: rgba(var(--accent-rgb), .055);
  transform: translateY(-2px);
}

.article-recommended-card:hover .article-recommended-media > img,
.article-recommended-card:focus-visible .article-recommended-media > img {
  opacity: .9;
  transform: scale(1.025);
}

.article-comments {
  margin-top: 16px;
}

.article-comment-plugin-slot:empty {
  display: none;
}

.article-comment-tools {
  display: grid;
  margin: 12px 0 2px;
  gap: 9px;
}

.article-comment-tool-row {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
}

.article-comment-tools button {
  font: inherit;
}

.article-comment-tag-trigger,
.article-comment-image-trigger {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 10px;
  background: #101713;
  color: #aebbb4;
  cursor: pointer;
  transition: border-color .16s ease, background-color .16s ease, color .16s ease;
}

.article-comment-tag-trigger {
  padding: 0 12px;
  gap: 7px;
  font-size: 13px;
  font-weight: 650;
}

.article-comment-image-trigger {
  width: 38px;
  padding: 0;
}

.article-comment-tag-trigger svg,
.article-comment-image-trigger svg,
.article-comment-upload-action svg,
.article-comment-picker-search svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.75;
}

.article-comment-tag-trigger:hover,
.article-comment-tag-trigger:focus-visible,
.article-comment-image-trigger:hover,
.article-comment-image-trigger:focus-visible,
.article-comment-tag-trigger[aria-expanded="true"],
.article-comment-image-trigger[aria-expanded="true"] {
  border-color: var(--article-accent-line);
  background: var(--article-accent-soft);
  color: #d9f8e5;
  outline: none;
}

.article-comment-image-trigger:disabled {
  cursor: not-allowed;
  opacity: .48;
}

.article-comment-tool-hint {
  overflow: hidden;
  color: #718078;
  font-size: 12px;
  line-height: 1.45;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.article-comment-upload-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.article-comment-upload-list:empty {
  display: none;
}

.article-comment-upload-card {
  display: grid;
  min-width: 0;
  grid-template-columns: 62px minmax(0, 1fr) auto;
  align-items: center;
  padding: 6px;
  gap: 9px;
  border: 1px solid rgba(var(--accent-rgb), .2);
  border-radius: 11px;
  background: rgba(var(--accent-rgb), .045);
}

.article-comment-upload-card > img {
  display: block;
  width: 62px;
  height: 50px;
  border-radius: 7px;
  background: #08100b;
  object-fit: cover;
}

.article-comment-upload-copy {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.article-comment-upload-copy strong,
.article-comment-upload-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.article-comment-upload-copy strong {
  color: #cbd8d1;
  font-size: 12px;
  font-weight: 650;
}

.article-comment-upload-copy small {
  color: #6f8178;
  font-size: 11px;
}

.article-comment-upload-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.article-comment-upload-action {
  display: grid;
  width: 31px;
  height: 31px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #7e8e85;
  cursor: pointer;
}

.article-comment-upload-action:hover,
.article-comment-upload-action:focus-visible {
  outline: none;
  background: rgba(255, 255, 255, .055);
  color: #ccebd9;
}

.article-comment-upload-action.is-remove:hover,
.article-comment-upload-action.is-remove:focus-visible {
  color: #ff9b9b;
}

.article-comment-tool-status {
  min-height: 17px;
  margin: 0;
  color: #829188;
  font-size: 12px;
  line-height: 1.4;
}

.article-comment-picker-dialog,
.article-comment-upload-dialog {
  position: fixed;
  z-index: 1300;
  inset: 50% auto auto 50%;
  width: min(620px, calc(100vw - 28px));
  max-width: none;
  max-height: min(760px, calc(100dvh - 28px));
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(179, 222, 199, .18);
  border-radius: 17px;
  outline: none;
  background: #09100c;
  color: #cbd6d0;
  box-shadow: 0 28px 80px rgba(0, 0, 0, .62), inset 0 1px rgba(255, 255, 255, .045);
  transform: translate(-50%, -50%);
}

.article-comment-upload-dialog {
  width: min(760px, calc(100vw - 28px));
}

.article-comment-picker-dialog:not([open]),
.article-comment-upload-dialog:not([open]) {
  display: none;
}

.article-comment-picker-dialog::backdrop,
.article-comment-upload-dialog::backdrop {
  background: rgba(0, 5, 2, .86);
}

.article-comment-dialog-shell {
  display: grid;
  max-height: min(760px, calc(100dvh - 28px));
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
}

.article-comment-dialog-head {
  display: flex;
  min-height: 66px;
  align-items: center;
  justify-content: space-between;
  padding: 11px 14px 11px 18px;
  gap: 18px;
  border-bottom: 1px solid rgba(255, 255, 255, .075);
  background:
    linear-gradient(90deg, rgba(var(--accent-rgb), .055), transparent 42%),
    #0d1510;
}

.article-comment-dialog-head > div {
  min-width: 0;
}

.article-comment-dialog-head span {
  display: block;
  margin-bottom: 2px;
  color: #5f7f6c;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .12em;
}

.article-comment-dialog-head h2 {
  margin: 0;
  color: #edf5f0;
  font-size: 18px;
  font-weight: 680;
  line-height: 1.3;
}

.article-comment-dialog-head > button {
  display: grid;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  padding: 0;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, .09);
  border-radius: 9px;
  background: #111a14;
  color: #9caaa2;
  font: 400 22px/1 sans-serif;
  cursor: pointer;
}

.article-comment-dialog-head > button:hover,
.article-comment-dialog-head > button:focus-visible {
  border-color: rgba(var(--accent-rgb), .32);
  outline: none;
  background: rgba(var(--accent-rgb), .08);
  color: #e6f8ed;
}

.article-comment-picker-body,
.article-comment-upload-body {
  min-height: 0;
  padding: 16px;
  overflow: auto;
  overscroll-behavior: contain;
}

.article-comment-picker-search {
  display: grid;
  min-height: 43px;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  padding: 0 12px;
  gap: 9px;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 11px;
  background: #060b08;
  color: #708078;
}

.article-comment-picker-search:focus-within {
  border-color: rgba(var(--accent-rgb), .36);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), .055);
}

.article-comment-picker-search input {
  width: 100%;
  min-width: 0;
  height: 41px;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: #d8e4dd;
  font: inherit;
  font-size: 13px;
}

.article-comment-picker-search input::placeholder {
  color: #66756d;
}

.article-comment-picker-tabs,
.article-comment-aspect-tabs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 12px;
  gap: 6px;
}

.article-comment-picker-tabs button,
.article-comment-aspect-tabs button {
  min-height: 32px;
  padding: 0 11px;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 8px;
  background: #101713;
  color: #829188;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}

.article-comment-picker-tabs button:hover,
.article-comment-picker-tabs button:focus-visible,
.article-comment-picker-tabs button[aria-selected="true"],
.article-comment-aspect-tabs button:hover,
.article-comment-aspect-tabs button:focus-visible,
.article-comment-aspect-tabs button[aria-pressed="true"] {
  border-color: rgba(var(--accent-rgb), .3);
  outline: none;
  background: rgba(var(--accent-rgb), .08);
  color: #cef1dc;
}

.article-comment-picker-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 13px;
  gap: 7px;
}

.article-comment-picker-item {
  display: grid;
  min-width: 0;
  min-height: 58px;
  grid-template-columns: 30px minmax(0, 1fr);
  align-items: center;
  padding: 6px 8px;
  gap: 7px;
  border: 1px solid rgba(255, 255, 255, .075);
  border-radius: 10px;
  background: #0d1410;
  color: #a8b5ae;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.article-comment-picker-item[hidden] {
  display: none;
}

.article-comment-picker-item b {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 8px;
  background: rgba(255, 255, 255, .045);
  color: #e8f0eb;
  font-size: 18px;
  font-weight: 550;
}

.article-comment-picker-item.is-topic b {
  color: #78e3a6;
  font-family: var(--font-mono);
  font-size: 14px;
}

.article-comment-picker-item span {
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.article-comment-picker-item:hover,
.article-comment-picker-item:focus-visible {
  border-color: rgba(var(--accent-rgb), .28);
  outline: none;
  background: rgba(var(--accent-rgb), .065);
  color: #ddf3e6;
}

.article-comment-picker-empty {
  margin: 22px 0 8px;
  color: #74837b;
  font-size: 13px;
  text-align: center;
}

.article-comment-upload-empty {
  display: grid;
  min-height: 300px;
  place-items: center;
  align-content: center;
  gap: 13px;
  border: 1px dashed rgba(159, 198, 178, .22);
  border-radius: 14px;
  background:
    linear-gradient(rgba(188, 218, 201, .025) 1px, transparent 1px) 0 0 / 26px 26px,
    linear-gradient(90deg, rgba(188, 218, 201, .025) 1px, transparent 1px) 0 0 / 26px 26px,
    #080e0a;
}

.article-comment-upload-empty[hidden],
.article-comment-crop-editor[hidden] {
  display: none;
}

.article-comment-upload-empty > button {
  display: grid;
  min-width: 168px;
  min-height: 142px;
  place-items: center;
  align-content: center;
  gap: 7px;
  border: 1px solid rgba(var(--accent-rgb), .25);
  border-radius: 14px;
  background: rgba(var(--accent-rgb), .055);
  color: #c7ded1;
  font: inherit;
  cursor: pointer;
}

.article-comment-upload-empty > button:hover,
.article-comment-upload-empty > button:focus-visible {
  border-color: rgba(var(--accent-rgb), .46);
  outline: none;
  background: rgba(var(--accent-rgb), .095);
}

.article-comment-upload-empty i {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border: 1px solid rgba(var(--accent-rgb), .32);
  border-radius: 50%;
  color: #75e6a4;
  font: 300 30px/1 sans-serif;
}

.article-comment-upload-empty strong {
  font-size: 14px;
}

.article-comment-upload-empty span,
.article-comment-upload-empty p {
  color: #6f7e76;
  font-size: 11px;
}

.article-comment-upload-empty p {
  margin: 0;
}

.article-comment-crop-editor {
  display: grid;
  gap: 12px;
}

.article-comment-crop-meta {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.article-comment-crop-meta > div {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.article-comment-crop-meta strong,
.article-comment-crop-meta span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.article-comment-crop-meta strong {
  color: #cfdbd4;
  font-size: 13px;
}

.article-comment-crop-meta span {
  color: #718078;
  font-size: 11px;
}

.article-comment-crop-meta > button {
  min-height: 32px;
  flex: 0 0 auto;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, .09);
  border-radius: 8px;
  background: #101713;
  color: #92a198;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}

.article-comment-crop-meta > button:hover,
.article-comment-crop-meta > button:focus-visible {
  border-color: rgba(var(--accent-rgb), .3);
  outline: none;
  color: #d5e9dd;
}

.article-comment-crop-stage {
  position: relative;
  display: grid;
  min-height: 260px;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .09);
  border-radius: 13px;
  background:
    linear-gradient(45deg, #101713 25%, transparent 25%, transparent 75%, #101713 75%) 0 0 / 18px 18px,
    linear-gradient(45deg, #101713 25%, #08100b 25%, #08100b 75%, #101713 75%) 9px 9px / 18px 18px;
}

.article-comment-crop-stage canvas {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 340px;
  outline: 0;
  cursor: grab;
  touch-action: none;
}

.article-comment-crop-stage canvas.is-dragging {
  cursor: grabbing;
}

.article-comment-crop-stage canvas:focus-visible {
  box-shadow: inset 0 0 0 3px rgba(var(--accent-rgb), .42);
}

.article-comment-crop-stage > span {
  position: absolute;
  right: 9px;
  bottom: 9px;
  padding: 4px 7px;
  border-radius: 6px;
  background: rgba(2, 7, 4, .78);
  color: #93a49a;
  font-size: 10px;
  pointer-events: none;
}

.article-comment-crop-controls {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.article-comment-aspect-tabs {
  margin-top: 0;
}

.article-comment-crop-controls > label {
  display: grid;
  width: min(240px, 42%);
  gap: 7px;
  color: #829188;
  font-size: 11px;
}

.article-comment-crop-controls input[type="range"] {
  width: 100%;
  accent-color: rgb(var(--accent-rgb));
}

.article-comment-upload-status {
  min-height: 18px;
  margin: 11px 0 0;
  color: #84938a;
  font-size: 12px;
  line-height: 1.45;
}

.article-comment-dialog-actions {
  display: flex;
  min-height: 62px;
  align-items: center;
  padding: 10px 16px;
  gap: 8px;
  border-top: 1px solid rgba(255, 255, 255, .075);
  background: #0d1510;
}

.article-comment-dialog-actions > span {
  flex: 1;
}

.article-comment-dialog-actions button {
  min-height: 38px;
  padding: 0 13px;
  border: 1px solid rgba(255, 255, 255, .09);
  border-radius: 9px;
  background: #111914;
  color: #9caba3;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}

.article-comment-dialog-actions button:hover,
.article-comment-dialog-actions button:focus-visible {
  border-color: rgba(var(--accent-rgb), .32);
  outline: none;
  color: #e2f4e9;
}

.article-comment-dialog-actions button.is-primary {
  border-color: rgba(var(--accent-rgb), .3);
  background: rgba(var(--accent-rgb), .11);
  color: #d9fae7;
}

.article-comment-dialog-actions button.is-quiet {
  color: #a98080;
}

.article-comment-dialog-actions button:disabled,
.article-comment-upload-dialog[aria-busy="true"] [data-comment-file-pick] {
  cursor: not-allowed;
  opacity: .42;
}

html.comment-tool-dialog-open {
  overflow: hidden;
}

.article-comments .comment-copy img {
  display: block;
  width: auto;
  max-width: min(100%, 280px);
  max-height: 180px;
  margin: 10px 0;
  border: 1px solid var(--article-border);
  border-radius: 10px;
  object-fit: contain;
  cursor: zoom-in;
  transition: border-color .16s ease, opacity .16s ease;
}

.article-comments .comment-copy img:hover {
  border-color: var(--article-accent-line);
  opacity: .92;
}

.article-comments .comment-copy img:focus-visible,
.article-comments .comment-copy a:focus-visible > img {
  border-color: var(--article-accent-line);
  outline: 2px solid rgba(var(--accent-rgb), .38);
  outline-offset: 3px;
}

.comment-alias-anchor {
  display: block;
  width: 0;
  height: 0;
  scroll-margin-top: 22px;
}

.article-comments .comment-item {
  scroll-margin-block: 22px;
}

.article-comments .comment-item:target {
  border-color: var(--article-accent-line);
}

.article-comment-image-dialog {
  width: min(1100px, calc(100vw - 28px));
  max-width: none;
  height: min(860px, calc(100dvh - 28px));
  max-height: none;
  padding: 48px 16px 16px;
  overflow: hidden;
  color: #dce8e1;
  background: #070c09;
  border: 1px solid rgba(210, 234, 221, .16);
  border-radius: 16px;
  box-shadow: 0 28px 80px rgba(0, 0, 0, .62);
}

.article-comment-image-dialog::backdrop {
  background: rgba(0, 4, 2, .9);
}

.article-comment-image-dialog:not([open]) {
  display: none;
}

.article-comment-image-dialog figure {
  display: grid;
  width: 100%;
  height: 100%;
  margin: 0;
  grid-template-rows: minmax(0, 1fr) auto;
  place-items: center;
  gap: 10px;
}

.article-comment-image-dialog img {
  display: block;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  object-fit: contain;
}

.article-comment-image-dialog figcaption {
  overflow: hidden;
  max-width: 100%;
  color: #849189;
  font-size: 12px;
  line-height: 1.4;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.article-comment-image-close {
  position: absolute;
  z-index: 2;
  top: 10px;
  right: 10px;
  display: grid;
  width: 34px;
  height: 34px;
  padding: 0;
  place-items: center;
  color: #cdd9d2;
  background: #111814;
  border: 1px solid rgba(220, 240, 230, .13);
  border-radius: 9px;
  font: 400 23px/1 sans-serif;
  cursor: pointer;
}

.article-comment-image-close:hover,
.article-comment-image-close:focus-visible {
  color: #effbf4;
  background: var(--article-accent-soft);
  border-color: var(--article-accent-line);
  outline: none;
}

html.comment-image-preview-open {
  overflow: hidden;
}

.article-qr-dialog {
  width: min(420px, calc(100vw - 28px));
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(123, 224, 166, .22);
  border-radius: 18px;
  background: #0a100d;
  color: #c7d2cc;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .5);
}

.article-qr-dialog::backdrop {
  background: rgba(0, 4, 2, .82);
}

.article-qr-head {
  display: flex;
  min-height: 62px;
  align-items: center;
  justify-content: space-between;
  padding: 0 17px;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.article-qr-head span {
  color: #6f7d75;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .12em;
}

.article-qr-head h2 {
  margin: 2px 0 0;
  color: #eef5f1;
  font-size: 19px;
}

.article-qr-head button {
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, .09);
  border-radius: 10px;
  background: #111713;
  color: #aab6af;
  font-size: 22px;
  cursor: pointer;
}

.article-qr-canvas {
  display: grid;
  margin: 22px auto 16px;
  place-items: center;
}

.article-qr-canvas canvas {
  display: block;
  max-width: calc(100vw - 78px);
  height: auto;
  border: 8px solid #fff;
  border-radius: 8px;
  background: #fff;
  image-rendering: pixelated;
}

.article-qr-dialog > p,
.article-qr-dialog > code,
.article-qr-actions,
.article-qr-status {
  margin-inline: 20px;
}

.article-qr-dialog > p {
  margin-block: 0 10px;
  color: #87948d;
  font-size: 13px;
  line-height: 1.6;
}

.article-qr-dialog > code {
  display: block;
  padding: 10px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 9px;
  background: #060b08;
  color: #9eddb8;
  font-family: var(--font-mono);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.article-qr-actions {
  display: flex;
  justify-content: flex-end;
  margin-block: 14px 18px;
  gap: 8px;
}

.article-qr-actions button {
  min-height: 38px;
  padding: 0 13px;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 9px;
  background: #111713;
  color: #b9c5be;
  font: inherit;
  cursor: pointer;
}

.article-qr-actions button:first-child {
  border-color: rgba(57, 226, 132, .32);
  background: rgba(20, 130, 68, .2);
  color: #acf2c9;
}

.article-qr-status {
  display: block;
  min-height: 0;
  color: #8e9b94;
  font-size: 12px;
}

@media (max-width: 1040px) {
  .article-toolbelt {
    align-items: stretch;
    flex-direction: column;
  }

  .article-tool-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 900px) {
  .article-reading-layout {
    grid-template-columns: 1fr;
  }

  .article-reader .article-toc {
    position: static;
    max-height: none;
    grid-row: 1;
  }

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

@media (max-width: 640px) {
  .article-reader .article-hero {
    min-height: 0;
    padding: 18px;
    gap: 16px;
  }

  .article-reader .article-heading h1 {
    font-size: clamp(25px, 8.4vw, 32px);
  }

  .article-reader .article-cover {
    height: 154px;
  }

  .article-breadcrumb {
    padding-inline: 12px;
    font-size: 12px;
  }

  .article-toolbelt {
    padding: 8px 10px;
  }

  .article-reading-signals,
  .article-tool-actions {
    width: 100%;
  }

  .article-tool-action {
    min-height: 44px;
  }

  .article-tool-status {
    position: static;
    width: 100%;
  }

  .article-reader .article-main {
    padding: 22px 18px;
  }

  .article-document-bar {
    margin: -22px -18px 28px;
    padding-inline: 13px;
    font-size: 9px;
  }

  .article-reader .article-content {
    font-size: 16px;
    line-height: 1.86;
  }

  .article-reader .article-content pre {
    margin-inline: -8px;
    padding: 16px;
  }

  .article-neighbors {
    grid-template-columns: 1fr;
  }

  .article-neighbor-card:only-child {
    grid-column: auto;
  }

  .article-neighbor-card.next {
    align-items: flex-start;
    text-align: left;
  }

  .article-recommended {
    margin-top: 20px;
    padding: 16px;
    scroll-margin-block-start: calc(16px + env(safe-area-inset-top));
  }

  .article-recommended-head {
    align-items: flex-start;
  }

  .article-recommended-grid {
    grid-template-columns: 1fr;
  }

  .article-recommended-card {
    display: grid;
    grid-template-columns: minmax(110px, 38%) minmax(0, 1fr);
  }

  .article-recommended-media {
    height: 100%;
    min-height: 88px;
    aspect-ratio: auto;
  }

  .article-comment-tool-hint {
    display: none;
  }

  .article-comment-upload-list {
    grid-template-columns: 1fr;
  }

  .article-comment-picker-dialog,
  .article-comment-upload-dialog {
    width: calc(100vw - 12px);
    max-height: calc(100dvh - 12px);
    border-radius: 13px;
  }

  .article-comment-dialog-shell {
    max-height: calc(100dvh - 12px);
  }

  .article-comment-dialog-head {
    min-height: 60px;
    padding-left: 14px;
  }

  .article-comment-picker-body,
  .article-comment-upload-body {
    padding: 12px;
  }

  .article-comment-picker-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .article-comment-picker-item {
    min-height: 52px;
    grid-template-columns: 27px minmax(0, 1fr);
    padding-inline: 6px;
  }

  .article-comment-picker-item b {
    width: 27px;
    height: 27px;
    font-size: 16px;
  }

  .article-comment-upload-empty {
    min-height: 250px;
  }

  .article-comment-crop-stage {
    min-height: 210px;
  }

  .article-comment-crop-stage canvas {
    max-height: 280px;
  }

  .article-comment-crop-controls {
    align-items: stretch;
    flex-direction: column;
  }

  .article-comment-crop-controls > label {
    width: 100%;
  }

  .article-comment-dialog-actions {
    min-height: 0;
    flex-wrap: wrap;
    padding: 10px 12px;
  }

  .article-comment-dialog-actions > span {
    display: none;
  }

  .article-comment-dialog-actions button {
    flex: 1 1 auto;
  }

  .article-comments .comment-copy img {
    max-width: min(100%, 240px);
    max-height: 170px;
  }

  .article-comment-image-dialog {
    width: calc(100vw - 12px);
    height: calc(100dvh - 12px);
    padding: 46px 8px 10px;
    border-radius: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .article-tool-action,
  .article-neighbor-card,
  .article-recommended-card,
  .article-recommended-media > img {
    transition: none;
  }

  .article-comments .comment-copy img {
    transition: none;
  }
}

@media (forced-colors: active) {
  .article-tool-action,
  .article-neighbor-card,
  .article-comment-tools button,
  .article-qr-dialog,
  .article-qr-actions button {
    border: 1px solid CanvasText;
  }
}
