/* Keep a 44px touch target around the compact visual control. */

/* One quiet article menu alongside the tags, with the existing Fay tokens. */

/* shadcn/ui Table treatment for static Markdown article tables. */

/* Reading progress: a single animated line fixed directly below the 64px header. */

/* The owner's reference uses a colored rule to distinguish the takeaway. */
/* Keep the article metadata row identical across the sidebar breakpoint. */
.article-byline--compact { padding-block: 0; border-block: 0; gap: 1rem; }
.article-byline--compact .article-byline__data {
  align-items: center;
  gap: 0 1rem;
}
.article-byline--compact .article-byline__item {
  align-items: center;
  min-height: 2.75rem;
  gap: .375rem;
  padding: 0;
  border: 0;
}
.article-byline--compact .article-byline__label,
.article-byline--compact .article-byline__value { font-size: .875rem; font-weight: 500; line-height: 1.5; }
.article-byline--compact .article-byline__label { display: flex; align-items: center; }
.article-byline--compact .article-byline__label-text { display: none; }
.article-byline--compact .article-byline__value { white-space: nowrap; }
.article-byline--compact .article-byline__hint {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.125rem;
  height: 1.125rem;
  border: 0;
  padding: 0;
  border-radius: .125rem;
  color: hsl(var(--muted-foreground));
  background: transparent;
  cursor: help;
  touch-action: manipulation;
}
.article-byline--compact .article-byline__hint::after {
  content: "";
  position: absolute;
  inset: 50% auto auto 50%;
  width: 48px;
  height: 48px;
  transform: translate(-50%, -50%);
}
.article-byline--compact .article-byline__hint:hover,
.article-byline--compact .article-byline__hint[data-state="instant-open"],
.article-byline--compact .article-byline__hint[data-state="delayed-open"] { color: hsl(var(--primary)); }
.article-byline--compact .article-byline__hint:focus-visible {
  outline: 2px solid hsl(var(--ring));
  outline-offset: 4px;
}
.article-byline--compact .article-byline__item--no-update { display: none; }

/* The source is a full-length photograph with the author on its right side. */

/* Shared article rhythm follows the project's 8px spacing scale. */

/* Article opening: introduction → author channels → short answer → sections. */
.article-messengers {
  container: article-messengers / inline-size;
  position: relative;
  padding: 1.5rem;
  margin: 0;
  border: 0;
  border-radius: inherit;
  background: transparent;
}
.article-messengers__icon {
  display: grid;
  place-items: center;
  flex: 0 0 2.75rem;
  height: 2.75rem;
  color: hsl(var(--primary));
  background: hsl(var(--primary) / .08);
  border-radius: 50%;
}
.article-messengers__copy { min-width: 0; }
.article-messengers__copy {
  margin: 0;
  color: hsl(var(--muted-foreground));
  font-size: 1rem;
  line-height: 1.65;
}
.article-messengers__copy strong { color: hsl(var(--foreground)); font-weight: 700; }
.article-messengers__links {
  position: absolute;
  z-index: 5;
  top: calc(100% + .5rem);
  left: -1px;
  right: -1px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: stretch;
  gap: .75rem;
  margin: 0;
  padding: 1.25rem 1.5rem;
  border: 1px solid hsl(var(--border));
  border-radius: 16px;
  box-shadow: 0 12px 28px hsl(var(--foreground) / .12);
  background: hsl(var(--card));
}
.article-messengers__links :is(a, button) {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .5rem .85rem;
  min-height: 44px;
  border: 1px solid hsl(var(--border));
  border-radius: 10px;
  color: hsl(var(--primary));
  font-size: 1rem;
  font-weight: 650;
  text-decoration: none;
}
.article-messengers__links :is(a, button):hover { text-decoration: none; }
.article-messengers__links :is(a, button):focus-visible { outline: 2px solid hsl(var(--ring)); outline-offset: 4px; border-radius: 4px; }
@media (max-width: 639px) {
  .article-messengers { gap: .75rem; padding: 1.25rem; border-radius: 16px; }
  .article-messengers__icon { flex-basis: 2rem; height: 2rem; }
  .article-messengers__icon svg { width: 20px; height: 20px; }
}
.article-messengers__trigger { display: flex; align-items: flex-start; gap: 1rem; padding-right: 3.75rem; }
.article-messengers__toggle { position: absolute; top: 1.5rem; right: 1.5rem; display: grid; place-items: center; width: 44px; height: 44px; border: 1px solid hsl(var(--border)); border-radius: 12px; color: hsl(var(--foreground)); background: hsl(var(--card)); cursor: pointer; list-style: none; }
.article-messengers__toggle::-webkit-details-marker { display: none; }
.article-messengers__toggle::marker { content: ''; }
.article-messengers__toggle:hover { background: hsl(var(--primary) / .1); border-color: hsl(var(--primary) / .5); }
.article-messengers__toggle:focus-visible { outline: 2px solid hsl(var(--ring)); outline-offset: 4px; }
.article-messengers__chevron { transition: transform 180ms ease-out; }
.article-messengers__menu[open] .article-messengers__chevron { transform: rotate(180deg); }

@media (prefers-reduced-motion: reduce) { .article-messengers__chevron { transition: none; } }
@media (max-width: 639px) {
  .article-messengers__trigger { gap: .75rem; }
  .article-messengers__links { padding: 1.25rem; border-radius: 16px; }
}
/* The reading column narrows when the desktop outline appears. Size this
   shared menu from its own available space, including the lower author card. */
@container article-messengers (max-width: 34rem) {
  .article-messengers__links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .article-messengers__links :is(a, button) { justify-content: center; }
}
@container article-messengers (max-width: 16rem) {
  .article-messengers__links { grid-template-columns: minmax(0, 1fr); }
}

.article-messengers-glow:has(details[open]) { z-index: 10; }
.article-messengers__links button { font-family: inherit; cursor: default; }
@media (max-width: 639px) { .article-messengers__toggle { top: 1.25rem; right: 1.25rem; } }
@media (prefers-reduced-motion: no-preference) {
  .article-messengers__menu[open] .article-messengers__links { animation: messenger-panel-in 160ms ease-out; }
}

/* React Bits Border Glow: keep the reading palette and the menu outside the card. */
.article-messengers-glow.border-glow-card { margin-block: 2rem; box-shadow: none; border-color: hsl(var(--border)); }
.article-messengers-glow .border-glow-inner { overflow: visible; }
.article-messengers-glow::before, .article-messengers-glow::after { pointer-events: none; }
:root:not(.dark) .article-messengers-glow > .edge-light { mix-blend-mode: normal; }
@media (max-width: 639px) { .article-messengers-glow { --border-radius: 16px !important; } }
@media (prefers-reduced-motion: reduce) {
  .article-messengers-glow::before, .article-messengers-glow::after, .article-messengers-glow > .edge-light { display: none; }
}
.article-messengers__trigger { cursor: pointer; }

/* Service colors are scoped to outbound channel controls, not site tokens.
   Blue fills are shaded slightly to keep white labels readable. */
.article-messengers__item { position: relative; display: flex; min-width: 0; }
.article-messengers__item[data-messenger="telegram"] { --messenger-brand: #0088cc; }
.article-messengers__item[data-messenger="max"] { --messenger-brand: #471aff; }
.article-messengers__item[data-messenger="threads"] { --messenger-brand: #151515; }
.article-messengers__item[data-messenger="vk"] { --messenger-brand: #0077ff; }
.article-messengers__item :is(a, button) {
  justify-content: center;
  width: 100%;
  min-height: 48px;
  padding: .65rem .5rem;
  color: #fff;
  background: color-mix(in srgb, var(--messenger-brand) 87%, #000);
  border-color: color-mix(in srgb, var(--messenger-brand) 80%, hsl(var(--border)));
  line-height: 1.25;
  white-space: nowrap;
}
.article-messengers__item :is(a, button):hover {
  background: color-mix(in srgb, var(--messenger-brand) 77%, #000);
}
.article-messengers__item svg { flex-shrink: 0; }
.article-messengers__tooltip {
  position: absolute;
  z-index: 6;
  top: calc(100% + .6rem);
  left: 50%;
  transform: translateX(-50%);
  width: 18rem;
  max-width: calc(100vw - 5rem);
  padding: .85rem 1rem;
  border-radius: 10px;
  color: hsl(var(--background));
  background: hsl(var(--foreground));
  font-size: .8125rem;
  font-weight: 400;
  line-height: 1.55;
  white-space: normal;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}
.article-messengers__item:hover .article-messengers__tooltip,
.article-messengers__item:focus-within .article-messengers__tooltip {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}
@media (max-width: 959px) {
  .article-messengers__tooltip { left: 0; transform: none; }
}
.article-messengers__item[data-messenger="tenchat"] { --messenger-brand: #df3040; }
.article-messengers__item[data-messenger="setka"] { --messenger-brand: #292637; }
.article-messengers__item[data-messenger="habr"] { --messenger-brand: #4d7689; }
.article-messengers__item[data-messenger="teletype"] { --messenger-brand: #202020; }

/* A related-reading list is editorial content, not a row of unlabelled links. */

/* Owner-selected Animate UI / Base UI accordion, scoped to ordinary articles. */

/* Contact action and portal: share article tokens in both themes. */

/* The open mobile outline replaces its trigger with search; contact floats below. */

/* Mobile articles use the course toolbar; the site header stays at the page start. */
/* The course's top mask would cover the article tags before this toolbar sticks. */
@media (max-width: 959px) {
  /* The chevron and both utilities share a 44px center-to-center rhythm. */
  /* Extend the clickable area to 44px around the smaller visible button. */
}

/* Collapse the article path only when its visible links exceed the available row. */
.article-context-row:has(> .article-path) { position: relative; }
.article-path { min-width: 0; }
.article-path__links { margin-bottom: 0; }
/* Measure the same ancestor links at every width; the popup retains the full path. */
.article-path__links > :is([aria-current], .article-breadcrumbs-static__current-separator) { display: none; }
.article-path__trigger { position: relative; cursor: pointer; font-family: inherit; }
.article-path__trigger[hidden] { display: none; }
.article-path__trigger:focus-visible { outline: 2px solid hsl(var(--ring)); outline-offset: 3px; }
.article-path__trigger > svg:last-child { transition: transform .16s ease; }
[data-path-open] .article-path__trigger > svg:last-child { transform: rotate(180deg); }
.article-path > .article-path__measure {
  position: fixed;
  top: 0;
  left: 0;
  visibility: hidden;
  pointer-events: none;
  flex-wrap: nowrap;
  width: max-content;
  max-width: none;
  white-space: nowrap;
}
[data-path-collapsed] > .article-path__links:not(.article-path__measure) { display: none; }
[data-path-collapsed][data-path-open] > .article-path__links:not(.article-path__measure) {
  position: absolute;
  z-index: 45;
  top: calc(100% + .5rem);
  left: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: .125rem;
  width: min(24rem, 100%);
  max-height: min(24rem, 60dvh);
  overflow-y: auto;
  padding: .5rem;
  border: 1px solid hsl(var(--border));
  border-radius: .75rem;
  background: hsl(var(--background));
  box-shadow: 0 8px 24px hsl(var(--foreground) / .1);
}
.article-path[data-path-open] > .article-path__links:not(.article-path__measure) > [aria-hidden] { display: none; }
.article-path[data-path-open] > .article-path__links:not(.article-path__measure) > [aria-current] { display: block; }
.article-path[data-path-open] > .article-path__links:not(.article-path__measure) > :is(a, [aria-current]) {
  padding: .5rem .75rem;
  border-radius: .375rem;
  overflow-wrap: anywhere;
}
.article-path[data-path-open] > .article-path__links:not(.article-path__measure) > a { text-decoration: none; }
.article-path[data-path-open] > .article-path__links:not(.article-path__measure) > [aria-current] { color: hsl(var(--muted-foreground)); background: hsl(var(--accent)); }
@media (hover: hover) {
  .article-path__trigger:hover { color: hsl(var(--primary)); }
  .article-path[data-path-open] > .article-path__links:not(.article-path__measure) > a:hover { background: hsl(var(--accent)); color: hsl(var(--primary)); }
}
@media (prefers-reduced-motion: reduce) { .article-path__trigger > svg:last-child { transition: none; } }

/* One short sentence replaces the desktop introduction on mobile. */
.article-messengers__mobile-copy { display: none; }
@media (max-width: 639px) {
  .article-messengers[data-compact-messengers] { padding: 1rem; cursor: pointer; }
  [data-compact-messengers] .article-messengers__icon { display: grid; flex-basis: 2rem; height: 2rem; }
  [data-compact-messengers] .article-messengers__trigger { align-items: center; min-height: 2.75rem; gap: .75rem; padding-right: 2rem; }
  [data-compact-messengers] .article-messengers__desktop-copy { display: none; }
  [data-compact-messengers] .article-messengers__mobile-copy { display: block; font-size: .875rem; line-height: 1.5; }
  [data-compact-messengers] .article-messengers__toggle { top: 50%; right: .5rem; transform: translateY(-50%); border: 0; background: transparent; }
  [data-compact-messengers] .article-messengers__toggle:hover { background: transparent; }
}

.article-actions { flex: none; margin-left: auto; }
.article-actions__trigger {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .375rem;
  min-height: var(--article-tool-size, 2.5rem);
  padding: .375rem .625rem;
  border: 1px solid hsl(var(--border));
  border-radius: .5rem;
  background: transparent;
  color: hsl(var(--muted-foreground));
  font: inherit;
  font-size: var(--article-tool-font, .875rem);
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
  cursor: pointer;
  transition: color .16s ease, background-color .16s ease;
}
.article-actions__trigger > svg { flex: none; }
.article-actions__trigger[data-popup-open] { color: hsl(var(--primary)); background: hsl(var(--accent)); }
.article-actions__trigger:focus-visible { outline: 2px solid hsl(var(--ring)); outline-offset: 3px; }
.article-actions__chevron { transition: transform .16s ease; }
.article-actions__trigger[data-popup-open] .article-actions__chevron { transform: rotate(180deg); }
.article-actions__positioner { z-index: 65; }
.article-actions__popup {
  width: min(17.5rem, calc(100vw - 2rem));
  max-height: var(--available-height);
  overflow-y: auto;
  padding: .375rem;
  border: 1px solid hsl(var(--border));
  border-radius: .75rem;
  background: hsl(var(--popover));
  color: hsl(var(--popover-foreground));
  outline: none;
  transform-origin: var(--transform-origin);
  transition: opacity .16s ease, transform .16s ease;
}
.article-actions__popup:is([data-starting-style], [data-ending-style]) { opacity: 0; transform: translateY(-4px); }
.article-actions__item { display: flex; align-items: center; gap: .625rem; min-height: 2.75rem; padding: .625rem .75rem; border-radius: .5rem; font-size: .875rem; line-height: 1.4; cursor: pointer; outline: none; }
.article-actions__item > svg { flex: none; color: hsl(var(--muted-foreground)); }
.article-actions__item[data-highlighted] { background: hsl(var(--accent)); color: hsl(var(--accent-foreground)); }
.article-actions__item[data-highlighted] > svg { color: currentColor; }
.article-actions__item:focus-visible { outline: 2px solid hsl(var(--ring)); outline-offset: -2px; }
.article-actions__separator { height: 1px; margin: .375rem .75rem; background: hsl(var(--border)); }
.article-actions__feedback { margin: 0; color: hsl(var(--muted-foreground)); font-size: .8125rem; line-height: 1.5; }
.article-actions__feedback:not(:empty) { padding: .5rem .75rem; }
@media (hover: hover) {
  .article-actions__trigger:hover { color: hsl(var(--primary)); background: hsl(var(--muted)); }
}
@media (prefers-reduced-motion: reduce) {
  .article-actions__trigger, .article-actions__chevron, .article-actions__popup { transition: none; }
}

.article-actions__item[data-disabled] { opacity: .5; cursor: default; }
.page-actions-row { display: flex; justify-content: flex-end; margin-block: .75rem; }

.article-actions__submenu-arrow { margin-left: auto; }
.article-actions__back { font-weight: 650; }
.article-actions__size-percent { margin-left: auto; color: hsl(var(--muted-foreground)); font-size: .8125rem; font-variant-numeric: tabular-nums; }
.article-actions__size-check { display: inline-flex; width: 1rem; flex: none; color: hsl(var(--primary)); }
.article-actions__size-note { margin: .375rem .75rem .5rem; font-size: .8125rem; line-height: 1.5; color: hsl(var(--muted-foreground)); }
html[data-reading-size="90"] { --reader-text-scale: .9; }
html[data-reading-size="100"] { --reader-text-scale: 1; }
html[data-reading-size="112"] { --reader-text-scale: 1.12; }
html[data-reading-size="125"] { --reader-text-scale: 1.25; }
html[data-reading-size] :is(.article-prose, .course-lesson__content).typeset-reading {
  --typeset-size: calc(var(--type-reading-size) * var(--reader-text-scale));
  --type-body-size: calc(1rem * var(--reader-text-scale));
}
html[data-reading-size] .course-lesson__content.typeset-reading { font-size: calc(1.125rem * var(--reader-text-scale)); }
@media (max-width: 47.99rem) {
  html[data-reading-size] .course-lesson__content.typeset-reading { font-size: calc(1.0625rem * var(--reader-text-scale)); }
}

/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */
.tag-disclosure__links[data-astro-cid-nmffimsr]{display:contents}[data-astro-cid-nmffimsr][data-tag-detail]{position:relative}[data-astro-cid-nmffimsr][data-tag-detail]>.tag-disclosure__links[data-astro-cid-nmffimsr]{flex-wrap:wrap;gap:.5rem;display:flex}.tag-disclosure__trigger[data-astro-cid-nmffimsr]{min-height:var(--article-tool-size,2.5rem);border:1px solid hsl(var(--border));color:hsl(var(--muted-foreground));font:inherit;font-size:var(--article-tool-font,.875rem);cursor:pointer;background:0 0;border-radius:.5rem;align-items:center;gap:.375rem;padding:.375rem .625rem;font-weight:600;line-height:1.4;display:inline-flex;position:relative}.tag-disclosure__trigger[data-astro-cid-nmffimsr][hidden]{display:none}.tag-disclosure__trigger[data-astro-cid-nmffimsr]:focus-visible{outline:2px solid hsl(var(--ring));outline-offset:3px}.tag-disclosure__trigger[data-astro-cid-nmffimsr] svg[data-astro-cid-nmffimsr]{flex:none;transition:transform .16s}[data-astro-cid-nmffimsr][data-tags-open] .tag-disclosure__trigger[data-astro-cid-nmffimsr] svg[data-astro-cid-nmffimsr]{transform:rotate(180deg)}[data-astro-cid-nmffimsr][data-tags-collapsed]>.tag-disclosure__links[data-astro-cid-nmffimsr]:not(.tag-disclosure__measure){display:none}[data-astro-cid-nmffimsr][data-tags-collapsed][data-tags-open]>.tag-disclosure__links[data-astro-cid-nmffimsr]:not(.tag-disclosure__measure){z-index:45;border:1px solid hsl(var(--border));background:hsl(var(--background));width:max-content;max-width:min(24rem,100vw - 3rem);max-height:min(20rem,50dvh);box-shadow:0 8px 24px hsl(var(--foreground) / .1);border-radius:.75rem;padding:.75rem;display:flex;position:absolute;top:calc(100% + .5rem);left:0;overflow-y:auto}@media (hover:hover){.tag-disclosure__trigger[data-astro-cid-nmffimsr]:hover{color:hsl(var(--primary));background:hsl(var(--accent))}}@media (prefers-reduced-motion:reduce){.tag-disclosure__trigger[data-astro-cid-nmffimsr] svg[data-astro-cid-nmffimsr]{transition:none}}


  .tag-disclosure__links { display: contents; }
  [data-tag-detail] { position: relative; }
  [data-tag-detail] > .tag-disclosure__links { display: flex; flex-wrap: wrap; gap: .5rem; }
  .tag-disclosure__trigger {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: .375rem;
    min-height: var(--article-tool-size, 2.5rem);
    padding: .375rem .625rem;
    border: 1px solid hsl(var(--border));
    border-radius: .5rem;
    background: transparent;
    color: hsl(var(--muted-foreground));
    font: inherit;
    font-size: var(--article-tool-font, .875rem);
    font-weight: 600;
    line-height: 1.4;
    cursor: pointer;
  }
  .tag-disclosure__trigger[hidden] { display: none; }
  .tag-disclosure__trigger:focus-visible { outline: 2px solid hsl(var(--ring)); outline-offset: 3px; }
  .tag-disclosure__trigger svg { flex: none; transition: transform .16s ease; }
  [data-tags-open] .tag-disclosure__trigger svg { transform: rotate(180deg); }
  [data-tags-collapsed] > .tag-disclosure__links:not(.tag-disclosure__measure) { display: none; }
  [data-tags-collapsed][data-tags-open] > .tag-disclosure__links:not(.tag-disclosure__measure) {
    display: flex;
    position: absolute;
    z-index: 45;
    top: calc(100% + .5rem);
    left: 0;
    width: max-content;
    max-width: min(24rem, calc(100vw - 3rem));
    max-height: min(20rem, 50dvh);
    overflow-y: auto;
    padding: .75rem;
    border: 1px solid hsl(var(--border));
    border-radius: .75rem;
    background: hsl(var(--background));
    box-shadow: 0 8px 24px hsl(var(--foreground) / .1);
  }
  [data-tag-detail] > .tag-disclosure__measure {
    position: fixed;
    visibility: hidden;
    pointer-events: none;
    display: flex;
    flex-wrap: nowrap;
    width: max-content;
    max-width: none;
    top: 0;
    left: 0;
  }
  .tag-disclosure__measure > a { flex: none; max-width: none !important; white-space: nowrap !important; }
  @media (hover: hover) { .tag-disclosure__trigger:hover { color: hsl(var(--primary)); background: hsl(var(--accent)); } }
  @media (prefers-reduced-motion: reduce) { .tag-disclosure__trigger svg { transition: none; } }
