/* CR3 layout on top of /assets/css/aero-tool-shell.css. The --cr3-* names
   point at the shared tokens so both tools use the same colours. */
:root {
    --cr3-bg: var(--tool-page);
    --cr3-surface: var(--tool-surface);
    --cr3-text: var(--tool-text);
    --cr3-muted: var(--tool-muted);
    --cr3-line: var(--tool-line);
    --cr3-accent: var(--tool-accent);
    --cr3-accent-fill: var(--tool-accent-fill);
    --cr3-tint: var(--tool-accent-soft);
    --cr3-canvas: var(--tool-canvas);
    --cr3-shadow: var(--tool-shadow);
    --cr3-tutorial-mark: var(--tool-cue);
    --cr3-result: var(--tool-result);
    --cr3-result-bg: var(--tool-result-bg);
    --cr3-result-line: var(--tool-result-line);
    --cr3-slider: #d4dced;
    --cr3-thumb-border: #ffffff;
}

html[data-theme="dark"] {
    --cr3-slider: #46516e;
    --cr3-thumb-border: #e1e7f4;
}

html, body { margin: 0; overflow: hidden; }
body.cr3-study {
    color: var(--cr3-text);
    background: var(--cr3-bg);
    font-family: Inter, "Open Sans", sans-serif;
}
body.cr3-study *, body.cr3-study *::before, body.cr3-study *::after { box-sizing: border-box; }
:where(body.cr3-study button, body.cr3-study input, body.cr3-study select) { font: inherit; }
/* Without it, iOS WebKit (Safari and Chrome on iPhone) reads two quick taps on Next as a
   double tap and zooms the page: it ignores maximum-scale=1. The arrows are <a>, and a tap
   that misses them lands on their bar, so both are here. */
body.cr3-study button, body.cr3-study label, body.cr3-study input[type="range"],
body.cr3-study a, body.cr3-study .tool_calc_btn_menu { touch-action: manipulation; }
body.cr3-study button:focus-visible,
body.cr3-study a:focus-visible,
body.cr3-study input:focus-visible,
body.cr3-study select:focus-visible,
body.cr3-study label:has(input:focus-visible) {
    outline: 3px solid var(--tool-focus);
    outline-offset: 3px;
}


html[data-theme="dark"] body.cr3-study #CR3_obj {
    filter:
        drop-shadow(0 0 1px rgba(143, 180, 230, 0.65))
        drop-shadow(0 18px 24px rgba(0, 0, 0, 0.62));
}
html[data-theme="dark"] body.cr3-study :is(
    .cr3_toolbar_ver img,
    .cr3_toolbar_hor img,
    .cr3_toolbar_hor input[type="image"],
    #cr3_tool_ctrl_showbtn img,
    .cr3_calc_expl_btn img
) { filter: invert(93%) sepia(8%) saturate(155%) hue-rotate(112deg) brightness(101%); }
html[data-theme="dark"] body.cr3-study #explanation .tool_calc_explslide > .cr3_tool_btn img { filter: brightness(0) invert(1); }
html[data-theme="dark"] body.cr3-study select option { color: var(--cr3-text); background: var(--cr3-surface); }

/* On the dark disk the tutorial marks are red: blue was lost on its colours. */
html[data-theme="dark"] body.cr3-study { --cr3-tutorial-mark: #ff1f3a; }
body.cr3-study #CR3_obj [id*="cr3_calc_"][stroke]:not([stroke="none"]) {
    stroke: var(--cr3-tutorial-mark) !important;
}
body.cr3-study #CR3_obj [id*="cr3_calc_"][fill]:not([fill="none"]) {
    fill: var(--cr3-tutorial-mark) !important;
}

body.cr3-study .background {
    position: fixed;
    inset: var(--tool-header-height, 58px) 0 0;
    width: auto;
    height: auto;
    box-shadow: none;
    background: var(--cr3-bg);
}
body.cr3-study .background .layer { display: none; }
body.cr3-study #cr3_windows {
    position: fixed;
    inset: var(--tool-header-height, 58px) 0 0;
    width: auto;
    height: auto;
    overflow: hidden;
}
body.cr3-study #cr3tool_container {
    height: calc(100% - 32px);
    margin: 16px;
    display: grid;
    grid-template-columns: 78px minmax(0, 1fr) 340px;
    grid-template-rows: 52px minmax(0, 1fr);
    gap: 10px 16px;
    position: relative;
}

.cr3-facebar {
    grid-area: 1 / 2;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    min-width: 0;
}

body.cr3-study .cr3_tool_menu { display: contents; }
body.cr3-study .cr3_toolbar {
    margin: 0 !important;
    padding: 7px 5px;
    position: relative;
    z-index: 24;
    display: flex;
    background: var(--cr3-surface);
    background-image: none;
    border: 1px solid var(--cr3-line);
    border-radius: 15px;
    box-shadow: var(--cr3-shadow);
    overflow: visible;
    /* index.css gives it `transition: 0.8s` on everything, and cr3-study arrives by script
       (cr3_ui.js): the toolbar faded in from white, in dark mode too. */
    transition: none;
}
body.cr3-study .cr3_toolbar_ver {
    grid-area: 1 / 1 / 3 / 2;
    width: 78px;
    align-self: center;
    flex-direction: column;
    gap: 3px;
}
body.cr3-study .cr3_toolbar_hor {
    grid-area: 2 / 2;
    width: auto;
    height: 48px;
    align-self: end;
    justify-self: center;
    flex-direction: row;
    padding: 5px 10px;
    gap: 7px;
}
body.cr3-study .cr3_toolbar_ver > .cr3_tool_ctrl,
body.cr3-study .cr3_toolbar_ver > .cr3_tool_btn,
body.cr3-study .cr3_toolbar_hor > .cr3_tool_ctrl,
body.cr3-study .cr3_toolbar_hor > .cr3_tool_btn { margin: 0; }
body.cr3-study .cr3_tool_ctrl,
body.cr3-study .cr3_tool_btn { border: 0; border-radius: 9px; }
body.cr3-study .cr3_toolbar_ver > .cr3_tool_ctrl,
body.cr3-study .cr3_toolbar_ver > .cr3_tool_btn,
body.cr3-study .cr3-trace-toggle,
body.cr3-study .cr3-lock-toggle {
    width: 66px;
    min-height: 58px;
}
body.cr3-study .cr3_toolbar_ver .cr3_tool_ctrl > label,
body.cr3-study .cr3-trace-toggle,
body.cr3-study .cr3-lock-toggle {
    width: 100%;
    min-height: 58px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 5px;
    color: var(--cr3-text);
    background: transparent;
    border: 0;
    border-radius: 10px;
    font-size: 9px;
    font-weight: 600;
    line-height: 1.1;
    cursor: pointer;
    box-shadow: none;
    text-shadow: none;
}
body.cr3-study .cr3_toolbar_ver .cr3_tool_ctrl > label > img,
body.cr3-study .cr3-trace-toggle img,
body.cr3-study .cr3-lock-toggle .aero-lock-icon { width: 25px; height: 25px; object-fit: contain; }
body.cr3-study .cr3_toolbar_ver .cr3_tool_ctrl > input:checked ~ label,
body.cr3-study .cr3-trace-toggle[aria-expanded="true"],
body.cr3-study .cr3-lock-toggle[aria-pressed="true"] { color: var(--cr3-accent); background: var(--cr3-tint); }
/* Only with a mouse: on a phone :hover sticks after a tap, and a lock just released
   looked still on. */
@media (hover: hover) {
    body.cr3-study .cr3_toolbar_ver .cr3_tool_ctrl > label:hover,
    body.cr3-study .cr3-trace-toggle:hover,
    body.cr3-study .cr3-lock-toggle:hover { color: var(--cr3-accent); background: var(--cr3-tint); }
}
/* Undo and Clear with nothing to undo or clear, as in the CRP-5. */
body.cr3-study .cr3_toolbar_ver .cr3_tool_btn > input:disabled ~ label { opacity: .42; cursor: default; }
body.cr3-study .cr3_toolbar_ver .cr3_tool_btn > input:disabled ~ label:hover { color: var(--cr3-text); background: transparent !important; }
body.cr3-study .cr3-trace-toggle span,
body.cr3-study .cr3-lock-toggle span { width: auto; font-size: 9px; line-height: 1.1; }
/* The lock of the disk (instrumentLock) only where a finger turns it. */
body.cr3-study .cr3_toolbar_ver > .cr3-lock-toggle { display: none; }
.cr3-tool-name { display: block; }
/* A gap, not a line, between the modes and undo/clear: as in the CRP-5. */
.cr3-tool-separator { height: 0; margin: 3px 0; }
body.cr3-study .cr3_toolbar_ver > hr { display: none; }
.cr3-draw-popover {
    position: absolute;
    left: calc(100% + 9px);
    top: 50%;
    width: 64px;
    display: none;
    flex-direction: column;
    gap: 4px;
    padding: 6px;
    transform: translateY(-50%);
    background: var(--cr3-surface);
    border: 1px solid var(--cr3-line);
    border-radius: 13px;
    box-shadow: var(--cr3-shadow);
}
.cr3-draw-popover.is-open { display: flex; }
.cr3-draw-popover.is-contextual {
    position: fixed;
    inset: auto;
    width: auto;
    flex-direction: row;
    transform: none;
    z-index: 60;
}
.cr3-draw-popover .cr3_tool_ctrl { width: 50px; height: 50px; }
.cr3-draw-popover .cr3_tool_ctrl label { width: 50px; height: 50px; display: grid; place-items: center; }
.cr3-draw-popover img { width: 28px !important; height: 28px !important; }

body.cr3-study .cr3_toolbar_hor .cr3_tool_ctrl,
body.cr3-study .cr3_toolbar_hor .cr3_tool_btn { width: 36px; height: 36px; }
body.cr3-study .cr3_toolbar_hor .cr3_tool_ctrl > label,
body.cr3-study .cr3_toolbar_hor .cr3_tool_ctrl > label > img,
body.cr3-study .cr3_toolbar_hor > input[type="image"] { width: 36px; height: 36px; }
body.cr3-study .cr3_toolbar_hor .cr3_tool_ctrl > label {
    display: grid;
    place-items: center;
    color: var(--cr3-text);
    background: transparent;
    border: 0;
    border-radius: 9px;
    box-shadow: none;
    text-shadow: none;
}
@media (hover: hover) {
    body.cr3-study .cr3_toolbar_hor .cr3_tool_ctrl > label:hover { background: var(--cr3-tint) !important; }
}
body.cr3-study #cr3_sizectrl { width: clamp(150px, 20vw, 240px); min-width: 150px; padding: 0 6px; }
body.cr3-study #cr3_sizectrl {
    height: 36px;
    appearance: none;
    -webkit-appearance: none;
    background: transparent;
    cursor: ew-resize;
    accent-color: var(--cr3-accent);
}
body.cr3-study #cr3_sizectrl::-webkit-slider-runnable-track {
    height: 6px;
    background: var(--cr3-slider);
    border-radius: 999px;
}
body.cr3-study #cr3_sizectrl::-webkit-slider-thumb {
    width: 18px;
    height: 18px;
    margin-top: -6px;
    appearance: none;
    -webkit-appearance: none;
    background: var(--cr3-accent);
    border: 3px solid var(--cr3-thumb-border);
    border-radius: 50%;
    box-shadow: 0 1px 5px rgba(24, 34, 97, 0.3);
}
body.cr3-study #cr3_sizectrl::-moz-range-track {
    height: 6px;
    background: var(--cr3-slider);
    border: 0;
    border-radius: 999px;
}
body.cr3-study #cr3_sizectrl::-moz-range-thumb {
    width: 14px;
    height: 14px;
    background: var(--cr3-accent);
    border: 3px solid var(--cr3-thumb-border);
    border-radius: 50%;
    box-shadow: 0 1px 5px rgba(24, 34, 97, 0.3);
}
body.cr3-study #cr3_tool_swapside { display: none; }
body.cr3-study #cr3_tool_swapside + label { display: none; }

body.cr3-study #CR3_container {
    grid-area: 2 / 2;
    position: relative !important;
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
    container-type: size;
    display: grid;
    place-items: center;
    overflow: hidden;
    touch-action: none;
    cursor: grab;
}
body.cr3-study #CR3_obj {
    position: relative;
    z-index: 2;
    display: block;
    width: min(92cqw, calc(100cqh - 64px));
    height: min(92cqw, calc(100cqh - 64px));
    aspect-ratio: 1;
    filter: drop-shadow(0 12px 12px rgba(24, 34, 97, 0.16));
    /* Scaled while the camera glides or the panel is dragged (fitDisk in cr3_ui.js). */
    will-change: transform;
}
/* Before the others: moving, drawing and a turn under way win over it. */
body.cr3-study #CR3_container.cr3-outside-disk { cursor: grab; }
body.cr3-study.cr3-moving #CR3_container { cursor: grab; }
body.cr3-study #CR3_container.is-panning { cursor: grabbing; }
body.cr3-study.cr3-drawing #CR3_container { cursor: crosshair; }
body.cr3-study.cr3-rotating #CR3_container { cursor: grabbing; }

body.cr3-study #tool_calc_container,
body.cr3-study #explanation {
    grid-area: 1 / 3 / 3 / 4;
    position: relative;
    inset: auto;
    width: 100%;
    min-width: 0;
    max-width: none;
    height: 100%;
    max-height: none;
    margin: 0 !important;
    padding: 0;
    color: var(--cr3-text);
    background: var(--cr3-surface);
    background-image: none;
    border: 1px solid var(--cr3-line);
    border-radius: var(--tool-radius);
    box-shadow: var(--cr3-shadow);
    overflow: hidden;
    align-items: stretch;
}
body.cr3-study #tool_calc_container { display: flex; flex-direction: column; }
/* Shorter than its fields, Calculate and the result (a phone on its side, or the panel pulled
   small), the Data panel scrolls and its tabs stay. It was cut off: Calculate out of reach. */
body.cr3-study #tool_calc_container:not(.cr3_calc_hide) { overflow-y: auto; overscroll-behavior: contain; }
/* Not folded: there the tabs would hold the arrow of the rail (a sticky box positions it). */
body.cr3-study #tool_calc_container:not(.cr3_calc_hide):not(.aero-panel-collapsed) > .cr3-panel-tabs { position: sticky; top: 0; z-index: 3; background: var(--cr3-surface); }
body.cr3-study #tool_calc_container.cr3_calc_hide {
    width: 100%;
    height: auto;
    max-height: none;
    align-self: start;
}
body.cr3-study #tool_calc_container.cr3_calc_hide > :not(.cr3-panel-tabs) { display: none !important; }
body.cr3-study #tool_calc_container.cr3_calc_hide > .cr3-panel-tabs { border-bottom: 0; }
/* Folded explanation (setExplanationCollapsed in cr3_ui.js): only its header, as the data. */
body.cr3-reading.cr3-explanation-collapsed #explanation > :not(.cr3-explanation-tabs) { display: none !important; }
body.cr3-reading.cr3-explanation-collapsed #explanation > .cr3-explanation-tabs { border-bottom: 0; }
body.cr3-reading.cr3-explanation-collapsed .cr3-panel-resizer { display: none !important; }
body.cr3-study #cr3_tool_ctrl_showbtn { display: none !important; }
.cr3-data-heading { padding: 22px 24px 0; }
.cr3-mode-label { padding: 20px 24px 7px; }
body.cr3-study #tool_calc_selec {
    position: static;
    width: calc(100% - 48px);
    margin: 0 24px;
}
body.cr3-study #tool_calc_param_container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 17px 14px;
    margin: 18px 24px 12px;
    text-align: left;
}
body.cr3-study .tool_calc_param { display: flex; min-width: 0; margin: 0; flex-direction: column; gap: 5px; }
body.cr3-study .tool_calc_param > label { color: var(--cr3-muted); font-size: 10px; white-space: normal; }
body.cr3-study .tool_calc_param > input {
    width: 100%;
    min-height: 40px;
    margin: 0;
    padding: 0 4px;
    color: var(--cr3-text);
    background: transparent;
    border: 0;
    border-bottom: 1px solid var(--cr3-line);
    font-size: 22px;
    text-align: left;
    font-variant-numeric: tabular-nums;
}
body.cr3-study #tool_calc_result {
    display: none;
    min-width: 0;
    margin: 0;
    padding: 15px 17px 17px;
    color: var(--cr3-result);
    background: var(--cr3-result-bg);
    border: 1px solid var(--cr3-result-line);
    border-radius: 12px;
    text-align: left;
}
body.cr3-study #tool_calc_result:not(:empty) { display: block; }
body.cr3-study #tool_calc_result:not(:empty)::before {
    content: "Result";
    display: block;
    margin-bottom: 7px;
    color: var(--cr3-muted);
    font-size: 9px;
    font-weight: 750;
    letter-spacing: 0.13em;
    text-transform: uppercase;
}
html[lang="es"] body.cr3-study #tool_calc_result:not(:empty)::before { content: "Resultado"; }
/* Input errors (cr3_utils_showalert) take the place of the result. */
body.cr3-study #tool_calc_result.is-error {
    color: var(--tool-error);
    background: transparent;
    border-color: currentColor;
    font-size: 13px;
    line-height: 1.45;
}
html[lang] body.cr3-study #tool_calc_result.is-error::before { content: none; display: none; }
body.cr3-study #tool_calc_result b {
    display: block;
    font-size: clamp(20px, 1.25vw, 25px);
    font-variant-numeric: tabular-nums;
    line-height: 1.22;
}
body.cr3-study #tool_calc_result ul {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
    margin: 0;
    padding: 0;
    list-style: none;
}
body.cr3-study #tool_calc_result li {
    min-width: 0;
    font-size: 15px;
    overflow-wrap: anywhere;
    white-space: normal;
}
body.cr3-study #tool_calc_container > .tool_calc_btn_menu {
    width: auto;
    margin: 8px 24px 20px;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
}
body.cr3-study #tool_calc_container > .tool_calc_btn_menu .cr3_tool_ctrl { border: 0; }
body.cr3-study #tool_calc_container > .tool_calc_btn_menu label {
    width: 100%;
    min-height: 48px;
    display: grid;
    place-items: center;
    padding: 7px 10px !important;
    color: var(--cr3-accent);
    background: var(--cr3-tint);
    border: 0;
    border-radius: 11px;
    font-size: 14px;
    font-weight: 750;
    cursor: pointer;
}
body.cr3-study #tool_calc_container > .tool_calc_btn_menu > .cr3-calculate-action label {
    color: #fff;
    background: var(--cr3-accent-fill);
}
body.cr3-study #tool_calc_container > .tool_calc_btn_menu > .cr3-open-explanation-action label {
    color: var(--cr3-accent);
    background: var(--cr3-tint);
}

body.cr3-study input#cr3_tool_expl_btn:checked ~ #explanation { display: flex; }
body.cr3-study #explanation { z-index: 26; flex-direction: column; justify-content: stretch; }
.cr3-panel-resizer {
    position: absolute;
    z-index: 8;
    display: none;
    touch-action: none;
    outline: 0;
}
.cr3-panel-resizer::before {
    content: "";
    position: absolute;
    background: var(--cr3-line);
    border-radius: 999px;
    transition: background-color 160ms ease, transform 160ms ease;
}
.cr3-panel-resizer:hover::before,
.cr3-panel-resizer:focus-visible::before,
body.cr3-resizing-panel .cr3-panel-resizer::before { background: var(--cr3-accent); }
.cr3-panel-resizer:focus-visible { outline: 3px solid var(--tool-focus); outline-offset: -3px; }
body.cr3-resizing-panel { user-select: none; }
body.cr3-resizing-panel-side { cursor: col-resize; }
body.cr3-resizing-panel-stacked { cursor: row-resize; }
body.cr3-study .cr3_calc_expl_btn { display: none !important; }
.cr3-reading-eyebrow,
#explanation > .aero-explanation-head { flex: 0 0 auto; padding: clamp(20px, 3vh, 34px) clamp(24px, 2vw, 36px) 0; }
/* With the Animation choice beside it (offerAutoPlay) its box takes the padding. */
#explanation > .aero-explanation-head > .cr3-reading-eyebrow { padding: 0; }
body.cr3-study #tool_calc_expl_expl {
    flex: 1 1 auto;
    min-height: 0;
    padding: 0 clamp(24px, 2vw, 36px) 20px;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
}
body.cr3-study .tool_calc_explslide {
    width: 100%;
    height: auto;
    min-height: 0;
    align-content: start;
    justify-content: flex-start;
    overflow: visible;
}
body.cr3-study .tool_calc_expl_title {
    flex: 0 0 auto;
    max-width: 22ch;
    margin: 0 34px 14px 0;
    color: var(--cr3-text);
    font-size: clamp(25px, 1.2rem + 0.55vw, 34px);
    line-height: 1.15;
    text-align: left;
    letter-spacing: -0.03em;
    font-weight: 600;
}
body.cr3-study .tool_calc_expl_text {
    flex: 0 0 auto;
    width: auto;
    max-width: 62ch;
    padding: 0;
    overflow: visible;
    color: var(--cr3-muted);
    font-size: clamp(15px, 0.82rem + 0.22vw, 19px);
    line-height: 1.65;
}
body.cr3-study .tool_calc_expl_text p { margin: 0 0 1.15em; }
body.cr3-study #explanation .tool_calc_explslide > .cr3_tool_btn {
    flex: 0 0 auto;
    width: 100%;
    min-height: 48px;
    display: block;
    max-width: none;
    margin-top: 16px;
}
body.cr3-study #explanation .tool_calc_explslide > .cr3_tool_btn label {
    width: 100%;
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #fff;
    background: var(--cr3-accent-fill);
    border-radius: 11px;
    cursor: pointer;
}
body.cr3-study #explanation .tool_calc_explslide > .cr3_tool_btn img {
    width: 22px;
    height: 22px;
    display: block !important;
    flex: 0 0 22px !important;
    filter: brightness(0) invert(1);
}
body.cr3-study .cr3-play-label { font-size: 14px; font-weight: 650; }
body.cr3-study #explanation > .tool_calc_btn_menu { width: auto; }

.cr3-returnbar {
    display: none;
    z-index: 28;
    align-items: center;
    gap: 9px;
    padding: 5px 12px;
    color: var(--cr3-text);
    background: var(--cr3-surface);
    border: 1px solid var(--cr3-line);
    border-radius: 12px;
    box-shadow: var(--cr3-shadow);
    font-size: 11px;
}
.cr3-returnbar-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--cr3-accent); }
.cr3-returnbar button { min-height: 42px; color: inherit; background: transparent; border: 0; border-radius: 8px; cursor: pointer; }
.cr3-returnbar-main { flex: 1; text-align: right; }
.cr3-returnbar-replay { width: 42px; font-size: 21px; }

body.cr3-study #language_picker { display: none !important; }
body.cr3-study #cr3_home_logo { display: none; }

/* On a desktop the drawing tools stay while reading the explanation; on
   small screens the panel needs their space. */
@media (max-width: 900px), (max-height: 560px) {
    body.cr3-reading .cr3_toolbar_ver { display: none; }
}
body.cr3-reading #tool_calc_container { display: none; }
body.cr3-reading #cr3tool_container { grid-template-columns: minmax(0, 1fr) 340px; }
body.cr3-reading .cr3-facebar { grid-area: 1 / 1; }
body.cr3-reading #CR3_container,
body.cr3-reading .cr3_toolbar_hor { grid-column: 1; }
body.cr3-reading #tool_calc_container,
body.cr3-reading #explanation { grid-area: 1 / 2 / 3 / 3; }

@media (max-width: 900px) and (min-height: 561px), (max-width: 599px) and (orientation: portrait) {
    body.cr3-study #cr3tool_container,
    body.cr3-reading #cr3tool_container {
        height: calc(100% - 8px);
        margin: 4px 9px;
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: 46px minmax(100px, 1fr) 62px min(205px, 29vh);
        grid-template-rows: 46px minmax(100px, 1fr) 62px min(205px, 29dvh);
        gap: 6px;
    }
    .cr3-facebar, body.cr3-reading .cr3-facebar { grid-area: 1 / 1; justify-content: center; }
    body.cr3-study #CR3_container, body.cr3-reading #CR3_container { grid-area: 2 / 1; border-radius: 16px; }
    body.cr3-study #CR3_obj { width: min(98cqw, calc(100cqh - 54px)); height: min(98cqw, calc(100cqh - 54px)); }
    body.cr3-study .cr3_toolbar_ver {
        grid-area: 3 / 1;
        width: 100%;
        align-self: stretch;
        flex-direction: row;
        justify-content: space-around;
        padding: 3px;
        gap: 2px;
        box-shadow: none;
    }
    body.cr3-study .cr3_toolbar_ver > .cr3_tool_ctrl,
    body.cr3-study .cr3_toolbar_ver > .cr3_tool_btn,
    body.cr3-study .cr3-trace-toggle,
    body.cr3-study .cr3-lock-toggle { width: auto; min-width: 50px; min-height: 54px; flex: 1; }
    body.cr3-study .cr3_toolbar_ver .cr3_tool_ctrl > label,
    body.cr3-study .cr3-trace-toggle,
    body.cr3-study .cr3-lock-toggle { min-height: 54px; gap: 2px; }
    body.cr3-study .cr3_toolbar_ver .cr3_tool_ctrl > label > img,
    body.cr3-study .cr3-trace-toggle img,
    body.cr3-study .cr3-lock-toggle .aero-lock-icon { width: 23px; height: 23px; }
    .cr3-tool-separator { display: none; }
    .cr3-draw-popover { left: 50%; top: auto; bottom: calc(100% + 7px); width: auto; flex-direction: row; transform: translateX(-50%); }
    .cr3-draw-popover .cr3_tool_ctrl { flex: 0 0 48px; }
    body.cr3-study .cr3_toolbar_hor, body.cr3-reading .cr3_toolbar_hor { grid-area: 2 / 1; align-self: end; }
    body.cr3-study #tool_calc_container,
    body.cr3-study #explanation,
    body.cr3-reading #tool_calc_container,
    body.cr3-reading #explanation {
        grid-area: 4 / 1;
        border-radius: 14px 14px 0 0;
        box-shadow: none;
    }
    .cr3-data-heading { display: none; }
    .cr3-mode-label { padding: 10px 14px 5px; }
    body.cr3-study #tool_calc_selec { width: calc(100% - 28px); margin: 0 14px; }
    body.cr3-study #tool_calc_param_container { grid-template-columns: repeat(4, 1fr); gap: 6px 8px; margin: 8px 14px 7px; }
    body.cr3-study .tool_calc_param > label { font-size: 9px; }
    body.cr3-study .tool_calc_param > input { min-height: 34px; font-size: 18px; }
    body.cr3-study #tool_calc_container > .tool_calc_btn_menu {
        width: auto;
        margin: 4px 14px 9px;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        grid-template-areas:
            "calculate explanation"
            "result result";
        gap: 6px 8px;
    }
    body.cr3-study .cr3-calculate-action { grid-area: calculate; }
    body.cr3-study .cr3-open-explanation-action { grid-area: explanation; }
    body.cr3-study #tool_calc_result { grid-area: result; padding: 8px 10px 9px; }
    body.cr3-study #tool_calc_result:not(:empty)::before { display: inline; margin: 0 8px 0 0; }
    body.cr3-study #tool_calc_result b { display: inline; font-size: 16px; }
    body.cr3-study #tool_calc_result ul { display: inline-grid; width: calc(100% - 72px); vertical-align: middle; }
    body.cr3-study #tool_calc_result li { font-size: 12px; }
    body.cr3-study #tool_calc_container > .tool_calc_btn_menu label { min-height: 40px; font-size: 12px; border-radius: 9px; }
    .cr3-reading-eyebrow, #explanation > .aero-explanation-head { padding: 16px 16px 0; }
    body.cr3-study #tool_calc_expl_expl { padding: 0 16px 12px; }
    body.cr3-study .tool_calc_expl_title { margin-bottom: 12px; font-size: 21px; }
    body.cr3-study .tool_calc_expl_text { font-size: 14px; line-height: 1.55; }
    body.cr3-reading #cr3tool_container { grid-template-rows: 46px minmax(100px, 1fr) min(520px, 60vh); }
    body.cr3-reading #cr3tool_container { grid-template-rows: 46px minmax(100px, 1fr) min(520px, 60dvh); }
    body.cr3-reading #explanation { grid-area: 3 / 1; }
    body.cr3-playing #cr3tool_container { grid-template-rows: 46px minmax(100px, 1fr) 54px; }
    body.cr3-playing #explanation { display: none !important; }
    body.cr3-playing .cr3-returnbar { display: flex; grid-area: 3 / 1; }
    body.cr3-playing .cr3_toolbar_hor { grid-area: 2 / 1; }
    body.cr3-data-collapsed #cr3tool_container {
        grid-template-rows: 46px minmax(100px, 1fr) 62px 54px;
    }
}



@media (max-width: 599px) and (orientation: portrait) and (max-height: 700px) {
    .cr3-mode-label { display: none; }
    body.cr3-study #tool_calc_selec { margin-top: 7px; }
    body.cr3-study #tool_calc_param_container { margin-top: 5px; margin-bottom: 4px; }
    body.cr3-study #tool_calc_container > .tool_calc_btn_menu { margin-bottom: 6px; }
}

@media (min-width: 600px) and (max-height: 560px) {
    body.cr3-study #cr3tool_container,
    body.cr3-reading #cr3tool_container {
        height: calc(100% - 10px);
        margin: 5px 11px;
        grid-template-columns: 62px minmax(0, 1fr) 280px;
        grid-template-rows: 44px minmax(0, 1fr);
        gap: 6px 10px;
    }
    body.cr3-study .cr3_toolbar_ver { grid-area: 1 / 1 / 3; width: 62px; padding: 3px; gap: 0; }
    body.cr3-study .cr3_toolbar_ver > .cr3_tool_ctrl,
    body.cr3-study .cr3_toolbar_ver > .cr3_tool_btn,
    body.cr3-study .cr3-trace-toggle,
    body.cr3-study .cr3-lock-toggle { width: 54px; min-height: 48px; }
    body.cr3-study .cr3_toolbar_ver .cr3_tool_ctrl > label,
    body.cr3-study .cr3-trace-toggle,
    body.cr3-study .cr3-lock-toggle { min-height: 48px; font-size: 8px; }
    body.cr3-study .cr3_toolbar_ver .cr3_tool_ctrl > label > img,
    body.cr3-study .cr3-trace-toggle img,
    body.cr3-study .cr3-lock-toggle .aero-lock-icon { width: 21px; height: 21px; }
    .cr3-facebar { grid-area: 1 / 3; justify-content: center; }
    body.cr3-study #CR3_container { grid-area: 1 / 2 / 3; border-radius: 14px; }
    body.cr3-study #CR3_obj { width: min(calc(100cqw - 62px), 98cqh); height: min(calc(100cqw - 62px), 98cqh); }
    body.cr3-study .cr3_toolbar_hor { grid-area: 1 / 2 / 3; align-self: center; justify-self: end; width: 48px; height: auto; flex-direction: column; padding: 5px; }
    body.cr3-study #cr3_sizectrl { width: 36px; min-width: 36px; height: 70px; padding: 0; writing-mode: vertical-lr; direction: rtl; }
    body.cr3-study #tool_calc_container,
    body.cr3-study #explanation { grid-area: 2 / 3; border-radius: 12px; }
    .cr3-data-heading { display: none; }
    .cr3-mode-label { padding: 8px 14px 4px; }
    body.cr3-study #tool_calc_selec { width: calc(100% - 28px); margin: 0 14px; }
    body.cr3-study #tool_calc_param_container { gap: 5px 11px; margin: 7px 14px; }
    body.cr3-study .tool_calc_param > input { min-height: 32px; font-size: 17px; }
    body.cr3-study #tool_calc_container > .tool_calc_btn_menu {
        margin: 4px 14px 8px;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        grid-template-areas:
            "calculate explanation"
            "result result";
        gap: 5px 7px;
    }
    body.cr3-study .cr3-calculate-action { grid-area: calculate; }
    body.cr3-study .cr3-open-explanation-action { grid-area: explanation; }
    body.cr3-study #tool_calc_result { grid-area: result; padding: 6px 8px 7px; }
    body.cr3-study #tool_calc_result:not(:empty)::before { display: inline; margin: 0 7px 0 0; }
    body.cr3-study #tool_calc_result b { display: inline; font-size: 14px; }
    body.cr3-study #tool_calc_result ul { display: inline-grid; width: calc(100% - 62px); vertical-align: middle; }
    body.cr3-study #tool_calc_result li { font-size: 10px; }
    body.cr3-study #tool_calc_container > .tool_calc_btn_menu label { min-height: 39px; font-size: 12px; border-radius: 9px; }
    body.cr3-reading #cr3tool_container { grid-template-columns: minmax(0, 1fr) clamp(340px, 42vw, 460px); }
    body.cr3-reading .cr3-facebar { grid-area: 1 / 2; }
    body.cr3-reading #CR3_container, body.cr3-reading .cr3_toolbar_hor { grid-column: 1; }
    body.cr3-reading #explanation { grid-area: 2 / 2; }
    .cr3-reading-eyebrow, #explanation > .aero-explanation-head { padding: 14px 16px 0; }
    body.cr3-study #tool_calc_expl_expl { padding: 0 16px 10px; }
    body.cr3-study .tool_calc_expl_title { margin-bottom: 10px; font-size: 22px; }
    body.cr3-study .tool_calc_expl_text { font-size: 15px; line-height: 1.55; }
    body.cr3-study #explanation .tool_calc_explslide > .cr3_tool_btn { min-height: 42px; margin-top: 5px; }
    body.cr3-study #explanation .tool_calc_explslide > .cr3_tool_btn label { min-height: 42px; }
    body.cr3-playing #cr3tool_container { grid-template-columns: minmax(0, 1fr) 210px; }
    body.cr3-playing #explanation { display: none !important; }
    body.cr3-playing .cr3-returnbar { display: flex; grid-area: 2 / 2; align-self: center; flex-wrap: wrap; padding: 13px; }
    body.cr3-playing .cr3-returnbar-main { flex-basis: 100%; text-align: left; }
}

/* The separator occupies the gap between the canvas and the active panel. */
@media (min-width: 901px) and (min-height: 561px) and (pointer: fine) {
    body.cr3-study #cr3tool_container,
    body.cr3-reading #cr3tool_container {
        --cr3-panel-gap: clamp(16px, 1.2vw, 32px);
        column-gap: var(--cr3-panel-gap);
    }
    body.cr3-study:not(.cr3-data-collapsed) #cr3tool_container > .cr3-panel-resizer,
    body.cr3-reading #cr3tool_container > .cr3-panel-resizer {
        position: relative;
        inset: auto;
        grid-area: 1 / 2;
        z-index: 28;
        width: var(--cr3-panel-gap);
        height: 100%;
        display: block;
        align-self: stretch;
        justify-self: start;
        transform: translateX(calc(-1 * var(--cr3-panel-gap)));
        cursor: col-resize;
    }
    body.cr3-study #cr3tool_container > .cr3-panel-resizer::before,
    body.cr3-reading #cr3tool_container > .cr3-panel-resizer::before {
        top: 50%;
        left: 50%;
        width: 4px;
        height: 58px;
        max-height: 18%;
        transform: translate(-50%, -50%);
        background: var(--cr3-line);
        box-shadow: none;
    }
    body.cr3-study #cr3tool_container > .cr3-panel-resizer:hover::before,
    body.cr3-study #cr3tool_container > .cr3-panel-resizer:focus-visible::before,
    body.cr3-reading #cr3tool_container > .cr3-panel-resizer:hover::before,
    body.cr3-reading #cr3tool_container > .cr3-panel-resizer:focus-visible::before,
    body.cr3-resizing-panel .cr3-panel-resizer::before {
        width: 6px;
        transform: translate(-50%, -50%);
        background: var(--cr3-accent);
    }
}

@media (max-width: 900px) and (min-height: 561px), (max-width: 599px) and (orientation: portrait) {
    body.cr3-study:not(.cr3-data-collapsed) #cr3tool_container > .cr3-panel-resizer,
    body.cr3-reading #cr3tool_container > .cr3-panel-resizer {
        position: relative;
        inset: auto;
        grid-area: 2 / 1;
        z-index: 28;
        width: 100%;
        height: 6px;
        display: block;
        align-self: start;
        justify-self: stretch;
        transform: translateY(-6px);
        cursor: row-resize;
    }
    body.cr3-study #cr3tool_container > .cr3-panel-resizer::before,
    body.cr3-reading #cr3tool_container > .cr3-panel-resizer::before {
        top: 50%;
        left: 50%;
        width: 58px;
        max-width: 18%;
        height: 4px;
        transform: translate(-50%, -50%);
        background: var(--cr3-line);
        box-shadow: none;
    }
    body.cr3-study #cr3tool_container > .cr3-panel-resizer:hover::before,
    body.cr3-study #cr3tool_container > .cr3-panel-resizer:focus-visible::before,
    body.cr3-reading #cr3tool_container > .cr3-panel-resizer:hover::before,
    body.cr3-reading #cr3tool_container > .cr3-panel-resizer:focus-visible::before,
    body.cr3-resizing-panel .cr3-panel-resizer::before {
        height: 6px;
        transform: translate(-50%, -50%);
        background: var(--cr3-accent);
    }
}

/* A phone on its side resizes the panel too, with the finger (a wider handle, below). */
@media (min-width: 600px) and (max-height: 560px) {
    body.cr3-study:not(.cr3-data-collapsed) #cr3tool_container > .cr3-panel-resizer,
    body.cr3-reading #cr3tool_container > .cr3-panel-resizer {
        position: relative;
        inset: auto;
        grid-area: 1 / 2;
        z-index: 28;
        width: 10px;
        height: 100%;
        display: block;
        align-self: stretch;
        justify-self: start;
        transform: translateX(-10px);
        cursor: col-resize;
    }
    body.cr3-study #cr3tool_container > .cr3-panel-resizer::before,
    body.cr3-reading #cr3tool_container > .cr3-panel-resizer::before {
        top: 50%;
        left: 50%;
        width: 4px;
        height: 48px;
        max-height: 20%;
        transform: translate(-50%, -50%);
        background: var(--cr3-line);
        box-shadow: none;
    }
    body.cr3-study #cr3tool_container > .cr3-panel-resizer:hover::before,
    body.cr3-study #cr3tool_container > .cr3-panel-resizer:focus-visible::before,
    body.cr3-reading #cr3tool_container > .cr3-panel-resizer:hover::before,
    body.cr3-reading #cr3tool_container > .cr3-panel-resizer:focus-visible::before,
    body.cr3-resizing-panel .cr3-panel-resizer::before {
        width: 6px;
        transform: translate(-50%, -50%);
        background: var(--cr3-accent);
    }
}
@media (pointer: coarse) and (min-width: 600px) and (max-height: 560px) {
    body.cr3-study:not(.cr3-data-collapsed) #cr3tool_container > .cr3-panel-resizer,
    body.cr3-reading #cr3tool_container > .cr3-panel-resizer { width: 24px; transform: translateX(-17px); }
}

/* The instrument controls share the CR3 canvas instead of consuming outer columns. */
@media (min-width: 901px) and (min-height: 561px) {
    body.cr3-study #cr3tool_container,
    body.cr3-reading #cr3tool_container {
        grid-template-columns: minmax(0, 1fr) 360px;
        grid-template-rows: minmax(0, 1fr);
        column-gap: clamp(16px, 1.2vw, 32px);
    }
    body.cr3-reading #cr3tool_container {
        grid-template-columns: minmax(0, 1fr) var(--cr3-panel-width, 360px);
    }
    body.cr3-study #CR3_container,
    body.cr3-reading #CR3_container { grid-area: 1 / 1; }
    body.cr3-study .cr3-facebar,
    body.cr3-reading .cr3-facebar {
        grid-area: 1 / 1;
        z-index: 25;
        align-self: start;
        justify-self: start;
        margin: 12px 0 0 12px;
    }
    body.cr3-study .cr3_toolbar_ver {
        grid-area: 1 / 1;
        z-index: 25;
        align-self: center;
        justify-self: start;
        margin-left: 12px !important;
    }
    body.cr3-study .cr3_toolbar_hor,
    body.cr3-reading .cr3_toolbar_hor {
        grid-area: 1 / 1;
        z-index: 25;
        margin-bottom: 12px !important;
    }
    body.cr3-study #tool_calc_container,
    body.cr3-study #explanation,
    body.cr3-reading #explanation { grid-area: 1 / 2; }
    body.cr3-reading #explanation {
        height: 100%;
        max-height: none;
        align-self: stretch;
        border-radius: 18px;
    }
    body.cr3-reading .cr3-panel-resizer {
        inset: 0 auto 0 0;
        width: 14px;
        display: block;
        cursor: col-resize;
    }
    body.cr3-reading .cr3-panel-resizer::before {
        top: 50%;
        left: 5px;
        width: 4px;
        height: 58px;
        max-height: 18%;
        transform: translateY(-50%);
    }
    body.cr3-reading .cr3-panel-resizer:hover::before,
    body.cr3-reading .cr3-panel-resizer:focus-visible::before,
    body.cr3-resizing-panel .cr3-panel-resizer::before { transform: translateY(-50%) scaleX(1.5); }
}

@media (max-width: 900px) and (min-height: 561px), (max-width: 599px) and (orientation: portrait) {
    body.cr3-study #cr3tool_container,
    body.cr3-reading #cr3tool_container {
        grid-template-rows: minmax(100px, 1fr) min(205px, 29vh);
        grid-template-rows: minmax(100px, 1fr) min(205px, 29dvh);
    }
    body.cr3-study .cr3-facebar,
    body.cr3-reading .cr3-facebar {
        grid-area: 1 / 1;
        z-index: 25;
        align-self: start;
        justify-self: center;
        width: auto;
        margin-top: 7px;
    }
    body.cr3-study #CR3_container,
    body.cr3-reading #CR3_container { grid-area: 1 / 1; }
    body.cr3-study .cr3_toolbar_hor,
    body.cr3-reading .cr3_toolbar_hor {
        grid-area: 1 / 1;
        z-index: 25;
        width: 48px;
        height: auto;
        align-self: center;
        justify-self: end;
        flex-direction: column;
        margin-right: 7px !important;
        padding: 5px;
    }
    body.cr3-study #cr3_sizectrl {
        width: 36px;
        min-width: 36px;
        height: 70px;
        padding: 0;
        writing-mode: vertical-lr;
        direction: rtl;
        cursor: ns-resize;
    }
    body.cr3-study .cr3_toolbar_ver {
        grid-area: 1 / 1;
        z-index: 25;
        width: min(430px, calc(100% - 64px));
        align-self: end;
        justify-self: center;
        margin-bottom: 7px !important;
    }
    body.cr3-study #tool_calc_container,
    body.cr3-study #explanation { grid-area: 2 / 1; }
    body.cr3-reading #cr3tool_container {
        grid-template-rows: minmax(100px, 1fr) var(--cr3-panel-height, min(520px, 60vh));
        grid-template-rows: minmax(100px, 1fr) var(--cr3-panel-height, min(520px, 60dvh));
    }
    body.cr3-reading #explanation { grid-area: 2 / 1; }
    body.cr3-reading .cr3-panel-resizer {
        inset: 0 0 auto;
        width: 100%;
        height: 12px;
        display: block;
        cursor: row-resize;
    }
    body.cr3-reading .cr3-panel-resizer::before {
        top: 4px;
        left: 50%;
        width: 58px;
        max-width: 18%;
        height: 4px;
        transform: translateX(-50%);
    }
    body.cr3-reading .cr3-panel-resizer:hover::before,
    body.cr3-reading .cr3-panel-resizer:focus-visible::before,
    body.cr3-resizing-panel .cr3-panel-resizer::before { transform: translateX(-50%) scaleY(1.5); }
    body.cr3-playing #cr3tool_container { grid-template-rows: minmax(100px, 1fr) 54px; }
    body.cr3-playing .cr3-returnbar { grid-area: 2 / 1; }
    body.cr3-data-collapsed #cr3tool_container { grid-template-rows: minmax(100px, 1fr) 54px; }
}

@media (max-width: 900px) and (min-height: 561px), (max-width: 599px) and (orientation: portrait) {
    /* With a result the Data panel is taller, unless the student has sized it (the
       separator: cr3_ui.js). Without the variable, the panel did not follow the drag
       after Calculate, in either method. */
    body.cr3-study:not(.cr3-reading):not(.cr3-data-collapsed):has(#tool_calc_result:not(:empty)) #cr3tool_container {
        grid-template-rows: minmax(100px, 1fr) var(--cr3-panel-height, min(275px, 48vh));
        grid-template-rows: minmax(100px, 1fr) var(--cr3-panel-height, min(275px, 48dvh));
    }
}

@media (min-width: 600px) and (max-height: 560px) {
    body.cr3-study #cr3tool_container,
    body.cr3-reading #cr3tool_container {
        grid-template-columns: minmax(0, 1fr) 280px;
        grid-template-rows: minmax(0, 1fr);
    }
    body.cr3-study #CR3_container,
    body.cr3-reading #CR3_container { grid-area: 1 / 1; }
    body.cr3-study #CR3_obj { margin-right: 0; }
    body.cr3-study .cr3-facebar,
    body.cr3-reading .cr3-facebar {
        grid-area: 1 / 1;
        z-index: 25;
        align-self: start;
        justify-self: start;
        width: auto;
        margin: 7px 0 0 7px;
    }
    body.cr3-study .cr3_toolbar_ver {
        grid-area: 1 / 1;
        z-index: 25;
        align-self: center;
        justify-self: start;
        margin-left: 7px !important;
    }
    body.cr3-study .cr3_toolbar_hor,
    body.cr3-reading .cr3_toolbar_hor { grid-area: 1 / 1; z-index: 25; margin-right: 7px !important; }
    body.cr3-study #tool_calc_container,
    body.cr3-study #explanation,
    body.cr3-reading #explanation { grid-area: 1 / 2; }
    body.cr3-reading #cr3tool_container { grid-template-columns: minmax(0, 1fr) var(--cr3-panel-width, 360px); }
    body.cr3-reading .cr3-panel-resizer {
        inset: 0 auto 0 0;
        width: 12px;
        display: block;
        cursor: col-resize;
    }
    body.cr3-reading .cr3-panel-resizer::before {
        top: 50%;
        left: 4px;
        width: 4px;
        height: 48px;
        max-height: 20%;
        transform: translateY(-50%);
    }
    body.cr3-reading .cr3-panel-resizer:hover::before,
    body.cr3-reading .cr3-panel-resizer:focus-visible::before,
    body.cr3-resizing-panel .cr3-panel-resizer::before { transform: translateY(-50%) scaleX(1.5); }
    body.cr3-playing #cr3tool_container { grid-template-columns: minmax(0, 1fr) 210px; }
    body.cr3-playing .cr3-returnbar { grid-area: 1 / 2; }
}

/* A tablet with a finger does not resize the panel at the side. A phone on its side does
   (24-oct-2026): there the panel is short and the instrument needs the room. */
@media (pointer: coarse) and (min-width: 901px) and (min-height: 561px), (max-width: 599px) and (orientation: landscape) {
    body.cr3-study .cr3-panel-resizer { display: none !important; }
}

/* The turning of the disk layers is what the explanation shows, so it keeps
   its transition; the rest of the interface stops moving. No transitions at
   all, rather than very short ones: with `transition-property: all` (the
   default) a duration made every change a transition, the rows of the grid
   too, and Safari measured the panel at its old size when the separator was
   let go, so it went back. Animations stay, short: the change of side waits
   for their animationend (index.js). */
@media (prefers-reduced-motion: reduce) {
    body.cr3-study *:not(.cr3_layer), body.cr3-study *::before, body.cr3-study *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition: none !important;
    }
}

/* Compact screens use direct manipulation: one finger rotates, two fingers pan/pinch. */
@media (max-width: 900px) and (min-height: 561px),
       (max-width: 599px) and (orientation: portrait),
       (min-width: 600px) and (max-height: 560px) {
    body.cr3-study .cr3-facebar,
    body.cr3-reading .cr3-facebar,
    body.cr3-face-a .cr3-facebar {
        grid-area: 1 / 1 !important;
        align-self: start;
        justify-self: start;
        width: auto;
        margin: 7px 0 0 7px;
    }
    body.cr3-study .cr3-facebar > .aero-segmented { padding: 2px; border-radius: 10px; }
    body.cr3-study .cr3-facebar > .aero-segmented button { min-height: 36px; padding: 0 10px; border-radius: 8px; font-size: 11px; }

    body.cr3-study .cr3_toolbar_hor,
    body.cr3-reading .cr3_toolbar_hor,
    body.cr3-face-a .cr3_toolbar_hor {
        grid-area: 1 / 1 !important;
        align-self: start;
        justify-self: end;
        width: 46px;
        height: 46px;
        margin: 7px 7px 0 0 !important;
        padding: 4px;
        flex-direction: row;
        gap: 0;
    }
    body.cr3-study .cr3_toolbar_hor > #cr3_sizectrl_zout,
    body.cr3-study .cr3_toolbar_hor > #cr3_sizectrl,
    body.cr3-study .cr3_toolbar_hor > #cr3_sizectrl_zin,
    body.cr3-study .cr3_toolbar_hor > :not(.cr3-reset-control) { display: none !important; }
    body.cr3-study .cr3_toolbar_hor .cr3-reset-control,
    body.cr3-study .cr3_toolbar_hor .cr3-reset-control > label,
    body.cr3-study .cr3_toolbar_hor .cr3-reset-control > label > img {
        width: 36px;
        height: 36px;
    }

    body.cr3-study .cr3_toolbar_ver {
        grid-area: 1 / 1 !important;
        align-self: end;
        justify-self: center;
        width: min(250px, calc(100% - 24px));
        margin: 0 0 7px !important;
        padding: 3px;
        flex-direction: row;
        justify-content: stretch;
        gap: 2px;
        box-shadow: var(--cr3-shadow);
    }
    body.cr3-study .cr3_toolbar_ver > .cr3-rotate-control,
    body.cr3-study .cr3_toolbar_ver > .cr3-move-control { display: none !important; }
    /* Where a finger turns the disk, the lock takes the place of Rotate and Move. */
    body.cr3-study .cr3_toolbar_ver > .cr3-lock-toggle { display: flex; }
    body.cr3-study .cr3_toolbar_ver > .cr3_tool_ctrl,
    body.cr3-study .cr3_toolbar_ver > .cr3_tool_btn,
    body.cr3-study .cr3-trace-toggle,
    body.cr3-study .cr3-lock-toggle {
        width: auto;
        min-width: 0;
        min-height: 48px;
        flex: 1 1 0;
    }
    body.cr3-study .cr3_toolbar_ver .cr3_tool_ctrl > label,
    body.cr3-study .cr3-trace-toggle,
    body.cr3-study .cr3-lock-toggle { min-height: 48px; gap: 2px; }
    body.cr3-study .cr3_toolbar_ver .cr3_tool_ctrl > label > img,
    body.cr3-study .cr3-trace-toggle img,
    body.cr3-study .cr3-lock-toggle .aero-lock-icon { width: 21px; height: 21px; }
    body.cr3-study .cr3-trace-toggle.is-active {
        color: var(--cr3-accent);
        background: var(--cr3-tint);
    }
    .cr3-tool-separator { display: none; }

}


/* Keep zoom direct: wheel, pinch and keyboard. The remaining control resets the view. */
body.cr3-study #cr3_sizectrl_zout,
body.cr3-study #cr3_sizectrl,
body.cr3-study #cr3_sizectrl_zin { display: none !important; }
body.cr3-study #tool_calc_container,
body.cr3-study #explanation {
    width: 100% !important;
    max-width: none !important;
    justify-self: stretch;
    transition: none;
}
body.cr3-study .cr3_toolbar_hor,
body.cr3-reading .cr3_toolbar_hor,
body.cr3-face-a .cr3_toolbar_hor {
    grid-area: 1 / 1 !important;
    width: 46px !important;
    height: 46px !important;
    align-self: start !important;
    justify-self: end !important;
    margin: 12px 12px 0 0 !important;
    padding: 4px !important;
    flex-direction: row !important;
    gap: 0 !important;
    background: color-mix(in srgb, var(--tool-surface) 92%, transparent);
    border-radius: 13px;
    box-shadow: var(--tool-float-shadow);
    backdrop-filter: blur(12px);
    transition: none;
}
body.cr3-study .cr3_toolbar_hor .cr3-reset-control,
body.cr3-study .cr3_toolbar_hor .cr3-reset-control > label,
body.cr3-study .cr3_toolbar_hor .cr3-reset-control > label > img {
    width: 36px;
    height: 36px;
}

/* The data and explanation views use the same resizable panel shell. */
@media (min-width: 901px) and (min-height: 561px) {
    body.cr3-study #cr3tool_container {
        grid-template-columns: minmax(0, 1fr) var(--cr3-panel-width, 360px);
    }
    body.cr3-reading #cr3tool_container {
        grid-template-columns: minmax(0, 1fr) var(--cr3-panel-width, 360px);
    }
    body.cr3-study.cr3-data-collapsed:not(.cr3-reading) #cr3tool_container,
    body.cr3-reading.cr3-explanation-collapsed #cr3tool_container {
        grid-template-columns: minmax(0, 1fr) 0;
        column-gap: 0;
    }
}

@media (min-width: 901px) and (min-height: 561px) and (pointer: fine),
       (min-width: 600px) and (max-height: 560px) and (pointer: fine) {
    body.cr3-study:not(.cr3-data-collapsed) #tool_calc_container > .cr3-panel-resizer,
    body.cr3-reading #explanation > .cr3-panel-resizer {
        inset: 0 auto 0 0;
        width: 14px;
        display: block;
        cursor: col-resize;
    }
    body.cr3-study #tool_calc_container > .cr3-panel-resizer::before,
    body.cr3-reading #explanation > .cr3-panel-resizer::before {
        top: 50%;
        left: 5px;
        width: 4px;
        height: 64px;
        max-height: 20%;
        transform: translateY(-50%);
        background: color-mix(in srgb, var(--cr3-accent) 38%, var(--cr3-line));
        box-shadow: 0 0 0 1px var(--cr3-surface);
    }
    body.cr3-study #tool_calc_container > .cr3-panel-resizer:hover::before,
    body.cr3-study #tool_calc_container > .cr3-panel-resizer:focus-visible::before,
    body.cr3-reading #explanation > .cr3-panel-resizer:hover::before,
    body.cr3-reading #explanation > .cr3-panel-resizer:focus-visible::before,
    body.cr3-resizing-panel .cr3-panel-resizer::before {
        transform: translateY(-50%) scaleX(1.5);
        background: var(--cr3-accent);
    }
}

@media (max-width: 900px) and (min-height: 561px), (max-width: 599px) and (orientation: portrait) {
    /* On a phone the disk is as wide as the screen and needs that plus 58px of height
       (diskBase in cr3_ui.js), plus room for the floating buttons above and below it;
       the height left over goes to the Data panel, up to 380px, so its fields show
       without dragging the separator. Never less than 205px / 29dvh, as before. The
       app adds its system bars to --cr3-reserved-height. */
    body.cr3-study #cr3tool_container {
        grid-template-rows: minmax(100px, 1fr) var(--cr3-panel-height, max(min(205px, 29dvh), min(380px, calc(100dvh - var(--cr3-reserved-height, var(--tool-header-height, 52px)) - 100vw - 110px))));
    }
    body.cr3-reading #cr3tool_container {
        grid-template-rows: minmax(100px, 1fr) var(--cr3-panel-height, min(520px, 60dvh));
    }
    body.cr3-study.cr3-data-collapsed:not(.cr3-reading) #cr3tool_container,
    body.cr3-reading.cr3-explanation-collapsed #cr3tool_container,
    body.cr3-playing #cr3tool_container {
        grid-template-rows: minmax(100px, 1fr) 54px;
    }
    body.cr3-study:not(.cr3-data-collapsed) #tool_calc_container > .cr3-panel-resizer,
    body.cr3-reading #explanation > .cr3-panel-resizer {
        inset: 0 0 auto;
        width: 100%;
        height: 14px;
        display: block;
        cursor: row-resize;
    }
    body.cr3-study #tool_calc_container > .cr3-panel-resizer::before,
    body.cr3-reading #explanation > .cr3-panel-resizer::before {
        top: 5px;
        left: 50%;
        width: 64px;
        max-width: 20%;
        height: 4px;
        transform: translateX(-50%);
        background: color-mix(in srgb, var(--cr3-accent) 38%, var(--cr3-line));
        box-shadow: 0 0 0 1px var(--cr3-surface);
    }
    body.cr3-study #tool_calc_container > .cr3-panel-resizer:hover::before,
    body.cr3-study #tool_calc_container > .cr3-panel-resizer:focus-visible::before,
    body.cr3-reading #explanation > .cr3-panel-resizer:hover::before,
    body.cr3-reading #explanation > .cr3-panel-resizer:focus-visible::before,
    body.cr3-resizing-panel .cr3-panel-resizer::before {
        transform: translateX(-50%) scaleY(1.5);
        background: var(--cr3-accent);
    }
}

@media (min-width: 600px) and (max-height: 560px) {
    body.cr3-study #cr3tool_container {
        grid-template-columns: minmax(0, 1fr) var(--cr3-panel-width, 360px);
    }
    body.cr3-reading #cr3tool_container {
        grid-template-columns: minmax(0, 1fr) var(--cr3-panel-width, 360px);
    }
    body.cr3-study.cr3-data-collapsed:not(.cr3-reading) #cr3tool_container,
    body.cr3-reading.cr3-explanation-collapsed #cr3tool_container {
        grid-template-columns: minmax(0, 1fr) 0;
        column-gap: 0;
    }
    body.cr3-study .cr3_toolbar_hor,
    body.cr3-reading .cr3_toolbar_hor,
    body.cr3-face-a .cr3_toolbar_hor { margin: 7px 7px 0 0 !important; }
}

@media (max-width: 900px) and (min-height: 561px),
       (max-width: 599px) and (orientation: portrait) {
    body.cr3-study .cr3_toolbar_hor,
    body.cr3-reading .cr3_toolbar_hor,
    body.cr3-face-a .cr3_toolbar_hor { margin: 7px 7px 0 0 !important; }
}

/* A finger needs a taller handle than the mouse: it overlaps the gap and the
   edges of the instrument and the panel. */
@media (pointer: coarse) and (max-width: 900px) and (min-height: 561px),
       (pointer: coarse) and (max-width: 599px) and (orientation: portrait) {
    body.cr3-study:not(.cr3-data-collapsed) #cr3tool_container > .cr3-panel-resizer,
    body.cr3-reading #cr3tool_container > .cr3-panel-resizer { height: 22px; transform: translateY(-14px); }
}

body.cr3-study .cr3_toolbar_ver .aero-tools-toggle { display: none; }
/* Phones: the tools fold into a button in the bottom-right corner and open
   upwards; the drawing tools open to their left. */
@media (max-width: 599px) and (orientation: portrait), (max-height: 560px) and (pointer: coarse) {
    body.cr3-study .cr3_toolbar_ver {
        width: auto !important;
        justify-self: end !important;
        align-self: end !important;
        margin: 0 7px 7px 0 !important;
        flex-direction: column-reverse !important;
        padding: 3px !important;
        gap: 2px !important;
        border-radius: 13px;
    }
    body.cr3-study .cr3_toolbar_ver .aero-tools-toggle { display: grid; }
    body.cr3-study .cr3_toolbar_ver:not(.is-open) > :not(.aero-tools-toggle):not(.cr3-draw-popover):not(.cr3-lock-toggle) { display: none !important; }
    body.cr3-study .cr3_toolbar_ver > .cr3_tool_ctrl,
    body.cr3-study .cr3_toolbar_ver > .cr3_tool_btn,
    body.cr3-study .cr3_toolbar_ver > .cr3-trace-toggle,
    body.cr3-study .cr3_toolbar_ver > .cr3-lock-toggle { flex: 0 0 auto !important; width: 50px !important; min-width: 0 !important; }
    body.cr3-study .cr3_toolbar_ver .cr3_tool_ctrl > label,
    body.cr3-study .cr3_toolbar_ver > .cr3-trace-toggle,
    body.cr3-study .cr3_toolbar_ver > .cr3-lock-toggle,
    body.cr3-study .cr3_toolbar_ver > .aero-tools-toggle { min-height: 50px; }
    body.cr3-study .cr3_toolbar_ver:has(.cr3-trace-toggle[aria-pressed="true"]) .aero-tools-toggle { color: var(--cr3-accent); background: var(--tool-accent-soft); }
    .cr3-draw-popover:not(.is-contextual) { left: auto; right: calc(100% + 7px); top: auto; bottom: 0; flex-direction: column; transform: none; }
}

/* Collapsed data panel at the side: a full-height rail with a grip. */
@media (min-width: 901px), (min-width: 600px) and (max-height: 560px) {
    body.cr3-study #tool_calc_container.cr3_calc_hide { height: 100%; align-self: stretch; }
    body.cr3-reading.cr3-explanation-collapsed .cr3-explanation-tabs > .aero-panel-tab { display: none; }
}

/* goToStep (cr3_ui.js): the steps before the one opened are played at once. */
body.cr3-instant #CR3_obj .cr3_layer { transition: none !important; }

/* Titles of the explanation on a phone, as in the other tools (aero-tool-shell.css). */
@media (max-width: 599px), (max-height: 560px) {
    body.cr3-study .tool_calc_expl_title { margin-bottom: 8px; font-size: 18px; }
}

/* The panel at a side by choice where the screen puts it at the bottom (an almost square
   screen, AeroToolShell.panelPlace): the grid of a phone on its side, resized with the
   finger at the side. The controls over the disk stay as on that screen. */
html[data-panel-from="bottom"]:not([data-panel="bottom"]) body.cr3-study #cr3tool_container,
html[data-panel-from="bottom"]:not([data-panel="bottom"]) body.cr3-reading #cr3tool_container,
html[data-panel-from="bottom"]:not([data-panel="bottom"]) body.cr3-study:not(.cr3-reading):not(.cr3-data-collapsed):has(#tool_calc_result:not(:empty)) #cr3tool_container {
    grid-template-columns: minmax(0, 1fr) var(--cr3-panel-width, 360px);
    grid-template-rows: minmax(0, 1fr);
    column-gap: 10px;
}
html[data-panel-from="bottom"]:not([data-panel="bottom"]) body.cr3-reading #cr3tool_container {
    grid-template-columns: minmax(0, 1fr) var(--cr3-panel-width, 360px);
}
html[data-panel-from="bottom"]:not([data-panel="bottom"]) body.cr3-study.cr3-data-collapsed:not(.cr3-reading) #cr3tool_container,
html[data-panel-from="bottom"]:not([data-panel="bottom"]) body.cr3-reading.cr3-explanation-collapsed #cr3tool_container {
    grid-template-columns: minmax(0, 1fr) 0;
    column-gap: 0;
}
html[data-panel-from="bottom"]:not([data-panel="bottom"]) body.cr3-playing #cr3tool_container { grid-template-columns: minmax(0, 1fr) 210px; }
html[data-panel-from="bottom"]:not([data-panel="bottom"]) body.cr3-playing .cr3-returnbar { grid-area: 1 / 2; }
html[data-panel-from="bottom"]:not([data-panel="bottom"]) body.cr3-study #tool_calc_container,
html[data-panel-from="bottom"]:not([data-panel="bottom"]) body.cr3-study #explanation,
html[data-panel-from="bottom"]:not([data-panel="bottom"]) body.cr3-reading #explanation { grid-area: 1 / 2; border-radius: 14px; }
html[data-panel-from="bottom"]:not([data-panel="bottom"]) body.cr3-study #tool_calc_container.cr3_calc_hide { height: 100%; align-self: stretch; }
html[data-panel-from="bottom"]:not([data-panel="bottom"]) body.cr3-reading.cr3-explanation-collapsed .cr3-explanation-tabs > .aero-panel-tab { display: none; }
html[data-panel-from="bottom"]:not([data-panel="bottom"]) body.cr3-study:not(.cr3-data-collapsed) #cr3tool_container > .cr3-panel-resizer,
html[data-panel-from="bottom"]:not([data-panel="bottom"]) body.cr3-reading #cr3tool_container > .cr3-panel-resizer {
    grid-area: 1 / 2;
    width: 24px;
    height: 100%;
    align-self: stretch;
    justify-self: start;
    transform: translateX(-17px);
    cursor: col-resize;
}
html[data-panel-from="bottom"]:not([data-panel="bottom"]) body.cr3-study #cr3tool_container > .cr3-panel-resizer::before,
html[data-panel-from="bottom"]:not([data-panel="bottom"]) body.cr3-reading #cr3tool_container > .cr3-panel-resizer::before {
    width: 4px;
    max-width: none;
    height: 48px;
    max-height: 20%;
}
html[data-panel-from="bottom"]:not([data-panel="bottom"]) body.cr3-study #cr3tool_container > .cr3-panel-resizer:hover::before,
html[data-panel-from="bottom"]:not([data-panel="bottom"]) body.cr3-study #cr3tool_container > .cr3-panel-resizer:focus-visible::before,
html[data-panel-from="bottom"]:not([data-panel="bottom"]) body.cr3-reading #cr3tool_container > .cr3-panel-resizer:hover::before,
html[data-panel-from="bottom"]:not([data-panel="bottom"]) body.cr3-reading #cr3tool_container > .cr3-panel-resizer:focus-visible::before,
html[data-panel-from="bottom"]:not([data-panel="bottom"]) body.cr3-resizing-panel .cr3-panel-resizer::before { width: 6px; height: 48px; }
html[data-panel-from="bottom"]:not([data-panel="bottom"]) body.cr3-resizing-panel { cursor: col-resize; }

/* The panel on the left (a choice): the grid mirrored, its contents as they are. The
   controls over the disk are cells of the same grid: they keep their side with left and
   right instead of start and end, and the separator moves into the gap the other way
   ([data-panel-from] only outranks the rules above). */
html[data-panel="left"] body.cr3-study #cr3tool_container { direction: rtl; }
html[data-panel="left"] body.cr3-study #cr3tool_container > * { direction: ltr; }
html[data-panel="left"] body.cr3-study .cr3-facebar { justify-self: left; }
html[data-panel="left"] body.cr3-study .cr3_toolbar_hor { justify-self: right !important; }
html[data-panel="left"][data-panel-from] body.cr3-study:not(.cr3-data-collapsed) #cr3tool_container > .cr3-panel-resizer,
html[data-panel="left"][data-panel-from] body.cr3-reading #cr3tool_container > .cr3-panel-resizer { transform: translateX(17px); }
@media (min-width: 901px) and (min-height: 561px) {
    html[data-panel="left"] body.cr3-study .cr3_toolbar_ver { justify-self: left; }
}
@media (max-height: 560px) and (pointer: coarse) {
    html[data-panel="left"] body.cr3-study .cr3_toolbar_ver { justify-self: right !important; }
}

/* The panel at the bottom by choice where the screen puts it at the side (an almost square
   screen, a computer's too): the panel under the disk as on a tablet held upright, resized
   up and down. The controls over the disk stay as on this screen. */
html[data-panel="bottom"][data-panel-from="right"] body.cr3-study #cr3tool_container,
html[data-panel="bottom"][data-panel-from="right"] body.cr3-reading #cr3tool_container,
html[data-panel="bottom"][data-panel-from="right"] body.cr3-study:not(.cr3-reading):not(.cr3-data-collapsed):has(#tool_calc_result:not(:empty)) #cr3tool_container {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(100px, 1fr) var(--cr3-panel-height, min(420px, 45vh));
    column-gap: 0;
    row-gap: 16px;
}
html[data-panel="bottom"][data-panel-from="right"] body.cr3-study.cr3-data-collapsed:not(.cr3-reading) #cr3tool_container,
html[data-panel="bottom"][data-panel-from="right"] body.cr3-reading.cr3-explanation-collapsed #cr3tool_container,
html[data-panel="bottom"][data-panel-from="right"] body.cr3-playing #cr3tool_container {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(100px, 1fr) 54px;
}
html[data-panel="bottom"][data-panel-from="right"] body.cr3-playing .cr3-returnbar { grid-area: 2 / 1; }
html[data-panel="bottom"][data-panel-from="right"] body.cr3-study #tool_calc_container,
html[data-panel="bottom"][data-panel-from="right"] body.cr3-study #explanation,
html[data-panel="bottom"][data-panel-from="right"] body.cr3-reading #explanation { grid-area: 2 / 1; }
html[data-panel="bottom"][data-panel-from="right"] body.cr3-reading.cr3-explanation-collapsed .cr3-explanation-tabs > .aero-panel-tab { display: inline-flex; }
html[data-panel="bottom"][data-panel-from="right"] body.cr3-study:not(.cr3-data-collapsed) #cr3tool_container > .cr3-panel-resizer,
html[data-panel="bottom"][data-panel-from="right"] body.cr3-reading #cr3tool_container > .cr3-panel-resizer {
    position: relative;
    inset: auto;
    grid-area: 2 / 1;
    z-index: 28;
    width: 100%;
    height: 12px;
    display: block !important;
    align-self: start;
    justify-self: stretch;
    transform: translateY(-14px);
    cursor: row-resize;
}
html[data-panel="bottom"][data-panel-from="right"] body.cr3-study #cr3tool_container > .cr3-panel-resizer::before,
html[data-panel="bottom"][data-panel-from="right"] body.cr3-reading #cr3tool_container > .cr3-panel-resizer::before {
    top: 50%;
    left: 50%;
    width: 58px;
    max-width: 18%;
    height: 4px;
    max-height: none;
    transform: translate(-50%, -50%);
    background: var(--cr3-line);
    box-shadow: none;
}
html[data-panel="bottom"][data-panel-from="right"] body.cr3-study #cr3tool_container > .cr3-panel-resizer:hover::before,
html[data-panel="bottom"][data-panel-from="right"] body.cr3-study #cr3tool_container > .cr3-panel-resizer:focus-visible::before,
html[data-panel="bottom"][data-panel-from="right"] body.cr3-reading #cr3tool_container > .cr3-panel-resizer:hover::before,
html[data-panel="bottom"][data-panel-from="right"] body.cr3-reading #cr3tool_container > .cr3-panel-resizer:focus-visible::before,
html[data-panel="bottom"][data-panel-from="right"] body.cr3-resizing-panel .cr3-panel-resizer::before {
    width: 58px;
    height: 6px;
    transform: translate(-50%, -50%);
    background: var(--cr3-accent);
}
html[data-panel="bottom"][data-panel-from="right"] body.cr3-resizing-panel { cursor: row-resize; }
html[data-panel="bottom"][data-panel-from="right"] body.cr3-study.cr3-data-collapsed:not(.cr3-reading) #cr3tool_container > .cr3-panel-resizer,
html[data-panel="bottom"][data-panel-from="right"] body.cr3-reading.cr3-explanation-collapsed #cr3tool_container > .cr3-panel-resizer { display: none !important; }
@media (pointer: coarse) {
    html[data-panel="bottom"][data-panel-from="right"] body.cr3-study:not(.cr3-data-collapsed) #cr3tool_container > .cr3-panel-resizer,
    html[data-panel="bottom"][data-panel-from="right"] body.cr3-reading #cr3tool_container > .cr3-panel-resizer { height: 22px; transform: translateY(-19px); }
}
