      *,
      *::before,
      *::after {
        box-sizing: border-box;
        margin: 0;
        padding: 0;
      }
      :root {
        --ink: #2b3038;
        --slate: #46525f;
        /* Controls' accents (sliders, the pressed choice, focus): a muted slate. */
        --accent: #8e9bab;
        --accent-soft: #e8ecf1;
        /* Ticked boxes: the green of a check mark. */
        --check: #3aa757;
        --marigold: #f2a541;
        --aqua: #5ec8bd;
        --coral: #d9573c;
        --cream: #ffffff;

        --desk: #f5f5f5;
        --text: #39434a;
        --sidebar-w: clamp(196px, 22.5vw, 288px);

        --sidebar-w-left: clamp(232px, 23vw, 300px);
      }
      html,
      body {
        height: 100%;
        font-family: "Prompt", sans-serif;
        background: var(--desk);
        color: var(--text);
        overflow: hidden;
      }
      #app {
        display: flex;
        flex-direction: column;
        height: 100vh;
        height: 100dvh;
        overflow: hidden;
      }
      header {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 0 20px;
        height: 64px;
        background: var(--ink);
        flex-shrink: 0;
      }
      header .logo {
        height: 40px;
        width: auto;
        display: block;
      }

      header .mark {
        height: 30px;
        width: 30px;
        display: block;
        flex-shrink: 0;
      }
      /* The Pro panel's PRO badge (Inter, outlined, square-ish corners), in white for the dark
         bar; filled once the account has Pro. */
      header .pro-pill {
        margin-left: auto;
        margin-right: 6px;
        padding: 5px 9px;
        border: 1.5px solid rgba(255, 255, 255, 0.85);
        border-radius: 8px;
        background: none;
        font: 700 0.85rem "Inter", system-ui, sans-serif;
        line-height: 1;
        letter-spacing: 0.06em;
        color: #fff;
        cursor: pointer;
        transition:
          background 0.15s,
          color 0.15s,
          border-color 0.15s;
      }
      header .pro-pill:hover {
        border-color: #fff;
        background: rgba(255, 255, 255, 0.1);
      }
      header .pro-pill:focus-visible {
        outline: 2px solid #fff;
        outline-offset: 2px;
      }
      header .pro-pill[hidden] {
        display: none;
      }
      header .pro-pill:not([hidden]) + .account-wrap {
        margin-left: 0;
      }
      header .account-wrap {
        margin-left: auto;
      }
      .legal-links .donate {
        display: inline-flex;
        vertical-align: -3px;
        margin-left: 4px;
        width: 20px;
        height: 20px;
        align-items: center;
        justify-content: center;
        border-radius: 50%;
        color: var(--coral);
        transition: transform 0.15s;
      }
      .legal-links .donate:hover {
        transform: scale(1.15);
        text-decoration: none;
      }
      .legal-links .donate svg {
        width: 15px;
        height: 15px;
        display: block;
      }
      header .donate {
        margin-left: auto;
        display: flex;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        border-radius: 50%;
        color: var(--coral);
        transition: background 0.15s, transform 0.15s;
      }
      header .donate:hover,
      header .donate:focus-visible {
        background: rgba(255, 255, 255, 0.08);
        transform: scale(1.1);
      }
      header .donate:focus-visible {
        outline: 2px solid var(--marigold);
        outline-offset: 2px;
      }
      header .donate svg {
        width: 24px;
        height: 24px;
        display: block;
      }
      main {
        display: flex;
        flex: 1;
        overflow: hidden;
      }

      .sidebar {
        width: var(--sidebar-w);
        background: var(--cream);
        display: flex;
        flex-direction: column;
        overflow-y: auto;
        overflow-x: hidden;
        flex-shrink: 0;

        position: relative;
        z-index: 2;
      }
      #left-sidebar {
        width: var(--sidebar-w-left);
        box-shadow: 6px 0 18px rgba(18, 22, 28, 0.34);
      }
      #right-sidebar {
        box-shadow: -6px 0 18px rgba(18, 22, 28, 0.34);
      }

      .sidebar::-webkit-scrollbar {
        width: 11px;
      }
      .sidebar::-webkit-scrollbar-track {
        background: transparent;
      }
      .sidebar::-webkit-scrollbar-thumb {
        background: #b3b8c2;
        border-radius: 6px;
        border: 2px solid transparent;
        background-clip: content-box;
      }
      .sidebar::-webkit-scrollbar-thumb:hover {
        background: #949aa5;
        background-clip: content-box;
      }
      .sb-section {
        padding: 12px 14px;
        border-bottom: 1px solid rgba(0, 0, 0, 0.1);
      }
      .sb-section h3 {
        font-family: "Playwrite DE Grund", cursive;
        font-size: 0.8rem;
        font-weight: 400;
        text-transform: uppercase;
        letter-spacing: 0.06em;
        color: var(--ink);
        margin-bottom: 10px;
        -webkit-text-stroke: 0.35px currentColor;
      }
      .ctrl-row {
        display: flex;
        align-items: center;
        gap: 8px;
        margin-bottom: 7px;
        min-width: 0;
      }
      .ctrl-row label {
        font-size: 0.76rem;
        min-width: 60px;
        color: #555;
        flex-shrink: 0;
      }
      .ctrl-row input[type="text"] {
        flex: 1;
        min-width: 0;
        box-sizing: border-box;
        padding: 3px 7px;
        border: 1px solid #ccc;
        border-radius: 4px;
        font-size: 0.78rem;
        font-family: inherit;
        background: #fff;
      }
      .ctrl-row textarea.ctrl-area {
        flex: 1;
        min-width: 0;
        box-sizing: border-box;
        padding: 3px 7px;
        border: 1px solid #ccc;
        border-radius: 4px;
        font-size: 0.78rem;
        font-family: inherit;
        line-height: 1.35;
        background: #fff;
        resize: none;
      }
      .ctrl-row textarea.ctrl-area:focus,
      .ctrl-row input[type="text"]:focus {
        outline: none;
        border-color: var(--accent);
      }
      .ctrl-row input[type="color"] {
        width: 34px;
        height: 26px;
        border: 1px solid #ccc;
        border-radius: 4px;
        cursor: pointer;
        padding: 1px;
        background: #fff;
      }
      /* A colour well opens the colour picker: a saturation-brightness square, a hue
         slider, the colour as HEX or RGB, and the preset colours below. */
      .color-well {
        width: 34px;
        height: 26px;
        flex-shrink: 0;
        border: 1px solid #ccc;
        border-radius: 4px;
        padding: 3px;
        background: #fff;
        cursor: pointer;
      }
      .color-well span {
        display: block;
        width: 100%;
        height: 100%;
        border-radius: 2px;
        box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12);
      }
      .color-well:focus-visible {
        outline: 2px solid var(--marigold);
        outline-offset: 1px;
      }
      #color-pop {
        position: fixed;
        z-index: 10000;
        width: 232px;
        box-sizing: border-box;
        padding: 12px;
        background: #fff;
        border: 1px solid #ddd;
        border-radius: 10px;
        box-shadow: 0 10px 30px rgba(18, 22, 28, 0.25);
        font-family: "Prompt", sans-serif;
        color: var(--slate);
      }
      #color-pop .cp-sv {
        position: relative;
        height: 140px;
        border-radius: 6px;
        cursor: crosshair;
        touch-action: none;
        background-image: linear-gradient(to top, #000, transparent), linear-gradient(to right, #fff, transparent);
      }
      #color-pop .cp-sv i,
      #color-pop .cp-hue i {
        position: absolute;
        width: 12px;
        height: 12px;
        margin: -6px 0 0 -6px;
        border: 2px solid #fff;
        border-radius: 50%;
        box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35);
        pointer-events: none;
      }
      #color-pop .cp-hue {
        position: relative;
        height: 12px;
        margin: 12px 0;
        border-radius: 6px;
        cursor: pointer;
        touch-action: none;
        background: linear-gradient(to right, #f00, #ff0, #0f0, #0ff, #00f, #f0f, #f00);
      }
      #color-pop .cp-hue i {
        top: 50%;
      }
      #color-pop .cp-fields {
        display: flex;
        gap: 6px;
        align-items: center;
      }
      #color-pop select,
      #color-pop input {
        min-width: 0;
        box-sizing: border-box;
        padding: 4px 5px;
        border: 1px solid #ccc;
        border-radius: 4px;
        font: 0.76rem "Prompt", sans-serif;
        background: #fff;
      }
      #color-pop .cp-fields input {
        flex: 1;
        width: 0;
        text-align: center;
      }
      #color-pop .cp-fields input:focus,
      #color-pop select:focus {
        outline: none;
        border-color: var(--slate);
      }
      #color-pop .cp-presets {
        margin-top: 12px;
        display: grid;
        grid-template-columns: repeat(9, 1fr);
        gap: 4px;
      }
      #color-pop .cp-presets button {
        aspect-ratio: 1;
        padding: 0;
        border: 1px solid rgba(0, 0, 0, 0.18);
        border-radius: 4px;
        cursor: pointer;
      }
      #color-pop .cp-presets button:hover {
        transform: scale(1.12);
      }
      #color-pop .cp-presets button.on {
        outline: 2px solid var(--slate);
        outline-offset: 1px;
      }
      #color-pop .cp-presets button:focus-visible {
        outline: 2px solid var(--marigold);
        outline-offset: 1px;
      }
      .ctrl-row input[type="number"] {
        width: 58px;
        padding: 3px 6px;
        border: 1px solid #ccc;
        border-radius: 4px;
        font-size: 0.78rem;
        font-family: inherit;
      }
      .ctrl-select {
        flex: 1;
        min-width: 0;
        padding: 3px 5px;
        border: 1px solid #ccc;
        border-radius: 4px;
        font-size: 0.78rem;
        font-family: inherit;
        background: #fff;
      }
      .ctrl-row input[type="checkbox"] {
        accent-color: var(--check);
        cursor: pointer;
        width: 15px;
        height: 15px;
      }

      .range-wrap {
        display: flex;
        align-items: center;
        gap: 5px;
        flex: 1;
        min-width: 0;
      }
      /* Sliders drawn by hand, so the track stays light whatever the accent: a thin grey
         track, filled with the accent up to the thumb (--fill, set by rangeCtrl). */
      .range-wrap input[type="range"] {
        flex: 1;
        min-width: 0;
        height: 16px;
        margin: 0;
        background: transparent;
        -webkit-appearance: none;
        appearance: none;
        cursor: pointer;
      }
      .range-wrap input[type="range"]::-webkit-slider-runnable-track {
        height: 4px;
        border-radius: 2px;
        background: linear-gradient(to right, var(--accent) var(--fill, 50%), #dde1e6 var(--fill, 50%));
      }
      .range-wrap input[type="range"]::-moz-range-track {
        height: 4px;
        border-radius: 2px;
        background: #dde1e6;
      }
      .range-wrap input[type="range"]::-moz-range-progress {
        height: 4px;
        border-radius: 2px;
        background: var(--accent);
      }
      .range-wrap input[type="range"]::-webkit-slider-thumb {
        -webkit-appearance: none;
        width: 14px;
        height: 14px;
        margin-top: -5px;
        border-radius: 50%;
        background: #fff;
        border: 2px solid var(--accent);
        box-sizing: border-box;
      }
      .range-wrap input[type="range"]::-moz-range-thumb {
        width: 14px;
        height: 14px;
        border-radius: 50%;
        background: #fff;
        border: 2px solid var(--accent);
        box-sizing: border-box;
      }
      .range-wrap input[type="range"]:focus-visible {
        outline: 2px solid var(--accent-soft);
        outline-offset: 2px;
      }
      .range-wrap input.range-num {
        width: 52px;
        flex-shrink: 0;
        box-sizing: border-box;
        padding: 3px 4px;
        border: 1px solid #ccc;
        border-radius: 4px;
        font-size: 0.74rem;
        font-family: inherit;
        text-align: right;
        background: #fff;
      }
      .range-wrap input.range-num:focus {
        outline: none;
        border-color: var(--accent);
      }
      /* Axes and tick labels: a label column, then one column per axis. */
      .axis-grid {
        display: grid;
        grid-template-columns: var(--ag-label, 92px) minmax(0, 1fr) minmax(0, 1fr);
        gap: 6px 8px;
        align-items: center;
        margin-bottom: 7px;
      }
      /* Two or three choices side by side, one pressed (the Left/Right axis picker). */
      .seg {
        display: inline-flex;
        border: 1px solid #ccc;
        border-radius: 6px;
        overflow: hidden;
      }
      .seg button {
        padding: 4px 10px;
        border: 0;
        background: #fff;
        font: 500 0.74rem "Prompt", sans-serif;
        color: var(--slate);
        cursor: pointer;
      }
      .seg button + button {
        border-left: 1px solid #ccc;
      }
      .seg button[aria-pressed="true"] {
        background: var(--accent-soft);
        color: var(--ink);
        box-shadow: inset 0 -2px 0 var(--accent);
      }
      /* A bracket's two ends, "from … to …". */
      .bracket-ends {
        display: flex;
        align-items: center;
        gap: 6px;
        min-width: 0;
      }
      .bracket-ends input {
        width: 0;
        flex: 1;
        min-width: 0;
      }
      .bracket-ends span {
        font-size: 0.8rem;
        color: var(--muted, #6b7480);
      }
      .axis-grid.with-right {
        grid-template-columns: var(--ag-label, 92px) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr);
        gap: 6px 6px;
      }
      .axis-grid.mirrored {
        grid-template-columns: var(--ag-label, 92px) repeat(4, minmax(0, 1fr));
        gap: 6px 4px;
      }
      .axis-grid.mirrored input[type="text"],
      .axis-grid.mirrored input[type="number"] {
        padding-left: 4px;
        padding-right: 2px;
        font-size: 0.74rem;
      }
      .axis-grid.mirrored .ag-head {
        font-size: 0.6rem;
        letter-spacing: 0.02em;
        white-space: nowrap;
      }
      /* The Axes section's less-used settings, folded away under "More options". */
      .axes-more {
        margin-top: 4px;
      }
      .axes-more > summary {
        cursor: pointer;
        list-style: none;
        font-size: 0.74rem;
        font-weight: 500;
        color: #6b7480;
        padding: 3px 0;
        user-select: none;
      }
      .axes-more > summary::-webkit-details-marker {
        display: none;
      }
      .axes-more > summary::before {
        content: "▸";
        display: inline-block;
        width: 1em;
        transition: transform 0.15s;
      }
      .axes-more[open] > summary::before {
        transform: rotate(90deg);
      }
      .axes-more > summary:hover {
        color: var(--slate);
      }
      .axes-more[open] > summary {
        margin-bottom: 6px;
      }
      .axis-grid .ag-head {
        font-size: 0.66rem;
        font-weight: 600;
        letter-spacing: 0.06em;
        color: #8a929b;
      }
      .axis-grid > label {
        font-size: 0.76rem;
        color: #555;
      }
      .axis-grid input[type="text"],
      .axis-grid input[type="number"] {
        width: 100%;
        min-width: 0;
        box-sizing: border-box;
        padding: 3px 6px;
        border: 1px solid #ccc;
        border-radius: 4px;
        font-size: 0.78rem;
        font-family: inherit;
        background: #fff;
      }
      .axis-grid input[type="text"]:focus,
      .axis-grid input[type="number"]:focus {
        outline: none;
        border-color: var(--accent);
      }
      .axis-grid input[type="checkbox"] {
        accent-color: var(--check);
        justify-self: center;
        margin: 0;
      }
      /* Element properties come in small groups, each under a quiet heading. */
      .prop-group + .prop-group,
      .prop-group + .side-btn {
        margin-top: 10px;
        padding-top: 10px;
        border-top: 1px solid rgba(70, 82, 95, 0.12);
      }
      .prop-group-title {
        margin-bottom: 6px;
        font-size: 0.66rem;
        font-weight: 600;
        letter-spacing: 0.06em;
        text-transform: uppercase;
        color: #8a929b;
      }
      .no-sel {
        font-size: 0.78rem;
        color: #999;
        text-align: center;
        padding: 18px 12px;
        font-style: italic;
      }
      .eq-input {
        display: block;
        width: 100%;
        padding: 8px 9px;
        border: 1px solid #ccc;
        border-radius: 5px;
        font-size: 0.8rem;
        background: #fff;
        box-sizing: border-box;
        --smart-fence-color: var(--slate);
      }
      .eq-input:focus,
      .eq-input:focus-within {
        outline: none;
        border-color: var(--accent);
      }
      .eq-input::part(virtual-keyboard-toggle),
      .eq-input::part(menu-toggle) {
        display: none;
      }
      .side-btn {
        display: block;
        width: 100%;
        padding: 7px 10px;
        margin-top: 6px;
        background: var(--slate);
        color: var(--cream);
        border: none;
        border-radius: 6px;
        font-family: "Prompt", sans-serif;
        font-size: 0.78rem;
        cursor: pointer;
        text-align: left;
        transition: background 0.15s;
      }
      .side-btn:hover {
        background: var(--marigold);
        color: var(--ink);
      }
      .side-btn small {
        display: block;
        font-size: 0.68rem;
        opacity: 0.65;
        margin-top: 1px;
      }

      .hint-text {
        font-size: 0.73rem;
        color: #666;
        line-height: 2;
        margin-top: 2px;
      }
      .hint-text b {
        color: var(--slate);
      }
      .region-row {
        display: flex;
        align-items: center;
        gap: 6px;
        margin-bottom: 6px;
      }
      .region-swatch {
        width: 16px;
        height: 16px;
        border-radius: 4px;
        flex-shrink: 0;
        border: 1px solid rgba(0, 0, 0, 0.15);
      }
      .region-name {
        flex: 1;
        min-width: 0;
        font-size: 0.76rem;
        color: var(--text);
      }
      /* Fill, Hatch and Generate in Quicksand: quiet white keys with a hairline edge. */
      .region-row .side-btn,
      .gen-row .side-btn.gen-go {
        border: 1px solid #d3d7dc;
        background: #fff;
        box-shadow: 0 1px 2px rgba(20, 24, 30, 0.06);
        font-family: "Quicksand", "Nunito", sans-serif;
        font-weight: 600;
        color: var(--ink);
        transition:
          background 0.15s,
          border-color 0.15s,
          color 0.15s;
      }
      .region-row .side-btn:hover,
      .gen-row .side-btn.gen-go:hover {
        border-color: #b9bfc6;
        background: #f4f5f7;
        color: var(--ink);
      }
      .region-row .side-btn:active,
      .gen-row .side-btn.gen-go:active {
        box-shadow: none;
      }
      .region-row .side-btn:focus-visible,
      .gen-row .side-btn.gen-go:focus-visible {
        outline: 2px solid var(--marigold);
        outline-offset: 2px;
      }
      .region-row .side-btn {
        width: auto;
        margin-top: 0;
        padding: 1px 7px;
        border-radius: 6px;
        font-size: 0.7rem;
        line-height: 1.3;
        letter-spacing: 0.04em;
        text-align: center;
        flex-shrink: 0;
      }
      /* Hatch wears faint hatching. */
      .region-row .side-btn.hatch {
        background-image: repeating-linear-gradient(-45deg, rgba(70, 82, 95, 0.1) 0 1px, transparent 1px 5px);
      }

      #canvas-area {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        /* Faint dot grid, like an engineering pad.
           Sits behind the white graph paper only. */
        background-color: #f8f7f4;
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='110' height='110'%3E%3Cg fill='%2346525f' fill-opacity='0.3'%3E%3Ccircle cx='11' cy='11' r='1.1'/%3E%3Ccircle cx='11' cy='33' r='1.1'/%3E%3Ccircle cx='11' cy='55' r='1.1'/%3E%3Ccircle cx='11' cy='77' r='1.1'/%3E%3Ccircle cx='11' cy='99' r='1.1'/%3E%3Ccircle cx='33' cy='11' r='1.1'/%3E%3Ccircle cx='33' cy='33' r='1.1'/%3E%3Ccircle cx='33' cy='55' r='1.1'/%3E%3Ccircle cx='33' cy='77' r='1.1'/%3E%3Ccircle cx='33' cy='99' r='1.1'/%3E%3Ccircle cx='55' cy='11' r='1.1'/%3E%3Ccircle cx='55' cy='33' r='1.1'/%3E%3Ccircle cx='55' cy='77' r='1.1'/%3E%3Ccircle cx='55' cy='99' r='1.1'/%3E%3Ccircle cx='77' cy='11' r='1.1'/%3E%3Ccircle cx='77' cy='33' r='1.1'/%3E%3Ccircle cx='77' cy='55' r='1.1'/%3E%3Ccircle cx='77' cy='77' r='1.1'/%3E%3Ccircle cx='77' cy='99' r='1.1'/%3E%3Ccircle cx='99' cy='11' r='1.1'/%3E%3Ccircle cx='99' cy='33' r='1.1'/%3E%3Ccircle cx='99' cy='55' r='1.1'/%3E%3Ccircle cx='99' cy='77' r='1.1'/%3E%3Ccircle cx='99' cy='99' r='1.1'/%3E%3Ccircle cx='55' cy='55' r='1.1'/%3E%3C/g%3E%3C/svg%3E");
        background-size: 110px 110px;
        padding: 12px 10px 8px;
        gap: 8px;
        overflow: hidden;
        min-height: 0;
      }
      .build-bar {
        display: flex;
        align-items: center;
        gap: 4px;
      }
      /* The maths tip beside the Label heading opens rightwards, inside the sidebar. */
      .prop-group-title {
        display: flex;
        align-items: center;
        gap: 6px;
      }
      .latex-hint .gen-tip {
        left: -7px;
        transform: none;
        width: 220px;
      }
      .latex-hint .gen-tip::before {
        left: 9px;
      }
      .latex-hint code {
        font-size: 0.68rem;
        background: rgba(255, 255, 255, 0.16);
        padding: 0 3px;
        border-radius: 3px;
      }
      .build-bar[hidden] {
        display: none;
      }
      .bb-label {
        display: inline-flex;
        align-items: center;
        gap: 7px;
        margin-right: 4px;
        font-size: 0.72rem;
        font-weight: 600;
        letter-spacing: 0.08em;
        text-transform: uppercase;
        color: var(--ink);
      }
      .bb-label svg {
        width: 20px;
        height: 18px;
      }
      .bb-count {
        min-width: 46px;
        text-align: center;
        font-family: "Prompt", sans-serif;
        font-size: 0.82rem;
        color: #777;
        font-variant-numeric: tabular-nums;
      }
      .bb-count.is-graph b {
        padding: 0 5px;
        border-radius: 5px;
        background: var(--marigold);
      }
      .pop-note {
        margin: 0 0 12px;
        font-size: 0.82rem;
        line-height: 1.5;
        color: #555;
      }
      .bb-count b {
        font-size: 1rem;
        font-weight: 600;
        color: var(--ink);
      }
      .bb-btn {
        display: inline-flex;
        align-items: center;
        gap: 7px;
        height: 36px;
        padding: 0 13px;
        border: 1.5px solid rgba(70, 82, 95, 0.25);
        border-radius: 10px;
        background: transparent;
        color: var(--slate);
        font-family: "Prompt", sans-serif;
        font-size: 0.8rem;
        font-weight: 500;
        white-space: nowrap;
        cursor: pointer;
        transition: all 0.14s;
      }
      .bb-btn:hover:not(:disabled) {
        background: rgba(70, 82, 95, 0.1);
        border-color: var(--slate);
      }
      .bb-btn:disabled {
        opacity: 0.35;
        cursor: default;
      }
      .bb-btn.bb-icon {
        width: 36px;
        padding: 0;
        justify-content: center;
      }
      .bb-btn svg {
        width: 15px;
        height: 15px;
      }
      .bb-btn.is-on {
        background: var(--marigold);
        border-color: var(--marigold);
        color: var(--ink);
      }
      .bb-more {
        position: relative;
      }
      .bb-more [aria-expanded="true"] {
        background: rgba(70, 82, 95, 0.12);
        border-color: var(--slate);
      }
      .bb-btn:focus-visible {
        outline: 2px solid var(--marigold);
        outline-offset: 2px;
      }
      .bb-select {
        height: 32px;
        padding: 0 28px 0 10px;
        border: 1.5px solid rgba(70, 82, 95, 0.3);
        border-radius: 9px;
        background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%2346525f' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 10px center / 10px 7px;
        color: var(--ink);
        font-family: "Prompt", sans-serif;
        font-size: 0.8rem;
        appearance: none;
        cursor: pointer;
      }
      .bb-select:focus-visible {
        outline: 2px solid var(--marigold);
        outline-offset: 2px;
      }
      .bb-select:disabled {
        background-color: #f2f3f4;
        color: #9aa1a9;
        cursor: default;
      }
      .bb-inline {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        margin: 0 4px;
        font-family: "Prompt", sans-serif;
        font-size: 0.76rem;
        color: var(--text);
        white-space: nowrap;
        cursor: pointer;
      }
      .bb-inline input {
        accent-color: var(--check);
      }
      #main-svg .build-ghost,
      #main-svg .build-ghost * {
        pointer-events: none !important;
      }
      #figure {
        display: grid;
        grid-template-columns: repeat(var(--cols, 1), auto);
        gap: 12px;
        justify-content: center;
        align-content: center;
        min-height: 0;
        max-width: 100%;
        flex-shrink: 1;
      }
      .panel-static {
        position: relative;
        display: flex;
        background: #fff;
        border-radius: 3px;
        border: 1px solid rgba(20, 25, 32, 0.16);
        box-shadow: 0 6px 22px rgba(18, 22, 28, 0.3);
        overflow: hidden;
        cursor: pointer;
        transition: outline-color 0.14s;
        outline: 2px solid transparent;
        outline-offset: 2px;
      }
      .panel-static:hover {
        outline-color: rgba(70, 82, 95, 0.45);
      }
      #figure.multi #svg-wrapper {
        outline: 2.5px solid var(--marigold);
        outline-offset: 2px;
      }
      #figure.multi #main-svg,
      .panel-static svg {
        display: block;
        height: var(--panel-h);
        width: auto; /* its own shape: a canvas widened for labels widens its frame */
        max-width: none;
        max-height: none;
      }
      .fig-layouts {
        display: flex;
        flex-wrap: wrap;
        gap: 5px;
      }
      .fig-layouts button {
        width: 36px;
        height: 30px;
        padding: 3px;
        border: 1.5px solid rgba(70, 82, 95, 0.3);
        border-radius: 7px;
        background: transparent;
        color: var(--slate);
        cursor: pointer;
      }
      .fig-layouts button:hover {
        border-color: var(--slate);
      }
      .fig-layouts button[aria-pressed="true"] {
        background: var(--marigold);
        border-color: var(--marigold);
        color: var(--ink);
      }
      .look-btns.wm-btns {
        grid-template-columns: minmax(0, 1.7fr) repeat(3, minmax(0, 1fr));
        margin-top: 0;
      }
      .wm-btns .side-btn {
        justify-content: center;
        background: #fff;
        color: var(--slate);
        border: 1.5px solid var(--slate);
      }
      .wm-btns .side-btn:hover {
        background: #f3f4f6;
        color: var(--slate);
      }
      .wm-btns .side-btn[aria-pressed="true"] {
        background: #fff6ea;
        border-color: var(--marigold);
        box-shadow: inset 0 0 0 1px var(--marigold);
      }
      .wm-icon {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 3px;
        height: 16px;
      }
      .wm-btns .side-btn svg.wm-word {
        width: 50px;
        height: 13px;
      }
      .wm-btns .side-btn svg.wm-mark {
        width: 13px;
        height: 13px;
      }
      .wm-btns .side-btn[data-mode="mark"] svg.wm-mark {
        width: 18px;
        height: 18px;
      }
      .fig-layouts svg {
        width: 100%;
        height: 100%;
        fill: none;
        stroke: currentColor;
        stroke-width: 1.6;
      }
      #svg-wrapper {
        background: #fff;
        border-radius: 3px;
        min-height: 0;
        flex-shrink: 1;
        border: 1px solid rgba(20, 25, 32, 0.16);
        box-shadow: 0 6px 22px rgba(18, 22, 28, 0.3);
        overflow: hidden;
        position: relative;
        display: flex;
        align-items: center;
        justify-content: center;
      }
      #main-svg {
        display: block;
        cursor: default;
        user-select: none;
        -webkit-user-select: none;
        max-width: 100%;
        max-height: calc(100vh - 132px);
        width: auto;
        height: auto;
      }
      #main-svg.mode-point,
      #main-svg.mode-line {
        cursor:
          url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCI+CjxsaW5lIHgxPSIxMiIgeTE9IjEiIHgyPSIxMiIgeTI9IjIzIiBzdHJva2U9IndoaXRlIiBzdHJva2Utd2lkdGg9IjMiLz4KPGxpbmUgeDE9IjEiIHkxPSIxMiIgeDI9IjIzIiB5Mj0iMTIiIHN0cm9rZT0id2hpdGUiIHN0cm9rZS13aWR0aD0iMyIvPgo8bGluZSB4MT0iMTIiIHkxPSIxIiB4Mj0iMTIiIHkyPSIyMyIgc3Ryb2tlPSIjMjIyIiBzdHJva2Utd2lkdGg9IjEiLz4KPGxpbmUgeDE9IjEiIHkxPSIxMiIgeDI9IjIzIiB5Mj0iMTIiIHN0cm9rZT0iIzIyMiIgc3Ryb2tlLXdpZHRoPSIxIi8+Cjwvc3ZnPg==")
            12 12,
          crosshair;
      }
      #main-svg.mode-curve {
        cursor: default;
      }
      #main-svg.mode-text {
        cursor: text;
      }

      #main-svg[class*="mode-"] g[data-id],
      #main-svg[class*="mode-"] g[data-id] * {
        cursor: inherit !important;
      }

      /* Undo/redo, the step bar (when open) and the view buttons share one bar above the canvas;
         the drawing tools are below it. */
      #topbar {
        display: flex;
        align-items: center;
        flex-wrap: wrap;
        justify-content: center;
        gap: 6px;
        max-width: 100%;
        padding: 8px 14px;
        border-radius: 16px;
        background: rgba(255, 255, 255, 0.92);
        backdrop-filter: blur(10px);
        box-shadow: 0 6px 20px rgba(18, 22, 28, 0.3);
        flex-shrink: 0;
        /* Above the graph, so the step menu drops over it. */
        position: relative;
        z-index: 30;
      }
      #topbar .tool-btn > svg {
        width: 25px;
        height: 22px;
      }
      #topbar .tool-sep {
        margin: 0 4px;
      }
      #toolbar {
        display: flex;
        gap: 6px;
        align-items: center;
        flex-wrap: wrap;
        justify-content: center;
        background: rgba(255, 255, 255, 0.92);
        padding: 8px 14px;
        border-radius: 16px;
        backdrop-filter: blur(10px);
        flex-shrink: 0;
        max-width: 100%;
        box-shadow: 0 6px 20px rgba(18, 22, 28, 0.38);
      }
      .tool-btn {
        width: 44px;
        height: 44px;
        padding: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        border: 1.5px solid rgba(70, 82, 95, 0.25);
        border-radius: 12px;
        background: transparent;
        color: var(--slate);
        font-family: "Prompt", sans-serif;
        cursor: pointer;
        transition: all 0.14s;
      }
      /* The button's name under it, in small capitals (see labelToolButtons). */
      .tool-btn[data-label] {
        position: relative;
      }
      /* Room under the bar's buttons for the names, so every button stays in line. */
      #toolbar:has(.tool-btn[data-label]),
      #topbar:has(.tool-btn[data-label]) {
        padding-bottom: 21px;
      }
      .tool-btn[data-label]::after {
        content: attr(data-label);
        position: absolute;
        top: calc(100% + 3px);
        left: 50%;
        transform: translateX(-50%);
        font: 600 8.5px/1 "Inter", system-ui, sans-serif;
        letter-spacing: 0.07em;
        text-transform: uppercase;
        white-space: nowrap;
        color: var(--slate);
        pointer-events: none;
      }
      .tool-btn.active[data-label]::after {
        color: var(--ink);
      }
      /* The Library's link to the public template gallery. */
      .lib-gallery {
        display: block;
        margin-top: 12px;
        font-size: 0.78rem;
        color: var(--slate);
        text-align: right;
      }
      .tool-btn:hover {
        background: rgba(70, 82, 95, 0.1);
        border-color: var(--slate);
      }
      .tool-btn.active {
        background: var(--marigold);
        color: var(--ink);
        border-color: var(--marigold);
      }
      .tool-btn.danger:hover {
        background: var(--coral);
        border-color: var(--coral);
        color: #fff;
      }
      .tool-sep {
        width: 3px;
        height: 28px;
        border-radius: 2px;
        background: rgba(70, 82, 95, 0.38);
        flex-shrink: 0;
      }
      .tool-icon {
        width: 27px;
        height: 23px;
        display: block;
        background: currentColor;
        -webkit-mask: var(--m) center/contain no-repeat;
        mask: var(--m) center/contain no-repeat;
      }

      #main-svg.mode-sketch {
        cursor: crosshair;
        touch-action: none;
      }
      .tool-icon-import {
        width: 32px;
        height: 29px;
        display: block;
      }

      #popup-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.55);
        z-index: 200;
        align-items: center;
        justify-content: center;
      }
      #popup-overlay.open {
        display: flex;
      }
      #popup-box {
        background: var(--cream);
        border-radius: 12px;
        padding: 24px 26px;
        min-width: 290px;
        max-width: 380px;
        box-shadow: 0 8px 40px rgba(0, 0, 0, 0.35);
      }
      #popup-box h2 {
        font-size: 1.05rem;
        color: var(--slate);
        margin-bottom: 8px;
      }
      #popup-box p {
        font-size: 0.82rem;
        color: #555;
        margin-bottom: 18px;
        line-height: 1.5;
      }
      #popup-box.pop-wide {
        width: calc(100vw - 32px);
        max-width: 460px;
        max-height: calc(100vh - 32px);
        overflow-y: auto;
      }
      #donate-overlay {
        display: none;
        position: fixed;
        inset: 0;
        padding: 16px;
        background: rgba(18, 22, 28, 0.6);
        z-index: 210;
        align-items: center;
        justify-content: center;
      }
      #donate-overlay.open {
        display: flex;
      }
      #donate-box {
        position: relative;
        width: 100%;
        max-width: 440px;
        max-height: 100%;
        overflow-y: auto;
        display: flex;
        flex-direction: column;
        background: #fdf6ec;
        border-radius: 16px;
        overflow: hidden;
        box-shadow: 0 18px 50px rgba(0, 0, 0, 0.4);
      }
      /* The spark and "contribute" in the wordmark's lowercase bold typeface, over the note, on cream. */
      #donate-head {
        flex-shrink: 0;
        padding: 24px 28px 22px;
        border-bottom: 1px solid #efe3d1;
      }
      #donate-title {
        display: flex;
        align-items: center;
        gap: 10px;
        margin-bottom: 12px;
        font-family: "Fredoka", "Prompt", sans-serif;
        font-size: 1.75rem;
        font-weight: 700;
        line-height: 1;
        color: #2b211c; /* a warm, near-black espresso */
      }
      .donate-spark {
        width: 30px;
        height: 30px;
        flex-shrink: 0;
      }
      #donate-note {
        font-family: "Nunito", sans-serif;
        font-size: 0.9rem;
        font-weight: 500;
        line-height: 1.6;
        color: #4a5560;
      }
      /* PayPal's hosted button, which carries its own amount and card form. */
      #donate-pay {
        padding: 20px 28px 22px;
      }
      #paypal-buttons:not(:empty) {
        min-height: 48px;
      }
      .pay-status {
        font-family: "Nunito", sans-serif;
        font-size: 0.85rem;
        font-weight: 600;
        color: #6b5a48;
      }
      .pay-status:empty {
        display: none;
      }
      .pay-status a {
        color: inherit;
      }
      .pay-or {
        display: flex;
        align-items: center;
        gap: 10px;
        margin: 18px 0 14px;
        font-family: "Nunito", sans-serif;
        font-size: 0.8rem;
        font-weight: 600;
        color: #a99a86;
      }
      .pay-or::before,
      .pay-or::after {
        content: "";
        flex: 1;
        height: 1px;
        background: #efe3d1;
      }
      /* Ko-fi: a chunky coral pill, like a physical button, with a steaming heart mug. */
      .kofi-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 10px;
        height: 50px;
        border-radius: 25px;
        background: #e8735f;
        box-shadow: 0 4px 0 #c4553f;
        color: #fff;
        font-family: "Fredoka", "Prompt", sans-serif;
        font-size: 1.05rem;
        font-weight: 600;
        letter-spacing: 0.01em;
        text-decoration: none;
        transition:
          transform 0.12s,
          box-shadow 0.12s,
          background 0.15s;
      }
      .kofi-btn:hover {
        background: #ee7f6b;
        transform: translateY(-1px);
        box-shadow: 0 5px 0 #c4553f;
      }
      .kofi-btn:active {
        transform: translateY(3px);
        box-shadow: 0 1px 0 #c4553f;
      }
      .kofi-btn:focus-visible {
        outline: 2px solid var(--slate);
        outline-offset: 3px;
      }
      .kofi-btn svg {
        width: 28px;
        height: 28px;
        margin-top: -4px;
        overflow: visible;
      }
      .kofi-btn:hover .kofi-steam {
        animation: kofi-steam 1.2s ease-in-out infinite;
      }
      @keyframes kofi-steam {
        0%,
        100% {
          transform: translateY(0);
          opacity: 1;
        }
        50% {
          transform: translateY(-1.5px);
          opacity: 0.6;
        }
      }
      @media (prefers-reduced-motion: reduce) {
        .kofi-btn,
        .kofi-btn:hover .kofi-steam {
          transition: none;
          animation: none;
        }
      }
      #donate-rzp {
        display: flex;
        justify-content: center;
        min-height: 48px;
      }
      #donate-rzp[hidden],
      #paypal-buttons[hidden],
      #pay-status[hidden] {
        display: none;
      }
      #donate-close {
        position: absolute;
        top: 14px;
        right: 14px;
        z-index: 1;
        display: flex;
        align-items: center;
        justify-content: center;
        width: 32px;
        height: 32px;
        border: none;
        border-radius: 50%;
        background: #f4e9d9;
        color: var(--slate);
        cursor: pointer;
        transition: background 0.15s;
      }
      #donate-close:hover {
        background: #ecdcc5;
      }
      #donate-close svg {
        width: 14px;
        height: 14px;
      }
      #donate-close:focus-visible {
        outline: 2px solid var(--marigold);
        outline-offset: 2px;
      }
      /* Account panel: the Pro panel's off-white sheet and Inter, with Sign in | Sign up
         tabs under the wordmark, and one form per view. */
      #account-overlay {
        display: none;
        position: fixed;
        inset: 0;
        padding: 16px;
        background: rgba(15, 18, 24, 0.55);
        z-index: 210;
        align-items: center;
        justify-content: center;
      }
      #account-overlay.open {
        display: flex;
      }
      #account-box {
        --acct-ink: #16191d;
        --acct-text: #4b5360;
        --acct-muted: #7c8591;
        --acct-line: #e2e0d9;
        position: relative;
        width: 100%;
        max-width: 440px;
        max-height: 100%;
        overflow-y: auto;
        padding: 30px 36px 26px;
        background: #f3f7f1;
        border-radius: 14px;
        box-shadow:
          0 24px 64px rgba(0, 0, 0, 0.28),
          0 2px 6px rgba(0, 0, 0, 0.08);
        font-family: "Inter", system-ui, sans-serif;
        color: var(--acct-text);
        -webkit-font-smoothing: antialiased;
      }
      @media (max-width: 520px) {
        #account-box {
          padding: 26px 20px 22px;
        }
      }
      #pro-kicker .pk-word {
        font-family: "Fredoka", "Prompt", sans-serif;
        font-size: 1.65rem;
        font-weight: 700;
        line-height: 1;
        letter-spacing: -0.01em;
      }
      /* Sign in | Sign up: two tabs on a shared rule, the current one underlined in ink. */
      #account-tabs {
        display: grid;
        grid-template-columns: 1fr 1fr;
        margin-bottom: 20px;
        border-bottom: 1px solid var(--acct-line);
      }
      #account-tabs[hidden] {
        display: none;
      }
      #account-tabs button {
        margin-bottom: -1px;
        padding: 10px 0 12px;
        border: none;
        border-bottom: 2px solid transparent;
        background: none;
        font: 600 0.95rem "Inter", system-ui, sans-serif;
        color: var(--acct-muted);
        cursor: pointer;
        transition:
          color 0.15s,
          border-color 0.15s;
      }
      #account-tabs button:hover {
        color: var(--acct-text);
      }
      #account-tabs button[aria-selected="true"] {
        border-bottom-color: var(--acct-ink);
        color: var(--acct-ink);
      }
      #account-tabs button:focus-visible {
        outline: 2px solid var(--acct-ink);
        outline-offset: -2px;
        border-radius: 6px;
      }
      #account-title {
        margin: 0 40px 6px 0;
        font-family: "Inter", system-ui, sans-serif;
        font-size: 1.5rem;
        font-weight: 700;
        line-height: 1.2;
        letter-spacing: -0.02em;
        color: var(--acct-ink);
      }
      /* With the tabs showing, the heading is for screen readers only. */
      #account-title.sr-only {
        position: absolute;
        width: 1px;
        height: 1px;
        margin: 0;
        overflow: hidden;
        clip: rect(0 0 0 0);
        white-space: nowrap;
      }
      #account-sub {
        margin-bottom: 20px;
        font-size: 0.9rem;
        line-height: 1.55;
      }
      #account-sub:empty {
        display: none;
      }
      #account-sub strong {
        font-weight: 600;
        color: var(--acct-ink);
      }
      #account-google-wrap[hidden] {
        display: none;
      }
      #account-or {
        display: flex;
        align-items: center;
        gap: 12px;
        margin: 18px 0;
        font-size: 0.8rem;
        color: var(--acct-muted);
      }
      #account-or::before,
      #account-or::after {
        content: "";
        flex: 1;
        height: 1px;
        background: var(--acct-line);
      }
      #account-form {
        display: flex;
        flex-direction: column;
        gap: 14px;
      }
      .acct-field {
        display: flex;
        flex-direction: column;
        gap: 6px;
      }
      .acct-field[hidden] {
        display: none;
      }
      .acct-field-head {
        display: flex;
        align-items: baseline;
        justify-content: space-between;
      }
      .acct-field label {
        font-size: 0.82rem;
        font-weight: 600;
        color: var(--acct-ink);
      }
      .acct-field input {
        height: 44px;
        padding: 0 12px;
        border: 1px solid #d9d7cf;
        border-radius: 10px;
        background: #fff;
        font: 400 0.95rem "Inter", system-ui, sans-serif;
        color: var(--acct-ink);
        transition:
          border-color 0.15s,
          box-shadow 0.15s;
      }
      .acct-pass-wrap {
        position: relative;
        display: flex;
      }
      .acct-pass-wrap input {
        flex: 1;
        min-width: 0;
        padding-right: 64px;
      }
      .acct-show {
        position: absolute;
        top: 50%;
        right: 6px;
        padding: 6px 8px;
        border: none;
        border-radius: 6px;
        background: none;
        font: 600 0.75rem "Inter", system-ui, sans-serif;
        color: var(--acct-muted);
        cursor: pointer;
        transform: translateY(-50%);
      }
      .acct-show:hover {
        background: #f2f1ec;
        color: var(--acct-ink);
      }
      .acct-show:focus-visible {
        outline: 2px solid var(--acct-ink);
        outline-offset: 0;
      }
      .acct-hint {
        font-size: 0.75rem;
        color: var(--acct-muted);
      }
      .acct-field input:focus {
        outline: none;
        border-color: var(--acct-ink);
        box-shadow: 0 0 0 3px rgba(22, 25, 29, 0.1);
      }
      .acct-primary,
      .acct-google {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 10px;
        width: 100%;
        height: 46px;
        border-radius: 10px;
        font: 600 0.95rem "Inter", system-ui, sans-serif;
        cursor: pointer;
        transition:
          background 0.15s,
          border-color 0.15s,
          opacity 0.15s;
      }
      .acct-primary {
        margin-top: 4px;
        border: none;
        background: var(--acct-ink);
        color: #fff;
      }
      .acct-primary[hidden] {
        display: none;
      }
      .acct-primary:hover {
        background: #2d333b;
      }
      .acct-google {
        border: 1px solid #d9d7cf;
        background: #fff;
        font-weight: 500;
        color: var(--acct-ink);
      }
      .acct-google:hover {
        border-color: #bfbcb2;
      }
      .acct-google svg {
        width: 18px;
        height: 18px;
      }
      .acct-primary:disabled,
      .acct-google:disabled {
        opacity: 0.55;
        cursor: default;
      }
      .acct-primary:focus-visible,
      .acct-google:focus-visible,
      .acct-link:focus-visible {
        outline: 2px solid var(--acct-ink);
        outline-offset: 2px;
      }
      #account-msg {
        margin-top: 14px;
        font-size: 0.85rem;
        line-height: 1.5;
        color: var(--acct-text);
      }
      #account-msg.error {
        color: #b4361f;
      }
      #account-msg:empty {
        display: none;
      }
      #account-links {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px 16px;
        margin-top: 16px;
      }
      #account-links:empty {
        display: none;
      }
      .acct-link {
        border: none;
        background: none;
        padding: 0;
        font: 500 0.82rem "Inter", system-ui, sans-serif;
        color: var(--acct-text);
        text-decoration: underline;
        text-decoration-color: #a9bea4;
        text-underline-offset: 2px;
        cursor: pointer;
      }
      .acct-link:hover {
        color: var(--acct-ink);
        text-decoration-color: currentColor;
      }
      /* The signed-in view lists its actions as a stack of quiet buttons. */
      #account-links.stack {
        flex-direction: column;
        gap: 8px;
        margin-top: 0;
      }
      #account-links.stack .acct-link {
        height: 44px;
        border: 1px solid #d9d7cf;
        border-radius: 10px;
        background: #fff;
        font-size: 0.9rem;
        font-weight: 500;
        color: var(--acct-ink);
        text-decoration: none;
      }
      #account-links.stack .acct-link:hover {
        border-color: #bfbcb2;
        text-decoration: none;
      }
      #account-close {
        position: absolute;
        top: 16px;
        right: 16px;
        display: flex;
        align-items: center;
        justify-content: center;
        width: 32px;
        height: 32px;
        border: none;
        border-radius: 8px;
        background: none;
        color: var(--acct-muted);
        cursor: pointer;
        transition:
          background 0.15s,
          color 0.15s;
      }
      #account-close:hover {
        background: #ebe9e2;
        color: var(--acct-ink);
      }
      #account-close svg {
        width: 14px;
        height: 14px;
      }
      #account-close:focus-visible {
        outline: 2px solid var(--acct-ink);
        outline-offset: 2px;
      }
      /* Sign in and Sign up open wide, as a welcome page: Cruxplot on graph paper on the
         left, the form on the right. A first visit opens it on Sign up (see initAccounts). */
      #account-overlay.open:has(.landing) {
        backdrop-filter: blur(3px);
      }
      /* Signed out, the panel can't be closed and the app behind is only a glimpse. */
      #account-overlay.gate {
        background: rgba(15, 18, 24, 0.68);
        backdrop-filter: blur(7px);
      }
      #account-close[hidden] {
        display: none;
      }
      .acct-hero {
        display: none;
      }
      #account-box.landing {
        display: grid;
        grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr);
        max-width: 980px;
        padding: 0;
        border-radius: 24px;
        background: #fff;
      }
      #account-box.landing .acct-main {
        display: flex;
        flex-direction: column;
        justify-content: center;
        padding: 44px 44px 30px;
      }
      /* The logo heads the form side. */
      .acct-brand {
        display: none;
      }
      #account-box.landing .acct-brand {
        display: block;
        width: 104px;
        height: 104px;
        margin: 0 auto 24px;
      }
      #account-box.landing .acct-hero {
        position: relative;
        display: flex;
        flex-direction: column;
        overflow: hidden;
        padding: 36px 40px 34px;
        border-right: 1px solid #e2d8c3;
        background-color: #f4eddd;
        background-image:
          linear-gradient(rgba(110, 80, 40, 0.13) 1px, transparent 1px),
          linear-gradient(90deg, rgba(110, 80, 40, 0.13) 1px, transparent 1px);
        background-size: 28px 28px;
        background-position: -1px -1px;
        color: #4b5360;
      }
      .acct-hero > :not(.hero-block) {
        position: relative;
        z-index: 1;
      }
      /* A few graph-paper squares filled in, in soft butter and apricot. */
      .hero-block {
        position: absolute;
        width: 27px;
        height: 27px;
      }
      .hero-title {
        max-width: 11em;
        margin: 6px 0 22px;
        font-family: "Faculty Glyphic", Georgia, serif;
        font-size: 2.3rem;
        font-weight: 400;
        line-height: 1.12;
        letter-spacing: -0.01em;
        color: #1f2329;
      }
      .hero-title mark {
        white-space: nowrap;
        padding: 0 4px;
        margin: 0 -2px;
        border-radius: 4px;
        background: linear-gradient(transparent 38%, rgba(250, 222, 110, 0.5) 38%, rgba(250, 222, 110, 0.5) 94%, transparent 94%);
        color: inherit;
      }
      .hero-sub {
        max-width: 30em;
        font-family: "Inter", system-ui, sans-serif;
        font-size: 0.95rem;
        line-height: 1.6;
      }
      .hero-fig {
        align-self: center;
        width: 100%;
        max-width: 380px;
        margin: auto 0;
        padding: 10px 12px 6px;
        border: 1px solid #e3e3e3;
        border-radius: 16px;
        background: #fff;
        box-shadow: 0 14px 30px rgba(0, 0, 0, 0.1);
        transform: rotate(-1.5deg);
      }
      .hero-fig svg {
        display: block;
        width: 100%;
        height: auto;
      }
      .hf-lab {
        font-family: "Times New Roman", Georgia, serif;
        font-size: 15px;
        font-style: italic;
        fill: #2b3038;
      }
      .hf-sm {
        font-size: 12.5px;
      }
      /* The diagram plays once: f and g draw in, their crossing point appears, then g
         slides up and left to g′ and stays there, the point moving with the crossing
         (to 140.6, 97.8) and its guide lines following. */
      .hf-d,
      .hf-s {
        stroke-dasharray: 1;
        stroke-dashoffset: 1;
        animation: hf-draw 0.9s ease-out forwards;
      }
      .hf-d {
        animation-delay: 0.25s;
      }
      .hf-s {
        animation-delay: 0.6s;
      }
      .hf-pt {
        transform-box: fill-box;
        transform-origin: center;
        animation: hf-pop 0.4s 1.35s cubic-bezier(0.3, 1.6, 0.6, 1) both;
      }
      .hf-shift {
        animation: hf-shift 1.6s 2.2s ease-in-out both;
      }
      .hf-move {
        animation: hf-move 1.6s 2.2s ease-in-out both;
      }
      .hf-g0 {
        animation:
          hf-in 0.4s 1.5s both,
          hf-out 0.3s 2.6s forwards;
      }
      .hf-g1 {
        opacity: 0;
        animation: hf-in 0.5s 3.8s both;
      }
      @keyframes hf-draw {
        to {
          stroke-dashoffset: 0;
        }
      }
      @keyframes hf-pop {
        from {
          transform: scale(0);
        }
        to {
          transform: scale(1);
        }
      }
      @keyframes hf-in {
        from {
          opacity: 0;
        }
        to {
          opacity: 1;
        }
      }
      @keyframes hf-out {
        to {
          opacity: 0;
        }
      }
      @keyframes hf-shift {
        0% {
          transform: translate(0, 0);
          opacity: 0;
        }
        20% {
          transform: translate(0, 0);
          opacity: 1;
        }
        100% {
          transform: translate(-28px, -18px);
          opacity: 1;
        }
      }
      @keyframes hf-move {
        0%,
        20% {
          transform: translate(0, 0);
        }
        100% {
          transform: translate(-29.43px, -17.17px);
        }
      }
      /* After the shift holds for a second, the diagram's pieces pop out, last drawn first,
         and the next scene draws in (see initHeroFigure). Each scene is built from .hs-el
         wrappers, so the pop-out never fights the animations inside them. */
      .hs-el {
        transform-box: fill-box;
        transform-origin: center;
      }
      .hs-out .hs-el {
        animation: hs-exit 0.42s var(--x, 0s) cubic-bezier(0.45, 0, 0.8, 0.3) forwards;
      }
      .hs-out .hs-el.hs-soft {
        animation: hf-out 0.4s var(--x, 0s) ease-in forwards;
      }
      .hs-draw {
        stroke-dasharray: 1;
        stroke-dashoffset: 1;
        animation: hf-draw var(--t, 0.9s) var(--d, 0s) ease-out forwards;
      }
      .hs-fade {
        animation: hf-in 0.45s var(--d, 0s) both;
      }
      .hs-pop {
        transform-box: fill-box;
        transform-origin: center;
        animation: hf-pop 0.4s var(--d, 0s) cubic-bezier(0.3, 1.6, 0.6, 1) both;
      }
      .hs-rise {
        animation: hs-rise 0.6s var(--d, 0s) cubic-bezier(0.2, 0.8, 0.3, 1) both;
      }
      .hs-tag {
        font: 600 9.5px "Inter", system-ui, sans-serif;
        fill: #6b7480;
      }
      .hs-tiny {
        font: 500 6.6px "Inter", system-ui, sans-serif;
        fill: #4b5360;
      }
      @keyframes hs-exit {
        0% {
          transform: scale(1);
          opacity: 1;
        }
        35% {
          transform: scale(1.07);
          opacity: 1;
        }
        100% {
          transform: scale(0.2);
          opacity: 0;
        }
      }
      @keyframes hs-rise {
        from {
          transform: translateY(16px);
          opacity: 0;
        }
        to {
          transform: translateY(0);
          opacity: 1;
        }
      }
      @keyframes hs-scrub {
        from {
          transform: translateX(-136px);
        }
      }
      .hero-dots {
        display: flex;
        justify-content: center;
        gap: 5px;
        margin: 6px 0 4px;
      }
      .hero-dots i {
        width: 6px;
        height: 6px;
        border-radius: 3px;
        background: #c3d3bd;
        transition:
          width 0.35s,
          background 0.35s;
      }
      .hero-dots i.on {
        width: 16px;
        background: #4f6b48;
      }
      /* Without motion, the diagram starts in its final state. */
      @media (prefers-reduced-motion: reduce) {
        .hf-d,
        .hf-s,
        .hf-pt {
          animation: none;
          stroke-dashoffset: 0;
        }
        .hf-shift {
          animation: none;
          transform: translate(-28px, -18px);
        }
        .hf-move {
          animation: none;
          transform: translate(-29.43px, -17.17px);
        }
        .hf-g0 {
          animation: none;
          opacity: 0;
        }
        .hf-g1 {
          animation: none;
          opacity: 1;
        }
        .hero-dots {
          display: none;
        }
      }
      @media (max-width: 820px) {
        #account-box.landing {
          grid-template-columns: 1fr;
          max-width: 480px;
          border-radius: 20px;
        }
        #account-box.landing .acct-hero {
          padding: 26px 24px 22px;
          border-right: none;
          border-bottom: 1px solid #e2d8c3;
        }
        #account-box.landing .acct-main {
          padding: 24px 24px 20px;
        }
        .hero-title {
          margin: 0 0 8px;
          font-size: 1.7rem;
        }
        .hero-sub {
          font-size: 0.88rem;
        }
        .hero-fig {
          display: none;
        }
      }
      /* Header account: a person outline when signed out; signed in, the name's first letter
         in a disc, then the name and a caret that opens the account menu. */
      header .account-wrap {
        position: relative;
      }
      header .account {
        display: flex;
        align-items: center;
        gap: 8px;
        height: 40px;
        min-width: 40px;
        padding: 0 8px;
        border: none;
        border-radius: 20px;
        background: none;
        color: #c9d1d9;
        cursor: pointer;
        transition: background 0.15s;
      }
      header .account[hidden] {
        display: none;
      }
      header .account:hover,
      header .account:focus-visible,
      header .account[aria-expanded="true"] {
        background: rgba(255, 255, 255, 0.08);
      }
      header .account:focus-visible {
        outline: 2px solid var(--marigold);
        outline-offset: 2px;
      }
      header .account .acct-person {
        width: 24px;
        height: 24px;
        display: block;
      }
      header .account .initial,
      header .account .account-name,
      header .account .account-caret {
        display: none;
      }
      header .account.signed-in {
        padding: 0 12px 0 5px;
      }
      header .account.signed-in .acct-person {
        display: none;
      }
      header .account.signed-in .initial {
        display: block;
        width: 30px;
        height: 30px;
        border-radius: 50%;
        background: var(--aqua);
        color: var(--ink);
        font-family: "Fredoka", "Prompt", sans-serif;
        font-size: 1rem;
        font-weight: 700;
        line-height: 30px;
        text-align: center;
        text-transform: uppercase;
      }
      header .account.signed-in .account-name {
        display: block;
        max-width: 14em;
        overflow: hidden;
        font: 500 0.9rem "Inter", system-ui, sans-serif;
        white-space: nowrap;
        text-overflow: ellipsis;
        color: #fff;
      }
      header .account.signed-in .account-caret {
        display: block;
        width: 10px;
        height: 6px;
      }
      /* A plain rectangle, exactly as wide as the name button above it. */
      #account-menu {
        position: absolute;
        top: calc(100% + 6px);
        left: 0;
        right: 0;
        z-index: 205;
        padding: 4px 0;
        border-radius: 0;
        background: #fff;
        box-shadow:
          0 14px 34px rgba(0, 0, 0, 0.22),
          0 0 0 1px rgba(0, 0, 0, 0.05);
        font-family: "Inter", system-ui, sans-serif;
      }
      #account-menu[hidden] {
        display: none;
      }
      .acct-menu-item {
        display: block;
        width: 100%;
        padding: 9px 12px;
        border: none;
        border-radius: 0;
        background: none;
        font: 500 0.88rem "Inter", system-ui, sans-serif;
        text-align: left;
        color: #16191d;
        cursor: pointer;
      }
      .acct-menu-item:hover,
      .acct-menu-item:focus-visible {
        outline: none;
        background: #f2f1ec;
      }
      /* Generate's thumbs, to rate the graph it just drew. */
      .gen-rate {
        display: flex;
        gap: 2px;
      }
      /* Before a graph is generated, and once it's rated, the thumbs vanish but keep their
         room, so Generate doesn't stretch. */
      .gen-rate[hidden] {
        display: flex;
        visibility: hidden;
      }
      /* Without Pro there's nothing to rate, and Generate needs the room for its tag. */
      .no-pro .gen-rate {
        display: none;
      }
      .gen-thumb {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 28px;
        height: 28px;
        padding: 0;
        border: none;
        border-radius: 7px;
        background: none;
        color: #6b7480;
        cursor: pointer;
        transition:
          background 0.15s,
          color 0.15s;
      }
      .gen-thumb svg {
        width: 15px;
        height: 15px;
      }
      .gen-thumb.down svg {
        transform: rotate(180deg);
      }
      .gen-thumb:hover:not(:disabled) {
        background: #eef0f2;
        color: var(--ink);
      }
      .gen-thumb:disabled {
        opacity: 0.35;
        cursor: default;
      }
      .gen-thumb:focus-visible {
        outline: 2px solid var(--marigold);
        outline-offset: 1px;
      }
      /* A short message at the bottom of the screen ("Saved to My graphs"). */
      #toast {
        position: fixed;
        left: 50%;
        bottom: 28px;
        z-index: 400;
        max-width: calc(100vw - 32px);
        padding: 10px 16px;
        border-radius: 10px;
        background: #16191d;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
        font: 500 0.85rem "Inter", system-ui, sans-serif;
        color: #fff;
        opacity: 0;
        pointer-events: none;
        transform: translate(-50%, 8px);
        transition:
          opacity 0.2s,
          transform 0.2s;
      }
      #toast.show {
        opacity: 1;
        transform: translate(-50%, 0);
      }
      #toast.error {
        background: #b4361f;
      }
      /* My graphs: a gallery of saved graphs on the account panel's off-white. */
      #graphs-overlay {
        display: none;
        position: fixed;
        inset: 0;
        z-index: 210;
        align-items: center;
        justify-content: center;
        padding: 16px;
        background: rgba(15, 18, 24, 0.55);
      }
      #graphs-overlay.open {
        display: flex;
      }
      /* Narrow while there are a few graphs; it widens once a row fills up. */
      #graphs-box {
        position: relative;
        width: 100%;
        max-width: 630px;
        transition: max-width 0.25s ease;
        max-height: 100%;
        overflow-y: auto;
        padding: 30px 32px 28px;
        border-radius: 18px;
        background: #f7f5ef;
        box-shadow:
          0 24px 64px rgba(0, 0, 0, 0.28),
          0 2px 6px rgba(0, 0, 0, 0.08);
        font-family: "Inter", system-ui, sans-serif;
        color: #4b5360;
      }
      @font-face {
        font-family: "Clarity City";
        src: url("fonts/ClarityCity-Bold.woff2") format("woff2");
        font-weight: 700;
        font-display: swap;
      }
      #graphs-title {
        margin: 0 40px 4px 0;
        font-family: "Clarity City", "Inter", system-ui, sans-serif;
        font-size: 1.6rem;
        font-weight: 700;
        letter-spacing: -0.02em;
        color: #16191d;
      }
      #graphs-box.wide {
        max-width: 900px;
      }
      #graphs-title {
        margin-bottom: 20px;
      }
      .graphs-empty {
        grid-column: 1 / -1;
        display: grid;
        justify-items: center;
        gap: 10px;
        padding: 18px 0 14px;
        text-align: center;
      }
      .graphs-empty svg {
        display: block;
        width: min(300px, 80%);
        height: auto;
        filter: grayscale(1);
        opacity: 0.45;
      }
      .graphs-empty p {
        margin: 0;
        font-family: "Prompt", sans-serif;
        font-size: 1.02rem;
        color: #9aa1a9;
      }
      #graphs-msg {
        font-size: 0.9rem;
        line-height: 1.55;
      }
      #graphs-msg:empty {
        display: none;
      }
      #graphs-list {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
        gap: 16px;
      }
      .graph-card {
        display: flex;
        flex-direction: column;
        overflow: hidden;
        border: 1px solid #e2e0d9;
        border-radius: 12px;
        background: #fff;
        transition:
          border-color 0.15s,
          box-shadow 0.15s;
      }
      .graph-card:hover {
        border-color: #c9c6bc;
        box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
      }
      .graph-open {
        display: flex;
        flex-direction: column;
        gap: 2px;
        padding: 0 0 10px;
        border: none;
        background: none;
        font: inherit;
        text-align: left;
        color: inherit;
        cursor: pointer;
      }
      .graph-open:focus-visible {
        outline: 2px solid var(--marigold);
        outline-offset: -2px;
      }
      .graph-thumb {
        display: block;
        aspect-ratio: 580 / 560;
        margin-bottom: 8px;
        border-bottom: 1px solid #eeede8;
        background: #fbfbfa;
      }
      .graph-thumb svg {
        display: block;
        width: 100%;
        height: 100%;
      }
      .graph-title {
        padding: 0 12px;
        overflow: hidden;
        font-size: 0.88rem;
        font-weight: 600;
        white-space: nowrap;
        text-overflow: ellipsis;
        color: #16191d;
      }
      .graph-date {
        padding: 0 12px;
        font-size: 0.75rem;
        color: #7c8591;
      }
      .graph-acts {
        display: flex;
        gap: 4px;
        padding: 0 8px 8px;
      }
      .graph-act {
        padding: 5px 6px;
        border: none;
        border-radius: 6px;
        background: none;
        font: 500 0.75rem "Inter", system-ui, sans-serif;
        color: #23766d;
        cursor: pointer;
      }
      .graph-act:hover {
        background: #f2f1ec;
      }
      .graph-act.danger {
        margin-left: auto;
        color: #b4361f;
      }
      .graph-act:focus-visible {
        outline: 2px solid var(--marigold);
        outline-offset: 0;
      }
      #graphs-close {
        position: absolute;
        top: 18px;
        right: 18px;
        display: flex;
        align-items: center;
        justify-content: center;
        width: 32px;
        height: 32px;
        border: none;
        border-radius: 8px;
        background: none;
        color: #7c8591;
        cursor: pointer;
      }
      #graphs-close:hover {
        background: #ebe9e2;
        color: #16191d;
      }
      #graphs-close svg {
        width: 14px;
        height: 14px;
      }

      /* Cruxplot for Educators (educator.js): the classes panel, on My graphs' off-white. */
      #edu-overlay {
        display: none;
        position: fixed;
        inset: 0;
        /* Under the popup (200), which asks its questions. */
        z-index: 199;
        align-items: center;
        justify-content: center;
        padding: 16px;
        background: rgba(15, 18, 24, 0.55);
      }
      #edu-overlay.open {
        display: flex;
      }
      #edu-box {
        position: relative;
        width: 100%;
        max-width: 760px;
        max-height: 100%;
        overflow-y: auto;
        padding: 30px 32px 28px;
        border-radius: 18px;
        background: #f7f5ef;
        box-shadow:
          0 24px 64px rgba(0, 0, 0, 0.28),
          0 2px 6px rgba(0, 0, 0, 0.08);
        font-family: "Inter", system-ui, sans-serif;
        font-size: 0.9rem;
        line-height: 1.5;
        color: #4b5360;
      }
      #edu-box.wide {
        max-width: 1040px;
      }
      #edu-crumbs {
        display: flex;
        flex-wrap: wrap;
        gap: 4px;
        margin: 0 40px 2px 0;
        font-size: 0.8rem;
        color: #7c8591;
      }
      #edu-crumbs button {
        padding: 0;
        border: none;
        background: none;
        font: inherit;
        color: #23766d;
        cursor: pointer;
      }
      #edu-crumbs button:hover {
        text-decoration: underline;
      }
      #edu-title {
        margin: 0 40px 6px 0;
        font-family: "Clarity City", "Inter", system-ui, sans-serif;
        font-size: 1.6rem;
        font-weight: 700;
        letter-spacing: -0.02em;
        color: #16191d;
      }
      #edu-msg {
        margin: 0 0 12px;
      }
      #edu-msg:empty {
        display: none;
      }
      #edu-msg.error {
        color: #b4361f;
      }
      #edu-close {
        position: absolute;
        top: 18px;
        right: 18px;
        display: flex;
        align-items: center;
        justify-content: center;
        width: 32px;
        height: 32px;
        border: none;
        border-radius: 8px;
        background: none;
        color: #7c8591;
        cursor: pointer;
      }
      #edu-close:hover {
        background: #ebe9e2;
        color: #16191d;
      }
      #edu-close svg {
        width: 14px;
        height: 14px;
      }
      .edu-sec {
        margin: 18px 0 0;
      }
      .edu-sec > h3 {
        display: flex;
        align-items: center;
        gap: 8px;
        margin: 0 0 8px;
        font-size: 0.78rem;
        font-weight: 600;
        letter-spacing: 0.06em;
        text-transform: uppercase;
        color: #7c8591;
      }
      .edu-sec > h3 .edu-btn {
        margin-left: auto;
        text-transform: none;
        letter-spacing: 0;
      }
      .edu-note {
        margin: 0 0 8px;
        color: #7c8591;
      }
      .edu-note.error {
        color: #b4361f;
      }
      .edu-note a {
        color: #23766d;
        font-weight: 600;
      }
      .edu-list {
        display: grid;
        gap: 8px;
      }
      .edu-row {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 6px 12px;
        padding: 12px 14px;
        border: 1px solid #e2e0d9;
        border-radius: 12px;
        background: #fff;
      }
      .edu-row.open {
        cursor: pointer;
      }
      .edu-row.open:hover {
        border-color: #c9c6bc;
      }
      .edu-row .edu-name {
        flex: 1 1 200px;
        min-width: 0;
        font-weight: 600;
        color: #16191d;
        overflow-wrap: anywhere;
      }
      .edu-row .edu-meta {
        font-size: 0.8rem;
        color: #7c8591;
      }
      .edu-empty {
        padding: 14px;
        border: 1px dashed #d9d7cf;
        border-radius: 12px;
        text-align: center;
        color: #9aa1a9;
      }
      .edu-btn {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        padding: 7px 12px;
        border: 1px solid #d9d7cf;
        border-radius: 8px;
        background: #fff;
        font: 500 0.82rem "Inter", system-ui, sans-serif;
        color: #16191d;
        cursor: pointer;
        white-space: nowrap;
      }
      .edu-btn:hover {
        background: #f2f1ec;
      }
      .edu-btn.primary {
        border-color: #16191d;
        background: #16191d;
        color: #fff;
      }
      .edu-btn.primary:hover {
        background: #2c3138;
      }
      .edu-btn.danger {
        color: #b4361f;
      }
      .edu-btn.link {
        padding: 4px 6px;
        border-color: transparent;
        background: none;
        color: #23766d;
      }
      .edu-btn.link:hover {
        background: #f2f1ec;
      }
      .edu-btn:disabled {
        opacity: 0.5;
        cursor: default;
      }
      .edu-btn:focus-visible,
      #edu-crumbs button:focus-visible {
        outline: 2px solid var(--marigold);
        outline-offset: 1px;
      }
      .edu-form {
        display: flex;
        flex-wrap: wrap;
        align-items: flex-end;
        gap: 10px 12px;
      }
      .edu-field {
        display: grid;
        gap: 4px;
        font-size: 0.78rem;
        font-weight: 500;
        color: #4b5360;
      }
      .edu-field.grow {
        flex: 1 1 260px;
      }
      .edu-field input,
      .edu-field textarea,
      .edu-field select {
        min-width: 0;
        padding: 7px 10px;
        border: 1px solid #d9d7cf;
        border-radius: 8px;
        background: #fff;
        font: 400 0.88rem "Inter", system-ui, sans-serif;
        color: #16191d;
      }
      .edu-field textarea {
        resize: vertical;
        min-height: 64px;
      }
      .edu-field input:focus,
      .edu-field textarea:focus,
      .edu-field select:focus {
        outline: 2px solid var(--marigold);
        outline-offset: 0;
        border-color: transparent;
      }
      .edu-check {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        font-size: 0.85rem;
        color: #16191d;
      }
      .edu-code {
        font: 600 1.05rem ui-monospace, "SF Mono", Menlo, monospace;
        letter-spacing: 0.12em;
        color: #16191d;
      }
      .edu-pill {
        display: inline-block;
        padding: 1px 8px;
        border-radius: 999px;
        background: #ebe9e2;
        font-size: 0.72rem;
        font-weight: 600;
        color: #4b5360;
        white-space: nowrap;
      }
      .edu-pill.live {
        background: #dff3ef;
        color: #1c6a61;
      }
      .edu-pill.warn {
        background: #fbebd1;
        color: #8a5a10;
      }
      .edu-pill.bad {
        background: #f8e1dc;
        color: #9c2f1b;
      }
      .edu-pill.plan {
        background: #fdebd0;
        color: #9a5b0c;
      }
      /* A class's code, join link and joining switch, in one card. */
      .edu-invite {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr);
        align-items: center;
        gap: 10px 20px;
        padding: 14px 16px;
        border: 1px solid #e2e0d9;
        border-radius: 12px;
        background: #fff;
      }
      .edu-invite-code {
        display: grid;
        gap: 2px;
      }
      .edu-invite-link {
        display: flex;
        gap: 8px;
      }
      .edu-invite-link input {
        flex: 1;
        min-width: 0;
        padding: 7px 10px;
        border: 1px solid #d9d7cf;
        border-radius: 8px;
        background: #faf9f6;
        font: 400 0.84rem "Inter", system-ui, sans-serif;
        color: #4b5360;
      }
      .edu-invite .edu-check {
        grid-column: 1 / -1;
      }
      @media (max-width: 520px) {
        .edu-invite {
          grid-template-columns: minmax(0, 1fr);
        }
      }
      /* Archived classes, folded away under the live ones. */
      .edu-fold {
        margin: 18px 0 0;
      }
      .edu-fold > summary {
        margin: 0 0 8px;
        font-size: 0.78rem;
        font-weight: 600;
        letter-spacing: 0.06em;
        text-transform: uppercase;
        color: #7c8591;
        cursor: pointer;
      }
      /* A question: a header row, the question beside its answer key, then the checklist. */
      .edu-q {
        display: grid;
        gap: 14px;
        padding: 16px 18px 14px;
        border: 1px solid #e2e0d9;
        border-left: 4px solid var(--marigold);
        border-radius: 12px;
        background: #fff;
      }
      .edu-q-head {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 8px 14px;
      }
      .edu-q-head h4 {
        margin: 0;
        font-family: "Clarity City", "Inter", system-ui, sans-serif;
        font-size: 1rem;
        font-weight: 700;
        color: #16191d;
      }
      .edu-q-head .edu-acts {
        margin-left: auto;
      }
      .edu-points {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        font-size: 0.8rem;
        color: #7c8591;
      }
      .edu-points input {
        width: 64px;
        padding: 4px 8px;
        border: 1px solid #d9d7cf;
        border-radius: 8px;
        font: 500 0.85rem "Inter", system-ui, sans-serif;
        color: #16191d;
      }
      .edu-q-main {
        display: grid;
        grid-template-columns: minmax(0, 1fr) 200px;
        gap: 16px;
        align-items: start;
      }
      @media (max-width: 640px) {
        .edu-q-main {
          grid-template-columns: minmax(0, 1fr);
        }
      }
      .edu-q-body {
        display: grid;
        gap: 8px;
        min-width: 0;
      }
      /* The question box: a formatting toolbar joined to the top of the text, as on Stack
         Exchange. The box shows focus, not the text area inside it. */
      .edu-md {
        border: 1px solid #d9d7cf;
        border-radius: 10px;
        background: #fff;
        overflow: hidden;
      }
      .edu-md:focus-within {
        outline: 2px solid var(--marigold);
        border-color: transparent;
      }
      .edu-md-bar {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 1px;
        padding: 4px;
        border-bottom: 1px solid #eeede8;
        background: #faf9f6;
      }
      .edu-md-bar button {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 27px;
        height: 28px;
        padding: 0;
        border: none;
        border-radius: 6px;
        background: none;
        font: 600 0.92rem "Inter", system-ui, sans-serif;
        color: #4b5360;
        cursor: pointer;
      }
      .edu-md-bar button:hover {
        background: #ecebe5;
        color: #16191d;
      }
      .edu-md-bar button:focus-visible {
        outline: 2px solid var(--marigold);
        outline-offset: -2px;
      }
      .edu-md-bar button svg {
        width: 18px;
        height: 18px;
      }
      .edu-md-bar i {
        font-family: Georgia, "Times New Roman", serif;
        font-size: 1rem;
      }
      .edu-md-tex {
        font: italic 500 0.9rem Georgia, "Times New Roman", serif;
      }
      .edu-md-sep {
        width: 1px;
        height: 18px;
        margin: 0 2px;
        background: #e2e0d9;
      }
      .edu-md-bar .edu-md-help {
        margin-left: auto;
        width: 24px;
        height: 24px;
        border: 1px solid #d9d7cf;
        border-radius: 50%;
        font-size: 0.78rem;
      }
      .edu-md-bar .edu-md-help[aria-expanded="true"] {
        background: #16191d;
        border-color: #16191d;
        color: #fff;
      }
      .edu-md textarea {
        display: block;
        width: 100%;
        min-height: 110px;
        padding: 10px 12px;
        border: none;
        background: #fff;
        font: 400 0.9rem/1.5 "Inter", system-ui, sans-serif;
        color: #16191d;
        resize: vertical;
        outline: none;
      }
      .edu-md-guide {
        padding: 8px 12px;
        border-top: 1px solid #eeede8;
        background: #faf9f6;
        font-size: 0.76rem;
        line-height: 1.8;
        color: #4b5360;
      }
      .edu-md-guide[hidden] {
        display: none;
      }
      .edu-md-guide code {
        padding: 1px 5px;
        border-radius: 4px;
        background: #ecebe5;
        font: 0.74rem ui-monospace, "SF Mono", Menlo, Consolas, monospace;
        color: #16191d;
      }
      .edu-points input:focus,
      .edu-settings input:focus {
        outline: 2px solid var(--marigold);
        outline-offset: 0;
        border-color: transparent;
      }
      .edu-q-key {
        display: grid;
        gap: 8px;
      }
      .edu-q-key .edu-btn {
        justify-content: center;
      }
      .edu-q-thumb {
        display: flex;
        align-items: center;
        justify-content: center;
        aspect-ratio: 580 / 560;
        border: 1px solid #eeede8;
        border-radius: 10px;
        background: #fbfbfa;
        font-size: 0.78rem;
        text-align: center;
        color: #9aa1a9;
        overflow: hidden;
        cursor: pointer;
      }
      .edu-q-thumb:hover {
        border-color: #c9c6bc;
      }
      .edu-q-thumb svg {
        display: block;
        width: 100%;
        height: 100%;
      }
      /* The checklist, folded under the question, its checks in groups. */
      .edu-rubric {
        border-top: 1px solid #eeede8;
        padding-top: 10px;
      }
      .edu-rubric > summary {
        display: flex;
        align-items: baseline;
        gap: 10px;
        list-style: none;
        cursor: pointer;
        color: #16191d;
      }
      .edu-rubric > summary::-webkit-details-marker {
        display: none;
      }
      .edu-rubric > summary::before {
        content: "▸";
        color: #7c8591;
        transition: transform 0.15s;
      }
      .edu-rubric[open] > summary::before {
        transform: rotate(90deg);
      }
      .edu-btn.link.danger {
        color: #b4361f;
      }
      .edu-rubric[open] > summary {
        margin-bottom: 8px;
      }
      .edu-check-groups {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
        gap: 12px 24px;
        margin-bottom: 12px;
      }
      .edu-check-group h5 {
        margin: 0 0 4px;
        font-size: 0.7rem;
        font-weight: 600;
        letter-spacing: 0.06em;
        text-transform: uppercase;
        color: #7c8591;
      }
      .edu-rubric-opts {
        display: grid;
        gap: 10px;
        padding: 12px 14px;
        border-radius: 10px;
        background: #f7f5ef;
      }
      /* The exam's status and next steps, and its settings. */
      .edu-exambar {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        padding: 12px 14px;
        border: 1px solid #e2e0d9;
        border-radius: 12px;
        background: #fff;
      }
      .edu-card {
        padding: 14px 16px;
        border: 1px solid #e2e0d9;
        border-radius: 12px;
        background: #fff;
      }
      .edu-settings {
        display: grid;
        grid-template-columns: minmax(0, 1.25fr) minmax(0, 1.25fr) minmax(0, 0.8fr);
        align-items: end;
        gap: 12px;
      }
      .edu-settings .edu-field.wide {
        grid-column: 1 / -1;
      }
      @media (max-width: 640px) {
        .edu-settings {
          grid-template-columns: minmax(0, 1fr);
        }
      }
      .edu-end {
        justify-content: flex-end;
        margin-top: 18px;
      }
      .edu-acts {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 6px;
      }
      .edu-checks {
        display: grid;
        gap: 2px;
        margin: 0;
        padding: 0;
        list-style: none;
      }
      .edu-checks li {
        display: flex;
        align-items: flex-start;
        gap: 8px;
        padding: 3px 0;
        font-size: 0.84rem;
        color: #16191d;
      }
      .edu-checks li.off {
        color: #9aa1a9;
      }
      .edu-checks li .edu-why {
        display: block;
        font-size: 0.78rem;
        color: #b4361f;
      }
      .edu-mark {
        flex: none;
        width: 18px;
        font-weight: 700;
        text-align: center;
      }
      .edu-mark.yes {
        color: #1c6a61;
      }
      .edu-mark.no {
        color: #b4361f;
      }
      .edu-spell {
        display: grid;
        grid-template-columns: max-content 1fr;
        align-items: center;
        gap: 6px 10px;
        font-size: 0.82rem;
      }
      .edu-spell input {
        padding: 4px 8px;
        border: 1px solid #d9d7cf;
        border-radius: 6px;
        font: 400 0.82rem "Inter", system-ui, sans-serif;
      }
      .edu-table-wrap {
        overflow-x: auto;
        border: 1px solid #e2e0d9;
        border-radius: 12px;
        background: #fff;
      }
      .edu-table {
        width: 100%;
        border-collapse: collapse;
        font-size: 0.84rem;
      }
      .edu-table th,
      .edu-table td {
        padding: 8px 10px;
        border-bottom: 1px solid #eeede8;
        text-align: left;
        white-space: nowrap;
      }
      .edu-table th {
        font-size: 0.74rem;
        font-weight: 600;
        color: #7c8591;
      }
      .edu-table tr:last-child td {
        border-bottom: none;
      }
      .edu-cell {
        min-width: 30px;
        padding: 3px 8px;
        border: 1px solid transparent;
        border-radius: 6px;
        background: none;
        font: 700 0.9rem "Inter", system-ui, sans-serif;
        cursor: pointer;
      }
      .edu-cell:hover {
        border-color: #d9d7cf;
      }
      .edu-cell.yes {
        color: #1c6a61;
      }
      .edu-cell.no {
        color: #b4361f;
      }
      .edu-cell.none {
        color: #c9c6bc;
      }
      .edu-cell.flag::after {
        content: "*";
        color: #8a5a10;
      }
      .edu-detail {
        margin-top: 12px;
        padding: 14px;
        border: 1px solid #e2e0d9;
        border-radius: 12px;
        background: #fff;
      }
      .edu-detail:empty {
        display: none;
      }
      @media (max-width: 640px) {
        #edu-box {
          padding: 24px 18px 20px;
        }
        .edu-q {
          grid-template-columns: 1fr;
        }
        .edu-q-thumb {
          max-width: 160px;
        }
      }

      /* The bar over the canvas while an exam, an answer key or an answer has it. */
      #edu-bar {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 8px 12px;
        width: 100%;
        max-width: 860px;
        padding: 10px 14px;
        border: 1px solid #e2e0d9;
        border-radius: 16px;
        background: #f7f5ef;
        box-shadow: 0 4px 14px rgba(18, 22, 28, 0.12);
        font-family: "Inter", system-ui, sans-serif;
        font-size: 0.84rem;
        color: #4b5360;
        flex-shrink: 0;
        position: relative;
        z-index: 31;
      }
      #edu-bar[hidden] {
        display: none;
      }
      #edu-bar .eb-kind {
        padding: 2px 8px;
        border-radius: 6px;
        background: var(--marigold);
        font-size: 0.7rem;
        font-weight: 700;
        letter-spacing: 0.08em;
        color: #16191d;
      }
      #edu-bar .eb-prompt {
        flex: 1 1 100%;
        order: 9;
        margin: 0;
        max-height: 7.5em;
        overflow-y: auto;
        /* Small enough for a long question to fit, large enough to read easily. */
        font-size: 0.84rem;
        line-height: 1.5;
        color: #16191d;
      }
      #edu-bar .eb-prompt.edu-rich {
        max-height: 12em;
      }
      #edu-bar .eb-prompt a {
        color: #23766d;
      }
      /* Question text: Markdown and LaTeX (educator.js's eduRich). */
      .edu-rich {
        overflow-wrap: anywhere;
      }
      .edu-rich.plain {
        white-space: pre-wrap;
      }
      .edu-rich > :first-child {
        margin-top: 0;
      }
      .edu-rich > :last-child {
        margin-bottom: 0;
      }
      .edu-rich p,
      .edu-rich ul,
      .edu-rich ol,
      .edu-rich pre,
      .edu-rich blockquote,
      .edu-rich table {
        margin: 0.45em 0;
      }
      .edu-rich h1,
      .edu-rich h2,
      .edu-rich h3,
      .edu-rich h4 {
        margin: 0.6em 0 0.3em;
        font-size: 1.05em;
        font-weight: 700;
      }
      .edu-rich ul,
      .edu-rich ol {
        padding-left: 1.4em;
      }
      .edu-rich blockquote {
        padding-left: 0.8em;
        border-left: 3px solid currentColor;
        opacity: 0.8;
      }
      .edu-rich code {
        padding: 0 0.25em;
        border-radius: 4px;
        background: rgba(127, 127, 127, 0.18);
        font-family: ui-monospace, Menlo, Consolas, monospace;
        font-size: 0.9em;
      }
      .edu-rich pre {
        padding: 0.5em 0.7em;
        border-radius: 6px;
        background: rgba(127, 127, 127, 0.14);
        overflow-x: auto;
      }
      .edu-rich pre code {
        padding: 0;
        background: none;
      }
      .edu-rich table {
        border-collapse: collapse;
      }
      .edu-rich th,
      .edu-rich td {
        padding: 2px 8px;
        border: 1px solid rgba(127, 127, 127, 0.4);
      }
      .edu-rich img {
        max-width: 100%;
      }
      .edu-rich hr {
        margin: 0.6em 0;
        border: 0;
        border-top: 1px solid rgba(127, 127, 127, 0.4);
      }
      .edu-rich .edu-math.display {
        display: block;
        margin: 0.4em 0;
        overflow-x: auto;
        overflow-y: hidden;
      }
      .edu-preview {
        padding: 8px 10px;
        border: 1px dashed #d9d7cf;
        border-radius: 8px;
        background: #fbfbf9;
        font: 400 0.88rem/1.45 "Inter", system-ui, sans-serif;
        color: #16191d;
      }
      .edu-preview[hidden] {
        display: none;
      }
      #edu-bar .eb-title {
        font-weight: 600;
        color: #16191d;
      }
      #edu-bar .eb-nav {
        display: flex;
        flex-wrap: wrap;
        gap: 4px;
      }
      #edu-bar .eb-nav button {
        min-width: 28px;
        height: 28px;
        padding: 0 6px;
        border: 1px solid #d9d7cf;
        border-radius: 7px;
        background: #fff;
        font: 600 0.8rem "Inter", system-ui, sans-serif;
        color: #4b5360;
        cursor: pointer;
      }
      #edu-bar .eb-nav button.done {
        border-color: #5ec8bd;
      }
      #edu-bar .eb-nav button[aria-current="true"] {
        border-color: #16191d;
        background: #16191d;
        color: #fff;
      }
      #edu-bar .eb-spacer {
        flex: 1;
      }
      #edu-bar .eb-status {
        font-size: 0.76rem;
        color: #7c8591;
      }
      #edu-bar .eb-timer {
        font: 600 0.95rem ui-monospace, "SF Mono", Menlo, monospace;
        color: #16191d;
      }
      #edu-bar .eb-timer.low {
        color: #b4361f;
      }
      #edu-bar button.eb-btn {
        padding: 6px 12px;
        border: 1px solid #d9d7cf;
        border-radius: 8px;
        background: #fff;
        font: 500 0.8rem "Inter", system-ui, sans-serif;
        color: #16191d;
        cursor: pointer;
      }
      #edu-bar button.eb-btn:hover {
        background: #f2f1ec;
      }
      #edu-bar button.eb-btn.primary:hover {
        border-color: #e3922a;
        background: #e3922a;
      }
      #edu-bar button.eb-btn.primary {
        border-color: var(--marigold);
        background: var(--marigold);
        color: #16191d;
      }
      #edu-bar button.eb-btn:disabled {
        opacity: 0.5;
        cursor: default;
      }
      #edu-bar button:focus-visible {
        outline: 2px solid var(--marigold);
        outline-offset: 1px;
      }
      /* In the right sidebar (see eduPlaceBar), it takes Generate's place and leaves the
         canvas its room. */
      #right-sidebar > #edu-bar {
        width: auto;
        max-width: none;
        margin: 12px;
        padding: 12px;
        border-radius: 12px;
        box-shadow: none;
      }
      #right-sidebar > #edu-bar .eb-prompt {
        max-height: none;
        overflow: visible;
      }
      /* The left sidebar gets a little more room in an exam: its properties are the tools. */
      body.exam-mode {
        --sidebar-w-left: clamp(260px, 26vw, 340px);
      }
      /* An exam has the drawing tools and nothing that could draw the answer for them. */
      body.exam-mode .no-exam,
      body.exam-mode #sheet-bar,
      body.exam-mode #sheet-bar + .tool-sep,
      body.exam-mode #style-sec,
      body.exam-mode #tools-slot,
      body.exam-mode #presets-sec,
      body.exam-mode #pro-btn,
      body.exam-mode .account-wrap,
      body.exam-mode #donate-btn {
        display: none !important;
      }
      /* The export popup's share link: the link, and Copy beside it. */
      .xp-link {
        display: flex;
        gap: 8px;
      }
      .xp-link input {
        flex: 1;
        min-width: 0;
        height: 34px;
        padding: 0 10px;
        border: 1px solid #d9d7cf;
        border-radius: 8px;
        background: #fff;
        font: 400 0.8rem "Inter", system-ui, sans-serif;
        color: #16191d;
      }
      /* Pro panel: a plain white sheet in Inter, apart from the playful cream panels, since
         it asks for money. Plans, then PayPal's subscribe button, then the terms. */
      #pro-overlay {
        display: none;
        position: fixed;
        inset: 0;
        padding: 16px;
        background: rgba(15, 18, 24, 0.55);
        z-index: 210;
        align-items: center;
        justify-content: center;
      }
      #pro-overlay.open {
        display: flex;
      }
      #pro-box {
        --pro-ink: #16191d;
        --pro-text: #4b5360;
        --pro-muted: #7c8591;
        --pro-line: #e6e8eb;
        position: relative;
        width: 100%;
        max-width: 560px;
        max-height: 100%;
        overflow-y: auto;
        padding: 36px 40px 28px;
        background: #f7f5ef;
        border-radius: 14px;
        box-shadow:
          0 24px 64px rgba(0, 0, 0, 0.28),
          0 2px 6px rgba(0, 0, 0, 0.08);
        font-family: "Inter", system-ui, sans-serif;
        font-feature-settings: "tnum", "cv11";
        color: var(--pro-text);
        -webkit-font-smoothing: antialiased;
      }
      @media (max-width: 520px) {
        #pro-box {
          padding: 28px 20px 22px;
        }
      }
      /* The wordmark in its logo colours, then "PRO" in a black outline. */
      #pro-kicker {
        display: flex;
        align-items: baseline;
        gap: 10px;
        margin-bottom: 14px;
      }
      #pro-kicker .pk-c {
        color: var(--marigold);
      }
      #pro-kicker .pk-p {
        color: var(--aqua);
      }
      #pro-kicker .pk-pro {
        position: relative;
        top: -1px;
        padding: 4px 9px;
        border: 1.5px solid var(--pro-ink);
        border-radius: 8px;
        font-size: 0.85rem;
        font-weight: 700;
        line-height: 1;
        letter-spacing: 0.06em;
        color: var(--pro-ink);
      }
      #pro-title {
        margin: 0 40px 8px 0;
        font-family: "Inter", system-ui, sans-serif;
        font-size: 1.75rem;
        font-weight: 700;
        line-height: 1.2;
        letter-spacing: -0.022em;
        color: var(--pro-ink);
      }
      #pro-intro {
        margin-bottom: 24px;
        font-size: 0.95rem;
        line-height: 1.55;
      }
      #pro-intro:empty {
        display: none;
      }
      #pro-features {
        list-style: none;
        display: flex;
        flex-direction: column;
        gap: 14px;
        margin-bottom: 28px;
        padding: 20px 0;
        border-top: 1px solid var(--pro-line);
        border-bottom: 1px solid var(--pro-line);
      }
      #pro-features li {
        display: grid;
        grid-template-columns: 20px 1fr;
        column-gap: 12px;
        font-size: 0.9rem;
        line-height: 1.45;
      }
      #pro-features li::before {
        content: "";
        grid-row: span 2;
        width: 20px;
        height: 20px;
        margin-top: 1px;
        border-radius: 50%;
        background: #eef7f5
          url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M6 10.3l2.6 2.6L14 7.5' fill='none' stroke='%23237a70' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E")
          center / 20px no-repeat;
      }
      #pro-features strong {
        font-weight: 600;
        color: var(--pro-ink);
      }
      #pro-plans {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 12px;
        margin-bottom: 20px;
      }
      #pro-plans[hidden] {
        display: none;
      }
      .pro-plan {
        position: relative;
        display: flex;
        flex-direction: column;
        gap: 4px;
        padding: 16px 18px;
        border: 1px solid var(--pro-line);
        border-radius: 12px;
        background: #fff;
        font: inherit;
        text-align: left;
        color: var(--pro-text);
        cursor: pointer;
        transition:
          border-color 0.15s,
          box-shadow 0.15s;
      }
      .pro-plan:hover {
        border-color: #c9ced4;
      }
      .pro-plan[aria-pressed="true"] {
        border-color: var(--pro-ink);
        box-shadow: inset 0 0 0 1px var(--pro-ink);
      }
      .pro-plan:focus-visible {
        outline: 2px solid var(--marigold);
        outline-offset: 2px;
      }
      .pro-plan .pp-label {
        font-size: 0.85rem;
        font-weight: 600;
        color: var(--pro-ink);
      }
      .pro-plan .pp-price {
        font-size: 0.85rem;
        color: var(--pro-muted);
      }
      .pro-plan .pp-price strong {
        margin-right: 2px;
        font-size: 1.6rem;
        font-weight: 700;
        letter-spacing: -0.02em;
        color: var(--pro-ink);
      }
      .pro-plan .pp-note {
        position: absolute;
        top: 14px;
        right: 14px;
        padding: 2px 8px;
        border-radius: 999px;
        background: #fdf1dc;
        font-size: 0.72rem;
        font-weight: 600;
        color: #9a5b0b;
      }
      @media (max-width: 520px) {
        .pro-plan .pp-note {
          position: static;
          align-self: flex-start;
          margin-top: 2px;
        }
      }
      #pro-paypal:not(:empty) {
        min-height: 48px;
      }
      #pro-offer[hidden],
      #pro-notice[hidden] {
        display: none;
      }
      #pro-notice {
        display: flex;
        flex-direction: column;
        gap: 10px;
      }
      #pro-notice button {
        height: 46px;
        border-radius: 10px;
        font: 600 0.95rem "Inter", system-ui, sans-serif;
        cursor: pointer;
      }
      #pro-notice .primary {
        border: none;
        background: var(--pro-ink);
        color: #fff;
      }
      #pro-notice .primary:hover {
        background: #2d333b;
      }
      #pro-notice .secondary {
        border: 1px solid var(--pro-line);
        background: #fff;
        color: var(--pro-ink);
      }
      #pro-notice .secondary:hover {
        border-color: #c9ced4;
      }
      #pro-notice button:focus-visible {
        outline: 2px solid var(--marigold);
        outline-offset: 2px;
      }
      #pro-action .pro-signin {
        width: 100%;
        height: 48px;
        border: none;
        border-radius: 10px;
        background: var(--pro-ink);
        font: 600 0.95rem "Inter", system-ui, sans-serif;
        color: #fff;
        cursor: pointer;
        transition: background 0.15s;
      }
      #pro-action .pro-signin:hover {
        background: #2d333b;
      }
      #pro-action .pro-signin:focus-visible {
        outline: 2px solid var(--marigold);
        outline-offset: 2px;
      }
      #pro-status {
        padding: 14px 16px;
        border: 1px solid #cfe9e4;
        border-radius: 10px;
        background: #f3faf8;
        font-size: 0.9rem;
        line-height: 1.55;
        color: #1f4d47;
      }
      #pro-status strong {
        color: var(--pro-ink);
      }
      #pro-status a,
      #pro-status .pro-linkbtn {
        color: inherit;
        font-weight: 600;
      }
      #pro-status .pro-linkbtn {
        padding: 0;
        border: none;
        background: none;
        font: inherit;
        font-weight: 600;
        text-decoration: underline;
        cursor: pointer;
      }
      #pro-action .pro-signin:disabled,
      #pro-notice button:disabled {
        opacity: 0.6;
        cursor: default;
      }
      #pro-msg {
        margin-top: 12px;
        font-size: 0.85rem;
        line-height: 1.5;
      }
      #pro-msg.error {
        color: #b4361f;
      }
      #pro-msg:empty {
        display: none;
      }
      /* Educators are offered a plan by email rather than a price. */
      #pro-edu {
        margin-top: 18px;
        padding: 12px 14px;
        border: 1px solid var(--pro-line);
        border-radius: 10px;
        background: #fff;
        font-size: 0.8rem;
        line-height: 1.55;
      }
      #pro-edu[hidden] {
        display: none;
      }
      #pro-edu strong {
        color: var(--marigold);
      }
      #pro-edu a {
        color: var(--pro-ink);
        font-weight: 600;
      }
      #pro-fine {
        margin-top: 18px;
        font-size: 0.75rem;
        line-height: 1.6;
        color: var(--pro-muted);
      }
      #pro-fine a {
        color: inherit;
      }
      #pro-close {
        position: absolute;
        top: 16px;
        right: 16px;
        display: flex;
        align-items: center;
        justify-content: center;
        width: 32px;
        height: 32px;
        border: none;
        border-radius: 8px;
        background: none;
        color: var(--pro-muted);
        cursor: pointer;
        transition:
          background 0.15s,
          color 0.15s;
      }
      #pro-close:hover {
        background: #f2f3f5;
        color: var(--pro-ink);
      }
      #pro-close svg {
        width: 14px;
        height: 14px;
      }
      #pro-close:focus-visible {
        outline: 2px solid var(--marigold);
        outline-offset: 2px;
      }
      #account-legal a {
        color: inherit;
      }
      /* Signed out: go straight into the editor as a guest. */
      #account-guest {
        display: block;
        width: 100%;
        margin-top: 14px;
        padding: 11px 14px;
        border: 1.5px solid #d6d9de;
        border-radius: 10px;
        background: #fff;
        font: 500 0.95rem "Inter", system-ui, sans-serif;
        color: #1f2a37;
        cursor: pointer;
      }
      #account-guest:hover {
        border-color: #1f2a37;
      }
      #account-guest[hidden] {
        display: none;
      }
      #account-legal {
        margin-top: 18px;
        font-size: 0.75rem;
        line-height: 1.6;
        text-align: center;
        color: #7c8591;
      }
      .legal-links {
        padding: 14px;
        font-size: 0.75rem;
        line-height: 1.6;
        color: #8a949e;
        text-align: center;
      }
      .legal-links a {
        color: inherit;
        text-decoration: none;
      }
      .legal-links a:hover {
        color: var(--slate);
        text-decoration: underline;
      }
      /* The small "Pro" tag on features a free account can see but not use. */
      .pro-tag {
        display: inline-block;
        white-space: nowrap;
        margin-left: 6px;
        padding: 1px 6px;
        border-radius: 6px;
        background: var(--marigold);
        font: 700 0.62rem "Nunito", sans-serif;
        letter-spacing: 0.05em;
        text-transform: uppercase;
        vertical-align: 1px;
        color: var(--ink);
      }
      .pro-tag.trial {
        background: #e3f5f2;
        color: #1f4d47;
      }
      .gen-pro-tag {
        display: none !important;
      }
      .no-pro .gen-pro-tag {
        display: inline-block !important;
      }
      .wm-btns .pro-tag {
        position: absolute;
        top: -6px;
        right: -4px;
        margin: 0;
      }
      .wm-btns .side-btn {
        position: relative;
      }
      #canvas-area {
        position: relative;
      }
      /* A first-time tip, like a game tutorial: key caps and what they do rise into view
         above the toolbar, hold, and float away (see showKeyTip). */
      .key-tip {
        position: absolute;
        left: 50%;
        bottom: 128px;
        z-index: 30;
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 10px 18px;
        border-radius: 16px;
        background: rgba(31, 35, 41, 0.92);
        box-shadow: 0 14px 34px rgba(18, 22, 28, 0.35);
        font: 600 0.95rem "Inter", system-ui, sans-serif;
        letter-spacing: 0.01em;
        color: #fff;
        pointer-events: none;
        transform: translateX(-50%);
        animation: key-tip var(--tip-dur, 3.4s) cubic-bezier(0.2, 0.8, 0.3, 1) forwards;
      }
      .key-tip .keys {
        display: flex;
        align-items: center;
        gap: 6px;
      }
      .key-tip img {
        display: block;
        height: 38px;
        border-radius: 9px;
        box-shadow: 0 3px 0 #0b0b0c;
        animation: key-press var(--tip-dur, 3.4s) ease-in-out;
      }
      .key-tip .plus {
        font-weight: 700;
        color: #fff;
      }
      @keyframes key-tip {
        0% {
          opacity: 0;
          transform: translate(-50%, 22px) scale(0.96);
        }
        14% {
          opacity: 1;
          transform: translate(-50%, 0) scale(1);
        }
        78% {
          opacity: 1;
          transform: translate(-50%, -6px);
        }
        100% {
          opacity: 0;
          transform: translate(-50%, -30px);
        }
      }
      @keyframes key-press {
        0%,
        24%,
        34%,
        48%,
        58%,
        100% {
          transform: translateY(0);
          box-shadow: 0 3px 0 #0b0b0c;
        }
        29%,
        53% {
          transform: translateY(3px);
          box-shadow: 0 0 0 #0b0b0c;
        }
      }
      @media (prefers-reduced-motion: reduce) {
        .key-tip,
        .key-tip img {
          animation-name: hf-in;
          animation-duration: 0.3s;
        }
      }
      .xp-form {
        display: flex;
        flex-direction: column;
        gap: 6px;
      }
      .xp-field {
        display: flex;
        align-items: flex-start;
        gap: 10px;
        font-size: 0.78rem;
        color: var(--text);
      }
      .xp-field span {
        flex: 0 0 82px;
        padding-top: 4px;
      }
      .xp-field input,
      .xp-field textarea {
        flex: 1;
        min-width: 0;
        box-sizing: border-box;
        padding: 4px 8px;
        border: 1px solid #ccc;
        border-radius: 4px;
        font: inherit;
        resize: vertical;
      }
      .xp-field input:focus,
      .xp-field textarea:focus {
        outline: none;
        border-color: var(--slate);
      }
      .xp.busy .xp-form {
        opacity: 0.55;
        pointer-events: none;
      }
      .look-grid {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 10px;
        margin: 2px 0 6px;
      }
      .look-card {
        position: relative;
        display: grid;
        gap: 6px;
        grid-template-rows: auto 1fr;
        padding: 5px 4px 7px;
        border: 2px solid transparent;
        border-radius: 11px;
        background: #fff;
        box-shadow: 0 1px 3px rgba(18, 22, 28, 0.16);
        color: var(--ink);
        text-align: center;
        cursor: pointer;
        transition:
          border-color 0.14s,
          box-shadow 0.14s;
      }
      .look-card svg {
        display: block;
        width: 100%;
        height: auto;
        border-radius: 7px;
      }
      .look-name {
        align-self: center;
        font-family: "Prompt", sans-serif;
        font-size: 0.68rem;
        font-weight: 600;
        line-height: 1.2;
        text-wrap: balance;
      }
      .look-card:hover {
        box-shadow: 0 3px 10px rgba(18, 22, 28, 0.2);
      }
      .look-card[aria-pressed="true"] {
        border-color: var(--marigold);
        background: #fffaf1;
      }
      .look-card:focus-visible {
        outline: 2px solid var(--slate);
        outline-offset: 2px;
      }
      .look-card.is-kit {
        background: #fbf6ec;
      }
      .look-del {
        position: absolute;
        top: -7px;
        right: -7px;
        width: 18px;
        height: 18px;
        border-radius: 50%;
        background: var(--slate);
        color: #fff;
        font-size: 12px;
        line-height: 18px;
        text-align: center;
        display: none;
      }
      /* Animate: the header carries a small Preview button on its right. */
      .look-sub.anim-head {
        display: flex;
        align-items: center;
        justify-content: space-between;
      }
      .anim-play {
        display: inline-flex;
        align-items: center;
        gap: 4px;
        padding: 3px 8px;
        border: 1px solid #d5d9de;
        border-radius: 999px;
        background: #fff;
        font: 600 0.68rem "Inter", system-ui, sans-serif;
        letter-spacing: 0.02em;
        text-transform: none;
        color: var(--slate);
        cursor: pointer;
      }
      .anim-play:hover {
        border-color: var(--slate);
      }
      .anim-play svg {
        width: 9px;
        height: 9px;
      }
      .look-sub {
        margin: 16px 0 8px;
        font-family: "Prompt", sans-serif;
        font-size: 0.66rem;
        font-weight: 600;
        letter-spacing: 0.1em;
        text-transform: uppercase;
        color: #6b7480;
      }
      #presets-sec .ctrl-row {
        margin-bottom: 11px;
      }
      .look-card:hover .look-del,
      .look-card:focus-within .look-del {
        display: block;
      }
      .look-btns {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 6px;
        margin-top: 14px;
      }
      .look-btns .side-btn {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 3px;
        width: auto;
        margin: 0;
        padding: 7px 4px 6px;
        font-size: 0.7rem;
        line-height: 1.1;
        text-align: center;
        white-space: nowrap;
      }
      .look-btns .side-btn svg {
        width: 16px;
        height: 16px;
        flex-shrink: 0;
      }
      /* Save, Export and Import kit: the same quiet white keys as Fill and Hatch. */
      .look-btns:not(.wm-btns) .side-btn {
        border: 1px solid #d3d7dc;
        background: #fff;
        box-shadow: 0 1px 2px rgba(20, 24, 30, 0.06);
        font-family: "Quicksand", "Nunito", sans-serif;
        font-weight: 600;
        letter-spacing: 0.02em;
        color: var(--ink);
        transition:
          background 0.15s,
          border-color 0.15s;
      }
      .look-btns:not(.wm-btns) .side-btn:hover {
        border-color: #b9bfc6;
        background: #f4f5f7;
        color: var(--ink);
      }
      .gfont-row {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 6px;
        margin: -4px 0 11px;
      }
      .gfont-row[hidden] {
        display: none;
      }
      .gfont-input {
        min-width: 0;
        padding: 3px 6px;
        border: 1px solid #ccc;
        border-radius: 4px;
        background: #fff;
        color: var(--ink);
        font-family: inherit;
        font-size: 0.76rem;
      }
      .gfont-input:focus {
        outline: 2px solid var(--slate);
        outline-offset: 0;
      }
      .gfont-row .gfont-go {
        width: auto;
        margin: 0;
        padding: 5px 10px;
        font-size: 0.72rem;
        text-align: center;
      }
      .gfont-row .gfont-msg {
        grid-column: 1 / -1;
        margin: 0;
      }
      .gfont-row .gfont-msg:empty {
        display: none;
      }
      #presets-sec .hint-text {
        margin: 2px 0 0;
      }
      .lib-launch {
        padding: 14px 14px 10px;
      }
      /* Generate: describe a graph and have it drawn. */
      .gen-head {
        display: flex;
        align-items: center;
        gap: 7px;
      }
      .gen-info {
        position: relative;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 15px;
        height: 15px;
        border: 1.3px solid currentColor;
        border-radius: 50%;
        color: #6b7480;
        font-family: "Prompt", sans-serif;
        font-size: 0.6rem;
        font-weight: 600;
        line-height: 1;
        letter-spacing: 0;
        text-transform: none;
        -webkit-text-stroke: 0;
        cursor: help;
      }
      .gen-info:hover,
      .gen-info:focus-visible {
        color: var(--ink);
        outline: none;
      }
      .gen-tip {
        position: absolute;
        top: calc(100% + 9px);
        left: 50%;
        transform: translateX(-45%);
        z-index: 40;
        width: 210px;
        padding: 8px 10px;
        border-radius: 8px;
        background: var(--ink);
        box-shadow: 0 6px 18px rgba(18, 22, 28, 0.25);
        color: #fff;
        font-size: 0.72rem;
        font-weight: 400;
        line-height: 1.45;
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transition: opacity 0.12s;
      }
      .gen-tip::before {
        content: "";
        position: absolute;
        top: -5px;
        left: calc(45% - 5px);
        width: 10px;
        height: 10px;
        background: var(--ink);
        transform: rotate(45deg);
      }
      .gen-info:hover .gen-tip,
      .gen-info:focus .gen-tip {
        opacity: 1;
        visibility: visible;
      }
      .gen-input {
        display: block;
        width: 100%;
        min-height: 66px;
        resize: vertical;
        padding: 8px 10px;
        border: 1px solid #d5d8dc;
        border-radius: 8px;
        background: #fff;
        color: var(--ink);
        font-family: "Prompt", sans-serif;
        font-size: 0.78rem;
        line-height: 1.45;
      }
      .gen-input::placeholder {
        color: #9aa1a9;
      }
      .gen-input:focus {
        outline: 2px solid var(--slate);
        outline-offset: -1px;
      }
      .gen-row {
        display: flex;
        align-items: center;
        gap: 8px;
        margin-top: 8px;
      }
      .gen-row .gen-go {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 6px;
        flex: 0 0 auto;
        width: auto;
        margin: 0;
        padding: 4px 14px;
        border-radius: 7px;
        font-size: 0.78rem;
        line-height: 1.3;
        letter-spacing: 0.04em;
        text-align: center;
      }
      .gen-go svg {
        width: 14px;
        height: 14px;
        color: var(--ink);
      }
      .gen-eg {
        margin-left: auto;
        padding: 6px 2px;
        border: none;
        background: none;
        color: #6b7480;
        font-family: "Prompt", sans-serif;
        font-size: 0.72rem;
        text-decoration: underline;
        text-underline-offset: 2px;
        cursor: pointer;
      }
      .gen-eg:hover {
        color: var(--ink);
      }
      .gen-notes {
        margin: 8px 0 0;
        padding: 0;
        list-style: none;
        font-size: 0.72rem;
        line-height: 1.45;
        color: #4b5560;
      }
      .gen-notes:empty {
        display: none;
      }
      .gen-notes li {
        position: relative;
        margin-top: 3px;
        padding-left: 13px;
      }
      .gen-notes li::before {
        content: "";
        position: absolute;
        top: 0.55em;
        left: 2px;
        width: 5px;
        height: 5px;
        border-radius: 50%;
        background: var(--aqua);
      }
      .gen-notes li.head {
        padding-left: 0;
        font-weight: 600;
        color: var(--ink);
      }
      .gen-notes li.head::before {
        content: none;
      }
      .gen-notes li.warn {
        color: #8a5a00;
      }
      .gen-notes li.warn::before {
        background: var(--marigold);
      }
      .gen-notes li.err {
        padding-left: 0;
        color: #b3261e;
      }
      .gen-notes li.err::before {
        content: none;
      }
      /* Open Library: an illustrated card with a chunky base, like a physical button. */
      .lib-hero {
        display: grid;
        width: 100%;
        margin: 2px 0 12px;
        padding: 0;
        border: 2px solid var(--ink);
        border-radius: 16px;
        background: #fff;
        color: var(--ink);
        text-align: left;
        cursor: pointer;
        box-shadow: 0 6px 0 0 var(--ink);
        transition:
          transform 0.12s ease,
          box-shadow 0.12s ease;
      }
      .lib-hero:hover {
        transform: translateY(2px);
        box-shadow: 0 4px 0 0 var(--ink);
      }
      .lib-hero:active {
        transform: translateY(6px);
        box-shadow: 0 0 0 0 var(--ink);
      }
      .lib-hero:focus-visible {
        outline: 3px solid var(--marigold);
        outline-offset: 3px;
      }
      .lib-hero-art {
        display: block;
        overflow: hidden;
        border-radius: 14px 14px 0 0;
        border-bottom: 2px solid var(--ink);
      }
      .lib-hero-art svg {
        display: block;
        width: 100%;
        height: auto;
      }
      .lib-hero-label {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        padding: 10px 12px 11px 15px;
        font-family: "Prompt", sans-serif;
        font-size: 1rem;
        font-weight: 600;
      }
      .lib-hero-go {
        display: grid;
        place-items: center;
        width: 30px;
        height: 30px;
        border: 2px solid var(--ink);
        border-radius: 50%;
        background: var(--marigold);
        transition: transform 0.12s ease;
      }
      .lib-hero-go svg {
        width: 15px;
        height: 15px;
      }
      .lib-hero:hover .lib-hero-go {
        transform: translateX(2px);
      }
      @media (prefers-reduced-motion: reduce) {
        .lib-hero,
        .lib-hero-go {
          transition: none;
        }
        .lib-hero:hover,
        .lib-hero:hover .lib-hero-go {
          transform: none;
        }
      }
      #popup-box.pop-lib {
        position: relative;
        display: flex;
        flex-direction: column;
        width: calc(100vw - 32px);
        max-width: 1040px;
        height: min(780px, calc(100vh - 32px));
        max-height: none;
        overflow: hidden;
        /* A light, businesslike sans for the whole library. */
        font-family: "Source Sans 3", "Segoe UI", system-ui, sans-serif;
        font-weight: 300;
      }
      #popup-box.pop-lib :is(h2, input, button) {
        font-family: inherit;
      }
      /* The header stands apart in a wide, heavy grotesque (Archivo, expanded). */
      #popup-box.pop-lib #pop-title,
      #popup-box.pop-lib #pop-msg {
        font-family: "Archivo", "Segoe UI", system-ui, sans-serif;
      }
      #popup-box.pop-lib #pop-title {
        font-size: 1.45rem;
        font-weight: 800;
        font-stretch: 125%;
        color: var(--ink);
      }
      #popup-box.pop-lib #pop-msg {
        font-size: 0.88rem;
        font-weight: 500;
        font-stretch: 110%;
      }
      #popup-box.pop-lib #pop-body {
        flex: 1;
        min-height: 0;
      }
      #popup-box.pop-lib .pop-btns:empty {
        display: none;
      }
      .lib {
        display: grid;
        grid-template-columns: 228px minmax(0, 1fr);
        gap: 22px;
        height: 100%;
        padding-bottom: 12px;
      }
      .lib-nav {
        display: flex;
        flex-direction: column;
        gap: 3px;
        min-height: 0;
        overflow-y: auto;
        padding: 10px;
        border-radius: 14px;
        background: #f1efe9;
      }
      #popup-box .lib-nav-head {
        margin: 6px 8px 4px;
        font-size: 0.64rem;
        font-weight: 600;
        letter-spacing: 0.12em;
        text-transform: uppercase;
        color: #8a929c;
      }
      #popup-box .lib-nav-head + .lib-field {
        margin-top: 0;
      }
      .lib-field {
        display: grid;
        grid-template-columns: 30px minmax(0, 1fr) auto;
        align-items: center;
        gap: 10px;
        padding: 7px 9px;
        border: none;
        border-radius: 10px;
        background: transparent;
        color: var(--ink);
        font-size: 0.84rem;
        font-weight: 400;
        text-align: left;
        cursor: pointer;
      }
      .lib-field-icon svg {
        display: block;
        width: 30px;
        height: 30px;
      }
      .lib-field[aria-current="true"] {
        background: #fff;
        box-shadow: 0 1px 4px rgba(18, 22, 28, 0.14);
      }
      .lib-count {
        font-size: 0.72rem;
        color: #8a929c;
        font-variant-numeric: tabular-nums;
      }
      .lib-soon {
        padding: 2px 7px;
        border-radius: 999px;
        background: rgba(70, 82, 95, 0.1);
        font-size: 0.6rem;
        font-weight: 600;
        letter-spacing: 0.06em;
        text-transform: uppercase;
        color: #7a828c;
      }
      .lib-field:disabled {
        color: #8a929c;
        cursor: default;
      }
      .lib-field:disabled .lib-field-icon {
        opacity: 0.5;
      }
      .lib-main.is-start {
        display: flex;
        align-items: center;
        justify-content: center;
      }
      .lib-start {
        display: grid;
        justify-items: center;
        gap: 4px;
        width: 100%;
        text-align: center;
      }
      .lib-start svg {
        display: block;
        width: min(320px, 80%);
        height: auto;
        filter: grayscale(1);
        opacity: 0.45;
      }
      #popup-box .lib-start p {
        margin: 0;
        font-size: 1.02rem;
        color: #9aa1a9;
      }
      .lib-field:not(:disabled):not([aria-current="true"]):hover {
        background: rgba(70, 82, 95, 0.08);
      }
      .lib-field:focus-visible {
        outline: 2px solid var(--marigold);
        outline-offset: 1px;
      }
      .lib-main {
        display: grid;
        align-content: start;
        gap: 22px;
        min-height: 0;
        overflow-y: auto;
        padding: 2px 6px 4px 2px;
      }
      #lib-search {
        width: 100%;
        height: 38px;
        padding: 0 14px;
        border: 1.5px solid rgba(70, 82, 95, 0.3);
        border-radius: 10px;
        background: #fff;
        font-size: 0.86rem;
        color: var(--ink);
      }
      #lib-search:focus {
        outline: none;
        border-color: var(--slate);
      }
      .lib-sec {
        display: grid;
        gap: 10px;
      }
      .lib-sec[hidden],
      .lib-tool-card[hidden] {
        display: none;
      }
      .lib-sec h3 {
        margin: 0;
        font-size: 0.72rem;
        font-weight: 600;
        letter-spacing: 0.1em;
        text-transform: uppercase;
        color: var(--ink);
      }
      .lib-tool-list {
        display: grid;
        gap: 10px;
      }
      .lib-tool-card {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr) auto;
        align-items: center;
        gap: 14px;
        padding: 12px 14px;
        border: 1.5px solid rgba(70, 82, 95, 0.2);
        border-radius: 12px;
        background: #fff;
      }
      .lib-tool-card.is-on {
        border-color: var(--marigold);
      }
      .lib-tool-text {
        display: grid;
        gap: 3px;
      }
      .lib-tool-card .pop-btn {
        white-space: nowrap;
      }
      .lib-tool-art {
        display: block;
        width: 104px;
        overflow: hidden;
        border-radius: 10px;
      }
      .lib-tool-art svg {
        display: block;
        width: 100%;
        height: auto;
      }
      @media (max-width: 680px) {
        .lib {
          grid-template-columns: minmax(0, 1fr);
          grid-template-rows: auto minmax(0, 1fr);
        }
        .lib-nav {
          flex-direction: row;
          flex-wrap: wrap;
          padding: 0 0 10px;
          border-right: none;
          border-bottom: 1px solid rgba(70, 82, 95, 0.15);
        }
        .lib-nav-head,
        .lib-field:disabled {
          display: none;
        }
        .lib-tool-card {
          grid-template-columns: minmax(0, 1fr);
        }
      }
      .lib-grid {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
        gap: 14px;
      }
      .lib-card {
        display: grid;
        align-content: start;
        padding: 0;
        border: 1.5px solid rgba(70, 82, 95, 0.2);
        border-radius: 12px;
        background: #fff;
        overflow: hidden;
        text-align: left;
        cursor: pointer;
        transition:
          transform 0.14s,
          box-shadow 0.14s,
          border-color 0.14s;
      }
      .lib-card[hidden],
      .lib-empty[hidden] {
        display: none;
      }
      .lib-card:hover {
        transform: translateY(-2px);
        border-color: var(--marigold);
        box-shadow: 0 8px 20px rgba(18, 22, 28, 0.16);
      }
      .lib-card:focus-visible {
        outline: 2px solid var(--marigold);
        outline-offset: 2px;
      }
      .lib-thumb {
        display: block;
        aspect-ratio: 580 / 560;
        background: #f3f3ef;
        border-bottom: 1px solid rgba(70, 82, 95, 0.12);
      }
      .lib-thumb svg {
        display: block;
        width: 100%;
        height: 100%;
      }
      .lib-text {
        display: grid;
        gap: 2px;
        padding: 9px 12px 11px;
      }
      .lib-name {
        font-size: 0.86rem;
        font-weight: 600;
        color: var(--ink);
      }
      .lib-desc {
        font-size: 0.74rem;
        font-weight: 400;
        line-height: 1.35;
        color: #4b5360;
      }
      @media (prefers-reduced-motion: reduce) {
        .lib-card {
          transition: none;
        }
        .lib-card:hover {
          transform: none;
        }
      }
      .xp {
        display: flex;
        flex-direction: column;
        gap: 11px;
        margin-bottom: 14px;
      }
      .xp-sec {
        display: flex;
        flex-direction: column;
        gap: 7px;
        padding-top: 11px;
        border-top: 1px solid #e6e6e6;
      }
      .xp-sec:first-child {
        padding-top: 0;
        border-top: none;
      }
      .xp-sec h3 {
        font-size: 0.72rem;
        font-weight: 600;
        letter-spacing: 0.08em;
        text-transform: uppercase;
        color: var(--ink);
      }
      #popup-box .xp-note {
        margin: 0;
        font-size: 0.74rem;
        line-height: 1.45;
        color: #777;
      }
      /* The export dialog: wide, in the Pro panel's off-white and type. The share link and
         the Cruxplot file sit on top; below, a column per kind of export. */
      #popup-box.pop-export {
        position: relative;
        width: calc(100vw - 32px);
        /* Five cards at their full width (about 198px each, as when there were four). */
        max-width: 1112px;
        max-height: calc(100vh - 32px);
        overflow-y: auto;
        padding: 30px 32px 22px;
        border-radius: 18px;
        background: #f7f5ef;
        box-shadow:
          0 24px 64px rgba(0, 0, 0, 0.28),
          0 2px 6px rgba(0, 0, 0, 0.08);
        font-family: "Inter", system-ui, sans-serif;
        color: #4b5360;
      }
      #popup-box.pop-export h2 {
        margin: 0 44px 18px 0;
        font-family: "Clarity City", "Inter", system-ui, sans-serif;
        font-size: 1.6rem;
        font-weight: 700;
        letter-spacing: -0.02em;
        color: #16191d;
      }
      #popup-box.pop-export #pop-msg,
      #popup-box.pop-export .pop-btns {
        display: none;
      }
      #popup-box.pop-export p {
        margin-bottom: 0;
      }
      .xe-close {
        position: absolute;
        top: 22px;
        right: 22px;
        display: flex;
        align-items: center;
        justify-content: center;
        width: 34px;
        height: 34px;
        border: none;
        border-radius: 50%;
        background: none;
        color: #7c8591;
        cursor: pointer;
      }
      .xe-close:hover {
        background: rgba(0, 0, 0, 0.06);
        color: #16191d;
      }
      .xe-close svg {
        width: 14px;
        height: 14px;
      }
      .xe-card {
        border: 1px solid #e6e2d8;
        border-radius: 14px;
        background: #fff;
      }
      .xe-top {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 14px;
        margin-bottom: 14px;
      }
      .xe-share {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 12px;
      }
      .xe-share input {
        flex: 1;
        min-width: 0;
        height: 40px;
        padding: 0 12px;
        border: 1px solid #e2e0d9;
        border-radius: 10px;
        background: #fbfaf6;
        font: 500 0.88rem "Inter", system-ui, sans-serif;
        color: #16191d;
      }
      .xe-share input:focus {
        outline: 2px solid var(--marigold);
        outline-offset: 1px;
      }
      /* An embedded graph: the graph alone, filling the frame, over the page beneath. */
      html.embed,
      html.embed body {
        overflow: hidden;
        background: transparent;
      }
      #embed-view {
        position: fixed;
        inset: 0;
        z-index: 2147483000;
        display: flex;
        align-items: center;
        justify-content: center;
        background: #fff;
      }
      #embed-view svg {
        display: block;
        width: 100%;
        height: 100%;
      }
      #embed-view .embed-open {
        position: absolute;
        right: 8px;
        bottom: 6px;
        padding: 2px 8px;
        border-radius: 999px;
        background: rgba(255, 255, 255, 0.85);
        font: 500 11px "Inter", system-ui, sans-serif;
        color: #6b7480;
        text-decoration: none;
        opacity: 0.7;
        transition: opacity 0.15s;
      }
      #embed-view .embed-open:hover,
      #embed-view .embed-open:focus-visible {
        opacity: 1;
        color: #16191d;
      }
      #embed-view .embed-msg {
        margin: 0;
        padding: 16px;
        font: 0.9rem "Inter", system-ui, sans-serif;
        color: #6b7480;
        text-align: center;
      }

      /* Alt text: a label, the editable description, and its copy button, in one row. */
      .xe-alt {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr) auto;
        align-items: center;
        gap: 6px 12px;
        margin-top: 14px;
        padding: 12px;
      }
      .xe-alt label {
        font: 600 0.82rem "Inter", system-ui, sans-serif;
        color: #16191d;
      }
      .xe-alt textarea {
        min-width: 0;
        min-height: 40px;
        padding: 8px 12px;
        border: 1px solid #e2e0d9;
        border-radius: 10px;
        background: #fbfaf6;
        font: 400 0.84rem/1.45 "Inter", system-ui, sans-serif;
        color: #16191d;
        resize: vertical;
      }
      .xe-alt textarea:focus {
        outline: 2px solid var(--marigold);
        outline-offset: 1px;
      }
      #popup-box .xe-alt .xe-sub {
        grid-column: 2 / 3;
        margin: 0;
      }
      .xe-file {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 8px 12px 8px 8px;
      }
      .xe-file .xe-art {
        width: 86px;
        height: 48px;
        flex: none;
      }
      .xe-file-name {
        display: grid;
        font-size: 0.78rem;
        line-height: 1.35;
      }
      .xe-file-name b {
        font-size: 0.9rem;
        color: #16191d;
      }
      .xe-cols {
        display: grid;
        grid-template-columns: repeat(5, minmax(0, 1fr));
        gap: 14px;
      }
      .xe-col {
        display: flex;
        flex-direction: column;
        gap: 10px;
        padding: 12px 12px 14px;
      }
      .xe-art {
        height: 92px;
        overflow: hidden;
        border-radius: 10px;
        line-height: 0;
      }
      .xe-art svg {
        display: block;
        width: 100%;
        height: 100%;
      }

      .xe-col h3 {
        margin: 2px 2px 0;
        font-size: 0.95rem;
        font-weight: 700;
        letter-spacing: -0.01em;
        color: #16191d;
      }
      .xe-sub {
        margin: -6px 2px 0;
        font-size: 0.75rem;
        line-height: 1.4;
        color: #7c8591;
      }
      .xe-col .xp-seg {
        width: 100%;
      }
      .xe-col .xp-seg[aria-label="Resolution"],
      .xe-col .xp-seg[aria-label="Frame"] {
        width: auto;
        max-width: 168px;
      }
      .xe-col .xp-seg[aria-label="Frame"] button {
        padding: 3px 6px;
        white-space: nowrap;
      }
      .xe-col .xp-seg button {
        flex: 1;
      }
      .xe-acts {
        display: flex;
        justify-content: center;
        gap: 8px;
        margin-top: auto;
      }
      /* Export buttons: the toolbar's outlined square, an icon inside (or, for the
         animation formats, a short label in a wider one). */
      .xe-ib {
        position: relative;
        flex: none;
        width: 44px;
        height: 44px;
        padding: 0;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border: 1.5px solid rgba(70, 82, 95, 0.25);
        border-radius: 12px;
        background: transparent;
        color: var(--slate);
        font: 600 0.82rem "Prompt", sans-serif;
        letter-spacing: 0.04em;
        cursor: pointer;
        transition: all 0.14s;
      }
      .xe-ib:hover:not(:disabled) {
        background: rgba(70, 82, 95, 0.1);
        border-color: var(--slate);
      }
      .xe-ib:focus-visible {
        outline: 2px solid var(--marigold);
        outline-offset: 2px;
      }
      .xe-ib:disabled {
        opacity: 0.4;
        cursor: default;
      }
      .xe-ib svg {
        width: 22px;
        height: 22px;
      }
      .xe-ib.xe-tb {
        flex: 1;
        width: auto;
        min-width: 0;
      }
      .xe-ib .pro-tag {
        position: absolute;
        top: -7px;
        right: -8px;
        margin: 0;
      }
      /* The worksheet's title and instructions: a slim row under the cards, like Alt text. */
      .xe-sheet-row {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr) minmax(0, 2fr);
        align-items: end;
        gap: 6px 12px;
        margin-top: 14px;
        padding: 12px;
      }
      .xe-row-label {
        align-self: center;
        font-weight: 600;
        font-size: 0.82rem;
        color: #16191d;
      }
      .xe-sheet-row .xp-field {
        display: grid;
        gap: 3px;
        font-size: 0.72rem;
        color: #6b7480;
      }
      .xe-sheet-row input,
      .xe-sheet-row textarea {
        width: 100%;
        min-width: 0;
        min-height: 38px;
        padding: 8px 12px;
        border: 1px solid #e2e0d9;
        border-radius: 10px;
        background: #fbfaf6;
        font-size: 0.84rem;
        line-height: 1.4;
        color: #16191d;
        resize: vertical;
      }
      .xe-sheet-row input:focus,
      .xe-sheet-row textarea:focus {
        outline: 2px solid var(--marigold);
        outline-offset: 1px;
      }
      @media (max-width: 1143px) {
        .xe-cols {
          grid-template-columns: repeat(3, minmax(0, 1fr));
        }
      }
      @media (max-width: 700px) {
        .xe-cols {
          grid-template-columns: repeat(2, minmax(0, 1fr));
        }
      }
      @media (max-width: 560px) {
        #popup-box.pop-export {
          padding: 24px 16px 18px;
        }
        .xe-top,
        .xe-cols {
          grid-template-columns: minmax(0, 1fr);
        }
        .xe-share,
        .xe-file {
          min-width: 0;
        }
        /* The alt text's label above its box, with the copy button beside it. */
        .xe-alt {
          grid-template-columns: minmax(0, 1fr) auto;
        }
        .xe-alt label,
        #popup-box .xe-alt .xe-sub {
          grid-column: 1 / -1;
        }
        .xe-sheet-row {
          grid-template-columns: minmax(0, 1fr);
        }
      }
      /* Without Pro, a graph with generated items says why its exports are tagged. */
      #popup-box .xp-pro-note {
        margin: 0 0 4px;
        padding: 10px 12px;
        border: 1px solid #f3d9a8;
        border-radius: 10px;
        background: #fff6e5;
        font-size: 0.78rem;
        line-height: 1.45;
        color: #4b3a1a;
      }
      .xp-pro-note .pro-tag {
        margin: 0 6px 0 0;
      }
      .xp-note code {
        font-size: 0.7rem;
        background: #f1f1f1;
        padding: 0 4px;
        border-radius: 3px;
      }
      .xp-opts {
        display: flex;
        align-items: center;
        flex-wrap: wrap;
        gap: 10px 12px;
      }
      .xp-seg {
        display: inline-flex;
        border: 2px solid var(--slate);
        border-radius: 6px;
        overflow: hidden;
      }
      .xp-seg button {
        padding: 3px 12px;
        border: none;
        background: transparent;
        color: var(--slate);
        font-family: "Prompt", sans-serif;
        font-size: 0.78rem;
        font-weight: 500;
        cursor: pointer;
      }
      .xp-seg button + button {
        border-left: 2px solid var(--slate);
      }
      .xp-seg button[aria-pressed="true"] {
        background: var(--slate);
        color: var(--cream);
      }
      .xp-dim {
        font-size: 0.72rem;
        color: #888;
        font-variant-numeric: tabular-nums;
      }
      .xp-check {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        font-size: 0.78rem;
        color: var(--text);
        cursor: pointer;
      }
      .xp-check input {
        accent-color: var(--check);
      }
      .xp-actions {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
      }
      .xp-actions .pop-btn {
        padding: 6px 14px;
      }
      .xp.busy .xp-actions,
      .xp.busy .xp-seg {
        opacity: 0.55;
        pointer-events: none;
      }
      #popup-box .xp-status {
        min-height: 1.3em;
        margin: 0;
        font-size: 0.78rem;
        color: var(--slate);
      }
      #popup-box .xp-status[data-kind="error"] {
        color: var(--coral);
      }
      .pop-btns {
        display: flex;
        gap: 8px;
        flex-wrap: wrap;
      }
      .pop-btn {
        padding: 8px 18px;
        border-radius: 6px;
        font-family: "Prompt", sans-serif;
        font-size: 0.82rem;
        font-weight: 500;
        cursor: pointer;
        border: 2px solid var(--slate);
        transition: all 0.13s;
      }
      .pop-btn.primary {
        background: var(--slate);
        color: var(--cream);
      }
      .pop-btn.primary:hover {
        background: var(--marigold);
        border-color: var(--marigold);
        color: var(--ink);
      }
      .pop-btn.secondary {
        background: transparent;
        color: var(--slate);
      }
      .pop-btn.secondary:hover {
        background: var(--slate);
        color: var(--cream);
      }
      .pop-btn.ghost {
        border-color: #ccc;
        color: #888;
      }
      .pop-btn.ghost:hover {
        background: #eee;
        border-color: #aaa;
        color: #555;
      }
      .pop-btn.danger {
        border-color: var(--coral);
        background: var(--coral);
        color: #fff;
      }
      .pop-btn.danger:hover {
        border-color: #b4361f;
        background: #b4361f;
      }
      /* A one-line answer in the popup (educator.js's renames). */
      #pop-body .pop-input {
        width: 100%;
        margin-bottom: 14px;
        padding: 8px 10px;
        border: 1px solid #d9d7cf;
        border-radius: 6px;
        font: 400 0.9rem "Inter", system-ui, sans-serif;
      }
      .pop-field {
        width: 100%;
        padding: 8px 10px;
        border: 2px solid #ccc;
        border-radius: 6px;
        font-family: "Prompt", sans-serif;
        font-size: 0.82rem;
        background: #fff;
      }
      .pop-field:focus {
        outline: none;
        border-color: var(--slate);
      }
      #popup-box p.pop-hint {
        font-size: 0.74rem;
        color: #777;
        margin: 8px 0 4px;
      }
      #popup-box p.pop-status {
        font-size: 0.78rem;
        color: var(--slate);
        min-height: 1.2em;
        margin: 4px 0 14px;
      }
      #popup-box p.pop-status.err {
        color: #c0392b;
      }
      /* The data table box: room for a pasted table, in a monospace face so columns line up. */
      /* Add data: the table on the left, what was read on the right, and a footer with the
         fit option across from the buttons. */
      #popup-box.pop-data {
        width: calc(100vw - 32px);
        max-width: 720px;
        max-height: calc(100vh - 32px);
        overflow-y: auto;
        padding: 26px 28px 22px;
      }
      #popup-box.pop-data #pop-msg:empty {
        display: none;
      }
      #popup-box.pop-data .pop-btns {
        align-items: center;
        justify-content: flex-end;
        padding-top: 16px;
        border-top: 1px solid #ece9e1;
      }
      .data-dlg {
        display: grid;
        grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
        gap: 14px 16px;
        margin-bottom: 16px;
      }
      @media (max-width: 560px) {
        .data-dlg {
          grid-template-columns: minmax(0, 1fr);
        }
      }
      .data-drop {
        position: relative;
        border: 1.5px solid #d4d4d4;
        border-radius: 10px;
        background: #fff;
        overflow: hidden;
      }
      .data-drop:focus-within {
        border-color: var(--slate);
      }
      /* The data grid: a numbered spreadsheet with a header row of column names. */
      .data-grid {
        max-height: 252px;
        overflow: auto;
      }
      .data-grid table {
        width: 100%;
        border-collapse: collapse;
        table-layout: fixed;
        font-variant-numeric: tabular-nums;
      }
      .data-grid th,
      .data-grid td {
        padding: 0;
        border-bottom: 1px solid #ecebe6;
        border-right: 1px solid #ecebe6;
      }
      .data-grid thead th {
        position: sticky;
        top: 0;
        z-index: 1;
        background: #f6f5f1;
        border-bottom-color: #dedcd4;
      }
      .data-grid .data-n {
        width: 26px;
        font-size: 0.66rem;
        text-align: center;
        color: #a3a8ae;
        background: #faf9f6;
      }
      .data-grid th:last-child,
      .data-grid td:last-child {
        border-right: none;
      }
      .data-grid td.data-last {
        position: relative;
      }
      /* x and y get the room; the error columns hold short numbers. */
      .data-grid thead th:nth-child(4),
      .data-grid thead th:nth-child(5) {
        width: 58px;
      }
      .data-grid input {
        display: block;
        width: 100%;
        height: 29px;
        padding: 0 8px;
        border: none;
        outline: none;
        background: transparent;
        font: 0.8rem "Prompt", sans-serif;
        color: #222;
      }
      .data-grid input.data-head {
        font-weight: 600;
        font-size: 0.76rem;
        color: #333;
      }
      .data-grid input::placeholder {
        color: #9aa1a9;
        font-weight: 500;
      }
      .data-grid input:focus {
        background: #fff7e8;
        box-shadow: inset 0 0 0 2px var(--marigold);
      }
      .data-del {
        position: absolute;
        top: 0;
        right: 0;
        width: 22px;
        height: 29px;
        padding: 0;
        border: none;
        background: none;
        font-size: 1rem;
        color: #b9bec4;
        cursor: pointer;
        visibility: hidden;
      }
      .data-grid tr:hover .data-del {
        visibility: visible;
      }
      .data-del:hover {
        color: #c0392b;
      }
      .data-add {
        margin-top: 8px;
      }
      .data-drop-hint {
        display: none;
        position: absolute;
        inset: 0;
        align-items: center;
        justify-content: center;
        border: 2px dashed var(--aqua);
        border-radius: 10px;
        background: rgba(94, 200, 189, 0.12);
        font: 600 0.85rem "Prompt", sans-serif;
        color: #1d6f66;
        pointer-events: none;
      }
      .data-drop.over .data-drop-hint {
        display: flex;
      }
      .data-empty {
        display: grid;
        justify-items: center;
        gap: 10px;
        max-width: 220px;
      }
      .data-empty[hidden] {
        display: none;
      }
      #popup-box .data-empty p {
        margin: 0;
        font-size: 0.78rem;
        line-height: 1.5;
        color: #6b7480;
      }
      .data-links {
        display: flex;
        align-items: center;
        gap: 6px;
        font-size: 0.76rem;
      }
      .data-link {
        padding: 0;
        border: none;
        background: none;
        font: 600 0.76rem "Prompt", sans-serif;
        color: #23766d;
        cursor: pointer;
      }
      .data-link:hover {
        text-decoration: underline;
      }
      .data-dot {
        color: #aaa;
      }
      .data-out {
        display: grid;
        align-content: start;
        gap: 8px;
        padding: 10px;
        border-radius: 10px;
        background: #f6f5f1;
      }
      .data-out.empty {
        place-content: center;
        min-height: 190px;
        text-align: center;
      }
      .data-chart svg {
        display: block;
        width: 100%;
        height: auto;
        border-radius: 8px;
        background: #fff;
      }
      .data-chart .ax {
        fill: none;
        stroke: #333;
        stroke-width: 1.2;
      }
      .data-chart circle {
        fill: var(--aqua);
        stroke: #1d6f66;
        stroke-width: 1;
      }
      .data-chart .eb {
        stroke: #1d6f66;
        stroke-width: 1;
      }
      #popup-box p.data-status {
        margin: 0;
        font-size: 0.72rem;
        color: #6b7480;
      }
      #popup-box p.data-status:empty {
        display: none;
      }
      #popup-box p.data-status.err {
        color: #c0392b;
      }
      .data-fit-opt {
        display: flex;
        align-items: center;
        gap: 7px;
        margin-right: auto;
        font-size: 0.8rem;
        color: #333;
        cursor: pointer;
      }
      .pop-btn:disabled {
        opacity: 0.45;
        cursor: default;
      }
      .sb-section .data-table {
        width: 100%;
        min-height: 96px;
        padding: 6px 8px;
        border: 1px solid #ccc;
        border-radius: 6px;
        font: 0.74rem/1.4 ui-monospace, "SF Mono", Menlo, Consolas, monospace;
        resize: vertical;
        white-space: pre;
      }
      .sb-section .data-block h4 {
        margin: 12px 0 6px;
        font-size: 0.72rem;
        font-weight: 600;
        letter-spacing: 0.06em;
        text-transform: uppercase;
        color: #666;
      }
      .sb-section .data-btns {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
        margin-top: 6px;
      }
      .sb-section .data-fit {
        font-size: 0.78rem;
        line-height: 1.5;
        color: #333;
      }
      .pop-list {
        font-size: 0.76rem;
        color: #555;
        margin: -8px 0 16px 18px;
        line-height: 1.5;
        word-break: break-word;
      }
      /* Import: a link, "or", a file, then Cancel and Import. */
      #popup-box.pop-import {
        width: calc(100vw - 32px);
        max-width: 460px;
      }
      #popup-box.pop-import .pop-btns {
        justify-content: flex-end;
      }
      .imp .pop-field {
        height: 40px;
      }
      .imp-or {
        display: flex;
        align-items: center;
        gap: 10px;
        margin: 12px 0;
        font: 500 0.74rem "Prompt", sans-serif;
        color: #9aa1a9;
      }
      .imp-or::before,
      .imp-or::after {
        content: "";
        flex: 1;
        height: 1px;
        background: #e2e0d9;
      }
      .imp-upload {
        display: block;
        width: 100%;
        padding: 10px 12px;
        border: 1.5px dashed #cfcac0;
        border-radius: 8px;
        background: #fff;
        font: 500 0.82rem "Prompt", sans-serif;
        color: var(--slate);
        cursor: pointer;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
      }
      .imp-upload:hover {
        border-color: var(--slate);
      }
      .imp-upload.has-file {
        border-style: solid;
        border-color: var(--slate);
      }
      #popup-box .imp p.pop-status:empty {
        min-height: 0;
        margin: 0 0 14px;
      }

      /* Add curve: the shapes as a row of tiles, Cancel on its own below. */
      #popup-box.pop-curves {
        width: calc(100vw - 32px);
        max-width: 640px;
      }
      #popup-box.pop-curves #pop-msg:empty {
        display: none;
      }
      #popup-box.pop-curves .pop-btns {
        justify-content: flex-end;
        margin-top: 16px;
      }
      .curve-pick {
        display: grid;
        grid-template-columns: repeat(6, minmax(0, 1fr));
        gap: 8px;
        margin-top: 4px;
      }
      @media (max-width: 560px) {
        .curve-pick {
          grid-template-columns: repeat(3, minmax(0, 1fr));
        }
      }
      .curve-pick button {
        display: grid;
        justify-items: center;
        gap: 6px;
        padding: 12px 4px 10px;
        border: 1.5px solid #e2e0d9;
        border-radius: 10px;
        background: #fff;
        font: 500 0.7rem "Prompt", sans-serif;
        line-height: 1.25;
        white-space: pre-line;
        align-content: start;
        color: var(--slate);
        cursor: pointer;
        transition:
          border-color 0.15s,
          background 0.15s;
      }
      .curve-pick button:hover {
        border-color: var(--slate);
        background: #fbfaf6;
      }
      .curve-pick button:focus-visible {
        outline: 2px solid var(--marigold);
        outline-offset: 1px;
      }
      .curve-pick svg {
        width: 44px;
        height: 44px;
        transition: transform 0.15s;
      }
      /* The quadrant row above the shapes, on a graph with negative sides. */
      .quad-pick {
        display: flex;
        align-items: center;
        gap: 6px;
        margin: 2px 0 10px;
        font: 500 0.75rem "Prompt", sans-serif;
        color: var(--slate);
      }
      .quad-pick span {
        margin-right: 4px;
      }
      .quad-pick button {
        min-width: 40px;
        padding: 5px 10px;
        border: 1.5px solid #e2e0d9;
        border-radius: 8px;
        background: #fff;
        font: 600 0.75rem "Prompt", sans-serif;
        color: var(--slate);
        cursor: pointer;
      }
      .quad-pick button:hover {
        border-color: var(--slate);
      }
      .quad-pick button.on {
        border-color: var(--accent);
        background: var(--accent-soft);
        color: var(--ink);
      }
      .quad-pick button:focus-visible {
        outline: 2px solid var(--marigold);
        outline-offset: 1px;
      }

      .svg-lbl {
        font-family: "Prompt", sans-serif;
        pointer-events: none;
        user-select: none;
      }

      /* Phones: the canvas takes the screen, and each sidebar slides in over it as a drawer,
         opened from its button in the header (see initPanelDrawers). */
      .panel-btn,
      #drawer-scrim {
        display: none;
      }
      @media (max-width: 760px), (max-height: 500px) and (pointer: coarse) {
        header {
          gap: 6px;
          padding: 0 8px;
          height: 56px;
        }
        header .logo {
          height: 30px;
          min-width: 0;
          flex-shrink: 1;
        }
        header .mark,
        header .donate {
          display: none;
        }
        header .pro-pill {
          margin-right: 0;
          padding: 5px 7px;
          font-size: 0.75rem;
        }
        .panel-btn {
          position: relative;
          display: flex;
          align-items: center;
          justify-content: center;
          width: 40px;
          height: 40px;
          flex-shrink: 0;
          padding: 0;
          border: none;
          border-radius: 10px;
          background: none;
          color: #fff;
          cursor: pointer;
        }
        .panel-btn svg {
          width: 24px;
          height: 24px;
          display: block;
        }
        .panel-btn[aria-expanded="true"] {
          background: rgba(255, 255, 255, 0.16);
        }
        .panel-btn:focus-visible {
          outline: 2px solid var(--marigold);
          outline-offset: 1px;
        }
        /* Something is selected: a marigold dot says its properties are in the drawer. */
        .panel-btn.has-sel::after {
          content: "";
          position: absolute;
          top: 6px;
          right: 5px;
          width: 9px;
          height: 9px;
          border-radius: 50%;
          background: var(--marigold);
          box-shadow: 0 0 0 2px var(--ink);
        }
        #left-sidebar,
        #right-sidebar {
          position: fixed;
          top: 56px;
          bottom: 0;
          width: min(88vw, 360px);
          z-index: 120;
          visibility: hidden;
          overscroll-behavior: contain;
          transition:
            transform 0.25s ease,
            visibility 0.25s;
        }
        #left-sidebar {
          left: 0;
          transform: translateX(-100%);
        }
        #right-sidebar {
          right: 0;
          transform: translateX(100%);
        }
        #left-sidebar.drawer-open,
        #right-sidebar.drawer-open {
          transform: none;
          visibility: visible;
        }
        #drawer-scrim.show {
          display: block;
          position: fixed;
          inset: 56px 0 0;
          background: rgba(15, 18, 24, 0.45);
          z-index: 110;
        }
        #canvas-area {
          padding: 8px 6px 6px;
          gap: 6px;
        }
        #topbar {
          padding: 5px 8px;
          gap: 4px;
        }
        /* The tools stay on one row, scrolled sideways when they don't fit. */
        #toolbar {
          flex-wrap: nowrap;
          justify-content: flex-start;
          overflow-x: auto;
          padding: 6px 8px;
          gap: 4px;
          scrollbar-width: none;
        }
        #toolbar::-webkit-scrollbar {
          display: none;
        }
        #toolbar > * {
          flex-shrink: 0;
        }
        /* A finger on the graph draws and drags; it doesn't scroll or zoom the page. */
        #figure {
          touch-action: none;
        }
        /* Sign in: the welcome text gives way so the form is in view. */
        #account-box.landing .acct-hero .hero-sub,
        #account-box.landing .acct-hero .hero-block {
          display: none;
        }
      }
      /* A phone on its side: the graph has the height, and the two bars stand at its sides. */
      @media (max-height: 500px) and (pointer: coarse) {
        #canvas-area {
          padding: 6px 66px;
        }
        #topbar,
        #toolbar {
          position: absolute;
          top: 6px;
          flex-direction: column;
          flex-wrap: nowrap;
          justify-content: flex-start;
          max-width: none;
          max-height: calc(100% - 12px);
          padding: 6px 5px;
          gap: 4px;
          overflow-x: hidden;
          overflow-y: auto;
          scrollbar-width: none;
        }
        #topbar {
          left: 6px;
        }
        #toolbar {
          right: 6px;
        }
        #topbar::-webkit-scrollbar {
          display: none;
        }
        #topbar > * {
          flex-shrink: 0;
        }
        #topbar .tool-sep,
        #toolbar .tool-sep {
          width: 28px;
          height: 3px;
          margin: 2px 0;
        }
      }
      @media (prefers-reduced-motion: reduce) {
        #left-sidebar,
        #right-sidebar {
          transition: none;
        }
      }

      /* The toolbar's popups (Add curve, Add data, Import, Export) share the library's type:
         the same header, and the same light businesslike sans and slate for everything else.
         Code stays monospace. Last in the sheet, so it wins over each popup's own font. */
      #popup-box.pop-tool {
        font-family: "Source Sans 3", "Segoe UI", system-ui, sans-serif;
        color: #4b5360;
      }
      #popup-box.pop-tool #pop-body :is(div, h3, h4, p, label, span, b, strong, small, input, textarea, select, button, td, th, a),
      #popup-box.pop-tool #pop-btns :is(button, label) {
        font-family: inherit;
      }
      #popup-box.pop-tool #pop-title,
      #popup-box.pop-tool #pop-msg {
        font-family: "Archivo", "Segoe UI", system-ui, sans-serif;
        letter-spacing: 0;
      }
      #popup-box.pop-tool #pop-title {
        font-size: 1.45rem;
        font-weight: 800;
        font-stretch: 125%;
        color: var(--ink);
      }
      #popup-box.pop-tool #pop-msg {
        font-size: 0.88rem;
        font-weight: 500;
        font-stretch: 110%;
      }

      /* The Auto Regions price picker: a row per price line the region is read at. */
      .price-pick {
        display: grid;
        gap: 8px;
        margin: 4px 0 6px;
      }
      .price-pick label {
        display: grid;
        grid-template-columns: 110px minmax(0, 1fr);
        align-items: center;
        gap: 8px;
        font-size: 0.82rem;
        color: var(--text);
      }

      /* The Auto Regions heading's info tip: clear of the heading's text. */
      h3 .regions-info {
        margin-left: 10px;
        vertical-align: 2px;
      }

      /* A linked bracket's Adjust choices: a short list of ticks. */
      .adjust-list {
        display: grid;
        gap: 3px;
        font-size: 0.76rem;
        color: var(--text);
      }
      .adjust-list label {
        display: flex;
        align-items: center;
        gap: 4px;
        cursor: pointer;
      }
      .adjust-list input {
        accent-color: var(--check);
      }

      /* ---------- Sidebar type and colour: crisp Inter, clear levels ---------- */
      .sidebar {
        --sb-ink: #1f2933;
        --sb-label: #4b5563;
        --sb-head: #2f5d8a;
        --sb-rule: #e3e8ee;
        font-family: "Source Sans 3", sans-serif;
      }
      /* Section titles keep their own script face; the rows get room to breathe. */
      .sidebar .sb-section {
        padding: 16px 16px;
      }
      .sidebar .sb-section h3 {
        margin-bottom: 14px;
      }
      /* Every row the same height, whatever its control, so the spacing is even. */
      .sidebar .ctrl-row {
        gap: 10px;
        min-height: 34px;
        margin-bottom: 8px;
      }
      .sidebar .prop-group + .prop-group,
      .sidebar .prop-group + .side-btn {
        margin-top: 14px;
        padding-top: 14px;
      }
      .sidebar .prop-group-title {
        font-family: "Inter", sans-serif;
        font-size: 0.7rem;
        font-weight: 700;
        letter-spacing: 0.05em;
        color: var(--sb-head);
        margin-bottom: 8px;
      }
      .sidebar .prop-group + .prop-group,
      .sidebar .prop-group + .side-btn {
        border-top-color: var(--sb-rule);
      }
      /* Labels and values in a lighter, humanist face; group headings stay in Inter. */
      .sidebar .ctrl-row label {
        font-family: "Source Sans 3", sans-serif;
        font-size: 0.9rem;
        font-weight: 400;
        color: var(--sb-label);
      }
      .sidebar .ctrl-row input[type="text"],
      .sidebar .ctrl-row input[type="number"],
      .sidebar .ctrl-select {
        font-family: "Source Sans 3", sans-serif;
        font-size: 0.88rem;
        color: var(--sb-ink);
      }
      .sidebar .seg {
        border-color: #cfd6de;
      }
      .sidebar .seg button {
        font: 400 0.86rem "Source Sans 3", sans-serif;
        color: var(--sb-label);
      }
      .sidebar .seg button[aria-pressed="true"] {
        background: #eaf1f8;
        color: var(--sb-head);
        box-shadow: inset 0 -2px 0 var(--sb-head);
      }
      .sidebar .hint-text {
        font-family: "Source Sans 3", sans-serif;
      }
      /* A bracket's span: two equal boxes either side of a dash, its length under them. */
      .sidebar .bracket-ends {
        display: grid;
        grid-template-columns: 1fr auto 1fr;
        flex: 1;
        gap: 6px;
      }
      .sidebar .bracket-ends input {
        width: 100%;
        min-width: 0;
      }
      .bracket-len {
        margin: -2px 0 8px 68px;
        font-size: 0.74rem;
        color: var(--sb-label);
      }
      .seg.icon-seg button {
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 4px 14px;
      }
      .seg.icon-seg svg {
        width: 34px;
        height: 16px;
        fill: none;
        stroke: currentColor;
        stroke-width: 1.6;
        stroke-linecap: round;
        stroke-linejoin: round;
      }
      .sidebar .anim-head {
        font-family: "Inter", sans-serif;
        font-size: 0.7rem;
        font-weight: 700;
        letter-spacing: 0.05em;
        color: var(--sb-head);
      }
      /* Labels a touch smaller; what's typed in boxes in Inter, so values stand apart. */
      .sidebar .ctrl-row label,
      .sidebar .axis-grid > label {
        font-family: "Source Sans 3", sans-serif;
        font-size: 0.84rem;
        font-weight: 400;
        color: var(--sb-label);
      }
      .sidebar input[type="text"],
      .sidebar input[type="number"],
      .sidebar textarea,
      .sidebar .ctrl-select {
        font-family: "Inter", sans-serif;
        font-size: 0.8rem;
        color: var(--sb-ink);
      }
      /* Axes grid: column heads in the group-heading style, centred over their boxes; the
         grid under More options shares the columns above, so it needs no heads of its own. */
      .sidebar .axis-grid {
        gap: 8px 8px;
        margin-bottom: 10px;
      }
      .sidebar .axis-grid .ag-head {
        font-family: "Inter", sans-serif;
        font-size: 0.68rem;
        font-weight: 700;
        letter-spacing: 0.05em;
        color: var(--sb-head);
        text-align: center;
      }
      .sidebar .axes-more .axis-grid .ag-head {
        display: none;
      }
      .sidebar .axes-more > summary {
        font-family: "Inter", sans-serif;
        font-size: 0.72rem;
        font-weight: 600;
        color: var(--sb-head);
        padding: 6px 0;
      }
      .sidebar .axes-more[open] > summary {
        margin-bottom: 8px;
      }

      /* ---------- Popups: Ink & Marigold ----------
         Titles in Poppins 500, words in Source Sans 3, numbers and typing in Inter; ink for
         the main button, marigold for focus, a warm sand for headers and side panels. */
      #popup-box {
        --pop-ink: #2b3038;
        --pop-text: #4b5563;
        --pop-link: #2f5d8a;
        --pop-sand: #f6f5f1;
        --pop-panel: #fdf6e9;
        --pop-line: #e5e7eb;
        border-radius: 16px;
        font-family: "Source Sans 3", sans-serif;
      }
      #popup-box h2 {
        font: 500 1.35rem "Poppins", sans-serif;
        color: var(--pop-ink);
        margin-bottom: 10px;
      }
      #popup-box p {
        font-size: 0.92rem;
        color: var(--pop-text);
      }
      .pop-btn {
        border-radius: 10px;
        font: 600 0.88rem "Source Sans 3", sans-serif;
        padding: 8px 18px;
      }
      .pop-btn.primary {
        background: var(--pop-ink, #2b3038);
        border-color: var(--pop-ink, #2b3038);
        color: #fff;
      }
      .pop-btn.primary:hover {
        background: #111418;
        border-color: #111418;
        color: #fff;
      }
      .pop-btn.primary:disabled {
        background: #c4c8ce;
        border-color: #c4c8ce;
        color: #fff;
        cursor: default;
      }
      .pop-btn.secondary {
        border-color: var(--pop-ink, #2b3038);
        color: var(--pop-ink, #2b3038);
      }
      .pop-btn.secondary:hover {
        background: var(--pop-ink, #2b3038);
        color: #fff;
      }
      .pop-btn.ghost {
        border: 1px solid #d1d5db;
        background: #fff;
        color: var(--pop-text, #4b5563);
      }
      .pop-btn.ghost:hover {
        background: var(--pop-sand, #f6f5f1);
        border-color: #b8bec6;
        color: var(--pop-ink, #2b3038);
      }
      #popup-box input[type="text"],
      #popup-box input[type="number"],
      #popup-box textarea,
      #popup-box select,
      #pop-body .pop-input,
      .pop-field {
        font-family: "Inter", sans-serif;
      }
      #popup-box input[type="text"]:focus,
      #popup-box input[type="number"]:focus,
      #popup-box textarea:focus,
      #popup-box select:focus,
      .pop-field:focus {
        outline: none;
        border-color: var(--marigold);
        box-shadow: 0 0 0 3px rgba(242, 165, 65, 0.25);
      }
      #popup-box input[type="checkbox"] {
        accent-color: var(--pop-ink);
      }
      /* Add data in the same scheme. */
      #popup-box.pop-data .pop-btns {
        border-top-color: var(--pop-line);
      }
      #popup-box .data-drop {
        border: 1px solid #dfe3e8;
        border-radius: 12px;
      }
      #popup-box .data-drop:focus-within {
        border-color: #c9ced5;
      }
      #popup-box .data-grid th,
      #popup-box .data-grid td {
        border-color: #eef0f2;
      }
      #popup-box .data-grid thead th {
        background: var(--pop-sand);
        border-bottom-color: #e3e1da;
      }
      #popup-box .data-grid input {
        font: 0.86rem "Inter", sans-serif;
        color: var(--pop-ink);
      }
      #popup-box .data-grid input.data-head {
        font: 600 0.84rem "Source Sans 3", sans-serif;
        color: #6b7280;
      }
      #popup-box .data-grid input:focus {
        background: rgba(242, 165, 65, 0.08);
        box-shadow: inset 0 0 0 2px var(--marigold);
      }
      #popup-box .data-out {
        background: var(--pop-panel);
        border-radius: 12px;
      }
      #popup-box .data-empty p {
        font-size: 0.9rem;
        color: var(--pop-text);
      }
      #popup-box .data-link,
      #popup-box .data-add {
        font: 600 0.86rem "Source Sans 3", sans-serif;
        color: var(--pop-link);
      }
      #popup-box .data-fit-opt {
        font: 0.9rem "Source Sans 3", sans-serif;
        color: var(--pop-ink);
      }
      /* The toolbar's and library's popups take the same title and type. */
      #popup-box.pop-tool #pop-title,
      #popup-box.pop-lib #pop-title {
        font: 500 1.4rem "Poppins", sans-serif;
        font-stretch: 100%;
        color: var(--pop-ink);
      }
      #popup-box.pop-tool #pop-msg {
        font: 400 0.92rem "Source Sans 3", sans-serif;
        font-stretch: 100%;
      }
      #popup-box.pop-tool #pop-body :is(input[type="text"], input[type="number"], select),
      #popup-box.pop-data .data-grid input {
        font-family: "Inter", sans-serif;
      }
      #popup-box.pop-data .data-grid input.data-head {
        font-family: "Source Sans 3", sans-serif;
      }
      #popup-box .data-grid thead th:nth-child(4),
      #popup-box .data-grid thead th:nth-child(5) {
        width: 74px;
      }
      #popup-box .data-link {
        white-space: nowrap;
      }
      /* Add curve: each shape in its own colour from the palette, on a light wash of it; the
         axes stay a quiet slate. */
      .curve-pick button:nth-child(1) { --c: #e08e1b; }
      .curve-pick button:nth-child(2) { --c: #d9573c; }
      .curve-pick button:nth-child(3) { --c: #2a9d8f; }
      .curve-pick button:nth-child(4) { --c: #2f5d8a; }
      .curve-pick button:nth-child(5) { --c: #3a9a57; }
      .curve-pick button:nth-child(6) { --c: #7c5cbf; }
      #popup-box .curve-pick button {
        border: 1.5px solid color-mix(in srgb, var(--c) 28%, #fff);
        background: color-mix(in srgb, var(--c) 7%, #fff);
        color: var(--pop-ink);
        font: 600 0.8rem "Source Sans 3", sans-serif;
      }
      #popup-box .curve-pick button:hover {
        border-color: var(--c);
        background: color-mix(in srgb, var(--c) 14%, #fff);
      }
      #popup-box .curve-pick button:hover svg {
        transform: translateY(-2px);
      }
      .curve-pick svg {
        color: #8a94a0;
      }
      .curve-pick svg path:nth-child(4) {
        stroke: var(--c);
        stroke-width: 7;
      }
      .listing-badge {
        display: flex;
        justify-content: center;
        padding: 4px 0 14px;
      }
