/* Shared by the Console and every standalone Gallery export. */
:root {
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Inter, Roboto, 'Helvetica Neue', sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sidebar: 248px;
  --sidebar-pad: 12px;
  --header: 56px;
  --brand-icon: 28px;
  --nav-icon: 28px;
  --nav-pad: 8px;
  --nav-height: 36px;
  --gutter: 24px;
  --panel-pad: 20px;
  --section-space: 24px;
  --control: 36px;
  --control-sm: 32px;
  --radius: 8px;
  --radius-lg: 12px;
  --title-size: 26px;
  --field: var(--bg);
  --ring: 0 0 0 3px var(--active);
  color-scheme: light;
  --bg: #ffffff;
  --sidebar-bg: #fafafa;
  --surface: #ffffff;
  --surface-2: #ffffff;
  --canvas: #f7f7f8;
  --hover: rgb(0 0 0 / 4%);
  --active: rgb(0 0 0 / 6.5%);
  --line: rgb(0 0 0 / 8%);
  --line-strong: rgb(0 0 0 / 13%);
  --line-hover: rgb(0 0 0 / 24%);
  --ink: #0f0f10;
  --muted: #5f5f63;
  --subtle: #68686e;
  --primary: #0f0f10;
  --primary-hover: #2a2a2d;
  --on-primary: #ffffff;
  --switch: rgb(0 0 0 / 16%);
  --thumb: #ffffff;
  --focus: rgb(0 0 0 / 50%);
  --pill-shadow: 0 1px 2px rgb(0 0 0 / 10%), 0 0 0 1px rgb(0 0 0 / 5%);
  --scrollbar: rgb(0 0 0 / 22%);
  --ok: #1f8a4c;
  --ok-bg: rgb(31 138 76 / 8%);
  --ok-line: rgb(31 138 76 / 30%);
  --warn: #a15c07;
  --info: #2f6db5;
  --info-bg: rgb(47 109 181 / 8%);
  --danger: #aa2828;
  --danger-bg: #fbeeee;
  --danger-line: #efc4c1;
  --warn-bg: #fff5df;
  --warn-line: #e9cf9c;
}
:root[data-website-theme='dark'] {
  color-scheme: dark;
  --bg: #0f0f10;
  --sidebar-bg: #161617;
  --surface: #161617;
  --surface-2: #2a2a2c;
  --canvas: #0b0b0c;
  --hover: rgb(255 255 255 / 5%);
  --active: rgb(255 255 255 / 8%);
  --line: rgb(255 255 255 / 8%);
  --line-strong: rgb(255 255 255 / 13%);
  --line-hover: rgb(255 255 255 / 22%);
  --ink: #fafafa;
  --muted: #a3a3a3;
  --subtle: #96969c;
  --primary: #fafafa;
  --primary-hover: #e4e4e4;
  --on-primary: #0f0f10;
  --switch: rgb(255 255 255 / 18%);
  --thumb: #ffffff;
  --focus: rgb(255 255 255 / 55%);
  --pill-shadow: 0 1px 2px rgb(0 0 0 / 35%);
  --scrollbar: rgb(255 255 255 / 22%);
  --ok: #6fcf97;
  --ok-bg: rgb(111 207 151 / 10%);
  --ok-line: rgb(111 207 151 / 26%);
  --warn: #f2c46d;
  --info: #8fb8ea;
  --info-bg: rgb(143 184 234 / 10%);
  --danger: #f4a5a0;
  --danger-bg: rgb(239 83 80 / 10%);
  --danger-line: rgb(239 83 80 / 28%);
  --warn-bg: rgb(242 196 109 / 9%);
  --warn-line: #584729;
}
.tool-navigation {
  flex: none;
}
.sidebar .section-switch {
  display: flex;
  flex: 0 0 auto;
  gap: 4px;
  padding: 4px;
  margin: 12px 0 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: transparent;
}
.sidebar .section-switch > :is(a, span) {
  display: inline-flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  margin: 0;
  min-height: var(--control-sm);
  padding: 4px;
  border-radius: 5px;
  background: transparent;
  color: var(--muted);
  text-decoration: none;
  font: 600 13px/1.3 var(--font);
}
.sidebar .section-switch [aria-current='page'],
.sidebar .section-switch a:hover {
  background: var(--active);
  color: var(--ink);
}
.sidebar .brand {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  flex: none;
  height: var(--header);
  margin-inline: calc(-1 * var(--sidebar-pad));
  padding-inline: calc(var(--sidebar-pad) + var(--nav-pad));
  border-bottom: 1px solid var(--line);
  border-radius: 0;
}
.sidebar .brand-mark {
  width: var(--brand-icon);
  height: var(--brand-icon);
  border-radius: var(--radius);
}
.sidebar .brand-name {
  font: 600 15px/20px var(--font);
  letter-spacing: -0.01em;
}
.sidebar .brand-tag,
.sidebar .brand-product {
  color: var(--muted);
  font: 500 14px/20px var(--font);
}
button.tool-theme {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: var(--control);
  height: var(--control);
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
}
button.tool-theme:hover:not(:disabled) {
  background: color-mix(in srgb, var(--surface) 94%, var(--ink));
  border-color: var(--line-hover);
  color: var(--ink);
}
.tool-theme .tool-icon {
  display: block;
  width: 18px;
  height: 18px;
}
[data-website-theme='dark'] .when-light,
[data-website-theme='light'] .when-dark {
  display: none !important;
}

/* One rail for the gallery sections, with room for each tool's review controls. */
.sidebar.gallery-sidebar {
  padding: 0 var(--sidebar-pad) var(--sidebar-pad);
  min-height: 0;
}
.sidebar .sidebar-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 8px 0 5px;
  padding: 0 8px;
  color: var(--muted);
  font: 500 12px/20px var(--font);
}
.gallery-sidebar #languages {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-height: 0;
  padding: 0;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar) transparent;
}
.gallery-sidebar .language-group {
  display: flex;
  justify-content: space-between;
  padding: 12px 8px 5px;
  color: var(--muted);
  font: 600 11px/16px var(--font);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.gallery-sidebar .language-group:first-child {
  padding-top: 3px;
}
.gallery-sidebar :is(.language-button, .language) {
  display: grid;
  flex: none;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  width: 100%;
  min-height: var(--nav-height);
  padding: 4px var(--nav-pad);
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: var(--muted);
  text-align: left;
  font: 500 14px/20px var(--font);
}
.gallery-sidebar .language-name {
  min-width: 0;
  font-weight: inherit;
}
.gallery-sidebar :is(.language-glyph, .language-script) {
  width: 28px;
  height: 20px;
  display: grid;
  place-items: center;
  color: inherit;
  font-size: 15px;
}
.gallery-sidebar :is(.language-button, .language):hover {
  background: var(--hover);
  color: var(--ink);
}
.gallery-sidebar [aria-current='true']:is(.language-button, .language) {
  background: var(--active);
  color: var(--ink);
}
.gallery-sidebar .sidebar-footer {
  flex: none;
  margin-top: 8px;
  padding: 8px var(--nav-pad) 0;
  border: 0;
  border-top: 1px solid var(--line);
  background: transparent;
  font-size: 12px;
}
.gallery-sidebar .text-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  width: 100%;
  min-height: var(--control-sm);
  margin: 0;
  padding: 0 4px;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: var(--muted);
  font: 500 12px/1.4 var(--font);
  cursor: pointer;
}
.gallery-sidebar .text-button:hover {
  color: var(--ink);
  background: var(--hover);
}
.gallery-sidebar .mobile-language {
  display: none;
}
@media (max-width: 1023px) {
  :root {
    --sidebar: 224px;
  }
}
@media (max-width: 900px) {
  :root {
    --gutter: 16px;
    --header: 52px;
    --section-space: 16px;
    --panel-pad: 16px;
    --title-size: 24px;
  }
  .sidebar.gallery-sidebar {
    display: flex;
    flex-flow: column nowrap;
    align-items: stretch;
    width: 100%;
    height: auto;
    max-height: none;
    padding: 0 12px 10px;
    border: 0;
    border-bottom: 1px solid var(--line);
  }
  .tool-navigation {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin: 0 calc(-1 * var(--sidebar-pad)) 8px;
    padding: 6px var(--sidebar-pad);
    min-height: var(--header);
    border-bottom: 1px solid var(--line);
  }
  .tool-navigation .brand {
    height: auto;
    gap: 6px;
    margin: 0;
    padding: 0;
    border: 0;
  }
  .sidebar .sidebar-label,
  .gallery-sidebar #languages {
    display: none;
  }
  .sidebar .section-switch {
    flex: 1;
    max-width: 240px;
    margin: 0;
  }
  .sidebar .section-switch > :is(a, span) {
    min-height: var(--control-sm);
  }
  .gallery-sidebar .mobile-language {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 36px;
    margin: 0;
    padding: 0 4px;
    color: var(--muted);
    font: 500 12px/18px var(--font);
  }
  .mobile-language select {
    min-width: 0;
    flex: 1;
    height: var(--control);
    padding: 0 8px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--ink);
    font: 500 13px/20px var(--font);
  }
  .gallery-sidebar .collection {
    display: block;
  }
  .gallery-sidebar .chapter-switcher {
    width: 100%;
    margin-bottom: 8px;
  }
  .gallery-sidebar .sidebar-footer:has(#export-review) {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    column-gap: 8px;
    margin-top: 6px;
    padding: 2px 4px;
    border: 0;
  }
  .gallery-sidebar .sidebar-footer:has(#export-review) .meter {
    display: none;
  }
  .gallery-sidebar .text-button {
    width: auto;
  }
  .gallery-sidebar #overall-summary {
    flex-basis: 100%;
    margin: 0;
    font-size: 11px;
  }
}
@media (max-width: 359px) {
  .tool-navigation {
    flex-wrap: wrap;
  }
  .sidebar .section-switch {
    flex-basis: 100%;
    max-width: none;
  }
}
@media (pointer: coarse) {
  :root {
    --control: 44px;
    --control-sm: 36px;
  }
}
