/* Shared interface of the CR3 and CRP-5 tools: tokens, site bar, canvas,
   panel tabs, buttons, result card and explanation reader. Each tool keeps
   its own layout and instrument styles. */
:root {
  color-scheme: light;
  --tool-page: #f4f6fb;
  --tool-surface: #fff;
  --tool-surface-raised: rgba(255, 255, 255, .97);
  --tool-canvas: #eaf0f9;
  --tool-text: #1e2848;
  --tool-muted: #65708e;
  --tool-line: #d7dfed;
  --tool-accent: #344290;
  --tool-accent-fill: #263676;
  --tool-accent-soft: #e9edf9;
  --tool-marker: #cf2d72;
  --tool-cue: #cf2d72;
  --tool-focus: #d88435;
  --tool-shadow: 0 18px 46px rgba(31, 46, 103, .12);
  --tool-float-shadow: 0 6px 20px rgba(29, 42, 86, .13);
  --tool-result: #765000;
  --tool-result-bg: #fff8df;
  --tool-result-line: #ead38b;
  --tool-error: #b42318;
  --tool-radius: 20px;
  --aero-ck-surface: var(--tool-surface);
  --aero-ck-text: var(--tool-text);
  --aero-ck-muted: var(--tool-muted);
  --aero-ck-line: var(--tool-line);
  --aero-ck-accent: var(--tool-accent);
  --aero-ck-tint: var(--tool-accent-soft);
  --aero-ck-button: var(--tool-accent-fill);
  --aero-ck-button-hover: var(--tool-accent);
  --aero-ck-on-button: #fff;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --tool-page: #0f1424;
  --tool-surface: #191f31;
  --tool-surface-raised: rgba(25, 31, 49, .97);
  --tool-canvas: #0b1120;
  --tool-text: #e8ecf7;
  --tool-muted: #a7b0c9;
  --tool-line: #343e5b;
  --tool-accent: #8fb4e6;
  --tool-accent-fill: #4358a0;
  --tool-accent-soft: #252e4d;
  --tool-marker: #ff4f9a;
  --tool-cue: #66e5ff;
  --tool-shadow: 0 18px 48px rgba(0, 0, 0, .28);
  --tool-float-shadow: 0 6px 20px rgba(0, 0, 0, .3);
  --tool-result: #f6d365;
  --tool-result-bg: #292943;
  --tool-result-line: #6e6038;
  --tool-error: #ff8a7a;
}

/* Site bar ---------------------------------------------------------------- */
/* The tools never scroll as a page: no pull-to-refresh or bounce on phones,
   and a panel scrolled to its end does not hand the swipe to the page. */
html, body { overscroll-behavior: none; }
body * { overscroll-behavior: contain; }
.aero-sitebar {
  position: fixed;
  z-index: 50;
  inset: 0 0 auto;
  height: var(--tool-header-height, 58px);
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 max(20px, env(safe-area-inset-right)) 0 max(20px, env(safe-area-inset-left));
  color: var(--tool-text);
  background: var(--tool-surface-raised);
  border-bottom: 1px solid var(--tool-line);
  backdrop-filter: blur(14px);
  font-family: Inter, "Open Sans", sans-serif;
}
.aero-sitebar *, .aero-sitebar *::before, .aero-sitebar *::after { box-sizing: border-box; }
.aero-sitebar a { color: inherit; text-decoration: none; }
.aero-sitebar-brand { display: flex; align-items: center; line-height: 0; }
.aero-sitebar-brand img { display: block; width: auto; height: 26px; }
/* Dark theme: the white wordmark (same drawing and size, the blues of the symbol
   lightened) instead of flattening the colours with a filter. Painted from the left so
   the symbol-only crop of narrow screens still works. */
html[data-theme="dark"] .aero-sitebar-brand { background: url("/assets/base/img/logos/logo_horizontal_white.svg") left center / auto 100% no-repeat; }
html[data-theme="dark"] .aero-sitebar-brand img { visibility: hidden; }
.aero-sitebar-divider { width: 1px; height: 22px; background: var(--tool-line); }
.aero-sitebar-section, .aero-sitebar-slash { color: var(--tool-muted); font-size: 12px; }
.aero-sitebar-current { font-size: 14px; font-weight: 700; letter-spacing: .06em; }
.aero-sitebar-link {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0 12px;
  color: var(--tool-muted) !important;
  border: 1px solid var(--tool-line);
  border-radius: 9px;
  font-size: 11px;
  font-weight: 600;
}
.aero-sitebar-link:hover { color: var(--tool-accent) !important; background: var(--tool-accent-soft); }
/* CR3 | CRP-5: which tool is open, and the way to the other one with the same problem
   (aero-tool-shell.js). */
.aero-tool-switch {
  display: flex;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--tool-line);
  border-radius: 10px;
  background: var(--tool-surface);
}
.aero-tool-switch a {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  color: var(--tool-muted) !important;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
  white-space: nowrap;
}
/* Only with a real pointer: on a touch screen iOS keeps :hover on the tapped option, which
   then looks chosen while the page has not changed. */
@media (hover: hover) {
  .aero-tool-switch a:not([aria-current]):hover { color: var(--tool-accent) !important; background: var(--tool-accent-soft); }
}
/* Same as the pressed .aero-segmented buttons of the tools. */
.aero-tool-switch a[aria-current="page"] {
  color: #fff !important;
  background: var(--tool-accent-fill);
}
.aero-sitebar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.aero-icon-button,
.aero-sitebar .aero-tool-help-button {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 10px;
  color: var(--tool-muted);
  background: transparent;
  border: 1px solid var(--tool-line);
  border-radius: 10px;
  font: 700 11px Inter, "Open Sans", sans-serif;
  cursor: pointer;
}
/* The :hover of buttons, here and below, only with a real pointer: on a touch screen it
   sticks after the tap and the button looks still pressed. */
@media (hover: hover) {
  .aero-icon-button:hover,
  .aero-sitebar .aero-tool-help-button:hover { color: var(--tool-accent); background: var(--tool-accent-soft); }
}
.aero-icon-button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.aero-icon-button svg circle { fill: currentColor; stroke: none; }
/* Cookies is reachable but should not compete with the other actions: just a faded icon. */
.aero-sitebar .aero-cookie-button { width: 34px; padding: 0; border-color: transparent; opacity: .5; transition: opacity .16s ease; }
.aero-sitebar .aero-cookie-button span { display: none; }
.aero-sitebar .aero-cookie-button:hover,
.aero-sitebar .aero-cookie-button:focus-visible { opacity: 1; }
.aero-language { position: relative; }
.aero-language-button img, .aero-language-menu img { width: 22px; height: 15px; object-fit: cover; border-radius: 2px; }
.aero-language-chevron {
  width: 7px;
  height: 7px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
}
.aero-language-button[aria-expanded="true"] .aero-language-chevron { transform: translateY(2px) rotate(225deg); }
.aero-language-menu {
  position: absolute;
  z-index: 80;
  top: calc(100% + 8px);
  right: 0;
  width: 170px;
  margin: 0;
  padding: 6px;
  list-style: none;
  background: var(--tool-surface);
  border: 1px solid var(--tool-line);
  border-radius: 12px;
  box-shadow: var(--tool-shadow);
}
.aero-language-menu[hidden] { display: none !important; }
.aero-language-menu li { display: block; margin: 0; padding: 0; list-style: none; background: transparent; }
.aero-language-menu li a::before { content: none; display: none; }
.aero-language-menu a {
  min-height: 40px;
  display: grid;
  grid-template-columns: 24px 1fr 14px;
  align-items: center;
  gap: 8px;
  padding: 0 9px;
  color: var(--tool-text) !important;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
}
.aero-language-menu a:hover,
.aero-language-menu a:focus-visible,
.aero-language-menu a[aria-current="page"] { color: var(--tool-accent) !important; background: var(--tool-accent-soft); }
.aero-language-menu b { text-align: center; font-size: 13px; }
.aero-theme-button { width: 40px; padding: 0; border-radius: 50%; }
/* Settings menu: on small screens it gathers cookies, language, theme and
   the user guide (aero-tool-shell.js). */
.aero-settings { position: relative; display: none; }
.aero-settings-button { width: 40px; padding: 0; }
.aero-settings-button svg { width: 20px; height: 20px; }
.aero-settings-menu {
  position: absolute;
  z-index: 80;
  top: calc(100% + 8px);
  right: 0;
  width: min(300px, calc(100vw - 16px));
  max-height: calc(100dvh - var(--tool-header-height, 58px) - 16px);
  overflow: auto;
  padding: 6px;
  background: var(--tool-surface);
  border: 1px solid var(--tool-line);
  border-radius: 12px;
  box-shadow: var(--tool-shadow);
}
.aero-settings-menu[hidden] { display: none !important; }
.aero-settings-item,
.aero-settings-row {
  width: 100%;
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 10px;
  color: var(--tool-text);
  font: 600 13px Inter, "Open Sans", sans-serif;
}
.aero-settings-item { background: transparent; border: 0; border-radius: 8px; text-align: left; cursor: pointer; }
@media (hover: hover) {
  .aero-settings-item:hover { color: var(--tool-accent); background: var(--tool-accent-soft); }
}
.aero-settings-item svg { flex: none; width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.aero-settings-item svg circle { fill: currentColor; stroke: none; }
.aero-settings-item .aero-theme-icon { flex: none; width: 16px; height: 16px; }
.aero-settings-row { justify-content: space-between; }
.aero-settings-languages { display: flex; gap: 2px; padding: 3px; border: 1px solid var(--tool-line); border-radius: 9px; }
.aero-settings-languages a {
  min-width: 42px;
  min-height: 32px;
  display: grid;
  place-items: center;
  color: var(--tool-muted) !important;
  border-radius: 7px;
  font: 700 12px Inter, "Open Sans", sans-serif;
}
.aero-settings-languages a[aria-current="page"] { color: #fff !important; background: var(--tool-accent-fill); }
.aero-settings-notice { margin: 6px 4px 2px; padding: 10px 6px 4px; color: var(--tool-muted); border-top: 1px solid var(--tool-line); font-size: 11px; line-height: 1.45; }
.aero-settings-notice p { margin: 0 0 6px; }
.aero-settings-row[hidden] { display: none; }

/* Animation of the explanation, Auto | Manual (offerAutoPlay): a row of the settings
   menu on a phone, the top right corner of the explanation on a computer. */
.aero-choice { display: flex; gap: 2px; padding: 3px; border: 1px solid var(--tool-line); border-radius: 9px; }
.aero-choice button {
  min-width: 54px;
  min-height: 32px;
  padding: 0 10px;
  color: var(--tool-muted);
  background: transparent;
  border: 0;
  border-radius: 7px;
  font: 700 12px Inter, "Open Sans", sans-serif;
  letter-spacing: 0;
  text-transform: none;
  cursor: pointer;
}
@media (hover: hover) {
  .aero-choice button:hover { color: var(--tool-accent); }
}
.aero-choice button[aria-pressed="true"] { color: #fff; background: var(--tool-accent-fill); }
.aero-choice button:focus-visible { outline: 3px solid var(--tool-focus); outline-offset: 1px; }
/* Beside the eyebrow, at the right, when both fit. When not, the choice goes to a row of
   its own above it (wrap-reverse), so the eyebrow is never split in two lines. */
.aero-explanation-head { display: flex; flex-wrap: wrap-reverse; align-items: center; gap: 6px 12px; margin-bottom: 10px; }
.aero-explanation-head > .aero-tool-eyebrow { margin: 0; white-space: nowrap; }
.aero-autoplay.is-inline { margin-left: auto; display: flex; align-items: center; gap: 8px; color: var(--tool-muted); font-size: 11px; font-weight: 650; }
.aero-autoplay.is-inline .aero-choice { padding: 2px; border-radius: 8px; }
.aero-autoplay.is-inline .aero-choice button { min-width: 0; min-height: 26px; padding: 0 9px; border-radius: 6px; font-size: 11px; }
/* Where the panel goes (panelPlaceChoice): a sketch of the screen with the panel shaded.
   Only the places this screen allows show. */
.aero-panel-place .aero-choice button { display: grid; min-width: 44px; place-items: center; }
.aero-panel-place .aero-choice button[hidden] { display: none; }
.aero-panel-place svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.aero-panel-place svg rect + rect { fill: currentColor; stroke: none; opacity: .6; }

/* Lock of the instrument (instrumentLock): one more button of the tool bar. */
.aero-lock-icon { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.aero-settings-notice a { color: var(--tool-accent) !important; font-weight: 700; text-decoration: underline !important; text-underline-offset: 2px; }
/* Theme: the moon switches to night, the sun back to day. Drawn as the lock and gear, in strokes. */
.aero-theme-icon {
  display: block;
  width: 21px;
  height: 21px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z'/%3E%3C/svg%3E") center / contain no-repeat;
}
html[data-theme="dark"] .aero-theme-icon {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.9' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='4'/%3E%3Cpath d='M12 2v2M12 20v2M4.9 4.9l1.4 1.4M17.7 17.7l1.4 1.4M2 12h2M20 12h2M4.9 19.1l1.4-1.4M17.7 6.3l1.4-1.4'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.9' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='4'/%3E%3Cpath d='M12 2v2M12 20v2M4.9 4.9l1.4 1.4M17.7 17.7l1.4 1.4M2 12h2M20 12h2M4.9 19.1l1.4-1.4M17.7 6.3l1.4-1.4'/%3E%3C/svg%3E");
}
.aero-sitebar :focus-visible { outline: 3px solid var(--tool-focus); outline-offset: 3px; }

@media (min-width: 901px) and (max-width: 1100px) {
  .aero-sitebar-section, .aero-sitebar-slash { display: none; }
}
@media (max-width: 900px), (max-height: 560px) {
  :root { --tool-header-height: 52px; }
  .aero-sitebar { gap: 8px; padding-inline: max(10px, env(safe-area-inset-left)); }
  .aero-sitebar-brand img { height: 23px; }
  .aero-sitebar-divider, .aero-sitebar-section, .aero-sitebar-slash, .aero-sitebar-current { display: none !important; }
  /* The switch between the tools stays; the rest goes into the settings menu. */
  .aero-settings { display: block; }
  .aero-autoplay.is-inline { display: none; }
  .aero-sitebar .aero-cookie-button, .aero-sitebar .aero-language,
  .aero-sitebar .aero-theme-button, .aero-sitebar .aero-tool-help-button { display: none !important; }
  .aero-settings-button { width: 36px; min-height: 36px; }
  .aero-icon-button, .aero-sitebar .aero-tool-help-button { min-height: 36px; }
  .aero-theme-button { width: 36px; height: 36px; }
}
@media (max-height: 560px) and (min-width: 600px) {
  :root { --tool-header-height: 44px; }
  .aero-sitebar-brand img { height: 21px; }
  .aero-icon-button, .aero-sitebar .aero-tool-help-button { min-height: 34px; }
  .aero-theme-button { width: 34px; height: 34px; }
}
@media (max-width: 520px) {
  .aero-sitebar { gap: 6px; padding-inline: max(8px, env(safe-area-inset-left)); }
  .aero-sitebar-actions { gap: 5px; }
  .aero-sitebar-brand img { height: 21px; }
  .aero-cookie-button, .aero-sitebar .aero-tool-help-button { width: 38px; padding: 0; }
  .aero-cookie-button span, .aero-sitebar .aero-tool-help-button span { display: none; }
  .aero-language-button { width: 42px; padding: 0; }
  .aero-language-button span, .aero-language-chevron { display: none; }
}
/* CR3 | CRP-5 | Vectors and the settings button do not fit beside the whole logo on a
   phone: only its symbol stays, the start of the same image. */
@media (max-width: 440px) {
  .aero-sitebar-brand { flex: none; width: 38px; overflow: hidden; }
  .aero-sitebar-brand img { max-width: none; }
}
@media (max-width: 360px) {
  .aero-tool-switch a { padding: 0 8px; }
}
@media (max-width: 350px) {
  .aero-sitebar { padding-inline: max(6px, env(safe-area-inset-left)); }
  .aero-sitebar-actions { gap: 3px; }
  .aero-sitebar-brand img { height: 19px; }
}

/* Instrument canvas ------------------------------------------------------- */
.aero-tool-canvas {
  background-color: var(--tool-canvas) !important;
  background-image: radial-gradient(circle, color-mix(in srgb, var(--tool-accent) 34%, transparent) 1px, transparent 1.25px) !important;
  background-size: 26px 26px !important;
  border: 1px solid var(--tool-line);
  border-radius: var(--tool-radius);
  box-shadow: var(--tool-shadow);
}
.aero-tool-canvas::after {
  content: "";
  position: absolute;
  z-index: 1;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background: radial-gradient(circle at 50% 48%, transparent 35%, color-mix(in srgb, var(--tool-canvas) 35%, transparent) 100%);
}

/* Floating controls on the canvas: variant switch and reset. */
.aero-float {
  background: color-mix(in srgb, var(--tool-surface) 92%, transparent);
  border: 1px solid var(--tool-line);
  border-radius: 13px;
  box-shadow: var(--tool-float-shadow);
  backdrop-filter: blur(12px);
}
.aero-segmented { display: flex; gap: 2px; padding: 4px; }
.aero-segmented button {
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 13px;
  color: var(--tool-muted);
  background: transparent;
  border: 0;
  border-radius: 9px;
  font: 700 12px Inter, "Open Sans", sans-serif;
  cursor: pointer;
}
@media (hover: hover) {
  .aero-segmented button:hover { color: var(--tool-accent); }
}
.aero-segmented button[aria-pressed="true"] { color: #fff; background: var(--tool-accent-fill); }

/* Panel ------------------------------------------------------------------- */
.aero-panel-tabs {
  flex: 0 0 auto;
  min-height: 56px;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 7px 8px 7px 10px;
  border-bottom: 1px solid var(--tool-line);
}
.aero-panel-tabs [role="tablist"] { min-width: 0; display: flex; align-items: center; gap: 4px; }
.aero-panel-tab {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  color: var(--tool-muted);
  background: transparent;
  border: 0;
  border-radius: 9px;
  font: 700 12px Inter, "Open Sans", sans-serif;
  letter-spacing: 0;
  text-transform: none;
  cursor: pointer;
}
@media (hover: hover) {
  .aero-panel-tab:hover { color: var(--tool-accent); }
}
.aero-panel-tab[aria-selected="true"],
.aero-panel-tab[aria-current] { color: var(--tool-accent); background: var(--tool-accent-soft); cursor: default; }
.aero-panel-tab:disabled { opacity: .42; cursor: default; }
.aero-panel-chip {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  color: var(--tool-accent);
  background: var(--tool-accent-soft);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}
.aero-panel-toggle {
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  margin-left: auto;
  padding: 0;
  color: var(--tool-muted);
  background: transparent;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
}
.aero-panel-chip + .aero-panel-toggle { margin-left: 4px; }
/* Move the panel (AeroToolShell.panelMover): a grip before the arrow, only where the panel
   can go elsewhere. It drags, so the finger does not scroll the page. */
.aero-panel-mover {
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  margin-left: auto;
  padding: 0;
  color: var(--tool-muted);
  background: transparent;
  border: 0;
  border-radius: 8px;
  cursor: grab;
  touch-action: none;
}
.aero-panel-mover[hidden],
.aero-panel-collapsed .aero-panel-mover { display: none !important; }
.aero-panel-mover svg { width: 18px; height: 18px; fill: currentColor; }
.aero-panel-chip + .aero-panel-mover,
.aero-share + .aero-panel-mover,
.aero-panel-mover:not([hidden]) + .aero-panel-toggle { margin-left: 0; }
.aero-panel-mover:not([hidden]) + .aero-share { margin-left: 0; }
@media (hover: hover) {
  .aero-panel-mover:hover { color: var(--tool-accent); background: var(--tool-accent-soft); }
}
.aero-panel-mover:focus-visible { outline: 3px solid var(--tool-focus); outline-offset: 1px; }
/* With a finger the icons of the panel header (grip, share, arrow) are 40 px, not 34: side
   by side with no gap, a tap that missed by a little was lost. The folded arrow keeps its
   own size (below). */
@media (pointer: coarse) {
  .aero-panel-tabs .aero-panel-toggle,
  .aero-panel-tabs .aero-panel-mover,
  .aero-panel-tabs .aero-share-button { flex-basis: 40px; width: 40px; height: 40px; }
}
@media (hover: hover) {
  .aero-panel-toggle:hover { color: var(--tool-accent); background: var(--tool-accent-soft); }
}
.aero-panel-toggle::before {
  content: "";
  width: 8px;
  height: 8px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg) translate(-2px, -2px);
}
.aero-panel-toggle[aria-expanded="false"]::before { transform: rotate(225deg) translate(-2px, -2px); }
/* Panel at the side: the arrow goes first, at the edge facing the instrument, and points
   the way the panel folds (right). Under the instrument it stays last and points down,
   also where the screen would put it at the side (AeroToolShell.panelPlace). */
@media (min-width: 901px), (min-width: 600px) and (max-height: 560px) {
  html:not([data-panel="bottom"]) .aero-panel-tabs { padding-left: 6px; }
  html:not([data-panel="bottom"]) .aero-panel-tabs > .aero-panel-toggle { order: -1; margin-left: 0; }
  html:not([data-panel="bottom"]) .aero-panel-toggle::before { transform: rotate(-45deg) translate(-2px, -2px); }
}
.aero-tool-eyebrow { margin: 0 0 8px; color: var(--tool-accent); font-size: 11px; font-weight: 800; letter-spacing: .11em; text-transform: uppercase; }
.aero-tool-title { margin: 0; color: var(--tool-text); font-size: clamp(25px, 2vw, 32px); font-weight: 650; line-height: 1.1; letter-spacing: -.035em; }
.aero-field-label { display: block; color: var(--tool-muted); font-size: 11px; font-weight: 650; }
.aero-select {
  width: 100%;
  min-height: 46px;
  padding: 0 38px 0 13px;
  color: var(--tool-text);
  background-color: var(--tool-surface);
  border: 1px solid var(--tool-line);
  border-radius: 11px;
  font-size: 14px;
  font-weight: 700;
}
.aero-button {
  width: 100%;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 7px 12px;
  color: #fff;
  background: var(--tool-accent-fill);
  border: 0;
  border-radius: 11px;
  font: 750 14px Inter, "Open Sans", sans-serif;
  cursor: pointer;
}
.aero-button.is-secondary { color: var(--tool-accent); background: var(--tool-accent-soft); }
.aero-button:disabled { opacity: .42; cursor: default; }
.aero-result {
  padding: 14px 15px;
  color: var(--tool-result);
  background: var(--tool-result-bg);
  border: 1px solid var(--tool-result-line);
  border-radius: 12px;
}
.aero-result-label { display: block; margin-bottom: 6px; color: var(--tool-muted); font-size: 9px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }

/* Explanation reader ------------------------------------------------------ */
.aero-explanation-data { flex: 0 0 auto; padding: 12px; background: var(--tool-page); border-bottom: 1px solid var(--tool-line); }
.aero-explanation-data-head { min-width: 0; display: flex; align-items: baseline; justify-content: space-between; gap: 14px; margin-bottom: 8px; }
.aero-explanation-data-head span { flex: 0 0 auto; color: var(--tool-accent); font-size: 10px; font-weight: 750; letter-spacing: .12em; }
.aero-explanation-data-head strong { min-width: 0; overflow: hidden; color: var(--tool-muted); font-size: 12px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.aero-explanation-data-list { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 0; }
.aero-explanation-datum { min-width: 0; padding: 8px; background: var(--tool-surface); border: 1px solid var(--tool-line); border-radius: 9px; }
.aero-explanation-datum dt { overflow: hidden; margin: 0 0 2px; color: var(--tool-muted); font-size: 9px; font-weight: 550; line-height: 1.2; text-overflow: ellipsis; white-space: nowrap; }
.aero-explanation-datum dd { overflow: hidden; margin: 0; color: var(--tool-text); font-size: 15px; font-weight: 700; line-height: 1.2; text-overflow: ellipsis; white-space: nowrap; font-variant-numeric: tabular-nums; }
.aero-explanation-title { margin: 0 0 14px; color: var(--tool-text); font-size: clamp(25px, 1.2rem + .55vw, 34px); font-weight: 600; line-height: 1.15; letter-spacing: -.03em; }
.aero-explanation-text { max-width: 62ch; color: var(--tool-muted); font-size: clamp(15px, .82rem + .22vw, 19px); line-height: 1.65; }
.aero-explanation-text p { margin: 0 0 1em; }
.aero-explanation-text p:last-child { margin-bottom: 0; }
/* Two quick taps on Next must not zoom the page: iOS WebKit (Safari and Chrome on iPhone)
   reads them as a double tap and ignores maximum-scale. The bar too, for a tap that misses.
   Same for CR3 | CRP-5 | Vectors: going quickly from one to another, the second tap was lost. */
button, .aero-step-nav, .aero-step-nav > a, .aero-tool-switch, .aero-tool-switch > a { touch-action: manipulation; }
.aero-step-nav {
  flex: 0 0 auto;
  min-height: 60px;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 8px 16px 10px;
  border-top: 1px solid var(--tool-line);
}
.aero-step-nav > button,
.aero-step-nav > a {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  color: var(--tool-accent);
  background: var(--tool-accent-soft);
  border: 0;
  border-radius: 9px;
  font: 700 24px/1 Inter, sans-serif;
  text-decoration: none;
  cursor: pointer;
}
.aero-step-nav > button:disabled,
.aero-step-nav > a[aria-disabled="true"] { opacity: .32; cursor: default; }
.aero-step-nav > span,
.aero-step-nav > label { color: var(--tool-muted); font-size: 12px; font-weight: 800; text-align: center; font-variant-numeric: tabular-nums; }

@media (max-width: 900px), (max-height: 560px) {
  .aero-panel-tabs { min-height: 46px; padding: 3px 5px 3px 6px; gap: 2px; }
  .aero-panel-tab { min-height: 36px; padding: 0 10px; font-size: 11px; }
  .aero-panel-chip { min-height: 24px; padding: 0 8px; font-size: 9px; }
  .aero-explanation-data { padding: 8px 10px 9px; }
  .aero-explanation-data-head { margin-bottom: 6px; }
  .aero-explanation-data-list { gap: 5px; }
  .aero-explanation-datum { padding: 5px 6px; }
  .aero-explanation-datum dt { font-size: 8px; }
  .aero-explanation-datum dd { font-size: 13px; }
  .aero-explanation-title { font-size: 21px; }
  .aero-explanation-text { font-size: 14px; line-height: 1.55; }
  .aero-step-nav { min-height: 50px; padding: 4px 12px 6px; }
  .aero-step-nav > button, .aero-step-nav > a { width: 40px; height: 40px; }
  .aero-select { min-height: 38px; font-size: 12px; }
  .aero-button { min-height: 40px; font-size: 12px; border-radius: 9px; }
}

/* On a phone the explanation is the point. The summary of the exercise data is left to the
   Data tab, where the same values are: on its side it took a third of the panel. Smaller
   titles too: two lines of 21 px pushed the text out of a short panel. */
@media (max-width: 599px), (max-height: 560px) {
  .aero-explanation-data { display: none; }
  .aero-explanation-title { margin-bottom: 10px; font-size: 18px; }
}

@media (prefers-reduced-motion: no-preference) {
  .aero-icon-button, .aero-segmented button, .aero-panel-tab, .aero-button { transition: color .16s ease, background-color .16s ease; }
}

/* Folded tool bar on phones (AeroToolShell.toolMenu); each tool shows it. */
.aero-tools-toggle {
  width: 50px;
  height: 48px;
  display: none;
  place-items: center;
  padding: 0;
  color: inherit;
  background: transparent;
  border: 0;
  border-radius: 10px;
  cursor: pointer;
}
.aero-tools-toggle svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.aero-tools-toggle[aria-expanded="true"] { color: var(--tool-accent); background: var(--tool-accent-soft); }
.aero-tools-toggle:focus-visible { outline: 3px solid var(--tool-focus); outline-offset: 1px; }

/* The separator dragged well past the smallest panel: released there, the panel folds
   (AeroToolShell.panelSizer). It fades meanwhile, so that letting go is not a surprise. */
.aero-panel-folding { opacity: .45; }
/* Being moved to another place (panelSizer, panelMover): the panel fades and the places
   it can go show over the tool, the one it would go to lit up, with a bar at its edge. */
.aero-panel-moving { opacity: .55; }
@media (prefers-reduced-motion: no-preference) {
  .aero-panel-folding, .aero-panel-moving { transition: opacity .12s ease; }
}
.aero-panel-zones { position: fixed; inset: 0; z-index: 80; pointer-events: none; }
.aero-panel-zones.is-picking { pointer-events: auto; background: color-mix(in srgb, var(--tool-page) 45%, transparent); }
.aero-panel-zone {
  position: fixed;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 6px;
  margin: 0;
  padding: 8px;
  color: var(--tool-accent);
  background: color-mix(in srgb, var(--tool-accent) 8%, var(--tool-surface) 70%);
  border: 2px dashed color-mix(in srgb, var(--tool-accent) 55%, transparent);
  border-radius: 16px;
  font: 800 12px Inter, "Open Sans", sans-serif;
  text-align: center;
  touch-action: manipulation;
}
button.aero-panel-zone { cursor: pointer; }
.aero-panel-zone svg { width: 34px; height: 34px; fill: none; stroke: currentColor; stroke-width: 1.5; }
.aero-panel-zone svg rect + rect { fill: currentColor; stroke: none; opacity: .6; }
.aero-panel-zone.is-active { background: color-mix(in srgb, var(--tool-accent) 30%, var(--tool-surface) 55%); border-style: solid; border-color: var(--tool-accent); }
.aero-panel-zone[data-panel-zone="left"].is-active { box-shadow: inset 8px 0 0 var(--tool-accent); }
.aero-panel-zone[data-panel-zone="right"].is-active { box-shadow: inset -8px 0 0 var(--tool-accent); }
.aero-panel-zone[data-panel-zone="bottom"].is-active { box-shadow: inset 0 -8px 0 var(--tool-accent); }
.aero-panel-zone:focus-visible { outline: 3px solid var(--tool-focus); outline-offset: 2px; }
@media (prefers-reduced-motion: no-preference) {
  .aero-panel-zone { transition: background-color .12s ease, box-shadow .12s ease; }
}

/* Collapsed data panel. Under the instrument it is the bar with the tabs and a grip that
   can be pulled out (AeroToolShell.panelRail). At the side it takes no room (each tool
   gives it a column of 0): only its arrow shows, a tab centred on the right edge of the
   instrument and half outside it. */
.aero-panel-collapsed { position: relative; touch-action: none; }
.aero-panel-collapsed::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  background: color-mix(in srgb, var(--tool-accent) 38%, var(--tool-line));
  pointer-events: none;
}
@media (hover: hover) {
  .aero-panel-collapsed:hover::after { background: var(--tool-accent); }
}
@media (min-width: 901px), (min-width: 600px) and (max-height: 560px) {
  html:not([data-panel="bottom"]) .aero-panel-collapsed {
    min-width: 0 !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    overflow: visible !important;
    touch-action: auto;
  }
  html:not([data-panel="bottom"]) .aero-panel-collapsed::after { display: none; }
  html:not([data-panel="bottom"]) .aero-panel-collapsed .aero-panel-tabs { position: static; min-height: 0; padding: 0; border: 0; }
  html:not([data-panel="bottom"]) .aero-panel-collapsed .aero-panel-tabs [role="tablist"],
  html:not([data-panel="bottom"]) .aero-panel-collapsed .aero-panel-chip { display: none !important; }
  html:not([data-panel="bottom"]) .aero-panel-collapsed .aero-panel-toggle {
    position: absolute;
    z-index: 30;
    top: 50%;
    left: 0;
    width: 26px;
    height: 56px;
    margin: 0;
    transform: translate(-50%, -50%);
    color: var(--tool-text);
    background: color-mix(in srgb, var(--tool-surface) 92%, transparent);
    border: 1px solid var(--tool-line);
    border-radius: 10px;
    box-shadow: var(--tool-float-shadow);
  }
  @media (hover: hover) {
    html:not([data-panel="bottom"]) .aero-panel-collapsed .aero-panel-toggle:hover { color: var(--tool-accent); background: var(--tool-accent-soft); }
  }
  html:not([data-panel="bottom"]) .aero-panel-collapsed .aero-panel-toggle[aria-expanded="false"]::before { transform: rotate(135deg) translate(-1px, -1px); }
}
@media (max-width: 900px) and (min-height: 561px), (max-width: 599px) {
  .aero-panel-collapsed { cursor: ns-resize; }
  .aero-panel-collapsed::after { top: 4px; left: 50%; width: 56px; height: 4px; transform: translateX(-50%); }
}
/* At the bottom by choice where the screen puts it at the side (an almost square screen,
   a computer's too): the folded bar of a tablet held upright. */
html[data-panel="bottom"][data-panel-from="right"] .aero-panel-collapsed { cursor: ns-resize; }
html[data-panel="bottom"][data-panel-from="right"] .aero-panel-collapsed::after { top: 4px; left: 50%; width: 56px; height: 4px; transform: translateX(-50%); }
/* The panel at a side by choice where the screen puts it at the bottom (an almost square
   screen, AeroToolShell.panelPlace): the arrow and the folded tab of the side, as above. */
html[data-panel-from="bottom"]:not([data-panel="bottom"]) .aero-panel-tabs { padding-left: 6px; }
html[data-panel-from="bottom"]:not([data-panel="bottom"]) .aero-panel-tabs > .aero-panel-toggle { order: -1; margin-left: 0; }
html[data-panel-from="bottom"]:not([data-panel="bottom"]) .aero-panel-toggle::before { transform: rotate(-45deg) translate(-2px, -2px); }
html[data-panel-from="bottom"]:not([data-panel="bottom"]) .aero-panel-collapsed {
  min-width: 0 !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  overflow: visible !important;
  touch-action: auto;
  cursor: auto;
}
html[data-panel-from="bottom"]:not([data-panel="bottom"]) .aero-panel-collapsed::after { display: none; }
html[data-panel-from="bottom"]:not([data-panel="bottom"]) .aero-panel-collapsed .aero-panel-tabs { position: static; min-height: 0; padding: 0; border: 0; }
html[data-panel-from="bottom"]:not([data-panel="bottom"]) .aero-panel-collapsed .aero-panel-tabs [role="tablist"],
html[data-panel-from="bottom"]:not([data-panel="bottom"]) .aero-panel-collapsed .aero-panel-chip { display: none !important; }
html[data-panel-from="bottom"]:not([data-panel="bottom"]) .aero-panel-collapsed .aero-panel-toggle {
  position: absolute;
  z-index: 30;
  top: 50%;
  left: 0;
  width: 26px;
  height: 56px;
  margin: 0;
  transform: translate(-50%, -50%);
  color: var(--tool-text);
  background: color-mix(in srgb, var(--tool-surface) 92%, transparent);
  border: 1px solid var(--tool-line);
  border-radius: 10px;
  box-shadow: var(--tool-float-shadow);
}
html[data-panel-from="bottom"]:not([data-panel="bottom"]) .aero-panel-collapsed .aero-panel-toggle[aria-expanded="false"]::before { transform: rotate(135deg) translate(-1px, -1px); }
/* The panel on the left (a choice): mirrored. The arrow goes last, at the edge facing the
   instrument, and points left, the way the panel folds; folded, the tab sits on the left
   edge of the instrument and points right. [data-panel-from] only outranks the rules
   above. */
html[data-panel="left"][data-panel-from] .aero-panel-tabs { padding-right: 6px; }
html[data-panel="left"][data-panel-from] .aero-panel-collapsed .aero-panel-tabs { padding: 0; }
html[data-panel="left"][data-panel-from] .aero-panel-tabs > .aero-panel-toggle { order: 0; margin-left: auto; }
html[data-panel="left"][data-panel-from] .aero-panel-toggle::before { transform: rotate(135deg) translate(-2px, -2px); }
html[data-panel="left"][data-panel-from] .aero-panel-collapsed .aero-panel-toggle { right: 0; left: auto; transform: translate(50%, -50%); }
html[data-panel="left"][data-panel-from] .aero-panel-collapsed .aero-panel-toggle[aria-expanded="false"]::before { transform: rotate(-45deg) translate(-1px, -1px); }
