@font-face {
  font-family: Mona;
  src: url(mona-sans.woff2) format('woff2');
  font-weight: 200 900;
  font-display: swap;
}
@font-face {
  font-family: Inter;
  src: url(inter.woff2) format('woff2');
  font-weight: 100 900;
  font-display: swap;
}
:root {
  --ink: #252730;
  --muted: #626773;
  --accent: #5a50bd;
  --accent-soft: #eeecfa;
  --surface: #f7f8fa;
  --sidebar-bg: #f5f6f8;
  --line: #e3e5eb;
  --sidebar: 264px;
  --header: 84px;
  scroll-behavior: smooth;
  scroll-padding-top: 104px;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: #fff;
  color: var(--ink);
  font: 16px/1.7 Inter, Arial, sans-serif;
}
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; cursor: pointer; }
a { color: inherit; text-underline-offset: 4px; text-decoration-color: #b6b9c4; }
a:hover { color: var(--accent); text-decoration-color: currentColor; }
button:focus-visible, a:focus-visible, summary:focus-visible, input:focus-visible {
  outline: 3px solid #9992d9;
  outline-offset: 4px;
}
h1, h2, h3, .brand, .nav-home, summary { font-family: Mona, Inter, Arial, sans-serif; }
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: 48px; line-height: 1.12; letter-spacing: -1.7px; font-weight: 730; }
h2 { font-size: 26px; line-height: 1.35; letter-spacing: -.5px; font-weight: 700; }
h3 { font-size: 19px; line-height: 1.45; letter-spacing: -.2px; font-weight: 680; }
p { margin-bottom: 1.05em; }
.icon {
  display: inline-block; flex-shrink: 0; width: 21px; height: 21px;
  vertical-align: middle;
}
.icon-button {
  display: inline-flex; align-items: center; justify-content: center;
  width: 42px; height: 42px; padding: 8px; border: 0; border-radius: 8px; background: transparent;
}
.icon-button:hover { background: #e9ebf0; }
.skip {
  position: fixed; z-index: 99; left: 24px; top: -70px;
  padding: 10px 18px; background: #fff; border: 2px solid var(--accent); border-radius: 8px;
}
.skip:focus { top: 12px; }

/* Navigazione chiara: il viola identifica soltanto i controlli e la voce attiva. */
.sidebar {
  position: fixed; inset: 0 auto 0 0; z-index: 20; width: var(--sidebar);
  display: flex; flex-direction: column; color: var(--ink);
  background: var(--sidebar-bg); border-right: 1px solid var(--line);
}
.brand {
  display: flex; gap: 11px; align-items: center; padding: 28px 25px 27px;
  color: var(--ink); text-decoration: none;
}
.brand img { width: 36px; height: 36px; }
.brand span { font-size: 25px; font-weight: 750; line-height: 1; }
.brand small { display: block; margin-top: 8px; color: var(--muted); font-size: 12px; font-weight: 450; }
.sidebar > nav {
  min-height: 0; overflow: auto; overscroll-behavior: contain;
  padding: 2px 14px 24px; scrollbar-width: thin; scrollbar-color: #c7cad4 transparent;
}
.nav-home {
  display: flex; gap: 10px; align-items: center; padding: 11px 12px; min-height: 44px;
  color: #555b67; text-decoration: none; font-size: 14px; font-weight: 560; border-radius: 7px;
}
.nav-home .icon { width: 19px; height: 19px; color: #737989; }
.nav-home:hover { color: var(--ink); background: #e9ebf0; }
.nav-home.active { background: #ebe9f6; color: #4e46a8; }
.nav-home.active .icon { color: var(--accent); }
.nav-count { margin-left: auto; padding: 0 7px; color: #626775; background: #e9ebf0; border-radius: 5px; font: 11px/22px Inter; }
.nav-groups { margin-top: 21px; }
.nav-groups details { margin-bottom: 8px; }
.nav-groups summary {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 8px 9px; min-height: 52px; border-radius: 9px; color: #303645; font-size: 13px; font-weight: 560; line-height: 1.45;
  cursor: pointer; list-style: none;
}
.nav-groups summary::-webkit-details-marker { display: none; }
.nav-category { display: flex; align-items: center; gap: 10px; min-width: 0; }
.nav-category-icon { display: flex; align-items: center; justify-content: center; flex-shrink: 0; width: 32px; height: 32px; border: 1px solid #e5e0f5; border-radius: 9px; background: #eeebf9; color: #6750b5; }
.nav-category-icon > .icon { width: 19px; height: 19px; stroke-width: 1.7; }
.tone-1 .nav-category-icon { background: #e9eff7; border-color: #dce5f1; color: #4e6b9b; }
.tone-2 .nav-category-icon { background: #e8f1ef; border-color: #d9e7e1; color: #48796b; }
.tone-3 .nav-category-icon { background: #f6eee3; border-color: #eddfc9; color: #96703e; }
.nav-groups summary:hover { background: #eaecef; }
.nav-groups details[open] > summary { background: #eceef2; }
.nav-groups .current-group > summary { color: #4d409e; }
.nav-groups summary:focus-visible, .nav-guide:focus-visible { outline: 2px solid #8c80c3; outline-offset: 1px; }
.nav-category > span { min-width: 0; }
.nav-chevron { display: flex; align-items: center; flex-shrink: 0; }
.nav-chevron > .icon { width: 14px; height: 14px; color: #898e9a; }
.nav-groups details[open] summary .nav-chevron > .icon { transform: rotate(90deg); }
.nav-groups details > div { padding: 7px 5px 5px 25px; }
.nav-guide {
  display: block; padding: 8px 10px 8px 15px; border-left: 1px solid #d8dbe4;
  color: #505866; text-decoration: none; font-size: 12.5px; font-weight: 420; line-height: 1.65; overflow-wrap: anywhere;
}
.nav-guide:hover { color: var(--ink); background: #eceef2; }
.nav-guide.active {
  padding-left: 14px; border-left: 2px solid var(--accent); color: #4c44a2;
  background: var(--accent-soft); border-radius: 0 6px 6px 0; font-weight: 570;
}
.sidebar-bottom {
  display: flex; align-items: center; gap: 8px; flex-shrink: 0;
  margin-top: auto; padding: 18px 24px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px;
}
.language-dot { width: 6px; height: 6px; background: #9298a4; border-radius: 50%; }
.sidebar-bottom a { display: flex; align-items: center; gap: 7px; margin-left: auto; text-decoration: none; }
.sidebar-bottom .icon { width: 15px; height: 15px; color: var(--accent); }

.workspace { display: flex; flex-direction: column; margin-left: var(--sidebar); min-height: 100vh; min-width: 0; }
.topbar {
  position: sticky; top: 0; z-index: 15; display: grid; align-items: center; gap: 18px;
  grid-template-columns: minmax(176px,1fr) minmax(0,640px) minmax(176px,1fr);
  height: var(--header); flex-shrink: 0; padding: 0 24px;
  background: #ffffffef; backdrop-filter: blur(12px); border-bottom: 1px solid var(--line);
}
.search-open {
  display: flex; gap: 11px; align-items: center; min-width: 0; padding: 12px 15px;
  border: 1px solid #dce0e7; border-radius: 9px; background: #fff; color: #686f7d;
  text-align: left; font-size: 13px;
}
.search-open:hover { border-color: #babfcb; color: var(--ink); }
.search-open .icon { width: 18px; height: 18px; color: #727989; }
.search-open kbd {
  margin-left: auto; min-width: 22px; border: 1px solid #e0e3ea; border-radius: 4px;
  background: #f8f9fb; color: #737a88; font: 11px/21px Inter; text-align: center;
}
.top-search {
  grid-column: 2; grid-row: 1; justify-self: center;
  width: 100%; height: 52px; padding: 13px 18px;
  background: #fafbfc; font-size: 16px; line-height: 1.4;
}
.top-search > span { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-search .icon { width: 21px; height: 21px; }
.header-actions {
  grid-column: 3; grid-row: 1; justify-self: end; display: flex; align-items: center; gap: 8px; min-width: 0;
}
.language-switch {
  display: inline-flex; flex-shrink: 0; padding: 3px; border: 1px solid #dce0e7; border-radius: 9px; background: #f6f7fa;
}
.language-switch a {
  display: inline-flex; align-items: center; justify-content: center; min-width: 36px; min-height: 38px;
  color: #555c6a; font-size: 12px; font-weight: 550; text-decoration: none; border-radius: 6px;
}
.language-switch a[aria-current] { background: #fff; color: #5144ac; box-shadow: 0 1px 3px #30354a18; }
.language-switch a:hover { color: #463998; background: #eeecf8; }
.home-link {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 9px 12px; border: 1px solid #dce0e7; border-radius: 8px;
  background: #fff; color: #4f5765; font-size: 13px; font-weight: 600;
  text-decoration: none; white-space: nowrap;
}
.home-link .icon { width: 18px; height: 18px; transform: rotate(180deg); }
.home-link:hover { color: var(--accent); border-color: #b8b4d9; background: #fafafd; }
.home-label-short { display: none; }
@media (max-width: 1599px) {
  .home-label-long { display: none; }
  .home-label-short { display: inline; }
}
.page-layout { width: 100%; margin-inline: auto; flex: 1 0 auto; min-width: 0; }
.home-layout { max-width: 1208px; }
.index-layout { max-width: 1088px; }
.article-layout { max-width: 908px; padding: 0 44px; }
.article-layout.with-toc { display: block; }
.footer {
  display: flex; justify-content: space-between; gap: 16px;
  margin-top: 24px; padding: 24px 36px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px;
}

/* Centro guide e indice: una ricerca e percorsi ordinati, senza blocchi colorati. */
.home-main { padding: 54px 44px 42px; min-width: 0; }
.welcome { padding: 35px 36px 32px; background: #f7f8fa; border: 1px solid #eceef3; border-radius: 14px; }
.welcome-label { margin-bottom: 15px; color: var(--muted); font-size: 13px; }
.topics { margin-top: 40px; }
.welcome h1 { max-width: 800px; margin-bottom: 20px; font-size: 49px; }
.welcome > p { max-width: 660px; margin-bottom: 26px; color: var(--muted); font-size: 16px; line-height: 1.8; }
.hero-search { width: min(100%, 640px); padding: 16px 17px; font-size: 14px; }
.hero-search .icon { width: 21px; height: 21px; color: var(--accent); }
.search-examples { margin-top: 13px; color: var(--muted); font-size: 12px; }
.search-examples button { padding: 0; border: 0; background: none; color: inherit; text-decoration: underline; text-underline-offset: 3px; font-size: inherit; }
.search-examples button:hover { color: var(--accent); }
.start-section { margin: 43px 0 48px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 25px; }
.section-heading h2 { margin: 0; font-size: 23px; }
.section-heading p { margin: 7px 0 0; color: var(--muted); font-size: 13px; }
.section-heading > a { display: flex; align-items: center; gap: 9px; flex-shrink: 0; font-size: 12px; text-decoration: none; }
.section-heading > a .icon { width: 16px; height: 16px; color: var(--accent); }
.journey { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 22px; margin: 0; padding: 0; list-style: none; }
.journey li { position: relative; padding-top: 19px; border-top: 1px solid #d7dbe4; }
.step-number { position: absolute; top: -12px; left: 0; display: flex; align-items: center; justify-content: center; width: 23px; height: 23px; background: #f1f3f6; border: 3px solid #fff; border-radius: 50%; color: #596171; font-size: 10px; }
.journey a { display: block; margin: 4px 0 7px; color: var(--ink); font-size: 13px; font-weight: 650; text-decoration: none; }
.journey a:hover { color: var(--accent); }
.journey p { max-width: 205px; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.7; }
.guide-total { padding: 4px 10px; border-radius: 20px; background: #f0f2f5; color: var(--muted); font-size: 11px; white-space: nowrap; }
.categories { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); column-gap: 32px; }
.category { display: flex; align-items: flex-start; gap: 15px; padding: 24px 0; border-bottom: 1px solid var(--line); color: inherit; text-decoration: none; min-width: 0; }
.category-icon { display: flex; align-items: center; justify-content: center; width: 42px; height: 42px; flex-shrink: 0; border-radius: 10px; background: #f5f6f9; color: var(--accent); }
.category-icon .icon { width: 22px; height: 22px; }
.category > div { min-width: 0; }
.category h3 { margin: 1px 0 7px; font-size: 17px; }
.category p { max-width: 350px; margin: 0 0 7px; color: var(--muted); font-size: 13px; line-height: 1.7; }
.category div > span { color: var(--muted); font-size: 11px; }
.category > .icon { width: 15px; height: 15px; margin: auto 0 auto auto; color: #8c93a0; }
.category:hover h3 { color: var(--accent); }
.questions { margin-top: 42px; }
.questions h2 { font-size: 23px; }
.quick-links { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 0 32px; }
.quick-links a { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line); font-size: 13px; text-decoration: none; }
.quick-links a .icon { width: 16px; height: 16px; color: var(--accent); }
.help-strip { display: flex; align-items: center; gap: 17px; margin-top: 44px; padding: 25px; border: 1px solid var(--line); border-radius: 10px; background: #fafbfc; }
.help-strip > .icon { width: 25px; height: 25px; color: var(--accent); }
.help-strip > div { min-width: 0; }
.help-strip h2 { margin: 0 0 5px; font-size: 17px; }
.help-strip p { margin: 0; color: var(--muted); font-size: 12px; }
.help-strip > a { display: flex; align-items: center; gap: 8px; margin-left: auto; font-size: 12px; text-decoration: none; }
.help-strip > a .icon { width: 16px; height: 16px; color: var(--accent); }
.index-main { padding: 44px 44px 50px; min-width: 0; }
.index-main h1 { margin-bottom: 17px; }
.index-search { width: 100%; margin: 28px 0 44px; }
.index-group { margin-top: 42px; scroll-margin-top: 108px; }
.index-group-title { display: flex; align-items: center; gap: 12px; }
.index-group-title > .icon { color: var(--accent); }
.index-group-title h2 { margin: 0; font-size: 24px; }
.index-group-title > span { margin-left: auto; color: var(--muted); font-size: 12px; white-space: nowrap; }
.index-group > p { margin: 9px 0 18px; color: var(--muted); font-size: 14px; }
.index-list { border-top: 1px solid var(--line); }
.index-list > a { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 22px 0; border-bottom: 1px solid var(--line); text-decoration: none; }
.index-list a > div { min-width: 0; }
.index-list h3 { margin: 0 0 6px; font-size: 17px; }
.index-list p { max-width: 750px; margin: 0; color: var(--muted); font-size: 13px; line-height: 1.8; }
.index-list a > span { display: flex; align-items: center; gap: 13px; flex-shrink: 0; color: var(--muted); font-size: 11px; white-space: nowrap; }
.index-list .icon { width: 15px; height: 15px; }
.index-list a:hover h3 { color: var(--accent); }

/* Lettura centrata: 820 px effettivi; indice laterale soltanto nelle guide lunghe. */
.article-main { min-width: 0; padding: 43px 0 50px; }
.breadcrumb { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; margin-bottom: 30px; color: var(--muted); font-size: 12px; }
.breadcrumb a { color: inherit; text-decoration: none; }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb .icon { width: 12px; height: 12px; color: #9096a3; }
.article-header h1 { margin-bottom: 23px; overflow-wrap: anywhere; }
.lead { margin-bottom: 21px; color: var(--muted); font-size: 18px; line-height: 1.8; }
.article-entry { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 17px; margin: 25px 0 17px; }
.platform-link {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  max-width: 100%; min-height: 46px; padding: 10px 15px; border: 1px solid #d6dae4; border-radius: 8px;
  background: #fafbfc; font-size: 14px; line-height: 1.55; font-weight: 600; text-decoration: none;
}
.platform-link .icon { width: 20px; height: 20px; color: var(--accent); }
.platform-link .icon:last-child { width: 15px; height: 15px; color: #7b8291; }
.platform-link:hover { border-color: #aaa5d1; background: #f5f4fa; }
.platform-note { color: var(--muted); font-size: 12px; }
.article-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 9px 20px; margin-bottom: 38px; padding: 2px 0 20px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.article-tools > div { display: flex; flex-wrap: wrap; gap: 15px; }
.article-tools button { display: flex; align-items: center; gap: 7px; min-height: 40px; padding: 7px 0; border: 0; background: none; color: var(--muted); font-size: 12px; }
.article-tools .icon { width: 16px; height: 16px; }
.article-tools button:hover { color: var(--accent); }
.article-section { margin-bottom: 42px; scroll-margin-top: 104px; overflow-wrap: anywhere; }
.article-section h2 { margin-bottom: 20px; font-size: 27px; }
.article-section h2 > a { color: inherit; text-decoration: none; }
.article-section h3 { margin-top: 28px; margin-bottom: 15px; }
.anchor { margin-left: 10px; color: #9398a6; font-size: 18px; opacity: 0; }
.article-section h2 > a:hover .anchor, .article-section h2 > a:focus-visible .anchor { opacity: 1; }
.article-section p, .article-section li { font-size: 16px; line-height: 1.85; }
.article-section ol, .article-section ul { margin: 18px 0 25px; padding-left: 27px; }
.article-section li { margin-bottom: 13px; padding-left: 5px; }
.article-section li::marker { color: #6b7180; font-weight: 650; }
.article-section strong { color: #30343e; font-weight: 650; }
.article-section aside, .article-section .note, .article-section .warning { margin: 26px 0; padding: 18px 21px; border-left: 3px solid #b4bac7; border-radius: 0 7px 7px 0; background: #f5f6f8; font-size: 14px; line-height: 1.8; }
.article-section aside p { font-size: 14px; }
.article-section aside p:last-child { margin-bottom: 0; }
.article-section .warning { border-color: #b69250; background: #fbf8ef; }
.article-section .success { padding: 18px 21px; border-left: 3px solid #789183; border-radius: 0 7px 7px 0; background: #f0f6f2; }
.article-section code { padding: 2px 5px; border: 1px solid #e4e6eb; border-radius: 4px; background: #f6f7f9; color: #454b57; font-size: 13px; overflow-wrap: anywhere; }
.article-section table { display: block; width: 100%; max-width: 100%; overflow-x: auto; margin: 26px 0; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.article-section th { text-align: left; background: #f5f6f8; font-weight: 650; }
.article-section th, .article-section td { padding: 13px; border: 1px solid var(--line); vertical-align: top; }
.article-section figure { margin: 28px 0; }
.article-section .screen-figure { max-width: min(100%,var(--screen-width,100%)); margin-inline: auto; }
.screen-figure .zoom-image { display: flex; align-items: center; justify-content: center; min-height: 44px; }
.article-section img { display: block; width: 100%; max-width: 100%; height: auto; border: 1px solid var(--line); border-radius: 9px; }
.zoom-image { display: block; width: 100%; padding: 0; border: 0; border-radius: 9px; background: none; cursor: zoom-in; }
.article-section figcaption { margin-top: 12px; color: var(--muted); font-size: 12px; line-height: 1.8; }
.article-section .puzzle-figure img, .article-section .puzzle-figure .zoom-image { width: 65px; height: 65px; }
.article-section .puzzle-figure img { border: 0; border-radius: 5px; }
.article-section .menu-figure { max-width: 672px; }
.toc { display: none; }
.mobile-toc { padding: 13px 17px; margin: 0 0 36px; border: 1px solid var(--line); border-radius: 8px; background: #fafbfc; font-size: 13px; }
.mobile-toc summary { cursor: pointer; font-weight: 600; }
.mobile-toc nav { display: flex; flex-direction: column; gap: 11px; padding-top: 15px; }
.mobile-toc a { text-decoration: none; }
.related { margin-top: 48px; padding-top: 29px; border-top: 1px solid var(--line); }
.related h2 { font-size: 22px; }
.related > div { display: flex; flex-direction: column; gap: 14px; }
.related a { display: flex; align-items: center; gap: 13px; font-size: 14px; text-decoration: none; }
.related .icon { width: 16px; height: 16px; color: var(--accent); }
.feature-return { display: grid; gap: 7px; margin-top: 30px; padding-top: 22px; border-top: 1px solid var(--line); }
.feature-return > span { color: var(--muted); font-size: 12px; }
.feature-return a { display: inline-flex; align-items: center; gap: 10px; width: fit-content; max-width: 100%; color: var(--accent); font-size: 14px; font-weight: 550; text-decoration: none; }
.feature-return .icon { width: 16px; height: 16px; }
.pager { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 18px; margin-top: 38px; }
.pager > a { min-width: 0; padding: 17px 18px; border: 1px solid var(--line); border-radius: 9px; text-decoration: none; }
.pager > a:hover { background: #fafbfc; border-color: #bfc4cf; }
.pager small { display: block; margin-bottom: 7px; color: var(--muted); font-size: 11px; }
.pager span { display: flex; align-items: center; justify-content: space-between; gap: 13px; font-size: 14px; line-height: 1.6; font-weight: 550; overflow-wrap: anywhere; }
.pager .icon { width: 15px; height: 15px; color: var(--accent); }

/* Ricerca e ingrandimento immagini, interamente locali. */
dialog { padding: 0; border: 1px solid var(--line); border-radius: 13px; color: var(--ink); box-shadow: 0 22px 80px #2830402b; }
dialog::backdrop { background: #282e3f55; backdrop-filter: blur(3px); }
.search-dialog { width: min(700px,calc(100vw - 24px)); max-height: 88vh; margin: 8vh auto auto; }
.search-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 15px 20px 8px; }
.search-head label { font-size: 13px; font-weight: 650; }
.search-head .icon { width: 18px; height: 18px; }
.search-field { display: flex; align-items: center; gap: 12px; padding: 7px 22px 18px; border-bottom: 1px solid var(--line); }
.search-field > .icon { color: var(--accent); }
.search-field input { min-width: 0; width: 100%; border: 0; outline: none; background: transparent; color: var(--ink); font-size: 18px; }
.search-field input:focus-visible { outline: none; }
.search-count { padding: 14px 22px 4px; margin: 0; color: var(--muted); font-size: 12px; }
.search-results { max-height: 48vh; overflow: auto; overscroll-behavior: contain; padding: 6px 10px 15px; }
.search-result { display: block; padding: 14px 12px; border: 1px solid transparent; border-radius: 8px; text-decoration: none; }
.search-result:hover, .search-result.selected { color: var(--ink); background: #f3f3f9; border-color: #dedee9; }
.search-result small { display: block; margin-bottom: 5px; color: var(--muted); font-size: 11px; }
.search-result strong { display: block; font: 650 16px/1.55 Mona; }
.search-result p { margin: 5px 0 0; color: var(--muted); font-size: 12px; line-height: 1.8; }
.search-empty { padding: 19px 13px; color: var(--muted); font-size: 14px; }
.search-empty a { display: inline-block; margin-top: 11px; }
.search-hint { display: flex; justify-content: space-between; gap: 12px; padding: 13px 22px; border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; }
.image-dialog { width: 95vw; max-width: 1600px; max-height: 94vh; padding: 48px 18px 13px; }
.image-dialog > button { position: absolute; top: 5px; right: 7px; }
.image-dialog > img { display: block; max-width: 100%; max-height: 75vh; object-fit: contain; margin: auto; }
.image-dialog > p { margin: 13px 0 4px; color: var(--muted); text-align: center; font-size: 12px; line-height: 1.7; }
.toast { position: fixed; bottom: 24px; left: calc(50% + var(--sidebar)/2); z-index: 100; max-width: calc(100vw - 32px); padding: 11px 18px; border-radius: 9px; background: #343945; color: #fff; transform: translate(-50%,20px); opacity: 0; pointer-events: none; font-size: 13px; transition: opacity .15s,transform .15s; }
.toast.visible { opacity: 1; transform: translate(-50%,0); }
.menu-toggle, .mobile-close, .mobile-brand { display: none; }

@media (min-width: 1600px) {
  .article-layout.with-toc {
    display: grid; grid-template-columns: minmax(0,820px) 176px; gap: 40px;
    max-width: 1124px;
  }
  .with-toc .mobile-toc { display: none; }
  .toc {
    display: block; position: sticky; top: 115px; align-self: start;
    max-height: calc(100vh - 145px); overflow: auto; margin-top: 47px;
    padding-left: 17px; border-left: 1px solid var(--line); font-size: 12px;
  }
  .toc > p { margin-bottom: 14px; color: #4e5460; font-size: 12px; font-weight: 650; }
  .toc nav { display: flex; flex-direction: column; gap: 13px; }
  .toc nav a { color: #717785; text-decoration: none; line-height: 1.7; }
  .toc nav a.active, .toc nav a:hover { color: var(--accent); }
  .toc-help { display: flex; align-items: center; gap: 8px; margin-top: 26px; padding-top: 19px; border-top: 1px solid var(--line); font-size: 11px; text-decoration: none; }
  .toc-help .icon { width: 15px; height: 15px; color: var(--accent); }
}
@media (max-width: 1279px) {
  :root { --sidebar: 246px; --header: 128px; scroll-padding-top: 154px; }
  .topbar {
    height: var(--header); padding: 12px 28px; gap: 10px 12px;
    grid-template-columns: 42px minmax(0,1fr) auto;
    grid-template-rows: 44px 50px;
  }
  .mobile-brand {
    display: flex; align-items: center; gap: 11px; grid-column: 1 / span 2; grid-row: 1;
    width: fit-content; color: var(--ink); font: 750 21px Mona; text-decoration: none;
  }
  .mobile-brand span { padding-left: 11px; border-left: 1px solid var(--line); color: var(--muted); font: 12px Inter; }
  .top-search { grid-column: 1 / -1; grid-row: 2; width: min(100%,640px); height: 50px; }
  .article-section { scroll-margin-top: 154px; }
  .index-group { scroll-margin-top: 158px; }
  .brand { padding-left: 23px; }
  .article-layout { padding-inline: 32px; max-width: 884px; }
  .home-main, .index-main { padding-inline: 32px; }
  .welcome { padding: 29px; }
  .welcome h1 { font-size: 43px; }
  .article-header h1 { font-size: 44px; }
  .section-heading h2 { font-size: 21px; }
  .help-strip { flex-wrap: wrap; }
  .help-strip > a { margin-left: 42px; }
  .journey { gap: 17px; }
  .footer { padding-inline: 28px; }
}
@media (max-width: 960px) {
  :root { --header: 128px; --sidebar: 280px; scroll-padding-top: 154px; }
  .workspace { margin-left: 0; }
  .sidebar { width: min(var(--sidebar),calc(100vw - 36px)); transform: translateX(-100%); transition: transform .2s; }
  .sidebar.is-open { transform: none; }
  .sidebar .brand { padding-top: 28px; }
  .mobile-close { display: flex; position: absolute; right: 9px; top: 29px; color: #626a78; }
  .mobile-close:hover { background: #e8ebf0; }
  .menu-toggle { display: flex; grid-column: 1; grid-row: 1; }
  .topbar { gap: 10px 12px; padding: 12px 20px; height: var(--header); }
  .mobile-brand { display: flex; grid-column: 2; grid-row: 1; align-items: center; gap: 11px; color: var(--ink); font: 750 21px Mona; text-decoration: none; }
  .mobile-brand span { padding-left: 11px; border-left: 1px solid var(--line); color: var(--muted); font: 12px Inter; }
  .top-search { width: min(100%,640px); height: 50px; padding: 12px 15px; margin-left: 0; }
  .mobile-shade { position: fixed; inset: 0; z-index: 19; background: #282e3f44; backdrop-filter: blur(2px); }
  body.menu-open { overflow: hidden; }
  .article-layout { max-width: 900px; padding-inline: 40px; }
  .article-main { padding-top: 36px; }
  .home-main { padding: 38px 32px; }
  .welcome h1 { font-size: 43px; }
  .article-header h1 { font-size: 43px; }
  .toast { left: 50%; }
}
@media (max-width: 620px) {
  h1 { font-size: 36px; letter-spacing: -1px; }
  .topbar { padding-inline: 12px; gap: 10px 8px; }
  .top-search { padding-inline: 13px; gap: 9px; font-size: 16px; }
  .top-search kbd { display: none; }
  .home-label-long { display: none; }
  .home-label-short { display: inline; }
  .home-link { padding-inline: 7px; gap: 5px; font-size: 12px; }
  .header-actions { gap: 6px; }
  .mobile-brand span { display: none; }
  .language-switch { padding: 2px; }
  .language-switch a { min-width: 34px; min-height: 38px; font-size: 11px; }
  .home-main { padding: 25px 20px 32px; }
  .welcome { padding: 26px 23px; border-radius: 11px; }
  .welcome-label { font-size: 12px; margin-bottom: 13px; }
  .welcome h1 { font-size: 36px; letter-spacing: -1.15px; margin-bottom: 18px; }
  .welcome > p { font-size: 14px; line-height: 1.85; margin-bottom: 23px; }
  .hero-search { padding: 13px 12px; font-size: 12px; gap: 9px; }
  .hero-search kbd { display: none; }
  .hero-search .icon { width: 18px; height: 18px; }
  .search-examples { font-size: 11px; line-height: 1.8; }
  .start-section { margin: 36px 0; }
  .section-heading { align-items: flex-start; flex-wrap: wrap; gap: 12px; margin-bottom: 27px; }
  .section-heading h2 { font-size: 22px; line-height: 1.45; }
  .section-heading p { font-size: 12px; }
  .section-heading > a { font-size: 12px; }
  .journey { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 30px 20px; }
  .journey a { font-size: 13px; }
  .journey p { font-size: 12px; }
  .categories { grid-template-columns: minmax(0,1fr); }
  .category { gap: 14px; padding: 22px 0; }
  .category h3 { font-size: 17px; }
  .category p { font-size: 13px; }
  .topics .section-heading { flex-wrap: nowrap; align-items: center; gap: 15px; margin-bottom: 5px; }
  .topics { margin-top: 28px; }
  .topics .section-heading h2 { font-size: 22px; }
  .guide-total { font-size: 10px; padding: 4px 8px; }
  .quick-links { grid-template-columns: minmax(0,1fr); }
  .questions { margin-top: 35px; }
  .questions h2 { font-size: 22px; }
  .help-strip { margin-top: 36px; padding: 21px 18px; gap: 12px; align-items: flex-start; }
  .help-strip > div { flex: 1 1 190px; }
  .help-strip h2 { font-size: 16px; line-height: 1.5; }
  .help-strip p { font-size: 12px; }
  .help-strip > a { margin-left: 37px; font-size: 12px; }
  .footer { flex-direction: column; gap: 7px; padding: 23px 20px; font-size: 11px; }
  .article-layout { padding-inline: 24px; }
  .article-main { padding: 27px 0 36px; }
  .breadcrumb { gap: 7px; font-size: 11px; margin-bottom: 25px; }
  .article-header h1 { font-size: 36px; letter-spacing: -1px; }
  .lead { font-size: 16px; line-height: 1.8; }
  .article-tools { margin-bottom: 29px; padding-bottom: 15px; font-size: 11px; }
  .article-tools > div { gap: 18px; }
  .article-tools button { font-size: 11px; }
  .mobile-toc { padding: 13px 15px; margin-bottom: 31px; font-size: 12px; }
  .article-section { margin-bottom: 34px; scroll-margin-top: 154px; }
  .article-section h2 { font-size: 24px; line-height: 1.4; margin-bottom: 17px; }
  .article-section h3 { font-size: 18px; }
  .article-section p, .article-section li { font-size: 15px; line-height: 1.85; }
  .article-section ol, .article-section ul { padding-left: 23px; }
  .article-section li { padding-left: 3px; margin-bottom: 13px; }
  .article-section aside { padding: 15px 17px; }
  .article-section code { font-size: 12px; }
  .article-section table { font-size: 12px; }
  .article-section th, .article-section td { padding: 10px; }
  .article-section figcaption { font-size: 11px; }
  .anchor { display: none; }
  .related { margin-top: 36px; }
  .related h2 { font-size: 21px; }
  .related a { font-size: 13px; }
  .pager { gap: 12px; margin-top: 29px; }
  .pager > a { padding: 14px; }
  .pager small { font-size: 10px; }
  .pager span { font-size: 12px; }
  .index-main { padding: 28px 24px 40px; }
  .index-main h1 { font-size: 37px; }
  .index-search { margin: 25px 0 35px; }
  .index-group { margin-top: 36px; }
  .index-group-title { gap: 10px; }
  .index-group-title h2 { font-size: 23px; }
  .index-group-title > span { font-size: 11px; }
  .index-group > p { font-size: 13px; }
  .index-list > a { gap: 14px; padding: 19px 0; }
  .index-list h3 { font-size: 16px; }
  .index-list p { font-size: 12px; }
  .index-list a > span { gap: 5px; font-size: 10px; }
  .search-dialog { margin-top: 4vh; max-height: 92vh; }
  .search-head { padding-inline: 16px; }
  .search-field { padding-inline: 17px; }
  .search-field input { font-size: 16px; }
  .search-count { padding-inline: 17px; }
  .search-results { max-height: 57vh; }
  .search-hint { padding: 12px 16px; font-size: 9px; flex-wrap: wrap; }
  .image-dialog { padding: 45px 9px 12px; }
  .image-dialog > p { font-size: 11px; }
  .toast { width: max-content; max-width: calc(100vw - 32px); text-align: center; }
}
@media (max-width: 374px) {
  .home-main { padding-inline: 16px; }
  .welcome { padding: 24px 18px; }
  .welcome h1 { font-size: 32px; }
  .hero-search { font-size: 11px; }
  .article-layout, .index-main { padding-inline: 20px; }
  .article-header h1 { font-size: 33px; }
  .article-section h2 { font-size: 23px; }
  .pager { grid-template-columns: minmax(0,1fr); }
  .pager > span:empty { display: none; }
  .index-list > a { align-items: flex-start; gap: 10px; }
  .index-list a > span .icon { display: none; }
  .category { gap: 11px; }
  .category-icon { width: 36px; height: 36px; }
  .category > .icon { width: 12px; }
  .category h3 { font-size: 16px; }
  .help-strip > a { margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) {
  :root { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
@media print {
  .sidebar, .topbar, .toc, .footer, .mobile-toc, .article-tools, .pager, .related, .feature-return, .skip, dialog, .toast { display: none !important; }
  .workspace { display: block; margin: 0; }
  .article-layout, .article-layout.with-toc { display: block; max-width: none; padding: 0; }
  .article-main { padding: 0; }
  .article-header h1 { font-size: 28px; }
  .article-section h2 { font-size: 20px; break-after: avoid; }
  .article-section aside, figure, table { break-inside: avoid; }
  .article-section p, .article-section li { font-size: 11px; }
  a { color: inherit; text-decoration: none; }
  body { color: #111; background: #fff; }
  .home-main, .index-main { padding: 0; }
}
